diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-11-19 12:00:31 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-11-19 12:07:15 (GMT) |
commit | 8e401cd4ae0133531613a3e097acc57979d78f50 (patch) | |
tree | 58e7572913a2c0d38af6a321fc44a5566a9b859d /examples/webkit/fancybrowser/mainwindow.cpp | |
parent | a1e1867ae3cac6b54cd06e9fc0ad1aa0b476fe9d (diff) | |
parent | 732e0d01df867200546ddb5e6f8695f263e1ee0d (diff) | |
download | Qt-8e401cd4ae0133531613a3e097acc57979d78f50.zip Qt-8e401cd4ae0133531613a3e097acc57979d78f50.tar.gz Qt-8e401cd4ae0133531613a3e097acc57979d78f50.tar.bz2 |
Merge branch '4.6' of oslo-staging-1 into 4.6
Diffstat (limited to 'examples/webkit/fancybrowser/mainwindow.cpp')
-rw-r--r-- | examples/webkit/fancybrowser/mainwindow.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp index aa84871..844106f 100644 --- a/examples/webkit/fancybrowser/mainwindow.cpp +++ b/examples/webkit/fancybrowser/mainwindow.cpp @@ -82,7 +82,7 @@ MainWindow::MainWindow() QMenu *effectMenu = menuBar()->addMenu(tr("&Effect")); effectMenu->addAction("Highlight all links", this, SLOT(highlightAllLinks())); - QAction *rotateAction = new QAction(this); + rotateAction = new QAction(this); rotateAction->setIcon(style()->standardIcon(QStyle::SP_FileDialogDetailedView)); rotateAction->setCheckable(true); rotateAction->setText(tr("Turn images upside down")); @@ -136,6 +136,8 @@ void MainWindow::finishLoading(bool) progress = 100; adjustTitle(); view->page()->mainFrame()->evaluateJavaScript(jQuery); + + rotateImages(rotateAction->isChecked()); } //! [6] @@ -148,10 +150,10 @@ void MainWindow::highlightAllLinks() //! [7] //! [8] -void MainWindow::rotateImages(bool toggle) +void MainWindow::rotateImages(bool invert) { QString code; - if (toggle) + if (invert) code = "$('img').each( function () { $(this).css('-webkit-transition', '-webkit-transform 2s'); $(this).css('-webkit-transform', 'rotate(180deg)') } )"; else code = "$('img').each( function () { $(this).css('-webkit-transition', '-webkit-transform 2s'); $(this).css('-webkit-transform', 'rotate(0deg)') } )"; |