diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-12-29 16:37:38 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-12-29 16:37:38 +0100 |
commit | aaff94c2df665035addb90714bab4722003894da (patch) | |
tree | 3af76e8aa4dbf86a86b1e4d2ad2f6dda06374ee0 /src/widgets/widgets | |
parent | 2302d386c7a1aa1a96658f79c236d6b8a59db7ac (diff) | |
parent | 1196f691120d77ab3be55f21824aba645210fb8c (diff) |
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
src/corelib/tools/qbytearray.cpp
src/gui/kernel/qplatformsystemtrayicon.cpp
src/gui/kernel/qplatformsystemtrayicon.h
src/plugins/platforms/xcb/xcb-plugin.pro
Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qprogressbar.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qscrollbar.cpp | 7 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgetlinecontrol.cpp | 23 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgetlinecontrol_p.h | 2 |
4 files changed, 23 insertions, 11 deletions
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp index 751fcda871..1c76bd0ac1 100644 --- a/src/widgets/widgets/qprogressbar.cpp +++ b/src/widgets/widgets/qprogressbar.cpp @@ -525,7 +525,7 @@ Qt::Orientation QProgressBar::orientation() const \property QProgressBar::invertedAppearance \brief whether or not a progress bar shows its progress inverted - If this property is \c false, the progress bar grows in the other + If this property is \c true, the progress bar grows in the other direction (e.g. from right to left). By default, the progress bar is not inverted. diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp index 5851020379..c2d2117e20 100644 --- a/src/widgets/widgets/qscrollbar.cpp +++ b/src/widgets/widgets/qscrollbar.cpp @@ -593,13 +593,14 @@ void QScrollBar::mousePressEvent(QMouseEvent *e) d->clickOffset = sliderLength / 2; } const int initialDelay = 500; // default threshold - d->activateControl(d->pressedControl, initialDelay); QElapsedTimer time; time.start(); + d->activateControl(d->pressedControl, initialDelay); repaint(style()->subControlRect(QStyle::CC_ScrollBar, &opt, d->pressedControl, this)); if (time.elapsed() >= initialDelay && d->repeatActionTimer.isActive()) { - // It took more than 500ms (the initial timer delay) to process the repaint(), we - // therefore need to restart the timer in case we have a pending mouse release event; + // It took more than 500ms (the initial timer delay) to process + // the control activation and repaint(), we therefore need + // to restart the timer in case we have a pending mouse release event; // otherwise we'll get a timer event right before the release event, // causing the repeat action to be invoked twice on a single mouse click. // 50ms is the default repeat time (see activateControl/setRepeatAction). diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index e6385ba390..7033eeea22 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -279,6 +279,23 @@ void QWidgetLineControl::clear() separate(); finishChange(priorState, /*update*/false, /*edited*/false); } +/*! + \internal + + Undoes the previous operation. +*/ + +void QWidgetLineControl::undo() +{ + // Undo works only for clearing the line when in any of password the modes + if (m_echoMode == QLineEdit::Normal) { + internalUndo(); + finishChange(-1, true); + } else { + cancelPasswordEchoTimer(); + clear(); + } +} /*! \internal @@ -1278,12 +1295,6 @@ void QWidgetLineControl::internalUndo(int until) cancelPasswordEchoTimer(); internalDeselect(); - // Undo works only for clearing the line when in any of password the modes - if (m_echoMode != QLineEdit::Normal) { - clear(); - return; - } - while (m_undoState && m_undoState > until) { Command& cmd = m_history[--m_undoState]; switch (cmd.type) { diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h index 78edefe0f3..1baceb9cc2 100644 --- a/src/widgets/widgets/qwidgetlinecontrol_p.h +++ b/src/widgets/widgets/qwidgetlinecontrol_p.h @@ -245,7 +245,7 @@ public: void insert(const QString &); void clear(); - void undo() { internalUndo(); finishChange(-1, true); } + void undo(); void redo() { internalRedo(); finishChange(); } void selectWordAtPos(int); |