From 2bd8443663676440dd03a699f8bbb42fb18cabb5 Mon Sep 17 00:00:00 2001 From: Alejandro Exojo Date: Fri, 12 Dec 2014 12:12:13 +0100 Subject: doc: Fix mistake in QProgressBar::orientation Reported on qt-interest: should say "true" instead of "false". Change-Id: Ic9d2608631679896179ae8601790847163a9224c Reviewed-by: Martin Smith Reviewed-by: Sze Howe Koh --- src/widgets/widgets/qprogressbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp index 5501247973..58aec8ee9a 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. -- cgit v1.2.3 From a07120d496c43d45792dc5ca92d93eea37f32cec Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 5 Dec 2014 10:22:28 +0100 Subject: Don't clear lineedit in non normal echo mode when validation is invalid This fixes a regression introduced with c09e9f71173a698670d6c728291ee24f53d50800 which caused the lineedit to clear the whole text when an invalid character was entered into a lineedit with an echo mode that was not Normal and a validator was set. Now if undo() is called directly then it will still clear the text as it is considered to be called as a user. Whereas the validation will take care of the invalid entry by using internalUndo() as before which avoids the clearing of the entire text. Task-number: QTBUG-29318 Change-Id: I5ff5777a75ab864de2217441b5f518f50646bd8f Reviewed-by: Friedemann Kleint Reviewed-by: Giuseppe D'Angelo --- src/widgets/widgets/qwidgetlinecontrol.cpp | 23 +++++++++++++++++------ src/widgets/widgets/qwidgetlinecontrol_p.h | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'src/widgets') 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 f21d88177c..49d9413fc0 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); -- cgit v1.2.3 From 1c1cce67fa1d03a49cdfb6f1ca378b182925ffdb Mon Sep 17 00:00:00 2001 From: Pavel Krebs Date: Fri, 5 Dec 2014 15:39:48 +0100 Subject: QScrollBar: emit valueChanged once even if a slot takes too much time Put also processing of control activation into initial timer check for possibly pending mouse release event. [ChangeLog][QtWidgets][QScrollBar] Fixed a bug where the valueChanged() signal was emitted twice if a connected slot took too much time. Task-number: QTBUG-42871 Change-Id: I7bad5279ef84463a033b55256d241d4445374081 Reviewed-by: Giuseppe D'Angelo --- src/widgets/widgets/qscrollbar.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/widgets') 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). -- cgit v1.2.3 From 66a8be268142d4f3272f54093299087289f530b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Sat, 20 Dec 2014 23:04:58 +0000 Subject: QColorDialog: Fix a few layouting issues. Fixes combo-boxes being too big and some alignment issues that were not present in Qt4. See screenshot in JIRA task. Tested with QT_SMALL_COLORDIALOG too. Task-number: QTBUG-43501 Change-Id: I2aefb64be1c5f3c4894149d85e1a12c9c0cc3d62 Reviewed-by: Giuseppe D'Angelo --- src/widgets/dialogs/qcolordialog.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index ee3ece2d77..f04e5b9ea6 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); -- cgit v1.2.3 From 2b7204c0a9d2af07e956c02113c779924ca0c188 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 18 Dec 2014 14:21:52 +0300 Subject: Doc: Describe the enum item QStyle::PE_FrameStatusBar as obsolete Change-Id: Ibda864d2b037bd8b2484b8642423ae1bca218021 Reviewed-by: Martin Smith --- src/widgets/styles/qstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index ba5bd717b6..6072842fc9 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. -- cgit v1.2.3