diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-04 01:00:23 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-04 01:00:23 +0100 |
commit | 0c29ebe374caad7e29c6a3d35c72c4eddaacc6af (patch) | |
tree | c6b228302ab37375a82f7bfb535e5bb39d36e624 /src/widgets | |
parent | e5438e8ded27eb6f7f0e85704d6843069296c698 (diff) | |
parent | 2ed59f0d42d2817a5855be167f5e3ccf23563e39 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I4134c0c6b6c9911950f58b3b5c86e789d28a185b
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/Qt5WidgetsMacros.cmake | 2 | ||||
-rw-r--r-- | src/widgets/itemviews/qtreeview.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 11 | ||||
-rw-r--r-- | src/widgets/styles/qcommonstyle_p.h | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstylehelper.cpp | 9 | ||||
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 33 |
6 files changed, 42 insertions, 17 deletions
diff --git a/src/widgets/Qt5WidgetsMacros.cmake b/src/widgets/Qt5WidgetsMacros.cmake index 737371a5ad..21e73d4f0c 100644 --- a/src/widgets/Qt5WidgetsMacros.cmake +++ b/src/widgets/Qt5WidgetsMacros.cmake @@ -41,7 +41,7 @@ include(CMakeParseArguments) # qt5_wrap_ui(outfiles inputfile ... ) -function(QT5_WRAP_UI outfiles ) +function(qt5_wrap_ui outfiles ) set(options) set(oneValueArgs) set(multiValueArgs OPTIONS) diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 034c1f4b4f..442369c2ec 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1892,6 +1892,8 @@ void QTreeView::mousePressEvent(QMouseEvent *event) handled = d->expandOrCollapseItemAtPos(event->pos()); if (!handled && d->itemDecorationAt(event->pos()) == -1) QAbstractItemView::mousePressEvent(event); + else + d->pressedIndex = QModelIndex(); } /*! diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index b2653878c1..3b7110cfa0 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -7002,8 +7002,10 @@ void QWidget::resize(const QSize &s) d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false); d->setDirtyOpaqueRegion(); } else { + const auto oldRect = data->crect; data->crect.setSize(s.boundedTo(maximumSize()).expandedTo(minimumSize())); - setAttribute(Qt::WA_PendingResizeEvent); + if (oldRect != data->crect) + setAttribute(Qt::WA_PendingResizeEvent); } } @@ -7018,10 +7020,13 @@ void QWidget::setGeometry(const QRect &r) d->setGeometry_sys(r.x(), r.y(), r.width(), r.height(), true); d->setDirtyOpaqueRegion(); } else { + const auto oldRect = data->crect; data->crect.setTopLeft(r.topLeft()); data->crect.setSize(r.size().boundedTo(maximumSize()).expandedTo(minimumSize())); - setAttribute(Qt::WA_PendingMoveEvent); - setAttribute(Qt::WA_PendingResizeEvent); + if (oldRect != data->crect) { + setAttribute(Qt::WA_PendingMoveEvent); + setAttribute(Qt::WA_PendingResizeEvent); + } } if (d->extra && d->extra->hasWindowContainer) diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h index 4860dfe4c9..6223a26a54 100644 --- a/src/widgets/styles/qcommonstyle_p.h +++ b/src/widgets/styles/qcommonstyle_p.h @@ -122,7 +122,7 @@ public: mutable QIcon tabBarcloseButtonIcon; #if QT_CONFIG(tabbar) - void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const; + virtual void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const; #endif int animationFps; diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index 4e61b2d1ec..9477ca86da 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -274,6 +274,12 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter) painter->drawLines(QStyleHelper::calcLines(option)); } + // setting color before BEGIN_STYLE_PIXMAPCACHE since + // otherwise it is not set when the image is in the cache + buttonColor.setHsv(buttonColor .hue(), + qMin(140, buttonColor .saturation()), + qMax(180, buttonColor.value())); + // Cache dial background BEGIN_STYLE_PIXMAPCACHE(QString::fromLatin1("qdial")); p->setRenderHint(QPainter::Antialiasing); @@ -285,9 +291,6 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter) QRectF br = QRectF(dx + 0.5, dy + 0.5, int(r * 2 - 2 * d_ - 2), int(r * 2 - 2 * d_ - 2)); - buttonColor.setHsv(buttonColor .hue(), - qMin(140, buttonColor .saturation()), - qMax(180, buttonColor.value())); if (enabled) { // Drop shadow diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 37d2211a00..7dffc55a36 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1200,12 +1200,18 @@ QMargins QLineEdit::textMargins() const Unset the mask and return to normal QLineEdit operation by passing an empty string (""). - The table below shows the characters that can be used in an input mask. - A space character, the default character for a blank, is needed for cases - where a character is \e{permitted but not required}. + The input mask is an input template string. It can contain the following elements: + \table + \row \li Mask Characters \li Defines the class of input characters that are + considered valid in this position + \row \li Meta Characters \li Various special meanings + \row \li Separators \li All other characters are regarded as immutable separators + \endtable + + The following table shows the mask and meta characters that can be used in an input mask. \table - \header \li Character \li Meaning + \header \li Mask Character \li Meaning \row \li \c A \li ASCII alphabetic character required. A-Z, a-z. \row \li \c a \li ASCII alphabetic character permitted but not required. \row \li \c N \li ASCII alphanumeric character required. A-Z, a-z, 0-9. @@ -1221,19 +1227,28 @@ QMargins QLineEdit::textMargins() const \row \li \c h \li Hexadecimal character permitted but not required. \row \li \c B \li Binary character required. 0-1. \row \li \c b \li Binary character permitted but not required. + \header \li Meta Character \li Meaning \row \li \c > \li All following alphabetic characters are uppercased. \row \li \c < \li All following alphabetic characters are lowercased. \row \li \c ! \li Switch off case conversion. + \row \li \c {;c} \li Terminates the input mask and sets the \e{blank} character to \e{c}. \row \li \c {[ ] { }} \li Reserved. \row \li \tt{\\} \li Use \tt{\\} to escape the special characters listed above to use them as separators. \endtable - The mask consists of a string of mask characters and separators, - optionally followed by a semicolon and the character used for - blanks. The blank characters are always removed from the text - after editing. + When created or cleared, the line edit will be filled with a copy of the + input mask string where the meta characters have been removed, and the mask + characters have been replaced with the \e{blank} character (by default, a + \c space). + + When an input mask is set, the text() method returns a modified copy of the + line edit content where all the \e{blank} characters have been removed. The + unmodified content can be read using displayText(). + + The hasAcceptableInput() method returns false if the current content of the + line edit does not fulfil the requirements of the input mask. Examples: \table @@ -1242,7 +1257,7 @@ QMargins QLineEdit::textMargins() const \row \li \c HH:HH:HH:HH:HH:HH;_ \li MAC address \row \li \c 0000-00-00 \li ISO Date; blanks are \c space \row \li \c >AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;# \li License number; - blanks are \c - and all (alphabetic) characters are converted to + blanks are \c{#} and all (alphabetic) characters are converted to uppercase. \endtable |