diff options
author | Marcel Schuette <marcel.schuette@pelagicore.com> | 2013-08-22 13:41:40 +0200 |
---|---|---|
committer | Marcel Schuette <marcel.schuette@pelagicore.com> | 2013-08-22 13:41:40 +0200 |
commit | 3a9f75d1ea0bda869cad404b1dacc782f0c6e386 (patch) | |
tree | 2cb773a15e7e7f707b2cc69720d72c46882e05c4 | |
parent | eee65c8a8368015cc5c4ebf2291f7310056dae7f (diff) | |
download | browser-poc-3a9f75d1ea0bda869cad404b1dacc782f0c6e386.tar.gz |
tested and fixed getContentSize
-rw-r--r-- | browser/webpagewindow.cpp | 4 | ||||
-rw-r--r-- | common/browserdbus.cpp | 18 | ||||
-rw-r--r-- | common/browserdbus.h | 2 | ||||
-rw-r--r-- | demoui/main.cpp | 2 | ||||
-rw-r--r-- | testapp/qml/testapp/WebPageWindow.qml | 28 |
5 files changed, 49 insertions, 5 deletions
diff --git a/browser/webpagewindow.cpp b/browser/webpagewindow.cpp index 421ae69..bbb4424 100644 --- a/browser/webpagewindow.cpp +++ b/browser/webpagewindow.cpp @@ -83,8 +83,8 @@ conn::brw::ERROR_IDS webpagewindow::getBrowserActionsState(conn::brw::BrowserAct conn::brw::ERROR_IDS webpagewindow::getContentSize(uint &a_u32Width, uint &a_u32Height) { qDebug() << __PRETTY_FUNCTION__; - uint width = webitem->property("width").toInt(); - uint height = webitem->property("height").toInt(); + uint width = webitem->property("contentWidth").toInt(); + uint height = webitem->property("contentHeight").toInt(); a_u32Width = width; a_u32Height = height; diff --git a/common/browserdbus.cpp b/common/browserdbus.cpp index 7cc7603..8ba74c1 100644 --- a/common/browserdbus.cpp +++ b/common/browserdbus.cpp @@ -51,6 +51,23 @@ BrowserDbus::BrowserDbus(QObject *parent) : connect(webpagewindow, SIGNAL(onLoadProgress(int)), this, SLOT(pageloadingprogress(int))); } +void BrowserDbus::getContentSize() { + qDebug() << __PRETTY_FUNCTION__; + + QDBusPendingReply<conn::brw::ERROR_IDS, uint, uint> reply = webpagewindow->getContentSize(); + reply.waitForFinished(); + if(reply.isValid()) { + conn::brw::ERROR_IDS ret = reply.value(); + uint width = reply.argumentAt<1>(); + uint height = reply.argumentAt<2>(); + + qDebug() << "ERROR_IDS " << ret << width << height; + } else { + QDBusError error = reply.error(); + qDebug() << "ERROR " << error.name() << error.message(); + } +} + void BrowserDbus::getGeometry() { qDebug() << __PRETTY_FUNCTION__; @@ -66,7 +83,6 @@ void BrowserDbus::getGeometry() { QDBusError error = reply.error(); qDebug() << "ERROR " << error.name() << error.message(); } - } void BrowserDbus::setGeometry(int x, int y, int width, int height) { diff --git a/common/browserdbus.h b/common/browserdbus.h index d968364..52dc81f 100644 --- a/common/browserdbus.h +++ b/common/browserdbus.h @@ -61,6 +61,8 @@ public: Q_INVOKABLE void getGeometry(); Q_INVOKABLE void setGeometry(int x, int y, int width, int height); + Q_INVOKABLE void getContentSize(); + Q_INVOKABLE void deleteBookmark(int index); QString title() { return m_title; } diff --git a/demoui/main.cpp b/demoui/main.cpp index 8e45d9d..0322013 100644 --- a/demoui/main.cpp +++ b/demoui/main.cpp @@ -14,7 +14,7 @@ #include <QtGui/QGuiApplication> #include "qtquick2applicationviewer.h" -#include "browserdbus.h" +#include "../common/browserdbus.h" #include <QtQml> diff --git a/testapp/qml/testapp/WebPageWindow.qml b/testapp/qml/testapp/WebPageWindow.qml index 1b45735..3c19809 100644 --- a/testapp/qml/testapp/WebPageWindow.qml +++ b/testapp/qml/testapp/WebPageWindow.qml @@ -72,6 +72,11 @@ Item { font.pixelSize: 20 text: "http://" } + Text { + text: "url" + anchors.top: inputfieldurl.bottom + anchors.left: inputfieldurl.left + } Button { width: 130 height: inputfieldurl.height @@ -117,7 +122,7 @@ Item { GroupBox { id: groupcontrolbuttons2 - title: "getVisible()/getGeometry()/getContentSize()/getBrowserActionsState()" + title: "getVisible()/getGeometry()/getContentSize()/getBrowserActionsState() " width: 4 * 130 + 3 * 20 + 30 anchors.top: groupsetvisible.bottom anchors.topMargin: 10 @@ -152,6 +157,7 @@ Item { anchors.left: buttongetgeometry.right anchors.leftMargin: 20 text: "Get ContentSize" + onClicked: browserinterface.getContentSize() } Button { @@ -183,6 +189,11 @@ Item { inputMask: "999" text: "0" } + Text { + text: "x" + anchors.top: inputfieldx.bottom + anchors.left: inputfieldx.left + } TextField { id: inputfieldy width: 50 @@ -195,6 +206,11 @@ Item { inputMask: "999" text: "0" } + Text { + text: "y" + anchors.top: inputfieldy.bottom + anchors.left: inputfieldy.left + } TextField { id: inputfieldwidth width: 50 @@ -207,6 +223,11 @@ Item { inputMask: "999" text: "800" } + Text { + text: "width" + anchors.top: inputfieldwidth.bottom + anchors.left: inputfieldwidth.left + } TextField { id: inputfieldheight width: 50 @@ -219,6 +240,11 @@ Item { inputMask: "999" text: "520" } + Text { + text: "height" + anchors.top: inputfieldheight.bottom + anchors.left: inputfieldheight.left + } Button { width: 130 height: inputfieldx.height |