PDA

View Full Version : from Qdialog to Qmainwindow in order to add a menu bar



Andrea Landi
15th May 2011, 21:22
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?

franz
16th May 2011, 07:11
Sounds like what I would have suggested to you.