summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-10-21 21:23:08 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-11-14 20:48:22 +0200
commit41702d8455a9e88ac70108e500a10e7bd4df2771 (patch)
tree88f2c1714f3556b63da50254db2e3e1b405ac0f9 /src/widgets
parent14bb413309092adc53e8451daff5690c4698c07d (diff)
Honor alpha for SH_Table_GridLineColor
Make sure to honor the alpha channel for the color returned by SH_Table_GridLineColor. Fixes: QTBUG-74909 Change-Id: If9688329e5e2ab41833dfeb7e6292fdfcbf63aa1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/doc/snippets/javastyle.cpp2
-rw-r--r--src/widgets/itemviews/qtableview.cpp2
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qfusionstyle.cpp2
-rw-r--r--src/widgets/styles/qstyle.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/doc/snippets/javastyle.cpp b/src/widgets/doc/snippets/javastyle.cpp
index 8657d5ed29..3d1b1e0030 100644
--- a/src/widgets/doc/snippets/javastyle.cpp
+++ b/src/widgets/doc/snippets/javastyle.cpp
@@ -2589,7 +2589,7 @@ int JavaStyle::styleHint(StyleHint hint, const QStyleOption *option,
switch (hint) {
case SH_Table_GridLineColor: {
- ret = static_cast<int>(option->palette.color(QPalette::Mid).rgb());
+ ret = static_cast<int>(option->palette.color(QPalette::Mid).rgba());
break;
}
case QStyle::SH_Menu_Scrollable:
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index 11c5be10fd..81fceba8dc 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -1431,7 +1431,7 @@ void QTableView::paintEvent(QPaintEvent *event)
const bool showGrid = d->showGrid;
const int gridSize = showGrid ? 1 : 0;
const int gridHint = style()->styleHint(QStyle::SH_Table_GridLineColor, &option, this);
- const QColor gridColor = static_cast<QRgb>(gridHint);
+ const QColor gridColor = QColor::fromRgba(static_cast<QRgb>(gridHint));
const QPen gridPen = QPen(gridColor, 0, d->gridStyle);
const QHeaderView *verticalHeader = d->verticalHeader;
const QHeaderView *horizontalHeader = d->horizontalHeader;
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 271b43fe89..861dd7a54c 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -5143,7 +5143,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
case SH_Table_GridLineColor:
if (opt)
- ret = opt->palette.color(QPalette::Mid).rgb();
+ ret = opt->palette.color(QPalette::Mid).rgba();
else
ret = -1;
break;
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index b58dc1660a..0f01a70faa 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -3733,7 +3733,7 @@ int QFusionStyle::styleHint(StyleHint hint, const QStyleOption *option, const QW
return 0;
case SH_Table_GridLineColor:
- return option ? option->palette.window().color().darker(120).rgb() : 0;
+ return option ? option->palette.window().color().darker(120).rgba() : 0;
case SH_MessageBox_TextInteractionFlags:
return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse;
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 6cbed34c3a..d2f5ac76f9 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -1835,7 +1835,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SH_LineEdit_PasswordMaskDelay Determines the delay before visible character is masked
with password character, in milliseconds. This enum value was added in Qt 5.4.
- \value SH_Table_GridLineColor The RGB value of the grid for a table.
+ \value SH_Table_GridLineColor The RGBA value of the grid for a table.
\value SH_UnderlineShortcut Whether shortcuts are underlined.