diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-08-19 10:04:39 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-08-19 10:04:39 (GMT) |
commit | a226143eeda6771efc4f0df6955351336735cb60 (patch) | |
tree | a279f87d74f5929e36fe6a3aa5e4f4d843b32458 /examples/graphicsview | |
parent | c02ad51733d0a2885ddb39cb7e3b09355ab97213 (diff) | |
parent | ffbce9839f8be5c2f21cc66b617dbeb0a47af269 (diff) | |
download | Qt-a226143eeda6771efc4f0df6955351336735cb60.zip Qt-a226143eeda6771efc4f0df6955351336735cb60.tar.gz Qt-a226143eeda6771efc4f0df6955351336735cb60.tar.bz2 |
Merge remote branch 'qt/master' into lighthouse-master
Diffstat (limited to 'examples/graphicsview')
-rw-r--r-- | examples/graphicsview/diagramscene/mainwindow.cpp | 12 | ||||
-rw-r--r-- | examples/graphicsview/dragdroprobot/robot.cpp | 4 | ||||
-rw-r--r-- | examples/graphicsview/padnavigator/padnavigator.cpp | 14 |
3 files changed, 15 insertions, 15 deletions
diff --git a/examples/graphicsview/diagramscene/mainwindow.cpp b/examples/graphicsview/diagramscene/mainwindow.cpp index f09c552..e4fe633 100644 --- a/examples/graphicsview/diagramscene/mainwindow.cpp +++ b/examples/graphicsview/diagramscene/mainwindow.cpp @@ -224,7 +224,7 @@ void MainWindow::textColorChanged() textAction = qobject_cast<QAction *>(sender()); fontColorToolButton->setIcon(createColorToolButtonIcon( ":/images/textpointer.png", - qVariantValue<QColor>(textAction->data()))); + qvariant_cast<QColor>(textAction->data()))); textButtonTriggered(); } //! [12] @@ -235,7 +235,7 @@ void MainWindow::itemColorChanged() fillAction = qobject_cast<QAction *>(sender()); fillColorToolButton->setIcon(createColorToolButtonIcon( ":/images/floodfill.png", - qVariantValue<QColor>(fillAction->data()))); + qvariant_cast<QColor>(fillAction->data()))); fillButtonTriggered(); } //! [13] @@ -246,7 +246,7 @@ void MainWindow::lineColorChanged() lineAction = qobject_cast<QAction *>(sender()); lineColorToolButton->setIcon(createColorToolButtonIcon( ":/images/linecolor.png", - qVariantValue<QColor>(lineAction->data()))); + qvariant_cast<QColor>(lineAction->data()))); lineButtonTriggered(); } //! [14] @@ -254,21 +254,21 @@ void MainWindow::lineColorChanged() //! [15] void MainWindow::textButtonTriggered() { - scene->setTextColor(qVariantValue<QColor>(textAction->data())); + scene->setTextColor(qvariant_cast<QColor>(textAction->data())); } //! [15] //! [16] void MainWindow::fillButtonTriggered() { - scene->setItemColor(qVariantValue<QColor>(fillAction->data())); + scene->setItemColor(qvariant_cast<QColor>(fillAction->data())); } //! [16] //! [17] void MainWindow::lineButtonTriggered() { - scene->setLineColor(qVariantValue<QColor>(lineAction->data())); + scene->setLineColor(qvariant_cast<QColor>(lineAction->data())); } //! [17] diff --git a/examples/graphicsview/dragdroprobot/robot.cpp b/examples/graphicsview/dragdroprobot/robot.cpp index 44ecda3..caca309 100644 --- a/examples/graphicsview/dragdroprobot/robot.cpp +++ b/examples/graphicsview/dragdroprobot/robot.cpp @@ -77,7 +77,7 @@ void RobotPart::dropEvent(QGraphicsSceneDragDropEvent *event) { dragOver = false; if (event->mimeData()->hasColor()) - color = qVariantValue<QColor>(event->mimeData()->colorData()); + color = qvariant_cast<QColor>(event->mimeData()->colorData()); update(); } //! [3] @@ -139,7 +139,7 @@ void RobotHead::dropEvent(QGraphicsSceneDragDropEvent *event) { if (event->mimeData()->hasImage()) { dragOver = false; - pixmap = qVariantValue<QPixmap>(event->mimeData()->imageData()); + pixmap = qvariant_cast<QPixmap>(event->mimeData()->imageData()); update(); } else { RobotPart::dropEvent(event); diff --git a/examples/graphicsview/padnavigator/padnavigator.cpp b/examples/graphicsview/padnavigator/padnavigator.cpp index 4988664..3ea68de 100644 --- a/examples/graphicsview/padnavigator/padnavigator.cpp +++ b/examples/graphicsview/padnavigator/padnavigator.cpp @@ -135,9 +135,9 @@ PadNavigator::PadNavigator(const QSize &size, QWidget *parent) smoothFlipRotation->setEasingCurve(QEasingCurve::InOutQuad); smoothFlipXRotation->setEasingCurve(QEasingCurve::InOutQuad); smoothFlipYRotation->setEasingCurve(QEasingCurve::InOutQuad); - smoothFlipScale->setKeyValueAt(0, qVariantValue<qreal>(1.0)); - smoothFlipScale->setKeyValueAt(0.5, qVariantValue<qreal>(0.7)); - smoothFlipScale->setKeyValueAt(1, qVariantValue<qreal>(1.0)); + smoothFlipScale->setKeyValueAt(0, qvariant_cast<qreal>(1.0)); + smoothFlipScale->setKeyValueAt(0.5, qvariant_cast<qreal>(0.7)); + smoothFlipScale->setKeyValueAt(1, qvariant_cast<qreal>(1.0)); flipAnimation->addAnimation(smoothFlipRotation); flipAnimation->addAnimation(smoothFlipScale); flipAnimation->addAnimation(smoothFlipXRotation); @@ -172,13 +172,13 @@ PadNavigator::PadNavigator(const QSize &size, QWidget *parent) frontState->assignProperty(pad, "fill", false); frontState->assignProperty(splash, "opacity", 0.0); frontState->assignProperty(backItem, "visible", false); - frontState->assignProperty(flipRotation, "angle", qVariantValue<qreal>(0.0)); + frontState->assignProperty(flipRotation, "angle", qvariant_cast<qreal>(0.0)); frontState->assignProperty(selectionItem, "visible", true); backState->assignProperty(pad, "fill", true); backState->assignProperty(backItem, "visible", true); - backState->assignProperty(xRotation, "angle", qVariantValue<qreal>(0.0)); - backState->assignProperty(yRotation, "angle", qVariantValue<qreal>(0.0)); - backState->assignProperty(flipRotation, "angle", qVariantValue<qreal>(180.0)); + backState->assignProperty(xRotation, "angle", qvariant_cast<qreal>(0.0)); + backState->assignProperty(yRotation, "angle", qvariant_cast<qreal>(0.0)); + backState->assignProperty(flipRotation, "angle", qvariant_cast<qreal>(180.0)); backState->assignProperty(selectionItem, "visible", false); stateMachine->addDefaultAnimation(smoothXRotation); stateMachine->addDefaultAnimation(smoothYRotation); |