From 806dda08d685bc5f9ed71dfe8b61f21848d48066 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 17 Aug 2012 13:23:19 +0200 Subject: Moving .qdoc files under examples/widgets/doc Updated those .qdoc files to refer to the new relative examples emplacement. Images and snippets to be moved later. Also grouped all widgets related examples under widgets. Change-Id: Ib29696e2d8948524537f53e8dda88f9ee26a597f Reviewed-by: J-P Nurmi --- .../graphicsview/padnavigator/flippablepad.cpp | 98 ------- examples/graphicsview/padnavigator/flippablepad.h | 63 ----- examples/graphicsview/padnavigator/form.ui | 208 -------------- .../padnavigator/images/artsfftscope.png | Bin 1291 -> 0 bytes .../padnavigator/images/blue_angle_swirl.jpg | Bin 11826 -> 0 bytes .../padnavigator/images/kontact_contacts.png | Bin 4382 -> 0 bytes .../padnavigator/images/kontact_journal.png | Bin 3261 -> 0 bytes .../padnavigator/images/kontact_mail.png | Bin 3202 -> 0 bytes .../padnavigator/images/kontact_notes.png | Bin 3893 -> 0 bytes .../padnavigator/images/kopeteavailable.png | Bin 2380 -> 0 bytes .../padnavigator/images/metacontact_online.png | Bin 2545 -> 0 bytes .../graphicsview/padnavigator/images/minitools.png | Bin 2087 -> 0 bytes examples/graphicsview/padnavigator/main.cpp | 55 ---- .../graphicsview/padnavigator/padnavigator.cpp | 306 --------------------- .../graphicsview/padnavigator/padnavigator.desktop | 11 - examples/graphicsview/padnavigator/padnavigator.h | 70 ----- .../graphicsview/padnavigator/padnavigator.pro | 28 -- .../graphicsview/padnavigator/padnavigator.qrc | 13 - .../graphicsview/padnavigator/roundrectitem.cpp | 113 -------- examples/graphicsview/padnavigator/roundrectitem.h | 75 ----- examples/graphicsview/padnavigator/splashitem.cpp | 83 ------ examples/graphicsview/padnavigator/splashitem.h | 61 ---- 22 files changed, 1184 deletions(-) delete mode 100644 examples/graphicsview/padnavigator/flippablepad.cpp delete mode 100644 examples/graphicsview/padnavigator/flippablepad.h delete mode 100644 examples/graphicsview/padnavigator/form.ui delete mode 100644 examples/graphicsview/padnavigator/images/artsfftscope.png delete mode 100644 examples/graphicsview/padnavigator/images/blue_angle_swirl.jpg delete mode 100644 examples/graphicsview/padnavigator/images/kontact_contacts.png delete mode 100644 examples/graphicsview/padnavigator/images/kontact_journal.png delete mode 100644 examples/graphicsview/padnavigator/images/kontact_mail.png delete mode 100644 examples/graphicsview/padnavigator/images/kontact_notes.png delete mode 100644 examples/graphicsview/padnavigator/images/kopeteavailable.png delete mode 100644 examples/graphicsview/padnavigator/images/metacontact_online.png delete mode 100644 examples/graphicsview/padnavigator/images/minitools.png delete mode 100644 examples/graphicsview/padnavigator/main.cpp delete mode 100644 examples/graphicsview/padnavigator/padnavigator.cpp delete mode 100644 examples/graphicsview/padnavigator/padnavigator.desktop delete mode 100644 examples/graphicsview/padnavigator/padnavigator.h delete mode 100644 examples/graphicsview/padnavigator/padnavigator.pro delete mode 100644 examples/graphicsview/padnavigator/padnavigator.qrc delete mode 100644 examples/graphicsview/padnavigator/roundrectitem.cpp delete mode 100644 examples/graphicsview/padnavigator/roundrectitem.h delete mode 100644 examples/graphicsview/padnavigator/splashitem.cpp delete mode 100644 examples/graphicsview/padnavigator/splashitem.h (limited to 'examples/graphicsview/padnavigator') diff --git a/examples/graphicsview/padnavigator/flippablepad.cpp b/examples/graphicsview/padnavigator/flippablepad.cpp deleted file mode 100644 index a6c44af70c..0000000000 --- a/examples/graphicsview/padnavigator/flippablepad.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 "flippablepad.h" - -#include - -//! [0] -static QRectF boundsFromSize(const QSize &size) -{ - return QRectF((-size.width() / 2.0) * 150, (-size.height() / 2.0) * 150, - size.width() * 150, size.height() * 150); -} -//! [0] - -//! [1] -static QPointF posForLocation(int column, int row, const QSize &size) -{ - return QPointF(column * 150, row * 150) - - QPointF((size.width() - 1) * 75, (size.height() - 1) * 75); -} -//! [1] - -//! [2] -FlippablePad::FlippablePad(const QSize &size, QGraphicsItem *parent) - : RoundRectItem(boundsFromSize(size), QColor(226, 255, 92, 64), parent) -{ -//! [2] -//! [3] - int numIcons = size.width() * size.height(); - QList pixmaps; - QDirIterator it(":/images", QStringList() << "*.png"); - while (it.hasNext() && pixmaps.size() < numIcons) - pixmaps << it.next(); -//! [3] - -//! [4] - const QRectF iconRect(-54, -54, 108, 108); - const QColor iconColor(214, 240, 110, 128); - iconGrid.resize(size.height()); - int n = 0; - - for (int y = 0; y < size.height(); ++y) { - iconGrid[y].resize(size.width()); - for (int x = 0; x < size.width(); ++x) { - RoundRectItem *rect = new RoundRectItem(iconRect, iconColor, this); - rect->setZValue(1); - rect->setPos(posForLocation(x, y, size)); - rect->setPixmap(pixmaps.at(n++ % pixmaps.size())); - iconGrid[y][x] = rect; - } - } -} -//! [4] - -//! [5] -RoundRectItem *FlippablePad::iconAt(int column, int row) const -{ - return iconGrid[row][column]; -} -//! [5] diff --git a/examples/graphicsview/padnavigator/flippablepad.h b/examples/graphicsview/padnavigator/flippablepad.h deleted file mode 100644 index e0d1fe24e5..0000000000 --- a/examples/graphicsview/padnavigator/flippablepad.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#ifndef FLIPPABLEPAD_H -#define FLIPPABLEPAD_H - -#include "roundrectitem.h" - -#include -#include -#include - -//! [0] -class FlippablePad : public RoundRectItem -{ -public: - FlippablePad(const QSize &size, QGraphicsItem *parent = 0); - - RoundRectItem *iconAt(int column, int row) const; - -private: - QVector > iconGrid; -}; -//! [0] - -#endif // FLIPPABLEPAD_H diff --git a/examples/graphicsview/padnavigator/form.ui b/examples/graphicsview/padnavigator/form.ui deleted file mode 100644 index fc7d12321e..0000000000 --- a/examples/graphicsview/padnavigator/form.ui +++ /dev/null @@ -1,208 +0,0 @@ - - Form - - - - 0 - 0 - 378 - 385 - - - - BackSide - - - - - - Settings - - - true - - - true - - - - - - Title: - - - - - - - Pad Navigator Example - - - - - - - Modified: - - - - - - - Extent - - - - - - - - - 42 - - - Qt::Horizontal - - - - - - - 42 - - - - - - - - - - - - - - - Other input - - - true - - - true - - - - - - - Widgets On Graphics View - - - - - QGraphicsProxyWidget - - - - QGraphicsWidget - - - - QObject - - - - - QGraphicsItem - - - - - QGraphicsLayoutItem - - - - - - - QGraphicsGridLayout - - - - QGraphicsLayout - - - - QGraphicsLayoutItem - - - - - - - QGraphicsLinearLayout - - - - QGraphicsLayout - - - - QGraphicsLayoutItem - - - - - - - - - - - - - groupBox - hostName - dateTimeEdit - horizontalSlider - spinBox - groupBox_2 - treeWidget - - - - - horizontalSlider - valueChanged(int) - spinBox - setValue(int) - - - 184 - 125 - - - 275 - 127 - - - - - spinBox - valueChanged(int) - horizontalSlider - setValue(int) - - - 272 - 114 - - - 190 - 126 - - - - - diff --git a/examples/graphicsview/padnavigator/images/artsfftscope.png b/examples/graphicsview/padnavigator/images/artsfftscope.png deleted file mode 100644 index 4db003f8d2..0000000000 Binary files a/examples/graphicsview/padnavigator/images/artsfftscope.png and /dev/null differ diff --git a/examples/graphicsview/padnavigator/images/blue_angle_swirl.jpg b/examples/graphicsview/padnavigator/images/blue_angle_swirl.jpg deleted file mode 100644 index 5bf0debdbd..0000000000 Binary files a/examples/graphicsview/padnavigator/images/blue_angle_swirl.jpg and /dev/null differ diff --git a/examples/graphicsview/padnavigator/images/kontact_contacts.png b/examples/graphicsview/padnavigator/images/kontact_contacts.png deleted file mode 100644 index 6fb4cc8f38..0000000000 Binary files a/examples/graphicsview/padnavigator/images/kontact_contacts.png and /dev/null differ diff --git a/examples/graphicsview/padnavigator/images/kontact_journal.png b/examples/graphicsview/padnavigator/images/kontact_journal.png deleted file mode 100644 index b1fedb6982..0000000000 Binary files a/examples/graphicsview/padnavigator/images/kontact_journal.png and /dev/null differ diff --git a/examples/graphicsview/padnavigator/images/kontact_mail.png b/examples/graphicsview/padnavigator/images/kontact_mail.png deleted file mode 100644 index 672f8fa3ab..0000000000 Binary files a/examples/graphicsview/padnavigator/images/kontact_mail.png and /dev/null differ diff --git a/examples/graphicsview/padnavigator/images/kontact_notes.png b/examples/graphicsview/padnavigator/images/kontact_notes.png deleted file mode 100644 index 229bf73ac6..0000000000 Binary files a/examples/graphicsview/padnavigator/images/kontact_notes.png and /dev/null differ diff --git a/examples/graphicsview/padnavigator/images/kopeteavailable.png b/examples/graphicsview/padnavigator/images/kopeteavailable.png deleted file mode 100644 index 2eaf41afec..0000000000 Binary files a/examples/graphicsview/padnavigator/images/kopeteavailable.png and /dev/null differ diff --git a/examples/graphicsview/padnavigator/images/metacontact_online.png b/examples/graphicsview/padnavigator/images/metacontact_online.png deleted file mode 100644 index 6a398dd10f..0000000000 Binary files a/examples/graphicsview/padnavigator/images/metacontact_online.png and /dev/null differ diff --git a/examples/graphicsview/padnavigator/images/minitools.png b/examples/graphicsview/padnavigator/images/minitools.png deleted file mode 100644 index 0248c9d50a..0000000000 Binary files a/examples/graphicsview/padnavigator/images/minitools.png and /dev/null differ diff --git a/examples/graphicsview/padnavigator/main.cpp b/examples/graphicsview/padnavigator/main.cpp deleted file mode 100644 index 380fde8cd9..0000000000 --- a/examples/graphicsview/padnavigator/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 "padnavigator.h" - -#include - -//! [0] -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - Q_INIT_RESOURCE(padnavigator); - - PadNavigator navigator(QSize(3, 3)); - navigator.show(); - return app.exec(); -} -//! [0] diff --git a/examples/graphicsview/padnavigator/padnavigator.cpp b/examples/graphicsview/padnavigator/padnavigator.cpp deleted file mode 100644 index fcfe84bb72..0000000000 --- a/examples/graphicsview/padnavigator/padnavigator.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 "flippablepad.h" -#include "padnavigator.h" -#include "splashitem.h" - -#include -#ifndef QT_NO_OPENGL -#include -#endif - -//! [0] -PadNavigator::PadNavigator(const QSize &size, QWidget *parent) - : QGraphicsView(parent) -{ -//! [0] -//! [1] - // Splash item - SplashItem *splash = new SplashItem; - splash->setZValue(1); -//! [1] - -//! [2] - // Pad item - FlippablePad *pad = new FlippablePad(size); - QGraphicsRotation *flipRotation = new QGraphicsRotation(pad); - QGraphicsRotation *xRotation = new QGraphicsRotation(pad); - QGraphicsRotation *yRotation = new QGraphicsRotation(pad); - flipRotation->setAxis(Qt::YAxis); - xRotation->setAxis(Qt::YAxis); - yRotation->setAxis(Qt::XAxis); - pad->setTransformations(QList() - << flipRotation - << xRotation << yRotation); -//! [2] - -//! [3] - // Back (proxy widget) item - QGraphicsProxyWidget *backItem = new QGraphicsProxyWidget(pad); - QWidget *widget = new QWidget; - form.setupUi(widget); - form.hostName->setFocus(); - backItem->setWidget(widget); - backItem->setVisible(false); - backItem->setFocus(); - backItem->setCacheMode(QGraphicsItem::ItemCoordinateCache); - const QRectF r = backItem->rect(); - backItem->setTransform(QTransform() - .rotate(180, Qt::YAxis) - .translate(-r.width()/2, -r.height()/2)); -//! [3] - -//! [4] - // Selection item - RoundRectItem *selectionItem = new RoundRectItem(QRectF(-60, -60, 120, 120), - Qt::gray, pad); - selectionItem->setZValue(0.5); -//! [4] - -//! [5] - // Splash animations - QPropertyAnimation *smoothSplashMove = new QPropertyAnimation(splash, "y"); - QPropertyAnimation *smoothSplashOpacity = new QPropertyAnimation(splash, "opacity"); - smoothSplashMove->setEasingCurve(QEasingCurve::InQuad); - smoothSplashMove->setDuration(250); - smoothSplashOpacity->setDuration(250); -//! [5] - -//! [6] - // Selection animation - QPropertyAnimation *smoothXSelection = new QPropertyAnimation(selectionItem, "x"); - QPropertyAnimation *smoothYSelection = new QPropertyAnimation(selectionItem, "y"); - QPropertyAnimation *smoothXRotation = new QPropertyAnimation(xRotation, "angle"); - QPropertyAnimation *smoothYRotation = new QPropertyAnimation(yRotation, "angle"); - smoothXSelection->setDuration(125); - smoothYSelection->setDuration(125); - smoothXRotation->setDuration(125); - smoothYRotation->setDuration(125); - smoothXSelection->setEasingCurve(QEasingCurve::InOutQuad); - smoothYSelection->setEasingCurve(QEasingCurve::InOutQuad); - smoothXRotation->setEasingCurve(QEasingCurve::InOutQuad); - smoothYRotation->setEasingCurve(QEasingCurve::InOutQuad); -//! [6] - -//! [7] - // Flip animation setup - QPropertyAnimation *smoothFlipRotation = new QPropertyAnimation(flipRotation, "angle"); - QPropertyAnimation *smoothFlipScale = new QPropertyAnimation(pad, "scale"); - QPropertyAnimation *smoothFlipXRotation = new QPropertyAnimation(xRotation, "angle"); - QPropertyAnimation *smoothFlipYRotation = new QPropertyAnimation(yRotation, "angle"); - QParallelAnimationGroup *flipAnimation = new QParallelAnimationGroup(this); - smoothFlipScale->setDuration(500); - smoothFlipRotation->setDuration(500); - smoothFlipXRotation->setDuration(500); - smoothFlipYRotation->setDuration(500); - smoothFlipScale->setEasingCurve(QEasingCurve::InOutQuad); - smoothFlipRotation->setEasingCurve(QEasingCurve::InOutQuad); - smoothFlipXRotation->setEasingCurve(QEasingCurve::InOutQuad); - smoothFlipYRotation->setEasingCurve(QEasingCurve::InOutQuad); - smoothFlipScale->setKeyValueAt(0, qvariant_cast(1.0)); - smoothFlipScale->setKeyValueAt(0.5, qvariant_cast(0.7)); - smoothFlipScale->setKeyValueAt(1, qvariant_cast(1.0)); - flipAnimation->addAnimation(smoothFlipRotation); - flipAnimation->addAnimation(smoothFlipScale); - flipAnimation->addAnimation(smoothFlipXRotation); - flipAnimation->addAnimation(smoothFlipYRotation); -//! [7] - -//! [8] - // Flip animation delayed property assignment - QSequentialAnimationGroup *setVariablesSequence = new QSequentialAnimationGroup; - QPropertyAnimation *setFillAnimation = new QPropertyAnimation(pad, "fill"); - QPropertyAnimation *setBackItemVisibleAnimation = new QPropertyAnimation(backItem, "visible"); - QPropertyAnimation *setSelectionItemVisibleAnimation = new QPropertyAnimation(selectionItem, "visible"); - setFillAnimation->setDuration(0); - setBackItemVisibleAnimation->setDuration(0); - setSelectionItemVisibleAnimation->setDuration(0); - setVariablesSequence->addPause(250); - setVariablesSequence->addAnimation(setBackItemVisibleAnimation); - setVariablesSequence->addAnimation(setSelectionItemVisibleAnimation); - setVariablesSequence->addAnimation(setFillAnimation); - flipAnimation->addAnimation(setVariablesSequence); -//! [8] - -//! [9] - // Build the state machine - QStateMachine *stateMachine = new QStateMachine(this); - QState *splashState = new QState(stateMachine); - QState *frontState = new QState(stateMachine); - QHistoryState *historyState = new QHistoryState(frontState); - QState *backState = new QState(stateMachine); -//! [9] -//! [10] - frontState->assignProperty(pad, "fill", false); - frontState->assignProperty(splash, "opacity", 0.0); - frontState->assignProperty(backItem, "visible", false); - frontState->assignProperty(flipRotation, "angle", qvariant_cast(0.0)); - frontState->assignProperty(selectionItem, "visible", true); - backState->assignProperty(pad, "fill", true); - backState->assignProperty(backItem, "visible", true); - backState->assignProperty(xRotation, "angle", qvariant_cast(0.0)); - backState->assignProperty(yRotation, "angle", qvariant_cast(0.0)); - backState->assignProperty(flipRotation, "angle", qvariant_cast(180.0)); - backState->assignProperty(selectionItem, "visible", false); - stateMachine->addDefaultAnimation(smoothXRotation); - stateMachine->addDefaultAnimation(smoothYRotation); - stateMachine->addDefaultAnimation(smoothXSelection); - stateMachine->addDefaultAnimation(smoothYSelection); - stateMachine->setInitialState(splashState); -//! [10] - -//! [11] - // Transitions - QEventTransition *anyKeyTransition = new QEventTransition(this, QEvent::KeyPress, splashState); - anyKeyTransition->setTargetState(frontState); - anyKeyTransition->addAnimation(smoothSplashMove); - anyKeyTransition->addAnimation(smoothSplashOpacity); -//! [11] - -//! [12] - QKeyEventTransition *enterTransition = new QKeyEventTransition(this, QEvent::KeyPress, - Qt::Key_Enter, backState); - QKeyEventTransition *returnTransition = new QKeyEventTransition(this, QEvent::KeyPress, - Qt::Key_Return, backState); - QKeyEventTransition *backEnterTransition = new QKeyEventTransition(this, QEvent::KeyPress, - Qt::Key_Enter, frontState); - QKeyEventTransition *backReturnTransition = new QKeyEventTransition(this, QEvent::KeyPress, - Qt::Key_Return, frontState); - enterTransition->setTargetState(historyState); - returnTransition->setTargetState(historyState); - backEnterTransition->setTargetState(backState); - backReturnTransition->setTargetState(backState); - enterTransition->addAnimation(flipAnimation); - returnTransition->addAnimation(flipAnimation); - backEnterTransition->addAnimation(flipAnimation); - backReturnTransition->addAnimation(flipAnimation); -//! [12] - -//! [13] - // Create substates for each icon; store in temporary grid. - int columns = size.width(); - int rows = size.height(); - QVector< QVector< QState * > > stateGrid; - stateGrid.resize(rows); - for (int y = 0; y < rows; ++y) { - stateGrid[y].resize(columns); - for (int x = 0; x < columns; ++x) - stateGrid[y][x] = new QState(frontState); - } - frontState->setInitialState(stateGrid[0][0]); - selectionItem->setPos(pad->iconAt(0, 0)->pos()); -//! [13] - -//! [14] - // Enable key navigation using state transitions - for (int y = 0; y < rows; ++y) { - for (int x = 0; x < columns; ++x) { - QState *state = stateGrid[y][x]; - QKeyEventTransition *rightTransition = new QKeyEventTransition(this, QEvent::KeyPress, - Qt::Key_Right, state); - QKeyEventTransition *leftTransition = new QKeyEventTransition(this, QEvent::KeyPress, - Qt::Key_Left, state); - QKeyEventTransition *downTransition = new QKeyEventTransition(this, QEvent::KeyPress, - Qt::Key_Down, state); - QKeyEventTransition *upTransition = new QKeyEventTransition(this, QEvent::KeyPress, - Qt::Key_Up, state); - rightTransition->setTargetState(stateGrid[y][(x + 1) % columns]); - leftTransition->setTargetState(stateGrid[y][((x - 1) + columns) % columns]); - downTransition->setTargetState(stateGrid[(y + 1) % rows][x]); - upTransition->setTargetState(stateGrid[((y - 1) + rows) % rows][x]); -//! [14] -//! [15] - RoundRectItem *icon = pad->iconAt(x, y); - state->assignProperty(xRotation, "angle", -icon->x() / 6.0); - state->assignProperty(yRotation, "angle", icon->y() / 6.0); - state->assignProperty(selectionItem, "x", icon->x()); - state->assignProperty(selectionItem, "y", icon->y()); - frontState->assignProperty(icon, "visible", true); - backState->assignProperty(icon, "visible", false); - - QPropertyAnimation *setIconVisibleAnimation = new QPropertyAnimation(icon, "visible"); - setIconVisibleAnimation->setDuration(0); - setVariablesSequence->addAnimation(setIconVisibleAnimation); - } - } -//! [15] - -//! [16] - // Scene - QGraphicsScene *scene = new QGraphicsScene(this); - scene->setBackgroundBrush(QPixmap(":/images/blue_angle_swirl.jpg")); - scene->setItemIndexMethod(QGraphicsScene::NoIndex); - scene->addItem(pad); - scene->setSceneRect(scene->itemsBoundingRect()); - setScene(scene); -//! [16] - -//! [17] - // Adjust splash item to scene contents - const QRectF sbr = splash->boundingRect(); - splash->setPos(-sbr.width() / 2, scene->sceneRect().top() - 2); - frontState->assignProperty(splash, "y", splash->y() - 100.0); - scene->addItem(splash); -//! [17] - -//! [18] - // View - setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setMinimumSize(50, 50); - setViewportUpdateMode(FullViewportUpdate); - setCacheMode(CacheBackground); - setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing); -#ifndef QT_NO_OPENGL - setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); -#endif - - stateMachine->start(); -//! [18] -} - -//! [19] -void PadNavigator::resizeEvent(QResizeEvent *event) -{ - QGraphicsView::resizeEvent(event); - fitInView(scene()->sceneRect(), Qt::KeepAspectRatio); -} -//! [19] diff --git a/examples/graphicsview/padnavigator/padnavigator.desktop b/examples/graphicsview/padnavigator/padnavigator.desktop deleted file mode 100644 index f0490730c6..0000000000 --- a/examples/graphicsview/padnavigator/padnavigator.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=Pad Navigator -Exec=/opt/usr/bin/padnavigator -Icon=padnavigator -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/graphicsview/padnavigator/padnavigator.h b/examples/graphicsview/padnavigator/padnavigator.h deleted file mode 100644 index 659b901f5c..0000000000 --- a/examples/graphicsview/padnavigator/padnavigator.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#ifndef PADNAVIGATOR_H -#define PADNAVIGATOR_H - -#include -#include "ui_form.h" - -QT_BEGIN_NAMESPACE - -class QState; -class QStateMachine; -class Ui_Form; - -QT_END_NAMESPACE - -//! [0] -class PadNavigator : public QGraphicsView -{ - Q_OBJECT -public: - explicit PadNavigator(const QSize &size, QWidget *parent = 0); - -protected: - void resizeEvent(QResizeEvent *event); - -private: - Ui_Form form; -}; -//! [0] - -#endif // PADNAVIGATOR_H diff --git a/examples/graphicsview/padnavigator/padnavigator.pro b/examples/graphicsview/padnavigator/padnavigator.pro deleted file mode 100644 index 4b9733bb9b..0000000000 --- a/examples/graphicsview/padnavigator/padnavigator.pro +++ /dev/null @@ -1,28 +0,0 @@ -SOURCES += main.cpp \ - roundrectitem.cpp \ - flippablepad.cpp \ - padnavigator.cpp \ - splashitem.cpp - -HEADERS += \ - roundrectitem.h \ - flippablepad.h \ - padnavigator.h \ - splashitem.h - -RESOURCES += \ - padnavigator.qrc - -FORMS += \ - form.ui - -QT += widgets -contains(QT_CONFIG, opengl):QT += opengl - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/padnavigator -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS padnavigator.pro images -sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/padnavigator -INSTALLS += target sources - -CONFIG += console diff --git a/examples/graphicsview/padnavigator/padnavigator.qrc b/examples/graphicsview/padnavigator/padnavigator.qrc deleted file mode 100644 index b26ab92ae1..0000000000 --- a/examples/graphicsview/padnavigator/padnavigator.qrc +++ /dev/null @@ -1,13 +0,0 @@ - - - images/blue_angle_swirl.jpg - images/artsfftscope.png - images/kontact_contacts.png - images/kontact_journal.png - images/kontact_mail.png - images/kontact_notes.png - images/kopeteavailable.png - images/metacontact_online.png - images/minitools.png - - diff --git a/examples/graphicsview/padnavigator/roundrectitem.cpp b/examples/graphicsview/padnavigator/roundrectitem.cpp deleted file mode 100644 index 1438db3a9c..0000000000 --- a/examples/graphicsview/padnavigator/roundrectitem.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 "roundrectitem.h" - -#include - -//! [0] -RoundRectItem::RoundRectItem(const QRectF &bounds, const QColor &color, - QGraphicsItem *parent) - : QGraphicsObject(parent), fillRect(false), bounds(bounds) -{ - gradient.setStart(bounds.topLeft()); - gradient.setFinalStop(bounds.bottomRight()); - gradient.setColorAt(0, color); - gradient.setColorAt(1, color.dark(200)); - setCacheMode(ItemCoordinateCache); -} -//! [0] - -//! [1] -QPixmap RoundRectItem::pixmap() const -{ - return pix; -} -void RoundRectItem::setPixmap(const QPixmap &pixmap) -{ - pix = pixmap; - update(); -} -//! [1] - -//! [2] -QRectF RoundRectItem::boundingRect() const -{ - return bounds.adjusted(0, 0, 2, 2); -} -//! [2] - -//! [3] -void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget) -{ - Q_UNUSED(option); - Q_UNUSED(widget); - painter->setPen(Qt::NoPen); - painter->setBrush(QColor(0, 0, 0, 64)); - painter->drawRoundRect(bounds.translated(2, 2)); -//! [3] -//! [4] - if (fillRect) - painter->setBrush(QApplication::palette().brush(QPalette::Window)); - else - painter->setBrush(gradient); - painter->setPen(QPen(Qt::black, 1)); - painter->drawRoundRect(bounds); -//! [4] -//! [5] - if (!pix.isNull()) { - painter->scale(1.95, 1.95); - painter->drawPixmap(-pix.width() / 2, -pix.height() / 2, pix); - } -} -//! [5] - -//! [6] -bool RoundRectItem::fill() const -{ - return fillRect; -} -void RoundRectItem::setFill(bool fill) -{ - fillRect = fill; - update(); -} -//! [6] diff --git a/examples/graphicsview/padnavigator/roundrectitem.h b/examples/graphicsview/padnavigator/roundrectitem.h deleted file mode 100644 index af84984d49..0000000000 --- a/examples/graphicsview/padnavigator/roundrectitem.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#ifndef ROUNDRECTITEM_H -#define ROUNDRECTITEM_H - -#include -#include - -//! [0] -class RoundRectItem : public QGraphicsObject -{ - Q_OBJECT - Q_PROPERTY(bool fill READ fill WRITE setFill) -public: - RoundRectItem(const QRectF &bounds, const QColor &color, - QGraphicsItem *parent = 0); - - QPixmap pixmap() const; - void setPixmap(const QPixmap &pixmap); - - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); - - bool fill() const; - void setFill(bool fill); -//! [0] - -//! [1] -private: - QPixmap pix; - bool fillRect; - QRectF bounds; - QLinearGradient gradient; -}; -//! [1] - -#endif // ROUNDRECTITEM_H diff --git a/examples/graphicsview/padnavigator/splashitem.cpp b/examples/graphicsview/padnavigator/splashitem.cpp deleted file mode 100644 index d87e8333bd..0000000000 --- a/examples/graphicsview/padnavigator/splashitem.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 "splashitem.h" - -#include - -//! [0] -SplashItem::SplashItem(QGraphicsItem *parent) - : QGraphicsObject(parent) -{ - text = tr("Welcome to the Pad Navigator Example. You can use the" - " keyboard arrows to navigate the icons, and press enter" - " to activate an item. Press any key to begin."); - setCacheMode(DeviceCoordinateCache); -} -//! [0] - -//! [1] -QRectF SplashItem::boundingRect() const -{ - return QRectF(0, 0, 400, 175); -} -//! [1] - -//! [2] -void SplashItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget) -{ - Q_UNUSED(option); - Q_UNUSED(widget); - painter->setPen(QPen(Qt::black, 2)); - painter->setBrush(QColor(245, 245, 255, 220)); - painter->setClipRect(boundingRect()); - painter->drawRoundRect(3, -100 + 3, 400 - 6, 250 - 6); - - QRectF textRect = boundingRect().adjusted(10, 10, -10, -10); - int flags = Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap; - - QFont font; - font.setPixelSize(18); - painter->setPen(Qt::black); - painter->setFont(font); - painter->drawText(textRect, flags, text); -} -//! [2] diff --git a/examples/graphicsview/padnavigator/splashitem.h b/examples/graphicsview/padnavigator/splashitem.h deleted file mode 100644 index bc0917e3de..0000000000 --- a/examples/graphicsview/padnavigator/splashitem.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#ifndef SPLASHITEM_H -#define SPLASHITEM_H - -#include - -//! [0] -class SplashItem : public QGraphicsObject -{ - Q_OBJECT -public: - explicit SplashItem(QGraphicsItem *parent = 0); - - QRectF boundingRect() const; - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); - -private: - QString text; -}; -//! [0] - -#endif // SPLASHITEM_H -- cgit v1.2.3