Results 1 to 2 of 2

Thread: Which widget should I use to get a normal program window?

  1. #1
    Join Date
    May 2010
    Posts
    18
    Qt products
    Qt4
    Platforms
    Windows

    Question Which widget should I use to get a normal program window?

    Hi, I've been using QDialog as my main window, but it has just a close button in the upper right corner, and no minimize and no maximize button, which I want. And it closes down when I press escape, which I don't want it to do. So I figured that QDialog is probably not the widget I want. So which widget do I want to use? I tried QMainWindow, but then no of the widgets I added to it showed up, and the window turned white inside (instead of the light grey color it usually gets). Did I maybe use the QMainWindow wrong? It really sounds like it could be the widget I want, although I'm not sure about it.

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Which widget should I use to get a normal program window?

    I use QWidget or QMainWindow for that.
    But if you create a GUI project, Qt Creator automatically creates MainWindow witch is derived from QMainWindow.

    You can create a QWidget in witch you layout other stuff, and then MainWindow variable call setCentralWidget(your_widget).
    Hope i was clear enough...

  3. The following user says thank you to Zlatomir for this useful post:

    zoz (30th May 2010)

Similar Threads

  1. How to host the other process's window in a program?
    By tszzp in forum Qt Programming
    Replies: 6
    Last Post: 10th February 2010, 11:34
  2. Start application minimized or normal
    By matze in forum Qt Programming
    Replies: 3
    Last Post: 12th January 2010, 15:57
  3. execute sth before program exits (user closes window)
    By donglebob in forum Qt Programming
    Replies: 6
    Last Post: 10th December 2008, 00:24
  4. Program that just shows a window
    By claudio-cit in forum Newbie
    Replies: 2
    Last Post: 5th July 2008, 10:55
  5. Difference between normal socket and QTcpSocket
    By ShaChris23 in forum Newbie
    Replies: 1
    Last Post: 16th June 2007, 05:38

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.