Results 1 to 11 of 11

Thread: Dynamically Loading a QMainWindow?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Location
    Seattle
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Dynamically Loading a QMainWindow?

    Hey, thanks you two for your help. I got it working so far.

    I realized my blunder - I basically had the right code, just in the wrong place.

    My main now loads the .ui file, followed by
    Qt Code:
    1. MainForm mfMain;
    2. mfMain.setCentralWidget(formWidget);
    To copy to clipboard, switch view to plain text mode 

    where the ctor for MainForm goes like so
    Qt Code:
    1. MainForm::MainForm(QWidget *parent) : QMainWindow(parent)
    2. {
    3. //...
    4. }
    To copy to clipboard, switch view to plain text mode 

    This makes a lot of sense too; it works like wysota's post above.

    Any idea why Gtk's (using Glade) method of interface design explicitly promotes dynamic interface loading, while in Qt land the paradigm focuses on the static method? I can see advantages and restrictions in both, but neither seems clearly better.

  2. #2
    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
    Any idea why Gtk's (using Glade) method of interface design explicitly promotes dynamic interface loading, while in Qt land the paradigm focuses on the static method? I can see advantages and restrictions in both, but neither seems clearly better.
    <flame mode>
    Maybe because Qt is better?
    </flame mode>

    Qt is object oriented and focuses on using classes, also for things like the GUI, whereas Gtk is not object oriented and doesn't care about classes, so it doesn't matter where it creates its bunch of variables responsible for controlling the user interface. Of course that's my personal opinion

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.