From 1f6bfc220774e9407fe88916843b76ed103cff72 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Mon, 3 Sep 2018 14:02:13 +0200 Subject: Doc: Move literal code block to a separate file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö --- .../doc/snippets/code/src_opengl_qglbuffer.cpp | 49 +++++++++++++ .../doc/snippets/code/src_opengl_qglfunctions.cpp | 75 +++++++++++++++++++ .../code/src_opengl_qgraphicsshadereffect.cpp | 84 ++++++++++++++++++++++ src/opengl/qglbuffer.cpp | 11 +-- src/opengl/qglfunctions.cpp | 37 ++-------- src/opengl/qgraphicsshadereffect.cpp | 46 +----------- 6 files changed, 217 insertions(+), 85 deletions(-) create mode 100644 src/opengl/doc/snippets/code/src_opengl_qglbuffer.cpp create mode 100644 src/opengl/doc/snippets/code/src_opengl_qglfunctions.cpp create mode 100644 src/opengl/doc/snippets/code/src_opengl_qgraphicsshadereffect.cpp (limited to 'src/opengl') diff --git a/src/opengl/doc/snippets/code/src_opengl_qglbuffer.cpp b/src/opengl/doc/snippets/code/src_opengl_qglbuffer.cpp new file mode 100644 index 0000000000..c9e49826ae --- /dev/null +++ b/src/opengl/doc/snippets/code/src_opengl_qglbuffer.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] + QGLBuffer buffer1(QGLBuffer::IndexBuffer); + buffer1.create(); + + QGLBuffer buffer2 = buffer1; +//! [0] + +//! [1] + QGLBuffer::release(QGLBuffer::VertexBuffer); +//! [1] diff --git a/src/opengl/doc/snippets/code/src_opengl_qglfunctions.cpp b/src/opengl/doc/snippets/code/src_opengl_qglfunctions.cpp new file mode 100644 index 0000000000..673186dca9 --- /dev/null +++ b/src/opengl/doc/snippets/code/src_opengl_qglfunctions.cpp @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] + class MyGLWidget : public QGLWidget, protected QGLFunctions + { + Q_OBJECT + public: + MyGLWidget(QWidget *parent = 0) : QGLWidget(parent) {} + + protected: + void initializeGL(); + void paintGL(); + }; + + void MyGLWidget::initializeGL() + { + initializeGLFunctions(); + } +//! [0] + +//! [1] + void MyGLWidget::paintGL() + { + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, textureId); + ... + } +//! [1] + +//! [2] + QGLFunctions glFuncs(QGLContext::currentContext()); + glFuncs.glActiveTexture(GL_TEXTURE1); +//! [2] + +//! [3] + QGLFunctions funcs(QGLContext::currentContext()); + bool npot = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures); +//! [3] diff --git a/src/opengl/doc/snippets/code/src_opengl_qgraphicsshadereffect.cpp b/src/opengl/doc/snippets/code/src_opengl_qgraphicsshadereffect.cpp new file mode 100644 index 0000000000..d53b73e837 --- /dev/null +++ b/src/opengl/doc/snippets/code/src_opengl_qgraphicsshadereffect.cpp @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] + static char const colorizeShaderCode[] = + "uniform lowp vec4 effectColor;\n" + "lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) {\n" + " vec4 src = texture2D(imageTexture, textureCoords);\n" + " float gray = dot(src.rgb, vec3(0.212671, 0.715160, 0.072169));\n" + " vec4 colorize = 1.0-((1.0-gray)*(1.0-effectColor));\n" + " return vec4(colorize.rgb, src.a);\n" + "}"; +//! [0] + +//! [1] + class ColorizeEffect : public QGraphicsShaderEffect + { + Q_OBJECT + public: + ColorizeEffect(QObject *parent = 0) + : QGraphicsShaderEffect(parent), color(Qt::black) + { + setPixelShaderFragment(colorizeShaderCode); + } + + QColor effectColor() const { return color; } + void setEffectColor(const QColor& c) + { + color = c; + setUniformsDirty(); + } + + protected: + void setUniforms(QGLShaderProgram *program) + { + program->setUniformValue("effectColor", color); + } + + private: + QColor color; + }; +//! [1] + +//! [2] + lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) { + return texture2D(imageTexture, textureCoords); + } +//! [2] diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp index 200ee2499e..bb9c2affbd 100644 --- a/src/opengl/qglbuffer.cpp +++ b/src/opengl/qglbuffer.cpp @@ -60,12 +60,7 @@ QT_BEGIN_NAMESPACE QGLBuffer objects can be copied around as a reference to the underlying GL buffer object: - \code - QGLBuffer buffer1(QGLBuffer::IndexBuffer); - buffer1.create(); - - QGLBuffer buffer2 = buffer1; - \endcode + \snippet code/src_opengl_qglbuffer.cpp 0 QGLBuffer performs a shallow copy when objects are copied in this manner, but does not implement copy-on-write semantics. The original @@ -474,9 +469,7 @@ void QGLBuffer::release() been bound to the context but wants to make sure that it is released. - \code - QGLBuffer::release(QGLBuffer::VertexBuffer); - \endcode + \snippet code/src_opengl_qglbuffer.cpp 1 */ void QGLBuffer::release(QGLBuffer::Type type) { diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index 07e1194342..7fe7102510 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -62,44 +62,18 @@ QT_BEGIN_NAMESPACE that need it. The recommended way to use QGLFunctions is by direct inheritance: - \code - class MyGLWidget : public QGLWidget, protected QGLFunctions - { - Q_OBJECT - public: - MyGLWidget(QWidget *parent = 0) : QGLWidget(parent) {} - - protected: - void initializeGL(); - void paintGL(); - }; - - void MyGLWidget::initializeGL() - { - initializeGLFunctions(); - } - \endcode + \snippet code/src_opengl_qglfunctions.cpp 0 The \c{paintGL()} function can then use any of the OpenGL ES 2.0 functions without explicit resolution, such as glActiveTexture() in the following example: - \code - void MyGLWidget::paintGL() - { - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, textureId); - ... - } - \endcode + \snippet code/src_opengl_qglfunctions.cpp 1 QGLFunctions can also be used directly for ad-hoc invocation of OpenGL ES 2.0 functions on all platforms: - \code - QGLFunctions glFuncs(QGLContext::currentContext()); - glFuncs.glActiveTexture(GL_TEXTURE1); - \endcode + \snippet code/src_opengl_qglfunctions.cpp 2 QGLFunctions provides wrappers for all OpenGL ES 2.0 functions, except those like \c{glDrawArrays()}, \c{glViewport()}, and @@ -114,10 +88,7 @@ QT_BEGIN_NAMESPACE feature. For example, the following checks if non power of two textures are available: - \code - QGLFunctions funcs(QGLContext::currentContext()); - bool npot = funcs.hasOpenGLFeature(QGLFunctions::NPOTTextures); - \endcode + \snippet code/src_opengl_qglfunctions.cpp 3 \note This class has been deprecated in favor of QOpenGLFunctions. */ diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp index cf3d307d71..97b83a6b3d 100644 --- a/src/opengl/qgraphicsshadereffect.cpp +++ b/src/opengl/qgraphicsshadereffect.cpp @@ -70,48 +70,12 @@ QT_BEGIN_NAMESPACE grayscale and then applies a colorize operation using the \c effectColor value: - \code - static char const colorizeShaderCode[] = - "uniform lowp vec4 effectColor;\n" - "lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) {\n" - " vec4 src = texture2D(imageTexture, textureCoords);\n" - " float gray = dot(src.rgb, vec3(0.212671, 0.715160, 0.072169));\n" - " vec4 colorize = 1.0-((1.0-gray)*(1.0-effectColor));\n" - " return vec4(colorize.rgb, src.a);\n" - "}"; - \endcode + \snippet code/src_opengl_qgraphicsshadereffect.cpp 0 To use this shader code, it is necessary to define a subclass of QGraphicsShaderEffect as follows: - \code - class ColorizeEffect : public QGraphicsShaderEffect - { - Q_OBJECT - public: - ColorizeEffect(QObject *parent = 0) - : QGraphicsShaderEffect(parent), color(Qt::black) - { - setPixelShaderFragment(colorizeShaderCode); - } - - QColor effectColor() const { return color; } - void setEffectColor(const QColor& c) - { - color = c; - setUniformsDirty(); - } - - protected: - void setUniforms(QGLShaderProgram *program) - { - program->setUniformValue("effectColor", color); - } - - private: - QColor color; - }; - \endcode + \snippet code/src_opengl_qgraphicsshadereffect.cpp 1 The setUniforms() function is called when the effect is about to be used for drawing to give the subclass the opportunity to @@ -216,11 +180,7 @@ QByteArray QGraphicsShaderEffect::pixelShaderFragment() const shader program. The following is the default pixel shader fragment, which draws a pixmap with no effect applied: - \code - lowp vec4 customShader(lowp sampler2D imageTexture, highp vec2 textureCoords) { - return texture2D(imageTexture, textureCoords); - } - \endcode + \snippet code/src_opengl_qgraphicsshadereffect.cpp 2 \sa pixelShaderFragment(), setUniforms() */ -- cgit v1.2.3 From b75babc6ae3f0fd48d6f09f1feab7b517d078cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 22 Oct 2018 19:00:31 +0200 Subject: QGLWidget: Prevent premature platform window creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passing Qt::MSWindowsOwnDC along with the window flags to the QWidget constructor results in creating a native window as part of the base class initialization. By deferring the window creation to later in the QGLWidget construction, the meta object reflects the actual class. Change-Id: I51343c767057d6841331614b93ad860fe99d65e3 Reviewed-by: Simon Hausmann Reviewed-by: Tor Arne Vestbø --- src/opengl/qgl.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index e136ddcff2..666cc19bbe 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3880,12 +3880,9 @@ void QGLContext::doneCurrent() */ QGLWidget::QGLWidget(QWidget *parent, const QGLWidget* shareWidget, Qt::WindowFlags f) - : QWidget(*(new QGLWidgetPrivate), parent, f | Qt::MSWindowsOwnDC) + : QWidget(*(new QGLWidgetPrivate), parent, f) { Q_D(QGLWidget); - setAttribute(Qt::WA_PaintOnScreen); - setAttribute(Qt::WA_NoSystemBackground); - setAutoFillBackground(true); // for compatibility d->init(new QGLContext(QGLFormat::defaultFormat(), this), shareWidget); } @@ -3893,12 +3890,9 @@ QGLWidget::QGLWidget(QWidget *parent, const QGLWidget* shareWidget, Qt::WindowFl \internal */ QGLWidget::QGLWidget(QGLWidgetPrivate &dd, const QGLFormat &format, QWidget *parent, const QGLWidget *shareWidget, Qt::WindowFlags f) - : QWidget(dd, parent, f | Qt::MSWindowsOwnDC) + : QWidget(dd, parent, f) { Q_D(QGLWidget); - setAttribute(Qt::WA_PaintOnScreen); - setAttribute(Qt::WA_NoSystemBackground); - setAutoFillBackground(true); // for compatibility d->init(new QGLContext(format, this), shareWidget); } @@ -3935,12 +3929,9 @@ QGLWidget::QGLWidget(QGLWidgetPrivate &dd, const QGLFormat &format, QWidget *par QGLWidget::QGLWidget(const QGLFormat &format, QWidget *parent, const QGLWidget* shareWidget, Qt::WindowFlags f) - : QWidget(*(new QGLWidgetPrivate), parent, f | Qt::MSWindowsOwnDC) + : QWidget(*(new QGLWidgetPrivate), parent, f) { Q_D(QGLWidget); - setAttribute(Qt::WA_PaintOnScreen); - setAttribute(Qt::WA_NoSystemBackground); - setAutoFillBackground(true); // for compatibility d->init(new QGLContext(format, this), shareWidget); } @@ -3971,12 +3962,9 @@ QGLWidget::QGLWidget(const QGLFormat &format, QWidget *parent, const QGLWidget* */ QGLWidget::QGLWidget(QGLContext *context, QWidget *parent, const QGLWidget *shareWidget, Qt::WindowFlags f) - : QWidget(*(new QGLWidgetPrivate), parent, f | Qt::MSWindowsOwnDC) + : QWidget(*(new QGLWidgetPrivate), parent, f) { Q_D(QGLWidget); - setAttribute(Qt::WA_PaintOnScreen); - setAttribute(Qt::WA_NoSystemBackground); - setAutoFillBackground(true); // for compatibility d->init(context, shareWidget); } @@ -5169,6 +5157,15 @@ QPaintEngine *QGLWidget::paintEngine() const void QGLWidgetPrivate::init(QGLContext *context, const QGLWidget *shareWidget) { + Q_Q(QGLWidget); + q->setAttribute(Qt::WA_PaintOnScreen); + q->setAttribute(Qt::WA_NoSystemBackground); + q->setAutoFillBackground(true); // for compatibility + + mustHaveWindowHandle = 1; + q->setAttribute(Qt::WA_NativeWindow); + q->setWindowFlag(Qt::MSWindowsOwnDC); + initContext(context, shareWidget); } -- cgit v1.2.3 From 102a919b734440df85617f1e3a8ba43c612839d5 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 29 Oct 2018 18:32:04 +0100 Subject: Generate documentation .tags files for all of the docs This allows others to link to QtDBus and the other libraries/tools using doxygen. Fixes: QTBUG-60933 Change-Id: I026895a432a328f224c40cf231ad12d109dc648f Reviewed-by: Paul Wicking Reviewed-by: Venugopal Shivashankar Reviewed-by: Martin Smith --- src/opengl/doc/qtopengl.qdocconf | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/opengl') diff --git a/src/opengl/doc/qtopengl.qdocconf b/src/opengl/doc/qtopengl.qdocconf index 6ff6cae2cb..2d38a5d2af 100644 --- a/src/opengl/doc/qtopengl.qdocconf +++ b/src/opengl/doc/qtopengl.qdocconf @@ -23,6 +23,8 @@ depends += qtdoc qtcore qtgui qtwidgets qmake examplesinstallpath = opengl +tagfile = qtopengl.tags + # The following parameters are for creating a qhp file, the qhelpgenerator # program can convert the qhp file into a qch file which can be opened in # Qt Assistant and/or Qt Creator. -- cgit v1.2.3 From 81d8319276f26d399bdff47b49bd69b19bd86c5a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 10 Oct 2018 15:54:07 +0200 Subject: doc: Fix all clang parse errors in QtBase during PCH build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update eliminates ALL parsing errors when clang parses the Qt headers to build the precompiled header qdoc needs. These errors are often cases where an old use of Q_QDOC no longer works because clang sees the enclosed fake declarations as erroneous. In a few cases, clang reported errors because two dummy function declartations under the Q_CLANG_QDOC guard were indistinguishable, so one of them was removed, and the documentation was patched accordingly. Using the macro Q_DECLARE_INTERFACE(...) causes clang to report errors because the class parametewr is abstract. These uses of the macro are not needed, so they are removed with #ifndef Q_CLANG_QDOC. Some declarations of default GL types that had been provided for qdoc were no longer needed, so they are removed. Now there are some member function signatures in QDBusPendingReply and QDBusPendingCall that have very long template clauses and qualifiers in their signatures. These unwieldy signatures will be unnecessary in the documentation and will look bad there, but for now they are correct. The ultimate solution will be to add a metacommand to qdoc, something like \simplify-signature to tell qdoc to generate the documentation for these member functions without the long template caluses and qualifiers. Change-Id: I012cf17a544fbba2ebc71002f31bdc865119bb8e Reviewed-by: Paul Wicking Reviewed-by: Topi Reiniö Reviewed-by: Martin Smith --- src/opengl/qgl.h | 16 ---------------- src/opengl/qglshaderprogram.h | 11 ----------- 2 files changed, 27 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index a1ba0485e0..f5accbeb3c 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -51,22 +51,6 @@ #include -#if defined(Q_CLANG_QDOC) -#undef GLint -typedef int GLint; -#undef GLuint -typedef unsigned int GLuint; -#undef GLenum -typedef unsigned int GLenum; -#undef GLclampf -typedef float GLclampf; -#undef GLsizei -typedef int GLsizei; -#undef GLboolean -typedef bool GLboolean; -#endif - - QT_BEGIN_NAMESPACE diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index dfdef44b54..3ce88197d2 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -46,17 +46,6 @@ #include #include -#if defined(Q_CLANG_QDOC) -#undef GLfloat -typedef double GLfloat; -#undef GLint -typedef int GLint; -#undef GLuint -typedef unsigned int GLuint; -#undef GLenum -typedef unsigned int GLenum; -#endif - QT_BEGIN_NAMESPACE -- cgit v1.2.3 From 15b1c3fd9b82c8a29148c73be7aa4e8b2e07add1 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 9 Nov 2018 15:44:02 +0100 Subject: Purge some unused code for the OpenGL library name We had a global static, a setter for it (that's nowhere used within Qt code) and a getter for it whose only use was commented out. Neither was declared in any header; the getter's commented-out client had a local extern declaration at the point of (non-)use. Found while reviewing a change to the next few lines of code after the commented-out use of the getter. Change-Id: I393d56219cb7dd7cf836ca80e1bdd605a2914003 Reviewed-by: Laszlo Agocs Reviewed-by: Gatis Paeglis --- src/opengl/qgl.cpp | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index d9f2113c14..78c2dfda7c 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -5195,25 +5195,6 @@ void QGLWidgetPrivate::cleanupColormaps() { } -Q_GLOBAL_STATIC(QString, qt_gl_lib_name) - -void qt_set_gl_library_name(const QString& name) -{ - qt_gl_lib_name()->operator=(name); -} - -const QString qt_gl_library_name() -{ - if (qt_gl_lib_name()->isNull()) { -# if defined(QT_OPENGL_ES_2) - return QLatin1String("GLESv2"); -# else - return QLatin1String("GL"); -# endif - } - return *qt_gl_lib_name(); -} - void QGLContextGroup::addShare(const QGLContext *context, const QGLContext *share) { Q_ASSERT(context && share); if (context->d_ptr->group == share->d_ptr->group) -- cgit v1.2.3 From e2093219665b02e9ac2a416412a371aeb60c7750 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Oct 2018 15:29:58 +0200 Subject: Use Q_DISABLE_COPY_MOVE for private classes Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b Reviewed-by: Giuseppe D'Angelo --- src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 2 +- src/opengl/qgraphicsshadereffect_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index d1ed621790..abf5b8ea48 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -160,7 +160,7 @@ public: void setTranslateZ(GLfloat z); private: - Q_DISABLE_COPY(QGL2PaintEngineEx) + Q_DISABLE_COPY_MOVE(QGL2PaintEngineEx) }; class QGL2PaintEngineExPrivate : public QPaintEngineExPrivate, protected QOpenGLExtensions diff --git a/src/opengl/qgraphicsshadereffect_p.h b/src/opengl/qgraphicsshadereffect_p.h index 9efcecd25f..1a32f24d70 100644 --- a/src/opengl/qgraphicsshadereffect_p.h +++ b/src/opengl/qgraphicsshadereffect_p.h @@ -80,7 +80,7 @@ protected: private: Q_DECLARE_PRIVATE(QGraphicsShaderEffect) - Q_DISABLE_COPY(QGraphicsShaderEffect) + Q_DISABLE_COPY_MOVE(QGraphicsShaderEffect) friend class QGLCustomShaderEffectStage; }; -- cgit v1.2.3 From a227ea5bd5af50ac6f874ecf764858a43c53cada Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 10 Dec 2018 15:18:07 +0100 Subject: Fix warnings building with --std=c++11 and gcc 8 Silence warnings about signed constants being shifted out of int range. Change-Id: I5dc397de71f4de09e54ce3cbc0f8e3a1cf977b03 Reviewed-by: Thiago Macieira --- src/opengl/qgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/opengl') diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index a5556ccee3..ba4a1dcaa1 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -157,7 +157,7 @@ class QGLDefaultOverlayFormat: public QGLFormat public: inline QGLDefaultOverlayFormat() { - setOption(QGL::FormatOption(0xffff << 16)); // turn off all options + setOption(QGL::FormatOption(0xffffU << 16)); // turn off all options setOption(QGL::DirectRendering); setPlane(1); } -- cgit v1.2.3 From 4ee8f755722bac9ad0b6fa62ddbfed8ee9943094 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 27 Jan 2019 17:42:27 +0100 Subject: QtBase: replace 0 with \nullptr in documentation Replace 0 with \nullptr in the documentation. As a drive-by also replace some 0 with nullptr in the corresponding code. Change-Id: I914b6b2151554c06acc2d244eff004524cbb9a82 Reviewed-by: Friedemann Kleint Reviewed-by: Paul Wicking --- src/opengl/qgl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 47252f211a..8ef53afaea 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -4119,14 +4119,14 @@ void QGLWidget::swapBuffers() /*! \fn const QGLContext* QGLWidget::overlayContext() const - Returns the overlay context of this widget, or 0 if this widget - has no overlay. + Returns the overlay context of this widget, or \nullptr if this + widget has no overlay. \sa context() */ const QGLContext* QGLWidget::overlayContext() const { - return 0; + return nullptr; } /*! -- cgit v1.2.3 From 44cf8cea8e5f496cab637930a942611b9026994a Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 21 Dec 2018 11:55:30 +0100 Subject: QtOpenGL: Unify license headers Change-Id: Ia25b8f9833bd3d941ef73dcc7c6590063fe65329 Reviewed-by: Jani Heikkinen --- .../doc/snippets/code/src_opengl_qglbuffer.cpp | 51 +++++++++++++--------- .../doc/snippets/code/src_opengl_qglfunctions.cpp | 49 +++++++++++++-------- .../code/src_opengl_qgraphicsshadereffect.cpp | 49 +++++++++++++-------- src/opengl/qtopenglglobal.h | 2 +- 4 files changed, 92 insertions(+), 59 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/doc/snippets/code/src_opengl_qglbuffer.cpp b/src/opengl/doc/snippets/code/src_opengl_qglbuffer.cpp index c9e49826ae..11ef88ab37 100644 --- a/src/opengl/doc/snippets/code/src_opengl_qglbuffer.cpp +++ b/src/opengl/doc/snippets/code/src_opengl_qglbuffer.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtOpenGL module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/opengl/doc/snippets/code/src_opengl_qglfunctions.cpp b/src/opengl/doc/snippets/code/src_opengl_qglfunctions.cpp index 673186dca9..c848ae7ede 100644 --- a/src/opengl/doc/snippets/code/src_opengl_qglfunctions.cpp +++ b/src/opengl/doc/snippets/code/src_opengl_qglfunctions.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtOpenGL module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/opengl/doc/snippets/code/src_opengl_qgraphicsshadereffect.cpp b/src/opengl/doc/snippets/code/src_opengl_qgraphicsshadereffect.cpp index d53b73e837..461e96e094 100644 --- a/src/opengl/doc/snippets/code/src_opengl_qgraphicsshadereffect.cpp +++ b/src/opengl/doc/snippets/code/src_opengl_qgraphicsshadereffect.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtOpenGL module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/opengl/qtopenglglobal.h b/src/opengl/qtopenglglobal.h index 6d03264e27..0e821f87b8 100644 --- a/src/opengl/qtopenglglobal.h +++ b/src/opengl/qtopenglglobal.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the QtOpenGL module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage -- cgit v1.2.3 From a4b8e7141b3dd3bf3c2ac139b44ece0f74b054d8 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 15 Feb 2019 21:27:58 +0100 Subject: QtGui/Network/OpenGl/Widgets/Xml: use \nullptr in documentation Replace null and '\c nullptr' with \nullptr in the documentation. Change-Id: I58934eea06943309ba895833f1991629870ab45b Reviewed-by: Friedemann Kleint --- src/opengl/qglfunctions.cpp | 5 +++-- src/opengl/qglshaderprogram.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index 7fe7102510..f22f9f470b 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -170,7 +170,8 @@ QGLFunctions::QGLFunctions() /*! Constructs a function resolver for \a context. If \a context - is null, then the resolver will be created for the current QGLContext. + is \nullptr, then the resolver will be created for the current + QGLContext. An object constructed in this way can only be used with \a context and other contexts that share with it. Use initializeGLFunctions() @@ -305,7 +306,7 @@ bool QGLFunctions::hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const /*! Initializes GL function resolution for \a context. If \a context - is null, then the current QGLContext will be used. + is \nullptr, then the current QGLContext will be used. After calling this function, the QGLFunctions object can only be used with \a context and other contexts that share with it. diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 545df8fa44..35f60318be 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -3169,7 +3169,8 @@ GLenum QGLShaderProgram::geometryOutputType() const Language (GLSL) are supported on this system; false otherwise. The \a context is used to resolve the GLSL extensions. - If \a context is null, then QGLContext::currentContext() is used. + If \a context is \nullptr, then QGLContext::currentContext() is + used. */ bool QGLShaderProgram::hasOpenGLShaderPrograms(const QGLContext *context) { @@ -3207,7 +3208,8 @@ void QGLShaderProgram::shaderDestroyed() this system; false otherwise. The \a context is used to resolve the GLSL extensions. - If \a context is null, then QGLContext::currentContext() is used. + If \a context is \nullptr, then QGLContext::currentContext() is + used. \since 4.7 */ -- cgit v1.2.3 From 85b0ce8ca36d52db71b519ee8d2a1ce369c53a81 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 25 Feb 2019 13:54:26 +0100 Subject: Fix can not -> cannot Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking --- src/opengl/qglframebufferobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/opengl') diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 0b2ddf97fe..b2158ebfaa 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -211,7 +211,7 @@ QGLFramebufferObjectFormat::~QGLFramebufferObjectFormat() If the desired amount of samples per pixel is not supported by the hardware then the maximum number of samples per pixel will be used. Note that - multisample framebuffer objects can not be bound as textures. Also, the + multisample framebuffer objects cannot be bound as textures. Also, the \c{GL_EXT_framebuffer_multisample} extension is required to create a framebuffer with more than one sample per pixel. -- cgit v1.2.3 From 41e7b71c410b77a81d09d3cc2e169ffd7975b4d2 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Mar 2019 11:46:26 +0100 Subject: More nullptr usage in headers Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint Reviewed-by: Simon Hausmann --- src/opengl/gl2paintengineex/qglengineshadermanager_p.h | 2 +- src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 4 ++-- src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h | 2 +- src/opengl/qgl_p.h | 12 ++++++------ src/opengl/qglframebufferobject_p.h | 6 +++--- src/opengl/qglpixelbuffer_p.h | 2 +- src/opengl/qgraphicsshadereffect_p.h | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index ec472da2e8..d23b3ad550 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -372,7 +372,7 @@ private: class QGLEngineShaderProg { public: - QGLEngineShaderProg() : program(0) {} + QGLEngineShaderProg() : program(nullptr) {} ~QGLEngineShaderProg() { if (program) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index abf5b8ea48..762aac2f65 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -175,9 +175,9 @@ public: QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr) : q(q_ptr), - shaderManager(0), + shaderManager(nullptr), width(0), height(0), - ctx(0), + ctx(nullptr), useSystemClip(true), elementIndicesVBOId(0), opacityArray(0), diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h index e76216ef5d..7c12ce8998 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h @@ -139,7 +139,7 @@ public: inline void setPaintEnginePrivate(QGL2PaintEngineExPrivate *p) { pex = p; } - inline const QOpenGLContextGroup *contextGroup() const { return m_textureResource ? m_textureResource->group() : 0; } + inline const QOpenGLContextGroup *contextGroup() const { return m_textureResource ? m_textureResource->group() : nullptr; } inline int serialNumber() const { return m_serialNumber; } diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index ed364283cc..4e52c0f5e9 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -203,7 +203,7 @@ const QGLContext *qt_gl_transfer_context(const QGLContext *); class QGLTemporaryContextPrivate; class QGLTemporaryContext { public: - explicit QGLTemporaryContext(bool directRendering = true, QWidget *parent = 0); + explicit QGLTemporaryContext(bool directRendering = true, QWidget *parent = nullptr); ~QGLTemporaryContext(); private: @@ -302,7 +302,7 @@ class Q_OPENGL_EXPORT QGLShareContextScope { public: QGLShareContextScope(const QGLContext *ctx) - : m_oldContext(0) + : m_oldContext(nullptr) { QGLContext *currentContext = const_cast(QGLContext::currentContext()); if (currentContext != ctx && !QGLContext::areSharing(ctx, currentContext)) { @@ -367,7 +367,7 @@ Q_SIGNALS: class QGLTexture { public: - explicit QGLTexture(QGLContext *ctx = 0, GLuint tx_id = 0, GLenum tx_target = GL_TEXTURE_2D, + explicit QGLTexture(QGLContext *ctx = nullptr, GLuint tx_id = 0, GLenum tx_target = GL_TEXTURE_2D, QGLContext::BindOptions opt = QGLContext::DefaultBindOption) : context(ctx), id(tx_id), @@ -378,7 +378,7 @@ public: ~QGLTexture() { if (options & QGLContext::MemoryManagedBindOption) { Q_ASSERT(context); - QPlatformPixmap *boundPixmap = 0; + QPlatformPixmap *boundPixmap = nullptr; context->d_ptr->texture_destroyer->emitFreeTexture(context, boundPixmap, id); } } @@ -392,9 +392,9 @@ public: bool canBindCompressedTexture (const char *buf, int len, const char *format, bool *hasAlpha); QSize bindCompressedTexture - (const QString& fileName, const char *format = 0); + (const QString& fileName, const char *format = nullptr); QSize bindCompressedTexture - (const char *buf, int len, const char *format = 0); + (const char *buf, int len, const char *format = nullptr); QSize bindCompressedTextureDDS(const char *buf, int len); QSize bindCompressedTexturePVR(const char *buf, int len); }; diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h index bf5e21cf0b..9d536527c3 100644 --- a/src/opengl/qglframebufferobject_p.h +++ b/src/opengl/qglframebufferobject_p.h @@ -124,9 +124,9 @@ private: class QGLFramebufferObjectPrivate { public: - QGLFramebufferObjectPrivate() : fbo_guard(0), texture_guard(0), depth_buffer_guard(0) - , stencil_buffer_guard(0), color_buffer_guard(0) - , valid(false), engine(0) {} + QGLFramebufferObjectPrivate() : fbo_guard(nullptr), texture_guard(nullptr), depth_buffer_guard(nullptr) + , stencil_buffer_guard(nullptr), color_buffer_guard(nullptr) + , valid(false), engine(nullptr) {} ~QGLFramebufferObjectPrivate() {} void init(QGLFramebufferObject *q, const QSize& sz, diff --git a/src/opengl/qglpixelbuffer_p.h b/src/opengl/qglpixelbuffer_p.h index 9125fcfb4b..2729ade2b6 100644 --- a/src/opengl/qglpixelbuffer_p.h +++ b/src/opengl/qglpixelbuffer_p.h @@ -77,7 +77,7 @@ private: class QGLPixelBufferPrivate { Q_DECLARE_PUBLIC(QGLPixelBuffer) public: - QGLPixelBufferPrivate(QGLPixelBuffer *q) : q_ptr(q), invalid(true), qctx(0), widget(0), fbo(0), blit_fbo(0), pbuf(0), ctx(0) + QGLPixelBufferPrivate(QGLPixelBuffer *q) : q_ptr(q), invalid(true), qctx(nullptr), widget(nullptr), fbo(nullptr), blit_fbo(nullptr), pbuf(nullptr), ctx(nullptr) { } bool init(const QSize &size, const QGLFormat &f, QGLWidget *shareWidget); diff --git a/src/opengl/qgraphicsshadereffect_p.h b/src/opengl/qgraphicsshadereffect_p.h index 1a32f24d70..218caa2936 100644 --- a/src/opengl/qgraphicsshadereffect_p.h +++ b/src/opengl/qgraphicsshadereffect_p.h @@ -67,7 +67,7 @@ class Q_OPENGL_EXPORT QGraphicsShaderEffect : public QGraphicsEffect { Q_OBJECT public: - QGraphicsShaderEffect(QObject *parent = 0); + QGraphicsShaderEffect(QObject *parent = nullptr); virtual ~QGraphicsShaderEffect(); QByteArray pixelShaderFragment() const; -- cgit v1.2.3