summaryrefslogtreecommitdiffstats
path: root/examples/opengl/hellogl2/window.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <[email protected]>2019-09-13 20:43:09 +0200
committerChristian Ehrlicher <[email protected]>2019-09-30 22:16:27 +0200
commitb0042601ed8056c9ed6056c26f71dfa9fbc951ce (patch)
tree9288bbda958a9e0755d3179de0fe5325d9bd7898 /examples/opengl/hellogl2/window.cpp
parentfbda189e081e6c7abf82334c0ac71b16ec2c37dd (diff)
Cleanup QtOpenGL examples
Cleanup the OpenGL examples - use nullptr (clang-tidy) - use member-initialization - avoid redundant checks for != nullptr when deleting a pointer Change-Id: I3e4702690ed79e71c3e952d51ceef83b907b45b7 Reviewed-by: Edward Welbourne <[email protected]> Reviewed-by: Laszlo Agocs <[email protected]>
Diffstat (limited to 'examples/opengl/hellogl2/window.cpp')
-rw-r--r--examples/opengl/hellogl2/window.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/opengl/hellogl2/window.cpp b/examples/opengl/hellogl2/window.cpp
index c3cd10cbfd3..5534f2edea1 100644
--- a/examples/opengl/hellogl2/window.cpp
+++ b/examples/opengl/hellogl2/window.cpp
@@ -121,7 +121,7 @@ void Window::keyPressEvent(QKeyEvent *e)
void Window::dockUndock()
{
if (parent()) {
- setParent(0);
+ setParent(nullptr);
setAttribute(Qt::WA_DeleteOnClose);
move(QApplication::desktop()->width() / 2 - width() / 2,
QApplication::desktop()->height() / 2 - height() / 2);
@@ -134,10 +134,12 @@ void Window::dockUndock()
dockBtn->setText(tr("Undock"));
mainWindow->setCentralWidget(this);
} else {
- QMessageBox::information(0, tr("Cannot dock"), tr("Main window already closed"));
+ QMessageBox::information(nullptr, tr("Cannot dock"),
+ tr("Main window already closed"));
}
} else {
- QMessageBox::information(0, tr("Cannot dock"), tr("Main window already occupied"));
+ QMessageBox::information(nullptr, tr("Cannot dock"),
+ tr("Main window already occupied"));
}
}
}