summaryrefslogtreecommitdiffstats
path: root/demos/embedded/anomaly/src/webview.h
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2010-01-18 15:10:24 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-01-18 15:10:24 (GMT)
commitee889d2404f6a55a8fae812dc5809dc805905d2b (patch)
tree1a21a11c5efef138b1244cecfadd00e9e3875e5d /demos/embedded/anomaly/src/webview.h
parent4974742bb85b5f22ade3e1a59c2b5fe7ac84e684 (diff)
downloadQt-ee889d2404f6a55a8fae812dc5809dc805905d2b.zip
Qt-ee889d2404f6a55a8fae812dc5809dc805905d2b.tar.gz
Qt-ee889d2404f6a55a8fae812dc5809dc805905d2b.tar.bz2
Avoid painting while loading in the anomaly demo browser
At load time, loading, layouting and painting are fighting for the CPU. By skipping painting and layouting, we achieve a better loading time, and the experience is better.
Diffstat (limited to 'demos/embedded/anomaly/src/webview.h')
-rw-r--r--demos/embedded/anomaly/src/webview.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/demos/embedded/anomaly/src/webview.h b/demos/embedded/anomaly/src/webview.h
new file mode 100644
index 0000000..a7426c6
--- /dev/null
+++ b/demos/embedded/anomaly/src/webview.h
@@ -0,0 +1,25 @@
+#ifndef WEBVIEW_H
+#define WEBVIEW_H
+
+#include <QWebView>
+#include <QTime>
+
+class WebView : public QWebView
+{
+ Q_OBJECT
+public:
+ WebView(QWidget *parent = 0);
+
+protected:
+ void paintEvent(QPaintEvent *event);
+
+private slots:
+ void newPageLoading();
+ void pageLoaded(bool ok);
+
+private:
+ QTime loadingTime;
+ bool inLoading;
+};
+
+#endif // WEBVIEW_H