I know how to add a QGridlayout in a QDialog but...
Is it possible to ad a QGridlayout to a QMainwindow without subclassing/inheriting QMainwindow?
How do I do this?
Tnx
I know how to add a QGridlayout in a QDialog but...
Is it possible to ad a QGridlayout to a QMainwindow without subclassing/inheriting QMainwindow?
How do I do this?
Tnx
Set the layout on a plain QWidget and set it as a central widget of the main window.
Qt Code:
widget->setLayout(gridLayout); mainWindow->setCentralWidget(widget);To copy to clipboard, switch view to plain text mode
J-P Nurmi
hakermania (20th October 2013)
Tnx J-P Nurmi,
It works, but...
In the console I get the message:
QLayout: Attempting to add QLayout "" to QMainWindow "", which already has a layout
Despite this message it seems to work. Do you know I can prevent this message?
Yep, you are right. Thanks a lot for your help J-P.
Bookmarks