Results 1 to 2 of 2

Thread: from Qdialog to Qmainwindow in order to add a menu bar

  1. #1
    Join Date
    May 2011
    Location
    Italy
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: from Qdialog to Qmainwindow in order to add a menu bar

    Hello, I have written a GUI subclassing a Qdialog.
    Now I need to add a menu bar, but I have read that a Qdialog can't have a menu bar.
    So I was wondering if it was possible to transform a qdialog in a qmainwindow just in order to add a menu bar.
    Thanks for your help


    Added after 1 38 minutes:


    I think I found a solution..I subclassed a Qmainwindow, created a new object of this class and used SetCentralWidget function to set my previous Qdialog as central widget of the main window. Then I created the menus. It seems to work.
    Is this a good approach in your opinion?
    Last edited by Andrea Landi; 15th May 2011 at 20:22.
    In QT I believe

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: from Qdialog to Qmainwindow in order to add a menu bar

    Sounds like what I would have suggested to you.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. How to Call a QDialog in QMainWindow
    By mcht_z in forum Newbie
    Replies: 2
    Last Post: 13th April 2011, 06:43
  2. manipulating qmainwindow widget through qdialog
    By xeroblast in forum Qt Programming
    Replies: 1
    Last Post: 16th December 2010, 07:17
  3. PyQt: Fix tab order in tabbed widgets of QMainWindow
    By Studentik in forum Qt Programming
    Replies: 0
    Last Post: 25th December 2009, 18:48
  4. QMainWindow child of a QDialog
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2008, 07:16
  5. Tab Order Settings in a QDialog widgets
    By vinnu in forum Qt Programming
    Replies: 10
    Last Post: 21st September 2006, 16:25

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.