Introduce MainWindowOption_HasCentralWidget
You can now set an arbitrary widget as "central widget".
It's similar to MainWindowOption_HasCentralFrame, however the widget
won't be detachable and won't show tabs.
Similar to what you'd get with QMainWindow central widget concept.
Example:
QWidget *myWidget = new MyWidget();
mainWindow->setPersistentCentralWidget(myWidget);
Fixes #225
This commit is contained in:
@@ -31,7 +31,16 @@ Frame *DropAreaWithCentralFrame::createCentralFrame(MainWindowOptions options)
|
||||
{
|
||||
Frame *frame = nullptr;
|
||||
if (options & MainWindowOption_HasCentralFrame) {
|
||||
frame = Config::self().frameworkWidgetFactory()->createFrame(nullptr, FrameOptions() | FrameOption_IsCentralFrame | FrameOption_AlwaysShowsTabs);
|
||||
FrameOptions frameOptions = FrameOption_IsCentralFrame;
|
||||
const bool hasPersistentCentralWidget = (options & MainWindowOption_HasCentralWidget) == MainWindowOption_HasCentralWidget;
|
||||
if (hasPersistentCentralWidget) {
|
||||
frameOptions |= FrameOption_NonDockable;
|
||||
} else {
|
||||
// With a persistent central widget we don't allow detaching it
|
||||
frameOptions |= FrameOption_AlwaysShowsTabs;
|
||||
}
|
||||
|
||||
frame = Config::self().frameworkWidgetFactory()->createFrame(nullptr, frameOptions);
|
||||
frame->setObjectName(QStringLiteral("central frame"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user