diff options
| author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-01 17:12:01 +0200 |
|---|---|---|
| committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-09-05 17:40:36 +0200 |
| commit | 6f4bc3942dda076eedf38d8c8604eb4fa5d7bd3b (patch) | |
| tree | 5813b88711ccfc1bb6f6948c1534fa407d4a4262 /examples/widgets/graphicsview/boxes/main.cpp | |
| parent | 42011c03613b38d2bf9c7770edf1392c5f5598f2 (diff) | |
Widgets/GraphicsView examples: cleanup
Cleanup GraphicsView examples with the help of clang-tidy
- modernize-use-nullptr
- modernize-use-default-member-init
- modernize-use-override.IgnoreDestructors
- Some QList -> QVector changes
- use nullptr
- use normalized includes, remove unused includes
- fix style
Change-Id: I79347e55bfde52f6ae7749cc7093fbd442044020
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/graphicsview/boxes/main.cpp')
| -rw-r--r-- | examples/widgets/graphicsview/boxes/main.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/examples/widgets/graphicsview/boxes/main.cpp b/examples/widgets/graphicsview/boxes/main.cpp index b7242d529b4..2b3e6d33897 100644 --- a/examples/widgets/graphicsview/boxes/main.cpp +++ b/examples/widgets/graphicsview/boxes/main.cpp @@ -48,13 +48,11 @@ ** ****************************************************************************/ -//#include <GL/glew.h> #include "glextensions.h" - #include "scene.h" -#include <QtWidgets> #include <QGLWidget> +#include <QtWidgets> class GraphicsView : public QGraphicsView { @@ -114,7 +112,7 @@ int main(int argc, char **argv) QApplication app(argc, argv); if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_5) == 0) { - QMessageBox::critical(0, "OpenGL features missing", + QMessageBox::critical(nullptr, "OpenGL features missing", "OpenGL version 1.5 or higher is required to run this demo.\n" "The program will now exit."); return -1; @@ -125,7 +123,7 @@ int main(int argc, char **argv) widget->makeCurrent(); if (!necessaryExtensionsSupported()) { - QMessageBox::critical(0, "OpenGL features missing", + QMessageBox::critical(nullptr, "OpenGL features missing", "The OpenGL extensions required to run this demo are missing.\n" "The program will now exit."); delete widget; @@ -134,7 +132,7 @@ int main(int argc, char **argv) // Check if all the necessary functions are resolved. if (!getGLExtensionFunctions().resolve(widget->context())) { - QMessageBox::critical(0, "OpenGL features missing", + QMessageBox::critical(nullptr, "OpenGL features missing", "Failed to resolve OpenGL functions required to run this demo.\n" "The program will now exit."); delete widget; @@ -142,7 +140,7 @@ int main(int argc, char **argv) } // TODO: Make conditional for final release - QMessageBox::information(0, "For your information", + QMessageBox::information(nullptr, "For your information", "This demo can be GPU and CPU intensive and may\n" "work poorly or not at all on your system."); |
