[Qt-creator] How to put individual classes to sub dir
Jakov
dkymail at gmail.com
Tue Aug 17 00:54:23 CEST 2010
Dear Adam,
Thanks for your reply. I remove the subdirs already, to make it a normal app
project. I "try-and-error" many ways, but the layout is not as expected.
Could you please suggest me the config or give me the document of using .pro
and .pri file? The idea is, I want to group individual classes (.h, .cpp,
.ui) in a separate directory (to have a better look, easy to
find/edit/manage...) within the main project dir, or even at the same
directory level with main project dir.
I'd like to thank Alan, but there's no libs yet. They're just pure UI
classes, just at lower directory level, as compared to main project
directory. I'll not include every single .h, .cpp, and .ui in the
HEADERS, SOURCES,
FORMS in the main .pro, as those files will be included in corresponding
nodes (Headers, Sources, Forms) separately.
I'm looking forward to your guide... In the meantime, I'll try-'n-error
again. I look at demo and examples in Qt SDK, but there's no helpful
examples... Thank you again.
BR,
Jakov
On Mon, Aug 16, 2010 at 9:31 PM, Coda Highland <coda at bobandgeorge.com>wrote:
> First off, don't use a subdirs project for that. Just use a normal
> "app" project and use relative paths in the .pro file. If you want to
> organize the .pro file you can use include() with some .pri files --
> Creator knows how to sort this out. (Note that .pri files consider
> paths relative to the main .pro file, not to itself.)
>
> Second, "INCLUDEPATH += Frames" in the main .pro file (or possibly in
> frames.pri) so that "Frame1/Frame1.h" can be found inside of the
> "Frames" directory.
>
> /s/ Adam
>
> On Mon, Aug 16, 2010 at 8:51 AM, Jakov <dkymail at gmail.com> wrote:
> > Hello Group,
> >
> > I have a question about organizing subdir/nested classes in Qt Creator. I
> > intend to use dozens classes (inherit from QFrame), to be promoted later.
> I
> > want to have each of them grouped in a separate folder (dir). Like this:
> >
> > <PROJECT_ROOT>
> > ----- Frames
> > --------- - frames.pro
> > --------- - Frame1
> > ---------------- frame1.h
> > ---------------- frame1.cpp
> > ---------------- frame1.ui
> > ---------------- frame1.pri
> > -------- - Frame2
> > ---------------- frame2.h
> > ---------------- frame2.cpp
> > ---------------- frame2.ui
> > ---------------- frame2.pri
> > ----- ex1.pro
> > ----- ex1.h
> > ----- ex2.cpp
> >
> > File frame?.pri indicates HEADERS, SOURCES, FORMS
> > File frames.pro simply includes those *.pri files.
> > File ex1.pro:
> > + TEMPLATE = app subdirs
> > + SUBDIRS += Frames
> >
> > That's it. The problem comes when I'm trying to use frame1, frame2 in the
> > main project (ex1). Although I specify INCLUDEPATH += Frames/Frame1 in
> the
> > ex1.pro, ex1 can "see" frame1.h, but it doesn't know about frame1.cpp,
> so an
> > error thrown: undefined reference to `TFrame1::TFrame1(QWidget*)'
> >
> > I'll try to summary the problem: how to put individual classes in subdir
> > freely?
> >
> > Please help me.
> >
> > Thank you in advance!!!
> >
> > Best regards,
> >
> > Jakov
> >
> > _______________________________________________
> > Qt-creator mailing list
> > Qt-creator at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-creator
> >
> >
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20100817/16a93c78/attachment.html
More information about the Qt-creator-old
mailing list