How to setBottomWidget insteads of setCentralWidget? and color? (solved)
Mobile and Embedded
26
Posts
3
Posters
7.7k
Views
1
Watching
-
To work with QMainWindow's central widget you have to create a container widget and work on it. I already wrote that setting a layout on a QMainWindow will fail since it already has one.
@
QWidget *containerWidget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout(containerWidget);
layout->addStretch(1);
layout->addWidget(pTicker);
setCentralWidget(containerWidget);
@"QMainWindow":http://qt-project.org/doc/qt-5/qmainwindow.html#qt-main-window-framework
-
Again: stop trying to put your own layout in QMainWindow, it's not meant for that.
-
Sure it's not, it's meant to be used in a QMainWindow subclass constructor