diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-07-10 17:04:42 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-07-13 10:43:15 +0200 |
commit | 2f33e030b8c80b4665cc2c120df7833469c05145 (patch) | |
tree | c82580c8ef761ddd5e22f695dc5934753429436d /examples | |
parent | e89b2f72c7147e46dcf606c3dcc507e2ae2841ce (diff) |
Remove usages of deprecated APIs of qtbase/gui
- Replaced the usages of deprecated APIs by corresponding
alternatives in the library code and documentation.
- Modified the tests to make them build when deprecated APIs disabled:
* Made the the parts of the tests testing the deprecated APIs to
be compiled conditionally, only when the corresponding methods are
enabled.
* If the test-case tests only the deprecated API, but not the
corresponding replacement, added tests for the replacement.
Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples')
4 files changed, 7 insertions, 7 deletions
diff --git a/examples/opengl/legacy/hellogl/glwidget.cpp b/examples/opengl/legacy/hellogl/glwidget.cpp index 22934136e5..059a9bb96d 100644 --- a/examples/opengl/legacy/hellogl/glwidget.cpp +++ b/examples/opengl/legacy/hellogl/glwidget.cpp @@ -140,10 +140,10 @@ void GLWidget::initializeGL() { initializeOpenGLFunctions(); - qglClearColor(qtPurple.dark()); + qglClearColor(qtPurple.darker()); logo = new QtLogo(this, 64); - logo->setColor(qtGreen.dark()); + logo->setColor(qtGreen.darker()); glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); diff --git a/examples/opengl/legacy/overpainting/glwidget.cpp b/examples/opengl/legacy/overpainting/glwidget.cpp index 0094f8ead7..c4558ce785 100644 --- a/examples/opengl/legacy/overpainting/glwidget.cpp +++ b/examples/opengl/legacy/overpainting/glwidget.cpp @@ -130,7 +130,7 @@ void GLWidget::initializeGL() glEnable(GL_MULTISAMPLE); logo = new QtLogo(this); - logo->setColor(qtGreen.dark()); + logo->setColor(qtGreen.darker()); } //! [2] @@ -163,7 +163,7 @@ void GLWidget::paintEvent(QPaintEvent *event) //! [4] //! [6] - qglClearColor(qtPurple.dark()); + qglClearColor(qtPurple.darker()); glShadeModel(GL_SMOOTH); glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); diff --git a/examples/widgets/painting/shared/arthurstyle.cpp b/examples/widgets/painting/shared/arthurstyle.cpp index 3fc461bbd2..31be899357 100644 --- a/examples/widgets/painting/shared/arthurstyle.cpp +++ b/examples/widgets/painting/shared/arthurstyle.cpp @@ -457,7 +457,7 @@ void ArthurStyle::polish(QWidget *widget) QPalette pal = widget->palette(); if (widget->isWindow()) { - pal.setColor(QPalette::Background, QColor(241, 241, 241)); + pal.setColor(QPalette::Window, QColor(241, 241, 241)); widget->setPalette(pal); } @@ -474,7 +474,7 @@ void ArthurStyle::unpolish(QWidget *widget) void ArthurStyle::polish(QPalette &palette) { - palette.setColor(QPalette::Background, QColor(241, 241, 241)); + palette.setColor(QPalette::Window, QColor(241, 241, 241)); } QRect ArthurStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const diff --git a/examples/widgets/painting/shared/arthurwidgets.cpp b/examples/widgets/painting/shared/arthurwidgets.cpp index bdac5de13c..285be99d20 100644 --- a/examples/widgets/painting/shared/arthurwidgets.cpp +++ b/examples/widgets/painting/shared/arthurwidgets.cpp @@ -153,7 +153,7 @@ void ArthurFrame::paintEvent(QPaintEvent *e) int o = 10; - QBrush bg = palette().brush(QPalette::Background); + QBrush bg = palette().brush(QPalette::Window); painter.fillRect(0, 0, o, o, bg); painter.fillRect(width() - o, 0, o, o, bg); painter.fillRect(0, height() - o, o, o, bg); |