Results 1 to 3 of 3

Thread: QMainWindow or QWidget start hidden?

  1. #1
    Join Date
    Jul 2008
    Posts
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QMainWindow or QWidget start hidden?

    I have been playing around with these two classes, and I can't get them to start as hidden.

    I try using the showEvent() and then calling hide(), or setVisible( false );. But neither works. However if I have a button within the window/widget, and when I press the button I then call hide(), it works. So how can I make a MainWindow or Widget Invisible upon it's creation? You probably ask why I want to make i invisible. Well I am using QSystemTrayIcon, and when the program is executed I only want a system tray icon to be visible, no window.

    Thanks,

    Marf

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMainWindow or QWidget start hidden?

    Hi,

    Take a look at "main" function. You have "yourMainWindow.show()". Just remove or comment this code line.
    Òscar Llarch i Galán

  3. #3
    Join Date
    Jul 2008
    Posts
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QMainWindow or QWidget start hidden?

    Hahahaha, how did I miss that? Thanks for pointing out the obvious. I'm still chuckling to myself..

Similar Threads

  1. Resize QWidget in QMainWindow
    By aamer4yu in forum Qt Programming
    Replies: 1
    Last Post: 8th March 2007, 12:16
  2. Showing QMainWindow without showing a child QWidget
    By discostu in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2007, 09:03

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.