From 99081b68153e8b623d936d1ab8afbcf932e4f9b5 Mon Sep 17 00:00:00 2001 From: Qt Submodule Update Bot Date: Thu, 12 Dec 2019 01:01:31 +0100 Subject: Update dependencies on 'dev' in qt/qtsvg Remove the framebufferobject example as it still relied on the now removed QGL* classes. Ported the svgviewer example over to use QOpenGLWidget. Change-Id: Idfb1ea7bcb0c8ba7f3f97b4b2d26603f4f7ec96a Reviewed-by: Lars Knoll Reviewed-by: Johan Helsing --- dependencies.yaml | 2 +- examples/svg/opengl/framebufferobject/bubbles.svg | 215 ------------- examples/svg/opengl/framebufferobject/designer.png | Bin 2810 -> 0 bytes .../opengl/framebufferobject/framebufferobject.pro | 11 - .../opengl/framebufferobject/framebufferobject.qrc | 6 - examples/svg/opengl/framebufferobject/glwidget.cpp | 332 --------------------- examples/svg/opengl/framebufferobject/glwidget.h | 92 ------ examples/svg/opengl/framebufferobject/main.cpp | 71 ----- examples/svg/opengl/opengl.pro | 2 - examples/svg/svg.pro | 2 - examples/svg/svgviewer/main.cpp | 3 - examples/svg/svgviewer/svgview.cpp | 4 +- 12 files changed, 3 insertions(+), 737 deletions(-) delete mode 100644 examples/svg/opengl/framebufferobject/bubbles.svg delete mode 100644 examples/svg/opengl/framebufferobject/designer.png delete mode 100644 examples/svg/opengl/framebufferobject/framebufferobject.pro delete mode 100644 examples/svg/opengl/framebufferobject/framebufferobject.qrc delete mode 100644 examples/svg/opengl/framebufferobject/glwidget.cpp delete mode 100644 examples/svg/opengl/framebufferobject/glwidget.h delete mode 100644 examples/svg/opengl/framebufferobject/main.cpp delete mode 100644 examples/svg/opengl/opengl.pro diff --git a/dependencies.yaml b/dependencies.yaml index e1bfcb0..6a5d0a0 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,4 +1,4 @@ dependencies: ../qtbase: - ref: bef74b6c3a0a9c8649ea8eb333d80015f76863e4 + ref: 5b193e3dd47704daf56c8817d0157f66363044c3 required: true diff --git a/examples/svg/opengl/framebufferobject/bubbles.svg b/examples/svg/opengl/framebufferobject/bubbles.svg deleted file mode 100644 index 5173012..0000000 --- a/examples/svg/opengl/framebufferobject/bubbles.svg +++ /dev/null @@ -1,215 +0,0 @@ - - - - Spheres - Semi-transparent bubbles on a colored background. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/svg/opengl/framebufferobject/designer.png b/examples/svg/opengl/framebufferobject/designer.png deleted file mode 100644 index 4f32d57..0000000 Binary files a/examples/svg/opengl/framebufferobject/designer.png and /dev/null differ diff --git a/examples/svg/opengl/framebufferobject/framebufferobject.pro b/examples/svg/opengl/framebufferobject/framebufferobject.pro deleted file mode 100644 index d180d4d..0000000 --- a/examples/svg/opengl/framebufferobject/framebufferobject.pro +++ /dev/null @@ -1,11 +0,0 @@ -qtConfig(opengles2):error("This example is written for OpenGL 1.x") - -QT += widgets opengl svg - -HEADERS += glwidget.h -SOURCES += glwidget.cpp main.cpp -RESOURCES += framebufferobject.qrc - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/svg/opengl/framebufferobject -INSTALLS += target diff --git a/examples/svg/opengl/framebufferobject/framebufferobject.qrc b/examples/svg/opengl/framebufferobject/framebufferobject.qrc deleted file mode 100644 index 986f1ca..0000000 --- a/examples/svg/opengl/framebufferobject/framebufferobject.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - bubbles.svg - designer.png - - diff --git a/examples/svg/opengl/framebufferobject/glwidget.cpp b/examples/svg/opengl/framebufferobject/glwidget.cpp deleted file mode 100644 index 03eed6c..0000000 --- a/examples/svg/opengl/framebufferobject/glwidget.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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 -** 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. -** -** 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$ -** -****************************************************************************/ - -#include -#include -#include "glwidget.h" - -#ifndef GL_MULTISAMPLE -#define GL_MULTISAMPLE 0x809D -#endif - -GLWidget::GLWidget(QWidget *parent) - : QGLWidget(QGLFormat(QGL::SampleBuffers|QGL::AlphaChannel), parent) -{ - setWindowTitle(tr("OpenGL framebuffer objects")); - makeCurrent(); - - if (QGLFramebufferObject::hasOpenGLFramebufferBlit()) { - QGLFramebufferObjectFormat format; - format.setSamples(4); - format.setAttachment(QGLFramebufferObject::CombinedDepthStencil); - - render_fbo = new QGLFramebufferObject(512, 512, format); - texture_fbo = new QGLFramebufferObject(512, 512); - } else { - render_fbo = new QGLFramebufferObject(1024, 1024); - texture_fbo = render_fbo; - } - - rot_x = rot_y = rot_z = 0.0f; - scale = 0.1f; - anim = new QTimeLine(750, this); - anim->setUpdateInterval(20); - connect(anim, SIGNAL(valueChanged(qreal)), SLOT(animate(qreal))); - connect(anim, SIGNAL(finished()), SLOT(animFinished())); - - svg_renderer = new QSvgRenderer(QLatin1String(":/res/bubbles.svg"), this); - connect(svg_renderer, SIGNAL(repaintNeeded()), this, SLOT(draw())); - - logo = QImage(":/res/designer.png"); - logo = logo.convertToFormat(QImage::Format_ARGB32); - - tile_list = glGenLists(1); - glNewList(tile_list, GL_COMPILE); - glBegin(GL_QUADS); - { - glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f); - glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f); - glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f); - glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f); - - glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f); - glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f); - glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f); - glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f); - - glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f); - glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, 1.0f, 1.0f); - glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, 1.0f, 1.0f); - glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f); - - glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, -1.0f, -1.0f); - glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, -1.0f, -1.0f); - glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f); - glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f); - - glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f, -1.0f, -1.0f); - glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, -1.0f); - glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 1.0f); - glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, -1.0f, 1.0f); - - glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, -1.0f); - glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 1.0f); - glTexCoord2f(1.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 1.0f); - glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, -1.0f); - } - glEnd(); - glEndList(); - - wave = new GLfloat[logo.width()*logo.height()]; - memset(wave, 0, logo.width()*logo.height()); - startTimer(30); // wave timer -} - -GLWidget::~GLWidget() -{ - delete[] wave; - glDeleteLists(tile_list, 1); - delete texture_fbo; - if (render_fbo != texture_fbo) - delete render_fbo; -} - -void GLWidget::paintEvent(QPaintEvent *) -{ - draw(); -} - -void GLWidget::draw() -{ - QPainter p(this); // used for text overlay - - // save the GL state set for QPainter - saveGLState(); - - // render the 'bubbles.svg' file into our framebuffer object - QPainter fbo_painter(render_fbo); - svg_renderer->render(&fbo_painter); - fbo_painter.end(); - - if (render_fbo != texture_fbo) { - QRect rect(0, 0, render_fbo->width(), render_fbo->height()); - QGLFramebufferObject::blitFramebuffer(texture_fbo, rect, - render_fbo, rect); - } - - // draw into the GL widget - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1, 1, -1, 1, 10, 100); - glTranslatef(0.0f, 0.0f, -15.0f); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glViewport(0, 0, width(), height()); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - glBindTexture(GL_TEXTURE_2D, texture_fbo->texture()); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glEnable(GL_TEXTURE_2D); - glEnable(GL_MULTISAMPLE); - glEnable(GL_CULL_FACE); - - // draw background - glPushMatrix(); - glScalef(1.7f, 1.7f, 1.7f); - glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - glCallList(tile_list); - glPopMatrix(); - - const int w = logo.width(); - const int h = logo.height(); - - glRotatef(rot_x, 1.0f, 0.0f, 0.0f); - glRotatef(rot_y, 0.0f, 1.0f, 0.0f); - glRotatef(rot_z, 0.0f, 0.0f, 1.0f); - glScalef(scale/w, scale/w, scale/w); - - glDepthFunc(GL_LESS); - glEnable(GL_DEPTH_TEST); - // draw the Qt icon - glTranslatef(-w+1, -h+1, 0.0f); - for (int y=h-1; y>=0; --y) { - uint *p = (uint*) logo.scanLine(y); - uint *end = p + w; - int x = 0; - while (p < end) { - glColor4ub(qRed(*p), qGreen(*p), qBlue(*p), uchar(qAlpha(*p)*.9)); - glTranslatef(0.0f, 0.0f, wave[y*w+x]); - if (qAlpha(*p) > 128) - glCallList(tile_list); - glTranslatef(0.0f, 0.0f, -wave[y*w+x]); - glTranslatef(2.0f, 0.0f, 0.0f); - ++x; - ++p; - } - glTranslatef(-w*2.0f, 2.0f, 0.0f); - } - - // restore the GL state that QPainter expects - restoreGLState(); - - // draw the overlayed text using QPainter - p.setPen(QColor(197, 197, 197, 157)); - p.setBrush(QColor(197, 197, 197, 127)); - p.drawRect(QRect(0, 0, width(), 50)); - p.setPen(Qt::black); - p.setBrush(Qt::NoBrush); - const QString str1(tr("A simple OpenGL framebuffer object example.")); - const QString str2(tr("Use the mouse wheel to zoom, press buttons and move mouse to rotate, double-click to flip.")); - QFontMetrics fm(p.font()); - p.drawText(width()/2 - fm.horizontalAdvance(str1)/2, 20, str1); - p.drawText(width()/2 - fm.horizontalAdvance(str2)/2, 20 + fm.lineSpacing(), str2); -} - -void GLWidget::mousePressEvent(QMouseEvent *e) -{ - anchor = e->pos(); -} - -void GLWidget::mouseMoveEvent(QMouseEvent *e) -{ - QPoint diff = e->pos() - anchor; - if (e->buttons() & Qt::LeftButton) { - rot_x += diff.y()/5.0f; - rot_y += diff.x()/5.0f; - } else if (e->buttons() & Qt::RightButton) { - rot_z += diff.x()/5.0f; - } - - anchor = e->pos(); - draw(); -} - -void GLWidget::wheelEvent(QWheelEvent *e) -{ - e->angleDelta().y() > 0 ? scale += scale*0.1f : scale -= scale*0.1f; - draw(); -} - -void GLWidget::mouseDoubleClickEvent(QMouseEvent *) -{ - anim->start(); -} - -void GLWidget::animate(qreal val) -{ - rot_y = val * 180; - draw(); -} - -void GLWidget::animFinished() -{ - if (anim->direction() == QTimeLine::Forward) - anim->setDirection(QTimeLine::Backward); - else - anim->setDirection(QTimeLine::Forward); -} - -void GLWidget::saveGLState() -{ - glPushAttrib(GL_ALL_ATTRIB_BITS); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); -} - -void GLWidget::restoreGLState() -{ - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - glPopAttrib(); -} - -void GLWidget::timerEvent(QTimerEvent *) -{ - if (QApplication::mouseButtons() != 0) - return; - - static bool scale_in = true; - - if (scale_in && scale > 35.0f) - scale_in = false; - else if (!scale_in && scale < .5f) - scale_in = true; - - scale *= scale_in ? 1.01f : 0.99f; - rot_z += 0.3f; - rot_x += 0.1f; - - static float wt = 0.0; - wt += 0.1f; - - const int width = logo.width(); - const int dx = width >> 1, dy = dx; // disturbance point - const float W = .3f; - const float v = -4; // wave speed - const int AMP = 5; - - for (int i = 0; i < width; ++i) { - for (int j = 0; j < width; ++j) { - const float s = hypot(j - dx, i - dy); - const double raw = AMP * sin(2 * M_PI * W * (wt + s / v)); - if (s != 0) - wave[i * width + j] = raw / (0.2 * (s + 2)); - else - wave[i * width + j] = raw; - } - } -} diff --git a/examples/svg/opengl/framebufferobject/glwidget.h b/examples/svg/opengl/framebufferobject/glwidget.h deleted file mode 100644 index 15cc7e7..0000000 --- a/examples/svg/opengl/framebufferobject/glwidget.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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 -** 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. -** -** 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$ -** -****************************************************************************/ - -#include -#include -#include -#include - -class GLWidget : public QGLWidget -{ - Q_OBJECT - -public: - GLWidget(QWidget *parent); - ~GLWidget(); - - void saveGLState(); - void restoreGLState(); - - void paintEvent(QPaintEvent *) override; - void mousePressEvent(QMouseEvent *) override; - void mouseDoubleClickEvent(QMouseEvent *) override; - void mouseMoveEvent(QMouseEvent *) override; - void timerEvent(QTimerEvent *) override; - void wheelEvent(QWheelEvent *) override; - -public slots: - void animate(qreal); - void animFinished(); - void draw(); - -private: - QPoint anchor; - float scale; - float rot_x, rot_y, rot_z; - GLuint tile_list; - GLfloat *wave; - - QImage logo; - QTimeLine *anim; - QSvgRenderer *svg_renderer; - QGLFramebufferObject *render_fbo; - QGLFramebufferObject *texture_fbo; -}; - diff --git a/examples/svg/opengl/framebufferobject/main.cpp b/examples/svg/opengl/framebufferobject/main.cpp deleted file mode 100644 index 78b5f4e..0000000 --- a/examples/svg/opengl/framebufferobject/main.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $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 -** 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. -** -** 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$ -** -****************************************************************************/ - -#include -#include -#include "glwidget.h" - -int main(int argc, char **argv) -{ - Q_INIT_RESOURCE(framebufferobject); - - QApplication a(argc, argv); - if (!QGLFormat::hasOpenGL() || !QGLFramebufferObject::hasOpenGLFramebufferObjects()) { - QMessageBox::information(0, "OpenGL framebuffer objects", - "This system does not support OpenGL/framebuffer objects."); - return -1; - } - - GLWidget widget(0); - widget.resize(640, 480); - widget.show(); - return a.exec(); -} - diff --git a/examples/svg/opengl/opengl.pro b/examples/svg/opengl/opengl.pro deleted file mode 100644 index 82c616c..0000000 --- a/examples/svg/opengl/opengl.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -qtHaveModule(widgets):!qtConfig(opengles2):!qtConfig(dynamicgl): SUBDIRS += framebufferobject diff --git a/examples/svg/svg.pro b/examples/svg/svg.pro index 410415b..4303b77 100644 --- a/examples/svg/svg.pro +++ b/examples/svg/svg.pro @@ -2,5 +2,3 @@ TEMPLATE = subdirs qtHaveModule(widgets): SUBDIRS += embeddedsvgviewer svggenerator svgviewer SUBDIRS += embedded richtext draganddrop network - -qtHaveModule(opengl):!qtConfig(opengles2): SUBDIRS += opengl diff --git a/examples/svg/svgviewer/main.cpp b/examples/svg/svgviewer/main.cpp index 5eb76c8..2233723 100644 --- a/examples/svg/svgviewer/main.cpp +++ b/examples/svg/svgviewer/main.cpp @@ -52,9 +52,6 @@ #include #include #include -#ifndef QT_NO_OPENGL -#include -#endif #include "mainwindow.h" diff --git a/examples/svg/svgviewer/svgview.cpp b/examples/svg/svgviewer/svgview.cpp index e87d0ea..6674f87 100644 --- a/examples/svg/svgviewer/svgview.cpp +++ b/examples/svg/svgviewer/svgview.cpp @@ -59,7 +59,7 @@ #include #ifndef QT_NO_OPENGL -#include +#include #endif SvgView::SvgView(QWidget *parent) @@ -146,7 +146,7 @@ void SvgView::setRenderer(RendererType type) if (m_renderer == OpenGL) { #ifndef QT_NO_OPENGL - setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); + setViewport(new QOpenGLWidget); #endif } else { setViewport(new QWidget); -- cgit v1.2.1