summaryrefslogtreecommitdiffstats
path: root/examples/graphicsview
diff options
context:
space:
mode:
Diffstat (limited to 'examples/graphicsview')
-rw-r--r--examples/graphicsview/diagramscene/mainwindow.cpp12
-rw-r--r--examples/graphicsview/dragdroprobot/robot.cpp4
-rw-r--r--examples/graphicsview/flowlayout/flowlayout.pro6
-rw-r--r--examples/graphicsview/padnavigator/padnavigator.cpp14
4 files changed, 17 insertions, 19 deletions
diff --git a/examples/graphicsview/diagramscene/mainwindow.cpp b/examples/graphicsview/diagramscene/mainwindow.cpp
index 3b4ac04..87eb33e 100644
--- a/examples/graphicsview/diagramscene/mainwindow.cpp
+++ b/examples/graphicsview/diagramscene/mainwindow.cpp
@@ -236,7 +236,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]
@@ -247,7 +247,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]
@@ -258,7 +258,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]
@@ -266,21 +266,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 d9744b0..9494e7a 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/flowlayout/flowlayout.pro b/examples/graphicsview/flowlayout/flowlayout.pro
index c029d6c..ce35367 100644
--- a/examples/graphicsview/flowlayout/flowlayout.pro
+++ b/examples/graphicsview/flowlayout/flowlayout.pro
@@ -1,12 +1,10 @@
-######################################################################
-# Automatically generated by qmake (2.01a) ma 30. mar 12:46:15 2009
-######################################################################
-
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
+QMAKE_PROJECT_NAME = flowlayout_graphicsview
+
# Input
HEADERS += flowlayout.h window.h
SOURCES += flowlayout.cpp main.cpp window.cpp
diff --git a/examples/graphicsview/padnavigator/padnavigator.cpp b/examples/graphicsview/padnavigator/padnavigator.cpp
index 22962d9..3e57dcf 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);