summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-20 01:01:00 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-02-20 09:51:12 +0100
commit035f934d7a798e97bf0213a5d42a3d511132f03d (patch)
tree89aa6efdc86864ce479cddca6b9c4ba523c2754a /examples/widgets/widgets
parentf4cc23cffbe3005f0a522cac938695e87ecd6407 (diff)
parentda4ab444ffac37514435364d4d3f0ad59d4f9bc3 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp Added tests/auto/testlib/selftests/expected_crashes_5.txt to work round the output of the crashes test (which exercises UB, see QTBUG-73903) being truncated on one test platform. Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
Diffstat (limited to 'examples/widgets/widgets')
-rw-r--r--examples/widgets/widgets/styles/norwegianwoodstyle.cpp8
-rw-r--r--examples/widgets/widgets/styles/widgetgallery.cpp4
-rw-r--r--examples/widgets/widgets/tetrix/tetrixboard.cpp6
3 files changed, 9 insertions, 9 deletions
diff --git a/examples/widgets/widgets/styles/norwegianwoodstyle.cpp b/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
index b334ca97cb..1d7ef2637b 100644
--- a/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
+++ b/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
@@ -85,8 +85,8 @@ void NorwegianWoodStyle::polish(QPalette &palette)
setTexture(palette, QPalette::Mid, midImage);
setTexture(palette, QPalette::Window, backgroundImage);
- QBrush brush = palette.background();
- brush.setColor(brush.color().dark());
+ QBrush brush = palette.window();
+ brush.setColor(brush.color().darker());
palette.setBrush(QPalette::Disabled, QPalette::WindowText, brush);
palette.setBrush(QPalette::Disabled, QPalette::Text, brush);
@@ -185,7 +185,7 @@ void NorwegianWoodStyle::drawPrimitive(PrimitiveElement element,
qstyleoption_cast<const QStyleOptionButton *>(option);
if (buttonOption
&& (buttonOption->features & QStyleOptionButton::Flat)) {
- brush = option->palette.background();
+ brush = option->palette.window();
darker = (option->state & (State_Sunken | State_On));
} else {
if (option->state & (State_Sunken | State_On)) {
@@ -261,7 +261,7 @@ void NorwegianWoodStyle::drawPrimitive(PrimitiveElement element,
painter->setPen(bottomPen);
painter->drawPath(roundRect);
- painter->setPen(option->palette.foreground().color());
+ painter->setPen(option->palette.windowText().color());
painter->setClipping(false);
painter->drawPath(roundRect);
diff --git a/examples/widgets/widgets/styles/widgetgallery.cpp b/examples/widgets/widgets/styles/widgetgallery.cpp
index 7f4b7f39d4..f0a0336a94 100644
--- a/examples/widgets/widgets/styles/widgetgallery.cpp
+++ b/examples/widgets/widgets/styles/widgetgallery.cpp
@@ -212,7 +212,7 @@ void WidgetGallery::createBottomLeftTabWidget()
tableWidget = new QTableWidget(10, 10);
QHBoxLayout *tab1hbox = new QHBoxLayout;
- tab1hbox->setMargin(5);
+ tab1hbox->setContentsMargins(5,5, 5, 5);
tab1hbox->addWidget(tableWidget);
tab1->setLayout(tab1hbox);
@@ -227,7 +227,7 @@ void WidgetGallery::createBottomLeftTabWidget()
"How I wonder what you are!\n"));
QHBoxLayout *tab2hbox = new QHBoxLayout;
- tab2hbox->setMargin(5);
+ tab2hbox->setContentsMargins(5, 5, 5, 5);
tab2hbox->addWidget(textEdit);
tab2->setLayout(tab2hbox);
diff --git a/examples/widgets/widgets/tetrix/tetrixboard.cpp b/examples/widgets/widgets/tetrix/tetrixboard.cpp
index b1139ca8a6..ef3ac4fc38 100644
--- a/examples/widgets/widgets/tetrix/tetrixboard.cpp
+++ b/examples/widgets/widgets/tetrix/tetrixboard.cpp
@@ -358,7 +358,7 @@ void TetrixBoard::showNextPiece()
QPixmap pixmap(dx * squareWidth(), dy * squareHeight());
QPainter painter(&pixmap);
- painter.fillRect(pixmap.rect(), nextPieceLabel->palette().background());
+ painter.fillRect(pixmap.rect(), nextPieceLabel->palette().window());
for (int i = 0; i < 4; ++i) {
int x = nextPiece.x(i) - nextPiece.minX();
@@ -405,11 +405,11 @@ void TetrixBoard::drawSquare(QPainter &painter, int x, int y, TetrixShape shape)
painter.fillRect(x + 1, y + 1, squareWidth() - 2, squareHeight() - 2,
color);
- painter.setPen(color.light());
+ painter.setPen(color.lighter());
painter.drawLine(x, y + squareHeight() - 1, x, y);
painter.drawLine(x, y, x + squareWidth() - 1, y);
- painter.setPen(color.dark());
+ painter.setPen(color.darker());
painter.drawLine(x + 1, y + squareHeight() - 1,
x + squareWidth() - 1, y + squareHeight() - 1);
painter.drawLine(x + squareWidth() - 1, y + squareHeight() - 1,