Results 1 to 2 of 2

Thread: How to leave including inherited classes?

  1. #1
    Join Date
    Nov 2010
    Location
    Budapest, Hungary
    Posts
    125
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to leave including inherited classes?

    Hi,

    this might be not a Qt-related question but as I would like to apply it in a Qt project maybe it has some connections. I made some nice working classes preveously which should be used now. There is some inheritance relationship between them, so say I have these:
    first.h // class First
    first.cpp
    second.h // class Second : public First
    second.cpp

    Now if I want to use Second in my project I have to include also first.h and first.cpp.
    For I have more than one relationships like this it would be nice just start the chain and tell somehow the project "follow the include series please" without including them actually to the project. Is it possible at all or dream little girl, dream? What should be the keywords for the topic? If I'm right this should be something like building a custom library but honestly I'm lost.
    Szilvi

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: How to leave including inherited classes?

    You may need use some code static analsis tool, and see the dependancy tree, and inclide all the required files in the project manually.

    It is possible to put all the files into a folder and compile all of them, and linker will link only the required files, but I don't think Qt Tool set support this, ecclipse does support this kind of feature, but you need write a custom make file (to make it work with Qt), (and not use qmake outputed make file). If you want to use qmake outputed make file, I think manually adding file by file to the .pro file (or the to project if using QtCreator) is the only option.

    As you already see, creating a library(either static or dynamic) would be nice idea (and reusable solution), I would suggest to do this, if the dependancy list is large enough to be difficult to manually manage them

Similar Threads

  1. Qt widget enter/leave event
    By bunjee in forum Qt Programming
    Replies: 11
    Last Post: 28th April 2014, 03:09
  2. Issue in using dynamic property in QT inherited classes.
    By Ratheendrans in forum Qt Programming
    Replies: 1
    Last Post: 25th August 2010, 15:21
  3. QPushbutton leave event
    By mikec in forum Qt Programming
    Replies: 2
    Last Post: 26th April 2010, 08:38
  4. Mouse Leave and Tab Key event in Delegate
    By faldzip in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2008, 19:04
  5. Tooltip enter/leave event.
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2007, 11:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.