diff options
author | Liang Qi <liang.qi@qt.io> | 2019-06-07 13:12:57 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-06-07 13:19:27 +0200 |
commit | 9967a011eaae8988b10e56fde0f2ab8b6bab90ac (patch) | |
tree | 353b932414a8d9d94a418e84068550b0a2376b37 /src/widgets | |
parent | 91ab70d17f892f3ff6b2019632fda3920d045dcb (diff) | |
parent | 99636127d10f96d8313bc26030cabf9841381914 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
qmake/generators/makefile.cpp
src/plugins/platforms/cocoa/qcocoaintegration.h
src/plugins/platforms/cocoa/qcocoaintegration.mm
Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I5a61e161784cc6f947abe370aab8f2971a9cbe78
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/itemviews/qheaderview.cpp | 5 | ||||
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 10 | ||||
-rw-r--r-- | src/widgets/widgets/qplaintextedit.cpp | 1 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 12 |
4 files changed, 26 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 99309633a7..1fcd5bdef2 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -146,7 +146,10 @@ static const int maxSizeSection = 1048575; // since section size is in a bitfiel Not all \l{Qt::}{ItemDataRole}s will have an effect on a QHeaderView. If you need to draw other roles, you can subclass QHeaderView and reimplement \l{QHeaderView::}{paintEvent()}. - QHeaderView respects the following item data roles: + QHeaderView respects the following item data roles, unless they are + in conflict with the style (which can happen for styles that follow + the desktop theme): + \l{Qt::}{TextAlignmentRole}, \l{Qt::}{DisplayRole}, \l{Qt::}{FontRole}, \l{Qt::}{DecorationRole}, \l{Qt::}{ForegroundRole}, and \l{Qt::}{BackgroundRole}. diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index f3961b2a99..34cc3c93db 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -2769,8 +2769,16 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption buttonOption.state &= ~State_MouseOver; } - if (comboBox->frame) + if (comboBox->frame) { + cachePainter.save(); + cachePainter.setRenderHint(QPainter::Antialiasing, true); + cachePainter.translate(0.5, 0.5); + cachePainter.setPen(Qt::NoPen); + cachePainter.setBrush(buttonOption.palette.base()); + cachePainter.drawRoundedRect(rect.adjusted(0, 0, -1, -1), 2, 2); + cachePainter.restore(); proxy()->drawPrimitive(PE_FrameLineEdit, &buttonOption, &cachePainter, widget); + } // Draw button clipped cachePainter.save(); diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index bc1ff78de0..4a875975a4 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -1957,6 +1957,7 @@ void QPlainTextEdit::paintEvent(QPaintEvent *e) } QAbstractTextDocumentLayout::PaintContext context = getPaintContext(); + painter.setPen(context.palette.text().color()); while (block.isValid()) { diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 07d631cfe9..f86a747b0f 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -61,6 +61,9 @@ #include "private/qtextdocument_p.h" #include "qtextlist.h" #include "private/qwidgettextcontrol_p.h" +#if QT_CONFIG(style_stylesheet) +# include "private/qstylesheetstyle_p.h" +#endif #if QT_CONFIG(graphicsview) #include "qgraphicssceneevent.h" #endif @@ -3198,6 +3201,15 @@ QAbstractTextDocumentLayout::PaintContext QWidgetTextControl::getPaintContext(QW ctx.selections = d->extraSelections; ctx.palette = d->palette; +#if QT_CONFIG(style_stylesheet) + if (widget) { + if (auto cssStyle = qt_styleSheet(widget->style())) { + QStyleOption option; + option.initFrom(widget); + cssStyle->styleSheetPalette(widget, &option, &ctx.palette); + } + } +#endif // style_stylesheet if (d->cursorOn && d->isEnabled) { if (d->hideCursor) ctx.cursorPosition = -1; |