Results 1 to 11 of 11

Thread: Dynamically Loading a QMainWindow?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Dynamically Loading a QMainWindow?

    Quote Originally Posted by natron
    Since this is no longer a QMainWindow subclass, the setCentralWidget is no longer available.
    Maybe you should create an instance of QMainWindow and then use setCentralWidget to set your widget as its main part? I mean something like:

    Qt Code:
    1. int main(int argc, char **argv){
    2. QApplication app(argc, argv);
    3. // ...
    4. mw.setCentralWidget(createYourWidgetHere);
    5. //...
    6. mw.show();
    7. return app.exec();
    8. }
    To copy to clipboard, switch view to plain text mode 


    As a side, how do you experts start your Qt applications?
    I don't exactly understand what you mean... How do we execute applications or how do we implement them?

    If the former then either from the command line, KDevelop or by clicking on an icon in Konqueror. I think all people do it in one of these ways...

    If the latter, then I start by writing main.cpp with contents such as the one above, then implement my main ui, subclass it to create the main window class and then I check if it works fine. Afterwards I begin to implement the functionality.

    And I don't use dynamically loaded forms

  2. The following user says thank you to wysota for this useful post:

    natron (20th July 2006)

Similar Threads

  1. Switching static to dynamic ui loading
    By s_a_white in forum Newbie
    Replies: 4
    Last Post: 26th June 2006, 15:57
  2. Insert separate QToolBar into QMainWindow
    By YuriyRusinov in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 10:37
  3. Replies: 18
    Last Post: 22nd February 2006, 20:51
  4. QSA: loading scripts at runtime
    By seneca in forum Qt Programming
    Replies: 0
    Last Post: 15th February 2006, 15: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
  •  
Qt is a trademark of The Qt Company.