diff options
Diffstat (limited to 'src/widgets/widgets/qstatusbar.cpp')
-rw-r--r-- | src/widgets/widgets/qstatusbar.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/widgets/widgets/qstatusbar.cpp b/src/widgets/widgets/qstatusbar.cpp index da7c86a2af..4635b73a81 100644 --- a/src/widgets/widgets/qstatusbar.cpp +++ b/src/widgets/widgets/qstatusbar.cpp @@ -47,8 +47,12 @@ #include "qtimer.h" #include "qstyle.h" #include "qstyleoption.h" +#if QT_CONFIG(sizegrip) #include "qsizegrip.h" +#endif +#if QT_CONFIG(mainwindow) #include "qmainwindow.h" +#endif #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" @@ -79,7 +83,7 @@ public: QBoxLayout * box; QTimer * timer; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) QSizeGrip * resizer; bool showSizeGrip; #endif @@ -101,7 +105,7 @@ public: return i; } -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) void tryToShowSizeGrip() { if (!showSizeGrip) @@ -127,7 +131,7 @@ QRect QStatusBarPrivate::messageRect() const int left = 6; int right = q->width() - 12; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (resizer && resizer->isVisible()) { if (rtl) left = resizer->x() + resizer->width(); @@ -232,7 +236,7 @@ QStatusBar::QStatusBar(QWidget * parent) d->box = 0; d->timer = 0; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) d->resizer = 0; setSizeGripEnabled(true); // causes reformat() #else @@ -429,7 +433,7 @@ void QStatusBar::removeWidget(QWidget *widget) bool QStatusBar::isSizeGripEnabled() const { -#ifdef QT_NO_SIZEGRIP +#if !QT_CONFIG(sizegrip) return false; #else Q_D(const QStatusBar); @@ -439,7 +443,7 @@ bool QStatusBar::isSizeGripEnabled() const void QStatusBar::setSizeGripEnabled(bool enabled) { -#ifdef QT_NO_SIZEGRIP +#if !QT_CONFIG(sizegrip) Q_UNUSED(enabled); #else Q_D(QStatusBar); @@ -475,7 +479,7 @@ void QStatusBar::reformat() delete d->box; QBoxLayout *vbox; -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (d->resizer) { d->box = new QHBoxLayout(this); d->box->setMargin(0); @@ -516,7 +520,7 @@ void QStatusBar::reformat() int itemH = qMin(qSmartMinSize(item->w).height(), item->w->maximumHeight()); maxH = qMax(maxH, itemH); } -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (d->resizer) { maxH = qMax(maxH, d->resizer->sizeHint().height()); d->box->addSpacing(1); @@ -647,7 +651,7 @@ void QStatusBar::hideOrShow() */ void QStatusBar::showEvent(QShowEvent *) { -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) Q_D(QStatusBar); if (d->resizer && d->showSizeGrip) d->tryToShowSizeGrip(); @@ -720,7 +724,7 @@ bool QStatusBar::event(QEvent *e) maxH = qMax(maxH, itemH); } -#ifndef QT_NO_SIZEGRIP +#if QT_CONFIG(sizegrip) if (d->resizer) maxH = qMax(maxH, d->resizer->sizeHint().height()); #endif |