summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:34:32 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:36:10 -0700
commitd38fe875c7850ca2c6ca28f91e94ae276735fac8 (patch)
treee5c92cef74e0853490d77cf0139b23f00d548a6e /src/widgets/widgets
parentac4e848c9802377b7c4ff673180f28b9ca76b746 (diff)
parent627f0a7f7d775ecd263b95dd07fca44bfcb0c5cf (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp2
-rw-r--r--src/widgets/widgets/qcombobox.cpp6
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp4
-rw-r--r--src/widgets/widgets/qdatetimeedit.h7
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h4
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp6
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h2
-rw-r--r--src/widgets/widgets/qmdiarea.cpp16
-rw-r--r--src/widgets/widgets/qmdiarea_p.h6
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp30
-rw-r--r--src/widgets/widgets/qmdisubwindow_p.h8
-rw-r--r--src/widgets/widgets/qrubberband.cpp4
-rw-r--r--src/widgets/widgets/qrubberband.h7
-rw-r--r--src/widgets/widgets/qsplitter.cpp2
-rw-r--r--src/widgets/widgets/qsplitter_p.h1
-rw-r--r--src/widgets/widgets/qtoolbar.cpp2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp14
-rw-r--r--src/widgets/widgets/widgets.pri19
18 files changed, 74 insertions, 66 deletions
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index 4a3abe0c32..22f3745b26 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -49,7 +49,9 @@
#include <qstylehints.h>
#include <qclipboard.h>
#include <qdatetime.h>
+#if QT_CONFIG(datetimeedit)
#include <qdatetimeedit.h>
+#endif
#include <qevent.h>
#include <qmenu.h>
#include <qpainter.h>
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index a8a54d8d67..90dfbe1633 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -47,7 +47,9 @@
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qlistview.h>
+#if QT_CONFIG(tableview)
#include <qtableview.h>
+#endif
#include <qitemdelegate.h>
#include <qmap.h>
#include <qmenu.h>
@@ -615,7 +617,7 @@ int QComboBoxPrivateContainer::topMargin() const
{
if (const QListView *lview = qobject_cast<const QListView*>(view))
return lview->spacing();
-#ifndef QT_NO_TABLEVIEW
+#if QT_CONFIG(tableview)
if (const QTableView *tview = qobject_cast<const QTableView*>(view))
return tview->showGrid() ? 1 : 0;
#endif
@@ -630,7 +632,7 @@ int QComboBoxPrivateContainer::spacing() const
QListView *lview = qobject_cast<QListView*>(view);
if (lview)
return 2 * lview->spacing(); // QListView::spacing is the padding around the item.
-#ifndef QT_NO_TABLEVIEW
+#if QT_CONFIG(tableview)
QTableView *tview = qobject_cast<QTableView*>(view);
if (tview)
return tview->showGrid() ? 1 : 0;
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 46e6369e3c..6d1521c48b 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -54,8 +54,6 @@
#include <algorithm>
-#ifndef QT_NO_DATETIMEEDIT
-
//#define QDATETIMEEDIT_QDTEDEBUG
#ifdef QDATETIMEEDIT_QDTEDEBUG
# define QDTEDEBUG qDebug() << QString::fromLatin1("%1:%2").arg(__FILE__).arg(__LINE__)
@@ -2675,5 +2673,3 @@ void QCalendarPopup::hideEvent(QHideEvent *)
QT_END_NAMESPACE
#include "moc_qdatetimeedit.cpp"
#include "moc_qdatetimeedit_p.cpp"
-
-#endif // QT_NO_DATETIMEEDIT
diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h
index 30e4a58bb3..b46434c1a4 100644
--- a/src/widgets/widgets/qdatetimeedit.h
+++ b/src/widgets/widgets/qdatetimeedit.h
@@ -45,10 +45,9 @@
#include <QtCore/qvariant.h>
#include <QtWidgets/qabstractspinbox.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(datetimeedit);
-#ifndef QT_NO_DATETIMEEDIT
+QT_BEGIN_NAMESPACE
class QDateTimeEditPrivate;
class QStyleOptionSpinBox;
@@ -228,8 +227,6 @@ Q_SIGNALS:
Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeEdit::Sections)
-#endif // QT_NO_DATETIMEEDIT
-
QT_END_NAMESPACE
#endif // QDATETIMEEDIT_H
diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h
index 5302d6d9a7..bc70780de9 100644
--- a/src/widgets/widgets/qdatetimeedit_p.h
+++ b/src/widgets/widgets/qdatetimeedit_p.h
@@ -63,8 +63,6 @@
#include "qdebug.h"
-#ifndef QT_NO_DATETIMEEDIT
-
QT_BEGIN_NAMESPACE
class QCalendarPopup;
@@ -181,6 +179,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_DATETIMEEDIT
-
#endif // QDATETIMEEDIT_P_H
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index e0269a3f02..e48ce301fb 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -49,7 +49,9 @@
#include "qtoolbar.h"
#include "qtoolbarlayout_p.h"
#include "qwidgetanimator_p.h"
+#if QT_CONFIG(rubberband)
#include "qrubberband.h"
+#endif
#include "qtabbar_p.h"
#include <qapplication.h>
@@ -2460,7 +2462,7 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
void QMainWindowLayout::updateGapIndicator()
{
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (!widgetAnimator.animating() && (!currentGapPos.isEmpty()
#if QT_CONFIG(dockwidget)
|| currentHoveredFloat
@@ -2490,7 +2492,7 @@ void QMainWindowLayout::updateGapIndicator()
} else if (gapIndicator) {
gapIndicator->hide();
}
-#endif //QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
}
void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h
index cc3b4e9261..6b75ef1caf 100644
--- a/src/widgets/widgets/qmainwindowlayout_p.h
+++ b/src/widgets/widgets/qmainwindowlayout_p.h
@@ -547,7 +547,7 @@ public:
QList<int> currentGapPos;
QRect currentGapRect;
QWidget *pluggingWidget;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
QPointer<QRubberBand> gapIndicator;
#endif
#ifndef QT_NO_DOCKWIDGET
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 0dc45ddbc3..83b5068bba 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -669,7 +669,7 @@ QMdiAreaPrivate::QMdiAreaPrivate()
regularTiler(0),
iconTiler(0),
placer(0),
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
rubberBand(0),
#endif
#ifndef QT_NO_TABBAR
@@ -1033,7 +1033,7 @@ void QMdiAreaPrivate::activateHighlightedWindow()
activateWindow(nextVisibleSubWindow(-1, QMdiArea::ActivationHistoryOrder));
else
activateWindow(childWindows.at(indexToHighlighted));
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
hideRubberBand();
#endif
}
@@ -1137,7 +1137,7 @@ void QMdiAreaPrivate::updateActiveWindow(int removedIndex, bool activeRemoved)
}
if (indexToHighlighted >= 0) {
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
// Hide rubber band if highlighted window is removed.
if (indexToHighlighted == removedIndex)
hideRubberBand();
@@ -1511,7 +1511,7 @@ void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor)
if (!highlight)
return;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (!rubberBand) {
rubberBand = new QRubberBand(QRubberBand::Rectangle, q);
// For accessibility to identify this special widget.
@@ -1521,7 +1521,7 @@ void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor)
#endif
// Only highlight if we're not switching back to the previously active window (Ctrl-Tab once).
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (tabToPreviousTimerId == -1)
showRubberBandFor(highlight);
#endif
@@ -2348,7 +2348,7 @@ void QMdiArea::timerEvent(QTimerEvent *timerEvent)
d->tabToPreviousTimerId = -1;
if (d->indexToHighlighted < 0)
return;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
// We're not doing a "quick switch" ... show rubber band.
Q_ASSERT(d->indexToHighlighted < d->childWindows.size());
Q_ASSERT(d->rubberBand);
@@ -2591,7 +2591,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event)
if (keyPress)
area->d_func()->highlightNextSubWindow(keyEvent->key() == Qt::Key_Tab ? 1 : -1);
return true;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
case Qt::Key_Escape:
area->d_func()->hideRubberBand();
break;
@@ -2640,7 +2640,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event)
case QEvent::Hide:
d->isSubWindowsTiled = false;
break;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
case QEvent::Close:
if (d->childWindows.indexOf(subWindow) == d->indexToHighlighted)
d->hideRubberBand();
diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h
index 353144a6ab..b77f3f63ea 100644
--- a/src/widgets/widgets/qmdiarea_p.h
+++ b/src/widgets/widgets/qmdiarea_p.h
@@ -144,7 +144,7 @@ public:
QMdi::Rearranger *regularTiler;
QMdi::Rearranger *iconTiler;
QMdi::Placer *placer;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
QRubberBand *rubberBand;
#endif
QMdiAreaTabBar *tabBar;
@@ -254,7 +254,7 @@ public:
subWindow->d_func()->setActive(active, changeFocus);
}
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
void showRubberBandFor(QMdiSubWindow *subWindow);
inline void hideRubberBand()
@@ -263,7 +263,7 @@ public:
rubberBand->hide();
indexToHighlighted = -1;
}
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
};
#endif // QT_NO_MDIAREA
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index 664dd8d710..498744e81e 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -863,14 +863,14 @@ QMdiSubWindowPrivate::QMdiSubWindowPrivate()
#ifndef QT_NO_SIZEGRIP
sizeGrip(0),
#endif
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
rubberBand(0),
#endif
userMinimumSize(0,0),
resizeEnabled(true),
moveEnabled(true),
isInInteractiveMode(false),
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
isInRubberBandMode(false),
#endif
isShadeMode(false),
@@ -944,13 +944,13 @@ void QMdiSubWindowPrivate::_q_enterInteractiveMode()
oldGeometry = q->geometry();
isInInteractiveMode = true;
q->setFocus();
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if ((q->testOption(QMdiSubWindow::RubberBandResize)
&& (currentOperation == BottomRightResize || currentOperation == BottomLeftResize))
|| (q->testOption(QMdiSubWindow::RubberBandMove) && currentOperation == Move)) {
enterRubberBandMode();
} else
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
{
q->grabMouse();
}
@@ -977,7 +977,7 @@ void QMdiSubWindowPrivate::_q_processFocusChanged(QWidget *old, QWidget *now)
void QMdiSubWindowPrivate::leaveInteractiveMode()
{
Q_Q(QMdiSubWindow);
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (isInRubberBandMode)
leaveRubberBandMode();
else
@@ -1881,7 +1881,7 @@ void QMdiSubWindowPrivate::updateWindowTitle(bool isRequestFromChild)
ignoreWindowTitleChange = false;
}
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
void QMdiSubWindowPrivate::enterRubberBandMode()
{
Q_Q(QMdiSubWindow);
@@ -1913,7 +1913,7 @@ void QMdiSubWindowPrivate::leaveRubberBandMode()
rubberBand->hide();
currentOperation = None;
}
-#endif // QT_NO_RUBBERBAND
+#endif // QT_CONFIG(rubberband)
// Taken from the old QWorkspace (::readColors())
QPalette QMdiSubWindowPrivate::desktopPalette() const
@@ -2410,7 +2410,7 @@ void QMdiSubWindow::setOption(SubWindowOption option, bool on)
Q_D(QMdiSubWindow);
d->options.setFlag(option, on);
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if ((option & (RubberBandResize | RubberBandMove)) && !on && d->isInRubberBandMode)
d->leaveRubberBandMode();
#endif
@@ -2709,7 +2709,7 @@ bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event)
d->oldGeometry = geometry();
d->currentOperation = isLeftToRight() ? QMdiSubWindowPrivate::BottomRightResize
: QMdiSubWindowPrivate::BottomLeftResize;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
d->enterRubberBandMode();
#endif
return true;
@@ -2823,7 +2823,7 @@ bool QMdiSubWindow::event(QEvent *event)
d->currentOperation = QMdiSubWindowPrivate::None;
d->activeSubControl = QStyle::SC_None;
d->hoveredSubControl = QStyle::SC_None;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (d->isInRubberBandMode)
d->leaveRubberBandMode();
#endif
@@ -3182,7 +3182,7 @@ void QMdiSubWindow::mousePressEvent(QMouseEvent *mouseEvent)
Q_D(QMdiSubWindow);
if (d->isInInteractiveMode)
d->leaveInteractiveMode();
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (d->isInRubberBandMode)
d->leaveRubberBandMode();
#endif
@@ -3197,7 +3197,7 @@ void QMdiSubWindow::mousePressEvent(QMouseEvent *mouseEvent)
d->mousePressPosition = mapToParent(mouseEvent->pos());
if (d->resizeEnabled || d->moveEnabled)
d->oldGeometry = geometry();
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if ((testOption(QMdiSubWindow::RubberBandResize) && d->isResizeOperation())
|| (testOption(QMdiSubWindow::RubberBandMove) && d->isMoveOperation())) {
d->enterRubberBandMode();
@@ -3277,7 +3277,7 @@ void QMdiSubWindow::mouseReleaseEvent(QMouseEvent *mouseEvent)
Q_D(QMdiSubWindow);
if (d->currentOperation != QMdiSubWindowPrivate::None) {
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (d->isInRubberBandMode && !d->isInInteractiveMode)
d->leaveRubberBandMode();
#endif
@@ -3392,13 +3392,13 @@ void QMdiSubWindow::keyPressEvent(QKeyEvent *keyEvent)
#ifndef QT_NO_CURSOR
QPoint newPosition = parentWidget()->mapFromGlobal(cursor().pos() + delta);
QRect oldGeometry =
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
d->isInRubberBandMode ? d->rubberBand->geometry() :
#endif
geometry();
d->setNewGeometry(newPosition);
QRect currentGeometry =
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
d->isInRubberBandMode ? d->rubberBand->geometry() :
#endif
geometry();
diff --git a/src/widgets/widgets/qmdisubwindow_p.h b/src/widgets/widgets/qmdisubwindow_p.h
index 33fa73eb0d..71fcc38378 100644
--- a/src/widgets/widgets/qmdisubwindow_p.h
+++ b/src/widgets/widgets/qmdisubwindow_p.h
@@ -179,7 +179,7 @@ public:
#ifndef QT_NO_SIZEGRIP
QPointer<QSizeGrip> sizeGrip;
#endif
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
QRubberBand *rubberBand;
#endif
QPoint mousePressPosition;
@@ -190,7 +190,7 @@ public:
bool resizeEnabled;
bool moveEnabled;
bool isInInteractiveMode;
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
bool isInRubberBandMode;
#endif
bool isShadeMode;
@@ -258,7 +258,7 @@ public:
void removeButtonsFromMenuBar();
#endif
void updateWindowTitle(bool requestFromChild);
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
void enterRubberBandMode();
void leaveRubberBandMode();
#endif
@@ -310,7 +310,7 @@ public:
Q_Q(QMdiSubWindow);
Q_ASSERT(parent);
geometry->setSize(geometry->size().expandedTo(internalMinimumSize));
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
if (isInRubberBandMode)
rubberBand->setGeometry(*geometry);
else
diff --git a/src/widgets/widgets/qrubberband.cpp b/src/widgets/widgets/qrubberband.cpp
index c91f837093..ade8675db8 100644
--- a/src/widgets/widgets/qrubberband.cpp
+++ b/src/widgets/widgets/qrubberband.cpp
@@ -43,8 +43,6 @@
#include "qrubberband.h"
#include "qtimer.h"
-#ifndef QT_NO_RUBBERBAND
-
#include "qstyle.h"
#include "qstyleoption.h"
#if 0 // Used to be included in Qt4 for Q_WS_MAC
@@ -334,5 +332,3 @@ bool QRubberBand::event(QEvent *e)
QT_END_NAMESPACE
#include "moc_qrubberband.cpp"
-
-#endif // QT_NO_RUBBERBAND
diff --git a/src/widgets/widgets/qrubberband.h b/src/widgets/widgets/qrubberband.h
index 217261bf75..a05eb0d543 100644
--- a/src/widgets/widgets/qrubberband.h
+++ b/src/widgets/widgets/qrubberband.h
@@ -43,10 +43,9 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(rubberband);
-#ifndef QT_NO_RUBBERBAND
+QT_BEGIN_NAMESPACE
class QRubberBandPrivate;
class QStyleOptionRubberBand;
@@ -91,8 +90,6 @@ inline void QRubberBand::setGeometry(int ax, int ay, int aw, int ah)
inline void QRubberBand::move(int ax, int ay)
{ setGeometry(ax, ay, width(), height()); }
-#endif // QT_NO_RUBBERBAND
-
QT_END_NAMESPACE
#endif // QRUBBERBAND_H
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index 0c98c3875a..7d507aa7f4 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -47,7 +47,9 @@
#include "qlayout.h"
#include "qlist.h"
#include "qpainter.h"
+#if QT_CONFIG(rubberband)
#include "qrubberband.h"
+#endif
#include "qstyle.h"
#include "qstyleoption.h"
#include "qtextstream.h"
diff --git a/src/widgets/widgets/qsplitter_p.h b/src/widgets/widgets/qsplitter_p.h
index 0730fab824..34ae34121e 100644
--- a/src/widgets/widgets/qsplitter_p.h
+++ b/src/widgets/widgets/qsplitter_p.h
@@ -53,7 +53,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "private/qframe_p.h"
-#include "qrubberband.h"
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index f4d8c357f6..aaa64c8b2f 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -48,7 +48,9 @@
#include <qmainwindow.h>
#include <qmenu.h>
#include <qmenubar.h>
+#if QT_CONFIG(rubberband)
#include <qrubberband.h>
+#endif
#include <qsignalmapper.h>
#include <qstylepainter.h>
#include <qtoolbutton.h>
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 905bc0f586..97df3427b0 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -973,12 +973,20 @@ void QWidgetLineControl::parseInputMask(const QString &maskFields)
// calculate m_maxLength / m_maskData length
m_maxLength = 0;
QChar c = 0;
+ bool escaped = false;
for (int i=0; i<m_inputMask.length(); i++) {
c = m_inputMask.at(i);
- if (i > 0 && m_inputMask.at(i-1) == QLatin1Char('\\')) {
- m_maxLength++;
- continue;
+ if (escaped) {
+ ++m_maxLength;
+ escaped = false;
+ continue;
}
+
+ if (c == '\\') {
+ escaped = true;
+ continue;
+ }
+
if (c != QLatin1Char('\\') && c != QLatin1Char('!') &&
c != QLatin1Char('<') && c != QLatin1Char('>') &&
c != QLatin1Char('{') && c != QLatin1Char('}') &&
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index 726235ef4e..610932c6ce 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -8,8 +8,6 @@ HEADERS += \
widgets/qcalendarwidget.h \
widgets/qcombobox.h \
widgets/qcombobox_p.h \
- widgets/qdatetimeedit.h \
- widgets/qdatetimeedit_p.h \
widgets/qdial.h \
widgets/qdockwidget.h \
widgets/qdockwidget_p.h \
@@ -32,7 +30,6 @@ HEADERS += \
widgets/qmenubar.h \
widgets/qmenubar_p.h \
widgets/qprogressbar.h \
- widgets/qrubberband.h \
widgets/qscrollbar.h \
widgets/qscrollbar_p.h \
widgets/qscrollarea_p.h \
@@ -72,7 +69,6 @@ SOURCES += \
widgets/qabstractspinbox.cpp \
widgets/qcalendarwidget.cpp \
widgets/qcombobox.cpp \
- widgets/qdatetimeedit.cpp \
widgets/qdial.cpp \
widgets/qdockwidget.cpp \
widgets/qdockarealayout.cpp \
@@ -89,7 +85,6 @@ SOURCES += \
widgets/qmenu.cpp \
widgets/qmenubar.cpp \
widgets/qprogressbar.cpp \
- widgets/qrubberband.cpp \
widgets/qscrollbar.cpp \
widgets/qsizegrip.cpp \
widgets/qslider.cpp \
@@ -150,6 +145,15 @@ qtConfig(commandlinkbutton) {
widgets/qcommandlinkbutton.cpp
}
+qtConfig(datetimeedit) {
+ HEADERS += \
+ widgets/qdatetimeedit.h \
+ widgets/qdatetimeedit_p.h
+
+ SOURCES += \
+ widgets/qdatetimeedit.cpp
+}
+
qtConfig(fontcombobox) {
HEADERS += widgets/qfontcombobox.h
SOURCES += widgets/qfontcombobox.cpp
@@ -197,6 +201,11 @@ qtConfig(dialogbuttonbox) {
widgets/qdialogbuttonbox.cpp
}
+qtConfig(rubberband) {
+ HEADERS += widgets/qrubberband.h
+ SOURCES += widgets/qrubberband.cpp
+}
+
qtConfig(splashscreen) {
HEADERS += \
widgets/qsplashscreen.h