summaryrefslogtreecommitdiffstats
path: root/examples/webkit/fancybrowser
diff options
context:
space:
mode:
authorDerick Hawcroft <derick.hawcroft@nokia.com>2009-11-23 03:36:20 (GMT)
committerDerick Hawcroft <derick.hawcroft@nokia.com>2009-11-23 03:36:20 (GMT)
commit0cadaf8932355d1fc9cc560d405a3915aeac7d5a (patch)
treef654169a39839dc43a703716fa40fb8d4a63d513 /examples/webkit/fancybrowser
parent0186faea383f3f8223bffd1844e5a47ca22770a5 (diff)
parentc74a5ae953899b9109ef56b2057b094152616480 (diff)
downloadQt-0cadaf8932355d1fc9cc560d405a3915aeac7d5a.zip
Qt-0cadaf8932355d1fc9cc560d405a3915aeac7d5a.tar.gz
Qt-0cadaf8932355d1fc9cc560d405a3915aeac7d5a.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'examples/webkit/fancybrowser')
-rw-r--r--examples/webkit/fancybrowser/mainwindow.cpp10
-rw-r--r--examples/webkit/fancybrowser/mainwindow.h3
2 files changed, 8 insertions, 5 deletions
diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp
index 11fac91..844106f 100644
--- a/examples/webkit/fancybrowser/mainwindow.cpp
+++ b/examples/webkit/fancybrowser/mainwindow.cpp
@@ -62,7 +62,7 @@ MainWindow::MainWindow()
view = new QWebView(this);
view->load(QUrl("http://www.google.com/ncr"));
connect(view, SIGNAL(loadFinished(bool)), SLOT(adjustLocation()));
- connect(view, SIGNAL(titleChanged(const QString&)), SLOT(adjustTitle()));
+ connect(view, SIGNAL(titleChanged(QString)), SLOT(adjustTitle()));
connect(view, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
connect(view, SIGNAL(loadFinished(bool)), SLOT(finishLoading(bool)));
@@ -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)') } )";
diff --git a/examples/webkit/fancybrowser/mainwindow.h b/examples/webkit/fancybrowser/mainwindow.h
index 33fd8f5..214d84b 100644
--- a/examples/webkit/fancybrowser/mainwindow.h
+++ b/examples/webkit/fancybrowser/mainwindow.h
@@ -63,7 +63,7 @@ protected slots:
void finishLoading(bool);
void highlightAllLinks();
- void rotateImages(bool toggle);
+ void rotateImages(bool invert);
void removeGifImages();
void removeInlineFrames();
void removeObjectElements();
@@ -73,6 +73,7 @@ private:
QString jQuery;
QWebView *view;
QLineEdit *locationEdit;
+ QAction *rotateAction;
int progress;
//! [1]
};