Results 1 to 3 of 3

Thread: Program that just shows a window

  1. #1
    Join Date
    Jul 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Arrow Program that just shows a window

    As expected, when I build i get an error message that says that show method doesn't exist. In fact i didn't create it.

    I created ui_ABase.h with qmake, giving as input the .ui file generated with Qt Designer.

    How I can display the whole mainwindow created with Qt Designer?

    Qt Code:
    1. #include <QApplication>
    2. #include <QFont>
    3. #include <QPushButton>
    4. #include "ui_ABase.h"
    5.  
    6. int main(int argc, char* argv[])
    7. {
    8. QApplication app(argc, argv);
    9.  
    10. Ui_ABase base;
    11.  
    12. base.show();
    13.  
    14. return app.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2007
    Location
    Rome, GA
    Posts
    199
    Thanks
    14
    Thanked 41 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Program that just shows a window

    I don't use the designer for my GUI, but when I create a new app in VS, it (annoyingly) always makes a .ui file, but it lives in a QMainWindow class. Its used in the main window's constructor like this: ui.setupUi(this);

    So I would say, make a QWidget or something, and put your ui object in there, then in the widget's constructor call ui.setupUi(this); Then in main() create your QWidget:

    QWidget myWidget;
    myWidget.show();

    Maybe that will do the trick...

  3. #3
    Join Date
    Jul 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Program that just shows a window

    Yeah i found it here too, thank you: http://doc.trolltech.com/4.4/designe...tance-approach

Similar Threads

  1. Error: BadMatch --> what's it?
    By mattia in forum Newbie
    Replies: 4
    Last Post: 9th June 2008, 13:20
  2. update window size
    By eric in forum Newbie
    Replies: 3
    Last Post: 14th January 2008, 11:21
  3. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 10:30
  4. Change shape of window / animate window
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2007, 09:16
  5. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 05:19

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.