[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/libs/webkitkde/kdelauncher
From: Urs Wolfer <uwolfer () kde ! org>
Date: 2009-07-08 19:56:22
Message-ID: 1247082982.470929.14623.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 993507 by uwolfer:
build test application also with Qt 4.5
M +12 -0 main.cpp
--- trunk/playground/libs/webkitkde/kdelauncher/main.cpp #993506:993507
@@ -37,7 +37,9 @@
#include <qwebframe.h>
#include <qwebsettings.h>
+#if QT_VERSION >= 0x040600
#include <qwebelement.h>
+#endif
#include <QtGui>
#include <QDebug>
@@ -81,7 +83,11 @@
setupUI();
+#if QT_VERSION >= 0x040600
QUrl qurl = view->guessUrlFromString(url);
+#else
+ QUrl qurl(url);
+#endif
if (qurl.isValid()) {
urlEdit->setText(qurl.toEncoded());
view->load(qurl);
@@ -105,7 +111,11 @@
void changeLocation() {
QString string = urlEdit->text();
+#if QT_VERSION >= 0x040600
QUrl url = view->guessUrlFromString(string);
+#else
+ QUrl url(url);
+#endif
if (!url.isValid())
url = QUrl("http://" + string + "/");
urlEdit->setText(url.toEncoded());
@@ -190,10 +200,12 @@
QString str = QInputDialog::getText(this, "Select elements", "Choose elements",
QLineEdit::Normal, "a", &ok);
if (ok && !str.isEmpty()) {
+#if QT_VERSION >= 0x040600
QList<QWebElement> result = view->page()->mainFrame()->findAllElements(str);
foreach (QWebElement e, result)
e.setStyleProperty("background-color", "yellow");
statusBar()->showMessage(QString("%1 element(s) selected").arg(result.count()), 5000);
+#endif
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic