Results 1 to 8 of 8

Thread: QMainWindow

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Shanghai, China
    Posts
    52
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMainWindow

    Of course QDialog could have menu and status bar etc, you can always add them yourself.

    Qt Code:
    1. QMenuBar menuBar = new QMenuBar(this);
    2. menuBar->addAction("File");
    3. menuBar->addAction("Tools");
    To copy to clipboard, switch view to plain text mode 
    1. Users don't have the manual, and if they did, they wouldn't read it.
    2. In fact, users can't read anything, and if they could, they wouldn't want to.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QMainWindow

    Quote Originally Posted by bood View Post
    Of course QDialog could have menu and status bar etc, you can always add them yourself.
    But then you can't float and move the menu bar out of the box.

  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMainWindow

    Quote Originally Posted by Lykurg View Post
    But then you can't float and move the menu bar out of the box.
    Hi, I don't want to float and move the menu bar.
    I would it fixed at its position.
    Franco Amato

  4. #4
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMainWindow

    You can just put everything in the central widget. I don't see the problem. If your application have one main window then it is your choice if it is QMainWindow, QDialog, QWidgetand so on. With this three you always have the main widget area: in QWidget and QDialog this are themselfs and in QMainWindow it is the central widget. Just place everything in proper layouts and it should work for those classes. QMainWindow just offers more then QWidget or QDialog, because has dock areas for example.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  5. #5
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMainWindow

    Quote Originally Posted by faldżip View Post
    You can just put everything in the central widget. I don't see the problem. If your application have one main window then it is your choice if it is QMainWindow, QDialog, QWidgetand so on. With this three you always have the main widget area: in QWidget and QDialog this are themselfs and in QMainWindow it is the central widget. Just place everything in proper layouts and it should work for those classes. QMainWindow just offers more then QWidget or QDialog, because has dock areas for example.
    So if I would have
    Menu bar,
    tool bar,
    status bar,
    and my custom widgets that I don't want be float, but fixed I can use QDialog approach?
    I still have problem in layout them
    Franco Amato

Similar Threads

  1. QMainWindow with QMainWindow
    By baray98 in forum Qt Programming
    Replies: 3
    Last Post: 12th April 2011, 07:07
  2. Maximumsize by layout QMainWindow
    By captiva in forum Qt Programming
    Replies: 7
    Last Post: 24th February 2009, 19:41
  3. QMainWindow setCentralWidget from ui widget, Qt4
    By alan in forum Qt Programming
    Replies: 5
    Last Post: 13th May 2008, 13:00
  4. QMainWindow child of a QDialog
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2008, 07:16
  5. Replies: 18
    Last Post: 22nd February 2006, 20:51

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.