diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/animation/easing/animation.h | 6 | ||||
-rw-r--r-- | examples/animation/stickman/lifecycle.cpp | 2 | ||||
-rw-r--r-- | examples/statemachine/factorial/main.cpp | 6 | ||||
-rw-r--r-- | examples/statemachine/rogue/movementtransition.h | 6 | ||||
-rw-r--r-- | examples/webkit/formextractor/formextractor.cpp | 14 |
5 files changed, 17 insertions, 17 deletions
diff --git a/examples/animation/easing/animation.h b/examples/animation/easing/animation.h index 78fdc14..bd58be0 100644 --- a/examples/animation/easing/animation.h +++ b/examples/animation/easing/animation.h @@ -68,7 +68,7 @@ public: m_path = QPainterPath(); } - void updateCurrentTime() + void updateCurrentTime(int currentTime) { if (m_pathType == CirclePath) { if (m_path.isEmpty()) { @@ -78,7 +78,7 @@ public: m_path.addEllipse(QRectF(from, to)); } int dura = duration(); - const qreal progress = ((dura == 0) ? 1 : ((((currentTime() - 1) % dura) + 1) / qreal(dura))); + const qreal progress = ((dura == 0) ? 1 : ((((currentTime - 1) % dura) + 1) / qreal(dura))); qreal easedProgress = easingCurve().valueForProgress(progress); if (easedProgress > 1.0) { @@ -90,7 +90,7 @@ public: updateCurrentValue(pt); emit valueChanged(pt); } else { - QPropertyAnimation::updateCurrentTime(); + QPropertyAnimation::updateCurrentTime(currentTime); } } diff --git a/examples/animation/stickman/lifecycle.cpp b/examples/animation/stickman/lifecycle.cpp index f5dca74..250fb85 100644 --- a/examples/animation/stickman/lifecycle.cpp +++ b/examples/animation/stickman/lifecycle.cpp @@ -64,7 +64,7 @@ public: virtual bool eventTest(QEvent *e) { if (QSignalTransition::eventTest(e)) { - QVariant key = static_cast<QSignalEvent*>(e)->arguments().at(0); + QVariant key = static_cast<QStateMachine::SignalEvent*>(e)->arguments().at(0); return (key.toInt() == int(m_key)); } diff --git a/examples/statemachine/factorial/main.cpp b/examples/statemachine/factorial/main.cpp index 54f4ec0..018b84f 100644 --- a/examples/statemachine/factorial/main.cpp +++ b/examples/statemachine/factorial/main.cpp @@ -98,13 +98,13 @@ public: { if (!QSignalTransition::eventTest(e)) return false; - QSignalEvent *se = static_cast<QSignalEvent*>(e); + QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e); return se->arguments().at(0).toInt() > 1; } virtual void onTransition(QEvent *e) { - QSignalEvent *se = static_cast<QSignalEvent*>(e); + QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e); int x = se->arguments().at(0).toInt(); int fac = m_fact->property("fac").toInt(); m_fact->setProperty("fac", x * fac); @@ -128,7 +128,7 @@ public: { if (!QSignalTransition::eventTest(e)) return false; - QSignalEvent *se = static_cast<QSignalEvent*>(e); + QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e); return se->arguments().at(0).toInt() <= 1; } diff --git a/examples/statemachine/rogue/movementtransition.h b/examples/statemachine/rogue/movementtransition.h index dbaf8d9..b919360 100644 --- a/examples/statemachine/rogue/movementtransition.h +++ b/examples/statemachine/rogue/movementtransition.h @@ -62,8 +62,8 @@ public: protected: bool eventTest(QEvent *event) { if (event->type() == QEvent::Wrapped && - static_cast<QWrappedEvent *>(event)->event()->type() == QEvent::KeyPress) { - QEvent *wrappedEvent = static_cast<QWrappedEvent *>(event)->event(); + static_cast<QStateMachine::WrappedEvent *>(event)->event()->type() == QEvent::KeyPress) { + QEvent *wrappedEvent = static_cast<QStateMachine::WrappedEvent *>(event)->event(); QKeyEvent *keyEvent = static_cast<QKeyEvent *>(wrappedEvent); int key = keyEvent->key(); @@ -78,7 +78,7 @@ protected: //![2] void onTransition(QEvent *event) { QKeyEvent *keyEvent = static_cast<QKeyEvent *>( - static_cast<QWrappedEvent *>(event)->event()); + static_cast<QStateMachine::WrappedEvent *>(event)->event()); int key = keyEvent->key(); switch (key) { diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp index 10bd9af..3ce888c 100644 --- a/examples/webkit/formextractor/formextractor.cpp +++ b/examples/webkit/formextractor/formextractor.cpp @@ -67,15 +67,15 @@ void FormExtractor::submit() QWebElement femaleGender = frame->findFirstElement("#genderFemale"); QWebElement updates = frame->findFirstElement("#updates"); - ui.firstNameEdit->setText(firstName.scriptableProperty("value").toString()); - ui.lastNameEdit->setText(lastName.scriptableProperty("value").toString()); + ui.firstNameEdit->setText(firstName.evaluateScript("this.value").toString()); + ui.lastNameEdit->setText(lastName.evaluateScript("this.value").toString()); - if (maleGender.scriptableProperty("checked").toBool()) - ui.genderEdit->setText(maleGender.scriptableProperty("value").toString()); - else if (femaleGender.scriptableProperty("checked").toBool()) - ui.genderEdit->setText(femaleGender.scriptableProperty("value").toString()); + if (maleGender.evaluateScript("this.checked").toBool()) + ui.genderEdit->setText(maleGender.evaluateScript("this.value").toString()); + else if (femaleGender.evaluateScript("this.checked").toBool()) + ui.genderEdit->setText(femaleGender.evaluateScript("this.value").toString()); - if (updates.scriptableProperty("checked").toBool()) + if (updates.evaluateScript("this.checked").toBool()) ui.updatesEdit->setText("Yes"); else ui.updatesEdit->setText("No"); |