Results 1 to 2 of 2

Thread: Display the GUI after that it has been completely initialized

  1. #1
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Display the GUI after that it has been completely initialized

    Hi,

    When my application starts up I resize it to a smaller size based on the user's system preferences. Here is the code (created with Qt-Creator):

    Qt Code:
    1. GUI::GUI(QWidget *parent) : QMainWindow(parent), ui(new Ui::GUI) {
    2. ui->setupUi(this);
    3. // create menu bar, fill comboboxes, ...
    4. this->initGUIStuff();
    5. // resize the GUI according to the users system preferences
    6. this->resize(this->sizeHint());
    7. ...
    8. }
    To copy to clipboard, switch view to plain text mode 

    This works fine, when the application starts up on Windows, Linux or Mac OS X it is resized to a smaller size that is more appropriate. Unfortunately one can see the resize action on Mac OS X, the GUI starts up and once it is rendered to the screen it is resized.

    Is there a possibility to hide the GUI until it has been set up and only then show it to the user? If tried this->setVisible(false), ..., this->setVisible(true) but that did not work.

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Display the GUI after that it has been completely initialized

    I guess you call show() in the main.cpp or somewhere else.
    Don't do that and let the GUI class either show itself or send a signal it is ready to show.

Similar Threads

  1. Why QWindow is not initialized with the NEW keyword?
    By probine in forum Qt Programming
    Replies: 5
    Last Post: 3rd April 2010, 22:28
  2. GUI completely nonfunctional in Release configuration.
    By alpinista in forum Qt Programming
    Replies: 2
    Last Post: 7th December 2009, 08:43
  3. Completely lost!!!
    By Zuks in forum Newbie
    Replies: 4
    Last Post: 2nd December 2009, 09:58
  4. How to destroy a UdpSocket completely
    By ms20020048 in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2006, 19:01
  5. variable in method not initialized?!
    By frosch in forum Qt Programming
    Replies: 10
    Last Post: 3rd September 2006, 14:09

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.