Results 1 to 4 of 4

Thread: How to get correct header with custom made widgets?

  1. #1
    Join Date
    Jan 2006
    Location
    Leiden, the Netherlands
    Posts
    43
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to get correct header with custom made widgets?

    Hello,

    I have a class, derived from QTreeWidget: DragDropTree.

    I made a user interface with the Qt Designer and I replaced my QTreeWidget by my DragDropTree in the .ui file. The Designer does not render my widget, but that's not a real problem.

    Once I do the custom build step with the .uic tool and compile my project I get an error:

    "Cannot open include file: 'dragdroptable.h': No such file or directory"

    This is because uic inserts a statement:

    #include <dragdroptable.h>

    in stead of

    #include "dragdroptable.h"

    Is there any way to easily avoid this problem? I couldn't find command line options to do so, just like the MOC tool.

    Best regards,
    Arthur

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get correct header with custom made widgets?

    What about the include paths set in your project?
    Do they include the directory with that header?
    It doesn't matter if you use "" or <>.
    The header will be searched in standard include paths and in user defined paths.

    Regards

  3. #3
    Join Date
    Jan 2006
    Location
    Leiden, the Netherlands
    Posts
    43
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to get correct header with custom made widgets?

    Thank you for your reply.

    Quote Originally Posted by marcel View Post
    What about the include paths set in your project?
    Do they include the directory with that header?
    Regards
    If I add the dir explicitely to my additional include paths it works...

    Not ideal, but ok...
    Last edited by Arthur; 26th April 2007 at 16:45.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to get correct header with custom made widgets?

    Quote Originally Posted by Arthur View Post
    I made a user interface with the Qt Designer and I replaced my QTreeWidget by my DragDropTree in the .ui file.
    The recommended way is not to edit .ui files by hand but use the promoting feature of the designer.

    Quote Originally Posted by Arthur View Post
    Once I do the custom build step with the .uic tool and compile my project I get an error:

    "Cannot open include file: 'dragdroptable.h': No such file or directory"

    This is because uic inserts a statement:

    #include <dragdroptable.h>

    in stead of

    #include "dragdroptable.h"
    I'm afraid changing <dragdroptable.h> to "drapdroptable.h" would have no effect. A proper include path must be added to the project unless it's in the same directory.
    J-P Nurmi

Similar Threads

  1. QScrollArea With Custom Widgets
    By VireX in forum Qt Programming
    Replies: 30
    Last Post: 22nd April 2007, 16:48
  2. create custom widgets
    By nimmyj in forum General Discussion
    Replies: 1
    Last Post: 20th November 2006, 08:24
  3. Global includes with designer custom widgets
    By mab in forum Qt Programming
    Replies: 2
    Last Post: 5th October 2006, 22:06
  4. Compiling custom Qt3 Widgets Gives warning in VC++6 Compiler
    By sunil.thaha in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2006, 12:44
  5. container populated with custom widgets
    By momesana in forum Qt Programming
    Replies: 2
    Last Post: 16th April 2006, 21:02

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.