Results 1 to 2 of 2

Thread: using pre-created widgets in Qt Creator/Qt Designer

  1. #1
    Join Date
    Sep 2016
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default using pre-created widgets in Qt Creator/Qt Designer

    I need to build a GUI that has flight instruments in it. I found these ones , however I can't figure out how to use them with Qt Creator/Qt Designer. One way that was recommended online is to promote a widget to a new widget. So I dropped a widget onto a form and tried to promote it to WidgetNAV. However during compilation I got an error saying that WidgetNAV.h was not found. Clearly I'm missing something here, would anyone be able to help me out?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,141
    Thanks
    235
    Thanked 661 Times in 651 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: using pre-created widgets in Qt Creator/Qt Designer

    Qt Designer and Qt Creator are different programs; Qt Designer is an editor for .UI files, while Qt Creator is both an editor for .h and .cpp files as well as an environment for controlling compiling, linking, and debugging your programs.

    If your WidgetNAV.h files is not in the same directory as the rest of your source code, then you need to modify your project's .pro file to add the path to the directory that contains that file. Likewise, you have to add the path and filename of the library containing WidgetNAV to the .pro file. After that, you need to run qmake again (if Qt Creator does not do it automatically for you) so Qt Creator can find these files when it compiles or links.

    If your library does not come with a Qt Designer plugin, then the only way you can use the widgets is through the promotion mechanism. Be careful that you are spelling the name of the widget -exactly- the same as it is named in the .h file, otherwise you will still get compile errors.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Working with widgets created bt Qt Designer
    By dpetican in forum Newbie
    Replies: 5
    Last Post: 22nd August 2016, 17:38
  2. Replies: 19
    Last Post: 12th June 2014, 07:30
  3. Replies: 4
    Last Post: 30th December 2012, 22:20
  4. Replies: 4
    Last Post: 25th October 2012, 18:29
  5. Replies: 18
    Last Post: 21st May 2010, 15:08

Tags for this Thread

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.