diff options
Diffstat (limited to 'src/widgets/widgets/qmdiarea.cpp')
-rw-r--r-- | src/widgets/widgets/qmdiarea.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index 2e0ecd4831..513011f0ad 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -564,7 +564,7 @@ QPoint MinOverlapPlacer::place(const QSize &size, const QVector<QRect> &rects, return findBestPlacement(domain, rects, candidates); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class QMdiAreaTabBar : public QTabBar { public: @@ -662,7 +662,7 @@ QMdiSubWindow *QMdiAreaTabBar::subWindowFromIndex(int index) const return subWindow; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /*! \internal @@ -675,12 +675,12 @@ QMdiAreaPrivate::QMdiAreaPrivate() #if QT_CONFIG(rubberband) rubberBand(0), #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) tabBar(0), #endif activationOrder(QMdiArea::CreationOrder), viewMode(QMdiArea::SubWindowView), -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) documentMode(false), tabsClosable(false), tabsMovable(false), @@ -780,7 +780,7 @@ void QMdiAreaPrivate::_q_processWindowStateChanged(Qt::WindowStates oldState, void QMdiAreaPrivate::_q_currentTabChanged(int index) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(index); #else if (!tabBar || index < 0) @@ -799,28 +799,28 @@ void QMdiAreaPrivate::_q_currentTabChanged(int index) QMdiSubWindow *subWindow = childWindows.at(index); Q_ASSERT(subWindow); activateWindow(subWindow); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QMdiAreaPrivate::_q_closeTab(int index) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(index); #else QMdiSubWindow *subWindow = childWindows.at(index); Q_ASSERT(subWindow); subWindow->close(); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QMdiAreaPrivate::_q_moveTab(int from, int to) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(from); Q_UNUSED(to); #else childWindows.move(from, to); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } /*! @@ -858,7 +858,7 @@ void QMdiAreaPrivate::appendChild(QMdiSubWindow *child) indicesToActivatedChildren.prepend(childWindows.size() - 1); Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar) { tabBar->addTab(child->windowIcon(), tabTextFor(child)); updateTabBarGeometry(); @@ -1082,7 +1082,7 @@ void QMdiAreaPrivate::emitWindowActivated(QMdiSubWindow *activeWindow) aboutToBecomeActive = 0; Q_ASSERT(active->d_func()->isActive); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar && tabBar->currentIndex() != indexToActiveWindow) tabBar->setCurrentIndex(indexToActiveWindow); #endif @@ -1125,7 +1125,7 @@ void QMdiAreaPrivate::updateActiveWindow(int removedIndex, bool activeRemoved) { Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar && removedIndex >= 0) { const QSignalBlocker blocker(tabBar); tabBar->removeTab(removedIndex); @@ -1563,7 +1563,7 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) // Just a guard since we cannot set viewMode = mode here. inViewModeChange = true; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (mode == QMdiArea::TabbedView) { Q_ASSERT(!tabBar); tabBar = new QMdiAreaTabBar(q); @@ -1604,12 +1604,12 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) QObject::connect(tabBar, SIGNAL(tabCloseRequested(int)), q, SLOT(_q_closeTab(int))); QObject::connect(tabBar, SIGNAL(tabMoved(int,int)), q, SLOT(_q_moveTab(int,int))); } else -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) { // SubWindowView -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) delete tabBar; tabBar = 0; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) viewMode = mode; q->setViewportMargins(0, 0, 0, 0); @@ -1624,7 +1624,7 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) inViewModeChange = false; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \internal */ @@ -1696,7 +1696,7 @@ void QMdiAreaPrivate::refreshTabBar() #endif updateTabBarGeometry(); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /*! Constructs an empty mdi area. \a parent is passed to QWidget's @@ -2141,7 +2141,7 @@ void QMdiArea::setViewMode(ViewMode mode) d->setViewMode(mode); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \property QMdiArea::documentMode \brief whether the tab bar is set to document mode in tabbed view mode. @@ -2216,7 +2216,7 @@ void QMdiArea::setTabsMovable(bool movable) d->tabsMovable = movable; d->refreshTabBar(); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #if QT_CONFIG(tabwidget) /*! @@ -2297,7 +2297,7 @@ void QMdiArea::resizeEvent(QResizeEvent *resizeEvent) return; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) d->updateTabBarGeometry(); #endif @@ -2535,7 +2535,7 @@ bool QMdiArea::event(QEvent *event) d->setActive(d->active, false, false); d->setChildActivationEnabled(false); break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QEvent::LayoutDirectionChange: d->updateTabBarGeometry(); break; @@ -2632,13 +2632,13 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) d->isSubWindowsTiled = false; break; case QEvent::Show: -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (d->tabBar) { const int tabIndex = d->childWindows.indexOf(subWindow); if (!d->tabBar->isTabEnabled(tabIndex)) d->tabBar->setTabEnabled(tabIndex, true); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) // fall through case QEvent::Hide: d->isSubWindowsTiled = false; @@ -2649,7 +2649,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) d->hideRubberBand(); break; #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QEvent::WindowTitleChange: case QEvent::ModifiedChange: if (d->tabBar) @@ -2659,7 +2659,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) if (d->tabBar) d->tabBar->setTabIcon(d->childWindows.indexOf(subWindow), subWindow->windowIcon()); break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) default: break; } |