8#if QT_CONFIG(dockwidget)
9#include "qdockwidget.h"
15#include <qapplication.h>
20#if QT_CONFIG(statusbar)
21#include <qstatusbar.h>
29#include <private/qwidget_p.h>
31#include "qtoolbar_p.h"
34#include <QtGui/qpa/qplatformwindow.h>
35#include <QtGui/qpa/qplatformwindow_p.h>
39using namespace Qt::StringLiterals;
43 Q_DECLARE_PUBLIC(QMainWindow)
62 return mainWindow ? mainWindow->d_func()->layout.data() :
static_cast<QMainWindowLayout *>(
nullptr);
68 return QMainWindowPrivate::mainWindowLayout(mainWindow);
75 layout =
new QMainWindowLayout(q,
nullptr);
77 const int metric = q->style()->pixelMetric(QStyle::PM_ToolBarIconSize,
nullptr, q);
78 iconSize = QSize(metric, metric);
79 q->setAttribute(Qt::WA_Hover);
80 q->setAcceptDrops(
true);
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
256
257
258
259
260
261
262
263
264
265
268
269
270
271
272
273
274
275
276
277
279#if QT_CONFIG(dockwidget)
281
282
283
284
285
286
287
288
292
293
294
295
296
297
298QMainWindow::QMainWindow(QWidget *parent, Qt::WindowFlags flags)
299 : QWidget(*(
new QMainWindowPrivate()), parent, flags | Qt::Window)
306
307
308QMainWindow::~QMainWindow()
312
313
314
315
316
317
320
321
322
323
324
325
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
366void QMainWindow::setDockOptions(DockOptions opt)
369 d->layout->setDockOptions(opt);
372QMainWindow::DockOptions QMainWindow::dockOptions()
const
374 Q_D(
const QMainWindow);
375 return d->layout->dockOptions;
378QSize QMainWindow::iconSize()
const
379{
return d_func()->iconSize; }
381void QMainWindow::setIconSize(
const QSize &iconSize)
386 const int metric = style()->pixelMetric(QStyle::PM_ToolBarIconSize,
nullptr,
this);
387 sz = QSize(metric, metric);
389 if (d->iconSize != sz) {
391 emit iconSizeChanged(d->iconSize);
393 d->explicitIconSize = iconSize.isValid();
397
398
399
400
401
402
403
404
406Qt::ToolButtonStyle QMainWindow::toolButtonStyle()
const
407{
return d_func()->toolButtonStyle; }
409void QMainWindow::setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle)
412 if (d->toolButtonStyle == toolButtonStyle)
414 d->toolButtonStyle = toolButtonStyle;
415 emit toolButtonStyleChanged(d->toolButtonStyle);
418#if QT_CONFIG(menubar)
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434QMenuBar *QMainWindow::menuBar()
const
436 QMenuBar *menuBar = qobject_cast<QMenuBar *>(layout()->menuBar());
438 QMainWindow *self =
const_cast<QMainWindow *>(
this);
439 menuBar =
new QMenuBar(self);
440 self->setMenuBar(menuBar);
446
447
448
449
450
451
452
453void QMainWindow::setMenuBar(QMenuBar *menuBar)
455 QLayout *topLayout = layout();
457 if (QWidget *existingMenuBar = topLayout->menuBar(); existingMenuBar && existingMenuBar != menuBar) {
459 QMenuBar *oldMenuBar = qobject_cast<QMenuBar *>(existingMenuBar);
460 if (oldMenuBar && menuBar) {
462 QWidget *cornerWidget = oldMenuBar->cornerWidget(Qt::TopLeftCorner);
464 menuBar->setCornerWidget(cornerWidget, Qt::TopLeftCorner);
466 cornerWidget = oldMenuBar->cornerWidget(Qt::TopRightCorner);
468 menuBar->setCornerWidget(cornerWidget, Qt::TopRightCorner);
471 existingMenuBar->hide();
472 existingMenuBar->setParent(
nullptr);
473 existingMenuBar->deleteLater();
475 topLayout->setMenuBar(menuBar);
479
480
481
482
483
484QWidget *QMainWindow::menuWidget()
const
486 QWidget *menuBar = d_func()->layout->menuBar();
491
492
493
494
495
496
497
498void QMainWindow::setMenuWidget(QWidget *menuBar)
501 if (d->layout->menuBar() && d->layout->menuBar() != menuBar) {
502 d->layout->menuBar()->hide();
503 d->layout->menuBar()->deleteLater();
505 d->layout->setMenuBar(menuBar);
509#if QT_CONFIG(statusbar)
511
512
513
514
515
516QStatusBar *QMainWindow::statusBar()
const
518 QStatusBar *statusbar = d_func()->layout->statusBar();
520 QMainWindow *self =
const_cast<QMainWindow *>(
this);
521 statusbar =
new QStatusBar(self);
522 statusbar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
523 self->setStatusBar(statusbar);
529
530
531
532
533
534
535
536
537void QMainWindow::setStatusBar(QStatusBar *statusbar)
540 if (d->layout->statusBar() && d->layout->statusBar() != statusbar) {
541 d->layout->statusBar()->hide();
542 d->layout->statusBar()->deleteLater();
544 d->layout->setStatusBar(statusbar);
549
550
551
552
553
554QWidget *QMainWindow::centralWidget()
const
555{
return d_func()->layout->centralWidget(); }
558
559
560
561
562
563
564
565void QMainWindow::setCentralWidget(QWidget *widget)
568 if (d->layout->centralWidget() && d->layout->centralWidget() != widget) {
569 d->layout->centralWidget()->hide();
570 d->layout->centralWidget()->deleteLater();
572 d->layout->setCentralWidget(widget);
576
577
578
579
580
581
582QWidget *QMainWindow::takeCentralWidget()
585 QWidget *oldcentralwidget = d->layout->centralWidget();
586 if (oldcentralwidget) {
587 oldcentralwidget->setParent(
nullptr);
588 d->layout->setCentralWidget(
nullptr);
590 return oldcentralwidget;
593#if QT_CONFIG(dockwidget)
595
596
597
598
599
600void QMainWindow::setCorner(Qt::Corner corner, Qt::DockWidgetArea area)
604 case Qt::TopLeftCorner:
605 valid = (area == Qt::TopDockWidgetArea || area == Qt::LeftDockWidgetArea);
607 case Qt::TopRightCorner:
608 valid = (area == Qt::TopDockWidgetArea || area == Qt::RightDockWidgetArea);
610 case Qt::BottomLeftCorner:
611 valid = (area == Qt::BottomDockWidgetArea || area == Qt::LeftDockWidgetArea);
613 case Qt::BottomRightCorner:
614 valid = (area == Qt::BottomDockWidgetArea || area == Qt::RightDockWidgetArea);
617 if (Q_UNLIKELY(!valid))
618 qWarning(
"QMainWindow::setCorner(): 'area' is not valid for 'corner'");
620 d_func()->layout->setCorner(corner, area);
624
625
626
627
628
629Qt::DockWidgetArea QMainWindow::corner(Qt::Corner corner)
const
630{
return d_func()->layout->corner(corner); }
633#if QT_CONFIG(toolbar)
635static bool checkToolBarArea(Qt::ToolBarArea area,
const char *where)
638 case Qt::LeftToolBarArea:
639 case Qt::RightToolBarArea:
640 case Qt::TopToolBarArea:
641 case Qt::BottomToolBarArea:
646 qWarning(
"%s: invalid 'area' argument", where);
651
652
653
654
655
656
657void QMainWindow::addToolBarBreak(Qt::ToolBarArea area)
659 if (!checkToolBarArea(area,
"QMainWindow::addToolBarBreak"))
661 d_func()->layout->addToolBarBreak(area);
665
666
667void QMainWindow::insertToolBarBreak(QToolBar *before)
668{ d_func()->layout->insertToolBarBreak(before); }
671
672
674void QMainWindow::removeToolBarBreak(QToolBar *before)
677 d->layout->removeToolBarBreak(before);
681
682
683
684
685
686
687
688
689
690
691
692
693
694void QMainWindow::addToolBar(Qt::ToolBarArea area, QToolBar *toolbar)
696 if (!checkToolBarArea(area,
"QMainWindow::addToolBar"))
701 disconnect(
this, SIGNAL(iconSizeChanged(QSize)),
702 toolbar, SLOT(_q_updateIconSize(QSize)));
703 disconnect(
this, SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
704 toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
706 if (toolbar->d_func()->state && toolbar->d_func()->state->dragging) {
708#if QT_CONFIG(dockwidget)
709 bool animated = isAnimated();
712 toolbar->d_func()->endDrag();
713#if QT_CONFIG(dockwidget)
714 setAnimated(animated);
718 d->layout->removeToolBar(toolbar);
720 toolbar->d_func()->_q_updateIconSize(d->iconSize);
721 toolbar->d_func()->_q_updateToolButtonStyle(d->toolButtonStyle);
722 connect(
this, SIGNAL(iconSizeChanged(QSize)),
723 toolbar, SLOT(_q_updateIconSize(QSize)));
724 connect(
this, SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
725 toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
727 d->layout->addToolBar(area, toolbar);
731
732
733void QMainWindow::addToolBar(QToolBar *toolbar)
734{ addToolBar(Qt::TopToolBarArea, toolbar); }
737
738
739
740
741
742
743
744QToolBar *QMainWindow::addToolBar(
const QString &title)
746 QToolBar *toolBar =
new QToolBar(
this);
747 toolBar->setWindowTitle(title);
753
754
755
756
757
758
759
760void QMainWindow::insertToolBar(QToolBar *before, QToolBar *toolbar)
764 d->layout->removeToolBar(toolbar);
766 toolbar->d_func()->_q_updateIconSize(d->iconSize);
767 toolbar->d_func()->_q_updateToolButtonStyle(d->toolButtonStyle);
768 connect(
this, SIGNAL(iconSizeChanged(QSize)),
769 toolbar, SLOT(_q_updateIconSize(QSize)));
770 connect(
this, SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
771 toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
773 d->layout->insertToolBar(before, toolbar);
777
778
779
780void QMainWindow::removeToolBar(QToolBar *toolbar)
783 d_func()->layout->removeToolBar(toolbar);
789
790
791
792
793
794
795Qt::ToolBarArea QMainWindow::toolBarArea(
const QToolBar *toolbar)
const
796{
return d_func()->layout->toolBarArea(toolbar); }
799
800
801
802
803
804
805bool QMainWindow::toolBarBreak(QToolBar *toolbar)
const
807 return d_func()->layout->toolBarBreak(toolbar);
812#if QT_CONFIG(dockwidget)
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
834bool QMainWindow::isAnimated()
const
836 Q_D(
const QMainWindow);
837 return d->layout->dockOptions & AnimatedDocks;
840void QMainWindow::setAnimated(
bool enabled)
844 DockOptions opts = d->layout->dockOptions;
845 opts.setFlag(AnimatedDocks, enabled);
847 d->layout->setDockOptions(opts);
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
870bool QMainWindow::isDockNestingEnabled()
const
872 Q_D(
const QMainWindow);
873 return d->layout->dockOptions & AllowNestedDocks;
876void QMainWindow::setDockNestingEnabled(
bool enabled)
880 DockOptions opts = d->layout->dockOptions;
881 opts.setFlag(AllowNestedDocks, enabled);
883 d->layout->setDockOptions(opts);
889
890
891
892
893
894
895
896
897
898
899
900
902bool QMainWindow::verticalTabsEnabled()
const
904 return d_func()->layout->verticalTabsEnabled();
907void QMainWindow::setVerticalTabsEnabled(
bool enabled)
909 d_func()->layout->setVerticalTabsEnabled(enabled);
913static bool checkDockWidgetArea(Qt::DockWidgetArea area,
const char *where)
916 case Qt::LeftDockWidgetArea:
917 case Qt::RightDockWidgetArea:
918 case Qt::TopDockWidgetArea:
919 case Qt::BottomDockWidgetArea:
924 qWarning(
"%s: invalid 'area' argument", where);
930
931
932
933
934
935
936
937
938bool QMainWindow::documentMode()
const
940 return d_func()->layout->documentMode();
943void QMainWindow::setDocumentMode(
bool enabled)
945 d_func()->layout->setDocumentMode(enabled);
949#if QT_CONFIG(tabwidget)
951
952
953
954
955
956
957
958
959QTabWidget::TabShape QMainWindow::tabShape()
const
961 return d_func()->layout->tabShape();
964void QMainWindow::setTabShape(QTabWidget::TabShape tabShape)
966 d_func()->layout->setTabShape(tabShape);
970
971
972
973
974
975
976
977
978
979
980
981
982
983QTabWidget::TabPosition QMainWindow::tabPosition(Qt::DockWidgetArea area)
const
985 if (!checkDockWidgetArea(area,
"QMainWindow::tabPosition"))
986 return QTabWidget::South;
987 return d_func()->layout->tabPosition(area);
991
992
993
994
995
996
997
998
999
1000
1001void QMainWindow::setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition)
1003 d_func()->layout->setTabPosition(areas, tabPosition);
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017void QMainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget)
1019 if (!checkDockWidgetArea(area,
"QMainWindow::addDockWidget"))
1022 Qt::Orientation orientation = Qt::Vertical;
1024 case Qt::TopDockWidgetArea:
1025 case Qt::BottomDockWidgetArea:
1026 orientation = Qt::Horizontal;
1031 const Qt::DockWidgetArea oldArea = dockWidgetArea(dockwidget);
1032 d_func()->layout->removeWidget(dockwidget);
1033 addDockWidget(area, dockwidget, orientation);
1034 if (oldArea != area)
1035 emit dockwidget->dockLocationChanged(area);
1039
1040
1041
1042
1043
1044
1046bool QMainWindow::restoreDockWidget(QDockWidget *dockwidget)
1048 return d_func()->layout->restoreDockWidget(dockwidget);
1052
1053
1054
1055
1056
1057
1058
1059void QMainWindow::addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget,
1060 Qt::Orientation orientation)
1062 if (!checkDockWidgetArea(area,
"QMainWindow::addDockWidget"))
1066 d_func()->layout->addDockWidget(area, dockwidget, orientation);
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090void QMainWindow::splitDockWidget(QDockWidget *after, QDockWidget *dockwidget,
1091 Qt::Orientation orientation)
1093 d_func()->layout->splitDockWidget(after, dockwidget, orientation);
1096#if QT_CONFIG(tabbar)
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108void QMainWindow::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
1110 d_func()->layout->tabifyDockWidget(first, second);
1115
1116
1117
1118
1119
1120
1121
1123QList<QDockWidget*> QMainWindow::tabifiedDockWidgets(QDockWidget *dockwidget)
const
1125 Q_D(
const QMainWindow);
1126 return d->layout ? d->layout->tabifiedDockWidgets(dockwidget) : QList<QDockWidget *>();
1132
1133
1134
1135void QMainWindow::removeDockWidget(QDockWidget *dockwidget)
1138 d_func()->layout->removeWidget(dockwidget);
1144
1145
1146
1147
1148
1149
1150Qt::DockWidgetArea QMainWindow::dockWidgetArea(QDockWidget *dockwidget)
const
1151{
return d_func()->layout->dockWidgetArea(dockwidget); }
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173void QMainWindow::resizeDocks(
const QList<QDockWidget *> &docks,
1174 const QList<
int> &sizes, Qt::Orientation orientation)
1176 d_func()->layout->layoutState.dockAreaLayout.resizeDocks(docks, sizes, orientation);
1177 d_func()->layout->invalidate();
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204QByteArray QMainWindow::saveState(
int version)
const
1207 QDataStream stream(&data, QIODevice::WriteOnly);
1208 stream.setVersion(QDataStream::Qt_5_0);
1209 stream << QMainWindowLayout::VersionMarker;
1211 d_func()->layout->saveState(stream);
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231bool QMainWindow::restoreState(
const QByteArray &state,
int version)
1233 if (state.isEmpty())
1235 QByteArray sd = state;
1236 QDataStream stream(&sd, QIODevice::ReadOnly);
1237 stream.setVersion(QDataStream::Qt_5_0);
1241 if (stream.status() != QDataStream::Ok || marker != QMainWindowLayout::VersionMarker || v != version)
1243 bool restored = d_func()->layout->restoreState(stream);
1248bool QMainWindow::event(QEvent *event)
1252#if QT_CONFIG(dockwidget)
1253 if (d->layout && d->layout->windowEvent(event))
1257 switch (event->type()) {
1259#if QT_CONFIG(toolbar)
1260 case QEvent::ToolBarChange: {
1261 Q_ASSERT(d->layout);
1262 d->layout->toggleToolBarsVisible();
1267#if QT_CONFIG(statustip)
1268 case QEvent::StatusTip:
1269#if QT_CONFIG(statusbar)
1270 Q_ASSERT(d->layout);
1271 if (QStatusBar *sb = d->layout->statusBar())
1272 sb->showMessage(
static_cast<QStatusTipEvent*>(event)->tip());
1275 static_cast<QStatusTipEvent*>(event)->ignore();
1279 case QEvent::StyleChange:
1280#if QT_CONFIG(dockwidget)
1281 Q_ASSERT(d->layout);
1282 d->layout->layoutState.dockAreaLayout.styleChangedEvent();
1284 if (!d->explicitIconSize)
1285 setIconSize(QSize());
1287#if QT_CONFIG(draganddrop)
1288 case QEvent::DragEnter:
1290 if (!d->layout->draggingWidget)
1294 case QEvent::DragMove: {
1295 if (!d->layout->draggingWidget)
1297 auto dragMoveEvent =
static_cast<QDragMoveEvent *>(event);
1298 d->layout->hover(d->layout->draggingWidget,
1299 mapToGlobal(dragMoveEvent->position()).toPoint());
1303 case QEvent::DragLeave:
1304 if (!d->layout->draggingWidget)
1306 d->layout->hover(d->layout->draggingWidget, pos() - QPoint(1, 1));
1313 return QWidget::event(event);
1316#if QT_CONFIG(toolbar)
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330void QMainWindow::setUnifiedTitleAndToolBarOnMac(
bool enabled)
1337 d->useUnifiedToolBar = enabled;
1343 setAttribute(Qt::WA_NativeWindow);
1344 setAttribute(Qt::WA_TranslucentBackground, enabled);
1348 auto *windowHandle = window()->windowHandle();
1349 windowHandle->setFlag(Qt::NoTitleBarBackgroundHint, enabled);
1351 if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSTahoe)
1352 windowHandle->setFlag(Qt::ExpandedClientAreaHint, enabled);
1353 overrideWindowFlags(windowHandle->flags());
1355 d->layout->updateUnifiedToolBarArea();
1363bool QMainWindow::unifiedTitleAndToolBarOnMac()
const
1366 return d_func()->useUnifiedToolBar;
1374
1375
1376bool QMainWindow::isSeparator(
const QPoint &pos)
const
1378#if QT_CONFIG(dockwidget)
1379 Q_D(
const QMainWindow);
1380 return !d->layout->layoutState.dockAreaLayout.findSeparator(pos).isEmpty();
1387#ifndef QT_NO_CONTEXTMENU
1389
1390
1391void QMainWindow::contextMenuEvent(QContextMenuEvent *event)
1396 QWidget *child = childAt(event->pos());
1397 while (child && child !=
this) {
1398#if QT_CONFIG(menubar)
1399 if (QMenuBar *mb = qobject_cast<QMenuBar *>(child)) {
1400 if (mb->parentWidget() !=
this)
1405#if QT_CONFIG(dockwidget)
1406 if (QDockWidget *dw = qobject_cast<QDockWidget *>(child)) {
1407 if (dw->parentWidget() !=
this)
1410 && dw->widget()->geometry().contains(child->mapFrom(
this, event->pos()))) {
1417#if QT_CONFIG(toolbar)
1418 if (QToolBar *tb = qobject_cast<QToolBar *>(child)) {
1419 if (tb->parentWidget() !=
this)
1424 child = child->parentWidget();
1430 QMenu *popup = createPopupMenu();
1432 if (!popup->isEmpty()) {
1433 popup->setAttribute(Qt::WA_DeleteOnClose);
1434 popup->popup(event->globalPos());
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460QMenu *QMainWindow::createPopupMenu()
1463 QMenu *menu =
nullptr;
1464#if QT_CONFIG(dockwidget)
1465 QList<QDockWidget *> dockwidgets = findChildren<QDockWidget *>();
1466 if (dockwidgets.size()) {
1467 menu =
new QMenu(
this);
1468 for (
int i = 0; i < dockwidgets.size(); ++i) {
1469 QDockWidget *dockWidget = dockwidgets.at(i);
1471 if (dockWidget->parentWidget() ==
this) {
1472 if (d->layout->layoutState.dockAreaLayout.indexOf(dockWidget).isEmpty())
1474 }
else if (QDockWidgetGroupWindow *dwgw =
1475 qobject_cast<QDockWidgetGroupWindow *>(dockWidget->parentWidget())) {
1476 if (dwgw->parentWidget() !=
this)
1478 if (dwgw->layoutInfo()->indexOf(dockWidget).isEmpty())
1483 menu->addAction(dockwidgets.at(i)->toggleViewAction());
1485 menu->addSeparator();
1488#if QT_CONFIG(toolbar)
1489 QList<QToolBar *> toolbars = findChildren<QToolBar *>();
1490 if (toolbars.size()) {
1492 menu =
new QMenu(
this);
1493 for (
int i = 0; i < toolbars.size(); ++i) {
1494 QToolBar *toolBar = toolbars.at(i);
1495 if (toolBar->parentWidget() ==
this
1496 && (!d->layout->layoutState.toolBarAreaLayout.indexOf(toolBar).isEmpty())) {
1497 menu->addAction(toolbars.at(i)->toggleViewAction());
1509#include "moc_qmainwindow.cpp"
Qt::ToolButtonStyle toolButtonStyle
static QMainWindowLayout * mainWindowLayout(const QMainWindow *mainWindow)
Combined button and popup list for selecting options.
QMainWindowLayout * qt_mainwindow_layout(const QMainWindow *mainWindow)