diff options
Diffstat (limited to 'src/widgets/widgets/qmainwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindow.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 889082cb2a..694a36ed5b 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -44,7 +44,9 @@ #ifndef QT_NO_MAINWINDOW +#if QT_CONFIG(dockwidget) #include "qdockwidget.h" +#endif #include "qtoolbar.h" #include <qapplication.h> @@ -348,7 +350,7 @@ void QMainWindowPrivate::init() \sa setToolButtonStyle() */ -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! \fn void QMainWindow::tabifiedDockWidgetActivated(QDockWidget *dockWidget) @@ -660,7 +662,7 @@ QWidget *QMainWindow::takeCentralWidget() return oldcentralwidget; } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! Sets the given dock widget \a area to occupy the specified \a corner. @@ -766,12 +768,12 @@ void QMainWindow::addToolBar(Qt::ToolBarArea area, QToolBar *toolbar) if(toolbar->d_func()->state && toolbar->d_func()->state->dragging) { //removing a toolbar which is dragging will cause crash -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) bool animated = isAnimated(); setAnimated(false); #endif toolbar->d_func()->endDrag(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) setAnimated(animated); #endif } @@ -870,7 +872,7 @@ bool QMainWindow::toolBarBreak(QToolBar *toolbar) const #endif // QT_NO_TOOLBAR -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! \property QMainWindow::animated \brief whether manipulating dock widgets and tool bars is animated @@ -984,7 +986,7 @@ static bool checkDockWidgetArea(Qt::DockWidgetArea area, const char *where) return false; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \property QMainWindow::documentMode \brief whether the tab bar for tabbed dockwidgets is set to document mode. @@ -1003,9 +1005,9 @@ void QMainWindow::setDocumentMode(bool enabled) { d_func()->layout->setDocumentMode(enabled); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) /*! \property QMainWindow::tabShape \brief the tab shape used for tabbed dock widgets. @@ -1057,7 +1059,7 @@ void QMainWindow::setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosit { d_func()->layout->setTabPosition(areas, tabPosition); } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) /*! Adds the given \a dockwidget to the specified \a area. @@ -1160,7 +1162,7 @@ void QMainWindow::tabifyDockWidget(QDockWidget *first, QDockWidget *second) QList<QDockWidget*> QMainWindow::tabifiedDockWidgets(QDockWidget *dockwidget) const { QList<QDockWidget*> ret; -#if defined(QT_NO_TABBAR) +#if !QT_CONFIG(tabbar) Q_UNUSED(dockwidget); #else const QDockAreaLayoutInfo *info = d_func()->layout->layoutState.dockAreaLayout.info(dockwidget); @@ -1232,7 +1234,7 @@ void QMainWindow::resizeDocks(const QList<QDockWidget *> &docks, } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) /*! Saves the current state of this mainwindow's toolbars and @@ -1323,7 +1325,7 @@ bool QMainWindow::event(QEvent *event) #endif // QT_CONFIG(statustip) case QEvent::StyleChange: -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) d->layout->layoutState.dockAreaLayout.styleChangedEvent(); #endif if (!d->explicitIconSize) @@ -1388,7 +1390,7 @@ bool QMainWindow::unifiedTitleAndToolBarOnMac() const */ bool QMainWindow::isSeparator(const QPoint &pos) const { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) Q_D(const QMainWindow); return !d->layout->layoutState.dockAreaLayout.findSeparator(pos).isEmpty(); #else @@ -1415,7 +1417,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event) break; } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QDockWidget *dw = qobject_cast<QDockWidget *>(child)) { if (dw->parentWidget() != this) return; @@ -1426,7 +1428,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event) } break; } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR if (QToolBar *tb = qobject_cast<QToolBar *>(child)) { if (tb->parentWidget() != this) @@ -1474,7 +1476,7 @@ QMenu *QMainWindow::createPopupMenu() { Q_D(QMainWindow); QMenu *menu = 0; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) QList<QDockWidget *> dockwidgets = findChildren<QDockWidget *>(); if (dockwidgets.size()) { menu = new QMenu(this); @@ -1497,7 +1499,7 @@ QMenu *QMainWindow::createPopupMenu() } menu->addSeparator(); } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR QList<QToolBar *> toolbars = findChildren<QToolBar *>(); if (toolbars.size()) { |