summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-12-29 16:37:38 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-12-29 16:37:38 +0100
commitaaff94c2df665035addb90714bab4722003894da (patch)
tree3af76e8aa4dbf86a86b1e4d2ad2f6dda06374ee0 /src/widgets
parent2302d386c7a1aa1a96658f79c236d6b8a59db7ac (diff)
parent1196f691120d77ab3be55f21824aba645210fb8c (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')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp15
-rw-r--r--src/widgets/styles/qstyle.cpp2
-rw-r--r--src/widgets/widgets/qprogressbar.cpp2
-rw-r--r--src/widgets/widgets/qscrollbar.cpp7
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp23
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h2
6 files changed, 37 insertions, 14 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 14853f3895..40ef6505cf 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -972,6 +972,7 @@ private:
QColorShowLabel *lab;
bool rgbOriginal;
QColorDialog *colorDialog;
+ QGridLayout *gl;
friend class QColorDialog;
friend class QColorDialogPrivate;
@@ -1099,7 +1100,7 @@ QColorShower::QColorShower(QColorDialog *parent)
curCol = qRgb(255, 255, 255);
curQColor = Qt::white;
- QGridLayout *gl = new QGridLayout(this);
+ gl = new QGridLayout(this);
gl->setMargin(gl->spacing());
lab = new QColorShowLabel(this);
@@ -1277,10 +1278,16 @@ QColorShower::QColorShower(QColorDialog *parent)
#else
htEd->setReadOnly(true);
#endif
+ htEd->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
lblHtml->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
+#if defined(QT_SMALL_COLORDIALOG)
+ gl->addWidget(lblHtml, 5, 0);
+ gl->addWidget(htEd, 5, 1, 1, /*colspan=*/ 2);
+#else
gl->addWidget(lblHtml, 5, 1);
- gl->addWidget(htEd, 5, 2);
+ gl->addWidget(htEd, 5, 2, 1, /*colspan=*/ 3);
+#endif
connect(hEd, SIGNAL(valueChanged(int)), this, SLOT(hsvEd()));
connect(sEd, SIGNAL(valueChanged(int)), this, SLOT(hsvEd()));
@@ -1742,7 +1749,9 @@ void QColorDialogPrivate::initWidgets()
lp->hide();
#else
lp->setFixedWidth(20);
+ pickLay->addSpacing(10);
pickLay->addWidget(lp);
+ pickLay->addStretch();
#endif
QObject::connect(cp, SIGNAL(newCol(int,int)), lp, SLOT(setCol(int,int)));
@@ -1751,6 +1760,7 @@ void QColorDialogPrivate::initWidgets()
rightLay->addStretch();
cs = new QColorShower(q);
+ pickLay->setMargin(cs->gl->margin());
QObject::connect(cs, SIGNAL(newCol(QRgb)), q, SLOT(_q_newColorTypedIn(QRgb)));
QObject::connect(cs, SIGNAL(currentColorChanged(QColor)),
q, SIGNAL(currentColorChanged(QColor)));
@@ -1760,6 +1770,7 @@ void QColorDialogPrivate::initWidgets()
topLay->addWidget(cs);
#else
rightLay->addWidget(cs);
+ leftLay->addSpacing(cs->gl->margin());
#endif
buttons = new QDialogButtonBox(q);
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 5999ba5431..8df68d25a5 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -627,7 +627,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
indicator or button bevel.
\omitvalue PE_IndicatorViewItemCheck
- \value PE_FrameStatusBar Frame
+ \value PE_FrameStatusBar Obsolete. Use PE_FrameStatusBarItem instead.
\value PE_PanelButtonCommand Button used to initiate an action, for
example, a QPushButton.
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);