From ceb4df5262ca41ff9314b36af9a3be19ffe24a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Fri, 21 Aug 2009 14:33:07 +0200 Subject: Move shader effect example from examples/graphicsview to examples/effects --- examples/effects/customshader/blureffect.cpp | 69 +++++++++++ examples/effects/customshader/blureffect.h | 67 ++++++++++ examples/effects/customshader/blurpicker.cpp | 137 +++++++++++++++++++++ examples/effects/customshader/blurpicker.h | 74 +++++++++++ examples/effects/customshader/blurpicker.qrc | 14 +++ examples/effects/customshader/customshader.pro | 10 ++ .../effects/customshader/customshadereffect.cpp | 72 +++++++++++ examples/effects/customshader/customshadereffect.h | 64 ++++++++++ examples/effects/customshader/images/README.txt | 5 + .../customshader/images/accessories-calculator.png | Bin 0 -> 3760 bytes .../images/accessories-text-editor.png | Bin 0 -> 4746 bytes .../effects/customshader/images/background.jpg | Bin 0 -> 16259 bytes .../effects/customshader/images/help-browser.png | Bin 0 -> 5392 bytes .../customshader/images/internet-group-chat.png | Bin 0 -> 2809 bytes .../effects/customshader/images/internet-mail.png | Bin 0 -> 3899 bytes .../customshader/images/internet-web-browser.png | Bin 0 -> 6376 bytes .../customshader/images/office-calendar.png | Bin 0 -> 4010 bytes .../effects/customshader/images/system-users.png | Bin 0 -> 5353 bytes examples/effects/customshader/main.cpp | 55 +++++++++ examples/effects/effects.pro | 3 +- examples/graphicsview/customshader/blureffect.cpp | 69 ----------- examples/graphicsview/customshader/blureffect.h | 67 ---------- examples/graphicsview/customshader/blurpicker.cpp | 137 --------------------- examples/graphicsview/customshader/blurpicker.h | 74 ----------- examples/graphicsview/customshader/blurpicker.qrc | 14 --- .../graphicsview/customshader/customshader.pro | 10 -- .../customshader/customshadereffect.cpp | 72 ----------- .../graphicsview/customshader/customshadereffect.h | 64 ---------- examples/graphicsview/customshader/main.cpp | 55 --------- 29 files changed, 569 insertions(+), 563 deletions(-) create mode 100644 examples/effects/customshader/blureffect.cpp create mode 100644 examples/effects/customshader/blureffect.h create mode 100644 examples/effects/customshader/blurpicker.cpp create mode 100644 examples/effects/customshader/blurpicker.h create mode 100644 examples/effects/customshader/blurpicker.qrc create mode 100644 examples/effects/customshader/customshader.pro create mode 100644 examples/effects/customshader/customshadereffect.cpp create mode 100644 examples/effects/customshader/customshadereffect.h create mode 100644 examples/effects/customshader/images/README.txt create mode 100644 examples/effects/customshader/images/accessories-calculator.png create mode 100644 examples/effects/customshader/images/accessories-text-editor.png create mode 100644 examples/effects/customshader/images/background.jpg create mode 100644 examples/effects/customshader/images/help-browser.png create mode 100644 examples/effects/customshader/images/internet-group-chat.png create mode 100644 examples/effects/customshader/images/internet-mail.png create mode 100644 examples/effects/customshader/images/internet-web-browser.png create mode 100644 examples/effects/customshader/images/office-calendar.png create mode 100644 examples/effects/customshader/images/system-users.png create mode 100644 examples/effects/customshader/main.cpp delete mode 100644 examples/graphicsview/customshader/blureffect.cpp delete mode 100644 examples/graphicsview/customshader/blureffect.h delete mode 100644 examples/graphicsview/customshader/blurpicker.cpp delete mode 100644 examples/graphicsview/customshader/blurpicker.h delete mode 100644 examples/graphicsview/customshader/blurpicker.qrc delete mode 100644 examples/graphicsview/customshader/customshader.pro delete mode 100644 examples/graphicsview/customshader/customshadereffect.cpp delete mode 100644 examples/graphicsview/customshader/customshadereffect.h delete mode 100644 examples/graphicsview/customshader/main.cpp diff --git a/examples/effects/customshader/blureffect.cpp b/examples/effects/customshader/blureffect.cpp new file mode 100644 index 0000000..2b5237b --- /dev/null +++ b/examples/effects/customshader/blureffect.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "blureffect.h" + +#include + +BlurEffect::BlurEffect(QGraphicsItem *item) + : QGraphicsBlurEffect() + , m_baseLine(200), item(item) +{ +} + +void BlurEffect::adjustForItem() +{ + qreal y = m_baseLine - item->pos().y(); + qreal radius = qBound(0.0, y / 32, 16.0); + setBlurRadius(radius); +} + +QRectF BlurEffect::boundingRectFor(const QRectF &rect) const +{ + const_cast(this)->adjustForItem(); + return QGraphicsBlurEffect::boundingRectFor(rect); +} + +void BlurEffect::draw(QPainter *painter, QGraphicsEffectSource *source) +{ + adjustForItem(); + QGraphicsBlurEffect::draw(painter, source); +} diff --git a/examples/effects/customshader/blureffect.h b/examples/effects/customshader/blureffect.h new file mode 100644 index 0000000..bf72226 --- /dev/null +++ b/examples/effects/customshader/blureffect.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef BLUREFFECT_H +#define BLUREFFECT_H + +#include +#include + +class BlurEffect: public QGraphicsBlurEffect +{ +public: + BlurEffect(QGraphicsItem *item); + + void setBaseLine(qreal y) { m_baseLine = y; } + + QRectF boundingRectFor(const QRectF &) const; + + void draw(QPainter *painter, QGraphicsEffectSource*); + +private: + void adjustForItem(); + +private: + qreal m_baseLine; + QGraphicsItem *item; +}; + +#endif // BLUREFFECT_H diff --git a/examples/effects/customshader/blurpicker.cpp b/examples/effects/customshader/blurpicker.cpp new file mode 100644 index 0000000..de80312 --- /dev/null +++ b/examples/effects/customshader/blurpicker.cpp @@ -0,0 +1,137 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "blurpicker.h" + +#include + +#include "blureffect.h" +#include "customshadereffect.h" + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +BlurPicker::BlurPicker(QWidget *parent): QGraphicsView(parent), m_index(0.0) +{ + setBackgroundBrush(QPixmap(":/images/background.jpg")); + setScene(&m_scene); + + setupScene(); + updateIconPositions(); + + connect(&m_timeLine, SIGNAL(valueChanged(qreal)), SLOT(updateIconPositions())); + m_timeLine.setDuration(400); + + setRenderHint(QPainter::Antialiasing, true); + setFrameStyle(QFrame::NoFrame); +} + +void BlurPicker::updateIconPositions() +{ + m_index = m_timeLine.currentFrame() / 1000.0; + + qreal baseline = 0; + for (int i = 0; i < m_icons.count(); ++i) { + QGraphicsItem *icon = m_icons[i]; + qreal a = ((i + m_index) * 2 * M_PI) / m_icons.count(); + qreal xs = 170 * sin(a); + qreal ys = 100 * cos(a); + QPointF pos(xs, ys); + pos = QTransform().rotate(-20).map(pos); + pos -= QPointF(40, 40); + icon->setPos(pos); + baseline = qMax(baseline, ys); + if (i != 3) + static_cast(icon->graphicsEffect())->setBaseLine(baseline); + } + + m_scene.update(); +} + +void BlurPicker::setupScene() +{ + m_scene.setSceneRect(-200, -120, 400, 240); + + QStringList names; + names << ":/images/accessories-calculator.png"; + names << ":/images/accessories-text-editor.png"; + names << ":/images/help-browser.png"; + names << ":/images/internet-group-chat.png"; + names << ":/images/internet-mail.png"; + names << ":/images/internet-web-browser.png"; + names << ":/images/office-calendar.png"; + names << ":/images/system-users.png"; + + for (int i = 0; i < names.count(); i++) { + QPixmap pixmap(names[i]); + QGraphicsPixmapItem *icon = m_scene.addPixmap(pixmap); + icon->setZValue(1); + if (i == 3) + icon->setGraphicsEffect(new CustomShaderEffect()); + else + icon->setGraphicsEffect(new BlurEffect(icon)); + m_icons << icon; + } + + QGraphicsPixmapItem *bg = m_scene.addPixmap(QPixmap(":/images/background.jpg")); + bg->setZValue(0); + bg->setPos(-200, -150); +} + +void BlurPicker::keyPressEvent(QKeyEvent *event) +{ + if (event->key() == Qt::Key_Left) { + if (m_timeLine.state() == QTimeLine::NotRunning) { + m_timeLine.setFrameRange(m_index * 1000, m_index * 1000 - 1000); + m_timeLine.start(); + event->accept(); + } + } + + if (event->key() == Qt::Key_Right) { + if (m_timeLine.state() == QTimeLine::NotRunning) { + m_timeLine.setFrameRange(m_index * 1000, m_index * 1000 + 1000); + m_timeLine.start(); + event->accept(); + } + } +} diff --git a/examples/effects/customshader/blurpicker.h b/examples/effects/customshader/blurpicker.h new file mode 100644 index 0000000..b7ea3b4 --- /dev/null +++ b/examples/effects/customshader/blurpicker.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef BLURPICKER_H +#define BLURPICKER_H + +#include +#include +#include + +#include "blureffect.h" + +class BlurPicker: public QGraphicsView +{ + Q_OBJECT + +public: + BlurPicker(QWidget *parent = 0); + +protected: + void keyPressEvent(QKeyEvent *event); + +private slots: + void updateIconPositions(); + +private: + void setupScene(); + +private: + qreal m_index; + QGraphicsScene m_scene; + QList m_icons; + QTimeLine m_timeLine; +}; + +#endif // BLURPICKER_H diff --git a/examples/effects/customshader/blurpicker.qrc b/examples/effects/customshader/blurpicker.qrc new file mode 100644 index 0000000..e88eaca --- /dev/null +++ b/examples/effects/customshader/blurpicker.qrc @@ -0,0 +1,14 @@ + + + images/background.jpg + images/accessories-calculator.png + images/accessories-text-editor.png + images/help-browser.png + images/internet-group-chat.png + images/internet-mail.png + images/internet-web-browser.png + images/office-calendar.png + images/system-users.png + + + diff --git a/examples/effects/customshader/customshader.pro b/examples/effects/customshader/customshader.pro new file mode 100644 index 0000000..4ce5d2b --- /dev/null +++ b/examples/effects/customshader/customshader.pro @@ -0,0 +1,10 @@ +SOURCES += main.cpp blurpicker.cpp blureffect.cpp customshadereffect.cpp +HEADERS += blurpicker.h blureffect.h customshadereffect.h +RESOURCES += blurpicker.qrc +QT += opengl + +# install +target.path = $$[QT_INSTALL_EXAMPLES]/effects/customshader +sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS customshader.pro +sources.path = $$[QT_INSTALL_EXAMPLES]/effects/customshader +INSTALLS += target sources diff --git a/examples/effects/customshader/customshadereffect.cpp b/examples/effects/customshader/customshadereffect.cpp new file mode 100644 index 0000000..293123c --- /dev/null +++ b/examples/effects/customshader/customshadereffect.cpp @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "customshadereffect.h" +#include + +static char const colorizeShaderCode[] = + "varying highp vec2 textureCoords;\n" + "uniform sampler2D imageTexture;\n" + "uniform lowp vec4 effectColor;\n" + "lowp vec4 srcPixel() {\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" + "}"; + +CustomShaderEffect::CustomShaderEffect() + : QGraphicsShaderEffect(), + color(Qt::red) +{ + setPixelShaderFragment(colorizeShaderCode); +} + +void CustomShaderEffect::setEffectColor(const QColor& c) +{ + color = c; + setUniformsDirty(); +} + +void CustomShaderEffect::setUniforms(QGLShaderProgram *program) +{ + program->setUniformValue("effectColor", color); +} diff --git a/examples/effects/customshader/customshadereffect.h b/examples/effects/customshader/customshadereffect.h new file mode 100644 index 0000000..6482bd5 --- /dev/null +++ b/examples/effects/customshader/customshadereffect.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef CUSTOMSHADEREFFECT_H +#define CUSTOMSHADEREFFECT_H + +#include +#include +#include + +class CustomShaderEffect: public QGraphicsShaderEffect +{ +public: + CustomShaderEffect(); + + QColor effectColor() const { return color; } + void setEffectColor(const QColor& c); + +protected: + void setUniforms(QGLShaderProgram *program); + +private: + QColor color; +}; + +#endif // CUSTOMSHADEREFFECT_H diff --git a/examples/effects/customshader/images/README.txt b/examples/effects/customshader/images/README.txt new file mode 100644 index 0000000..0927e17 --- /dev/null +++ b/examples/effects/customshader/images/README.txt @@ -0,0 +1,5 @@ +The background is taken from a public domain photo at: +http://www.photos8.com/view/computer_board2-800x600.html + +All other icons are from the Tango Desktop project: +http://tango.freedesktop.org/Tango_Desktop_Project diff --git a/examples/effects/customshader/images/accessories-calculator.png b/examples/effects/customshader/images/accessories-calculator.png new file mode 100644 index 0000000..4e7661f Binary files /dev/null and b/examples/effects/customshader/images/accessories-calculator.png differ diff --git a/examples/effects/customshader/images/accessories-text-editor.png b/examples/effects/customshader/images/accessories-text-editor.png new file mode 100644 index 0000000..33bef0b Binary files /dev/null and b/examples/effects/customshader/images/accessories-text-editor.png differ diff --git a/examples/effects/customshader/images/background.jpg b/examples/effects/customshader/images/background.jpg new file mode 100644 index 0000000..e75b388 Binary files /dev/null and b/examples/effects/customshader/images/background.jpg differ diff --git a/examples/effects/customshader/images/help-browser.png b/examples/effects/customshader/images/help-browser.png new file mode 100644 index 0000000..8ef4fae Binary files /dev/null and b/examples/effects/customshader/images/help-browser.png differ diff --git a/examples/effects/customshader/images/internet-group-chat.png b/examples/effects/customshader/images/internet-group-chat.png new file mode 100644 index 0000000..dd92d93 Binary files /dev/null and b/examples/effects/customshader/images/internet-group-chat.png differ diff --git a/examples/effects/customshader/images/internet-mail.png b/examples/effects/customshader/images/internet-mail.png new file mode 100644 index 0000000..7e6b93b Binary files /dev/null and b/examples/effects/customshader/images/internet-mail.png differ diff --git a/examples/effects/customshader/images/internet-web-browser.png b/examples/effects/customshader/images/internet-web-browser.png new file mode 100644 index 0000000..a979a92 Binary files /dev/null and b/examples/effects/customshader/images/internet-web-browser.png differ diff --git a/examples/effects/customshader/images/office-calendar.png b/examples/effects/customshader/images/office-calendar.png new file mode 100644 index 0000000..e095906 Binary files /dev/null and b/examples/effects/customshader/images/office-calendar.png differ diff --git a/examples/effects/customshader/images/system-users.png b/examples/effects/customshader/images/system-users.png new file mode 100644 index 0000000..a7f630a Binary files /dev/null and b/examples/effects/customshader/images/system-users.png differ diff --git a/examples/effects/customshader/main.cpp b/examples/effects/customshader/main.cpp new file mode 100644 index 0000000..b88a51d --- /dev/null +++ b/examples/effects/customshader/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "blurpicker.h" +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + + BlurPicker blurPicker; + blurPicker.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Application Picker")); + blurPicker.setFixedSize(400, 300); + blurPicker.show(); + + return app.exec(); +} diff --git a/examples/effects/effects.pro b/examples/effects/effects.pro index 8ba0324..4a6c8de 100644 --- a/examples/effects/effects.pro +++ b/examples/effects/effects.pro @@ -2,7 +2,8 @@ TEMPLATE = \ subdirs SUBDIRS = \ blurpicker \ - lighting + lighting \ + customshader # install target.path = $$[QT_INSTALL_EXAMPLES]/effects diff --git a/examples/graphicsview/customshader/blureffect.cpp b/examples/graphicsview/customshader/blureffect.cpp deleted file mode 100644 index 2b5237b..0000000 --- a/examples/graphicsview/customshader/blureffect.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "blureffect.h" - -#include - -BlurEffect::BlurEffect(QGraphicsItem *item) - : QGraphicsBlurEffect() - , m_baseLine(200), item(item) -{ -} - -void BlurEffect::adjustForItem() -{ - qreal y = m_baseLine - item->pos().y(); - qreal radius = qBound(0.0, y / 32, 16.0); - setBlurRadius(radius); -} - -QRectF BlurEffect::boundingRectFor(const QRectF &rect) const -{ - const_cast(this)->adjustForItem(); - return QGraphicsBlurEffect::boundingRectFor(rect); -} - -void BlurEffect::draw(QPainter *painter, QGraphicsEffectSource *source) -{ - adjustForItem(); - QGraphicsBlurEffect::draw(painter, source); -} diff --git a/examples/graphicsview/customshader/blureffect.h b/examples/graphicsview/customshader/blureffect.h deleted file mode 100644 index bf72226..0000000 --- a/examples/graphicsview/customshader/blureffect.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BLUREFFECT_H -#define BLUREFFECT_H - -#include -#include - -class BlurEffect: public QGraphicsBlurEffect -{ -public: - BlurEffect(QGraphicsItem *item); - - void setBaseLine(qreal y) { m_baseLine = y; } - - QRectF boundingRectFor(const QRectF &) const; - - void draw(QPainter *painter, QGraphicsEffectSource*); - -private: - void adjustForItem(); - -private: - qreal m_baseLine; - QGraphicsItem *item; -}; - -#endif // BLUREFFECT_H diff --git a/examples/graphicsview/customshader/blurpicker.cpp b/examples/graphicsview/customshader/blurpicker.cpp deleted file mode 100644 index de80312..0000000 --- a/examples/graphicsview/customshader/blurpicker.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "blurpicker.h" - -#include - -#include "blureffect.h" -#include "customshadereffect.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -BlurPicker::BlurPicker(QWidget *parent): QGraphicsView(parent), m_index(0.0) -{ - setBackgroundBrush(QPixmap(":/images/background.jpg")); - setScene(&m_scene); - - setupScene(); - updateIconPositions(); - - connect(&m_timeLine, SIGNAL(valueChanged(qreal)), SLOT(updateIconPositions())); - m_timeLine.setDuration(400); - - setRenderHint(QPainter::Antialiasing, true); - setFrameStyle(QFrame::NoFrame); -} - -void BlurPicker::updateIconPositions() -{ - m_index = m_timeLine.currentFrame() / 1000.0; - - qreal baseline = 0; - for (int i = 0; i < m_icons.count(); ++i) { - QGraphicsItem *icon = m_icons[i]; - qreal a = ((i + m_index) * 2 * M_PI) / m_icons.count(); - qreal xs = 170 * sin(a); - qreal ys = 100 * cos(a); - QPointF pos(xs, ys); - pos = QTransform().rotate(-20).map(pos); - pos -= QPointF(40, 40); - icon->setPos(pos); - baseline = qMax(baseline, ys); - if (i != 3) - static_cast(icon->graphicsEffect())->setBaseLine(baseline); - } - - m_scene.update(); -} - -void BlurPicker::setupScene() -{ - m_scene.setSceneRect(-200, -120, 400, 240); - - QStringList names; - names << ":/images/accessories-calculator.png"; - names << ":/images/accessories-text-editor.png"; - names << ":/images/help-browser.png"; - names << ":/images/internet-group-chat.png"; - names << ":/images/internet-mail.png"; - names << ":/images/internet-web-browser.png"; - names << ":/images/office-calendar.png"; - names << ":/images/system-users.png"; - - for (int i = 0; i < names.count(); i++) { - QPixmap pixmap(names[i]); - QGraphicsPixmapItem *icon = m_scene.addPixmap(pixmap); - icon->setZValue(1); - if (i == 3) - icon->setGraphicsEffect(new CustomShaderEffect()); - else - icon->setGraphicsEffect(new BlurEffect(icon)); - m_icons << icon; - } - - QGraphicsPixmapItem *bg = m_scene.addPixmap(QPixmap(":/images/background.jpg")); - bg->setZValue(0); - bg->setPos(-200, -150); -} - -void BlurPicker::keyPressEvent(QKeyEvent *event) -{ - if (event->key() == Qt::Key_Left) { - if (m_timeLine.state() == QTimeLine::NotRunning) { - m_timeLine.setFrameRange(m_index * 1000, m_index * 1000 - 1000); - m_timeLine.start(); - event->accept(); - } - } - - if (event->key() == Qt::Key_Right) { - if (m_timeLine.state() == QTimeLine::NotRunning) { - m_timeLine.setFrameRange(m_index * 1000, m_index * 1000 + 1000); - m_timeLine.start(); - event->accept(); - } - } -} diff --git a/examples/graphicsview/customshader/blurpicker.h b/examples/graphicsview/customshader/blurpicker.h deleted file mode 100644 index b7ea3b4..0000000 --- a/examples/graphicsview/customshader/blurpicker.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BLURPICKER_H -#define BLURPICKER_H - -#include -#include -#include - -#include "blureffect.h" - -class BlurPicker: public QGraphicsView -{ - Q_OBJECT - -public: - BlurPicker(QWidget *parent = 0); - -protected: - void keyPressEvent(QKeyEvent *event); - -private slots: - void updateIconPositions(); - -private: - void setupScene(); - -private: - qreal m_index; - QGraphicsScene m_scene; - QList m_icons; - QTimeLine m_timeLine; -}; - -#endif // BLURPICKER_H diff --git a/examples/graphicsview/customshader/blurpicker.qrc b/examples/graphicsview/customshader/blurpicker.qrc deleted file mode 100644 index e88eaca..0000000 --- a/examples/graphicsview/customshader/blurpicker.qrc +++ /dev/null @@ -1,14 +0,0 @@ - - - images/background.jpg - images/accessories-calculator.png - images/accessories-text-editor.png - images/help-browser.png - images/internet-group-chat.png - images/internet-mail.png - images/internet-web-browser.png - images/office-calendar.png - images/system-users.png - - - diff --git a/examples/graphicsview/customshader/customshader.pro b/examples/graphicsview/customshader/customshader.pro deleted file mode 100644 index bc07d7a..0000000 --- a/examples/graphicsview/customshader/customshader.pro +++ /dev/null @@ -1,10 +0,0 @@ -SOURCES += main.cpp blurpicker.cpp blureffect.cpp customshadereffect.cpp -HEADERS += blurpicker.h blureffect.h customshadereffect.h -RESOURCES += blurpicker.qrc -QT += opengl - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/blurpicker -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS blurpicker.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/graphicsview/blurpicker -INSTALLS += target sources diff --git a/examples/graphicsview/customshader/customshadereffect.cpp b/examples/graphicsview/customshader/customshadereffect.cpp deleted file mode 100644 index 293123c..0000000 --- a/examples/graphicsview/customshader/customshadereffect.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "customshadereffect.h" -#include - -static char const colorizeShaderCode[] = - "varying highp vec2 textureCoords;\n" - "uniform sampler2D imageTexture;\n" - "uniform lowp vec4 effectColor;\n" - "lowp vec4 srcPixel() {\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" - "}"; - -CustomShaderEffect::CustomShaderEffect() - : QGraphicsShaderEffect(), - color(Qt::red) -{ - setPixelShaderFragment(colorizeShaderCode); -} - -void CustomShaderEffect::setEffectColor(const QColor& c) -{ - color = c; - setUniformsDirty(); -} - -void CustomShaderEffect::setUniforms(QGLShaderProgram *program) -{ - program->setUniformValue("effectColor", color); -} diff --git a/examples/graphicsview/customshader/customshadereffect.h b/examples/graphicsview/customshader/customshadereffect.h deleted file mode 100644 index 6482bd5..0000000 --- a/examples/graphicsview/customshader/customshadereffect.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CUSTOMSHADEREFFECT_H -#define CUSTOMSHADEREFFECT_H - -#include -#include -#include - -class CustomShaderEffect: public QGraphicsShaderEffect -{ -public: - CustomShaderEffect(); - - QColor effectColor() const { return color; } - void setEffectColor(const QColor& c); - -protected: - void setUniforms(QGLShaderProgram *program); - -private: - QColor color; -}; - -#endif // CUSTOMSHADEREFFECT_H diff --git a/examples/graphicsview/customshader/main.cpp b/examples/graphicsview/customshader/main.cpp deleted file mode 100644 index b88a51d..0000000 --- a/examples/graphicsview/customshader/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "blurpicker.h" -#include - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - - BlurPicker blurPicker; - blurPicker.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Application Picker")); - blurPicker.setFixedSize(400, 300); - blurPicker.show(); - - return app.exec(); -} -- cgit v0.12