From 811be6f81b2e8c4d9d23cff5b4287c8a5dc86fc3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 6 Feb 2014 14:00:25 +0200 Subject: Change rotations to use angle and vector in APIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quaternions are pain in the behind to use, especially in QML, so change them to angle + vector combinations. Change-Id: I25eb5ea92deaf3a079e2e193cce2e8de89f3c3c4 Reviewed-by: Tomi Korpipää --- tests/directional/main.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'tests/directional/main.cpp') diff --git a/tests/directional/main.cpp b/tests/directional/main.cpp index f4871a70..2b077b97 100644 --- a/tests/directional/main.cpp +++ b/tests/directional/main.cpp @@ -32,11 +32,9 @@ int main(int argc, char **argv) { - //! [0] QApplication app(argc, argv); Q3DScatter *graph = new Q3DScatter(); QWidget *container = QWidget::createWindowContainer(graph); - //! [0] QSize screenSize = graph->screen()->size(); container->setMinimumSize(QSize(screenSize.width() / 2, screenSize.height() / 1.5)); @@ -44,17 +42,14 @@ int main(int argc, char **argv) container->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); container->setFocusPolicy(Qt::StrongFocus); - //! [1] QWidget *widget = new QWidget; QHBoxLayout *hLayout = new QHBoxLayout(widget); QVBoxLayout *vLayout = new QVBoxLayout(); hLayout->addWidget(container, 1); hLayout->addLayout(vLayout); - //! [1] widget->setWindowTitle(QStringLiteral("Directional scatter")); - //! [4] QComboBox *themeList = new QComboBox(widget); themeList->addItem(QStringLiteral("Qt")); themeList->addItem(QStringLiteral("Primary Colors")); @@ -79,7 +74,7 @@ int main(int argc, char **argv) cameraButton->setText(QStringLiteral("Change camera preset")); QPushButton *toggleRotationButton = new QPushButton(widget); - toggleRotationButton->setText(QStringLiteral("Toggle rotation")); + toggleRotationButton->setText(QStringLiteral("Toggle animation")); QCheckBox *backgroundCheckBox = new QCheckBox(widget); backgroundCheckBox->setText(QStringLiteral("Show background")); @@ -101,9 +96,7 @@ int main(int argc, char **argv) QFontComboBox *fontList = new QFontComboBox(widget); fontList->setCurrentFont(QFont("Arial")); - //! [4] - //! [5] vLayout->addWidget(labelButton, 0, Qt::AlignTop); vLayout->addWidget(cameraButton, 0, Qt::AlignTop); vLayout->addWidget(toggleRotationButton, 0, Qt::AlignTop); @@ -117,13 +110,9 @@ int main(int argc, char **argv) vLayout->addWidget(shadowQuality); vLayout->addWidget(new QLabel(QStringLiteral("Change font"))); vLayout->addWidget(fontList, 1, Qt::AlignTop); - //! [5] - //! [2] ScatterDataModifier *modifier = new ScatterDataModifier(graph); - //! [2] - //! [6] QObject::connect(cameraButton, &QPushButton::clicked, modifier, &ScatterDataModifier::changePresetCamera); QObject::connect(toggleRotationButton, &QPushButton::clicked, modifier, @@ -159,12 +148,9 @@ int main(int argc, char **argv) QObject::connect(modifier, &ScatterDataModifier::fontChanged, fontList, &QFontComboBox::setCurrentFont); - //! [6] itemStyleList->setCurrentIndex(0); - //! [3] widget->show(); return app.exec(); - //! [3] } -- cgit v1.2.3