summaryrefslogtreecommitdiffstats
path: root/examples/webkit/formextractor
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2011-04-28 17:39:11 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2011-04-28 17:39:11 (GMT)
commit3abaecc3aec4e46f1c5969c33875fd45aa542385 (patch)
tree58613c5d2b765018c31d0b189e9c5a34d8adde69 /examples/webkit/formextractor
parentddb22795641253a026b72f752ebc769745dd41be (diff)
downloadQt-3abaecc3aec4e46f1c5969c33875fd45aa542385.zip
Qt-3abaecc3aec4e46f1c5969c33875fd45aa542385.tar.gz
Qt-3abaecc3aec4e46f1c5969c33875fd45aa542385.tar.bz2
Squashed commit of the changes from the mobile-examples repository
(4.7-generated-declarative branch).
Diffstat (limited to 'examples/webkit/formextractor')
-rw-r--r--examples/webkit/formextractor/formextractor.cpp5
-rw-r--r--examples/webkit/formextractor/formextractor.desktop11
-rw-r--r--examples/webkit/formextractor/formextractor.h6
-rw-r--r--examples/webkit/formextractor/formextractor.pro5
-rw-r--r--examples/webkit/formextractor/formextractor_mobiles.ui139
5 files changed, 164 insertions, 2 deletions
diff --git a/examples/webkit/formextractor/formextractor.cpp b/examples/webkit/formextractor/formextractor.cpp
index c1417ba..4f2b25b 100644
--- a/examples/webkit/formextractor/formextractor.cpp
+++ b/examples/webkit/formextractor/formextractor.cpp
@@ -78,6 +78,11 @@ void FormExtractor::submit()
ui.updatesEdit->setText("Yes");
else
ui.updatesEdit->setText("No");
+
+ // In mobile devices, change the tab when the data has been submitted
+ #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ ui.tabWidget->setCurrentWidget(ui.tabData);
+ #endif
}
void FormExtractor::populateJavaScriptWindowObject()
diff --git a/examples/webkit/formextractor/formextractor.desktop b/examples/webkit/formextractor/formextractor.desktop
new file mode 100644
index 0000000..5c67097
--- /dev/null
+++ b/examples/webkit/formextractor/formextractor.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Form Extractor
+Exec=/opt/usr/bin/formextractor
+Icon=formextractor
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/examples/webkit/formextractor/formextractor.h b/examples/webkit/formextractor/formextractor.h
index 9fd17b1..8958708 100644
--- a/examples/webkit/formextractor/formextractor.h
+++ b/examples/webkit/formextractor/formextractor.h
@@ -43,7 +43,11 @@
#include <QtGui/QWidget>
#include <QWebFrame>
-#include "ui_formextractor.h"
+#if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR
+ #include "ui_formextractor_mobiles.h"
+#else
+ #include "ui_formextractor.h"
+#endif
class FormExtractor : public QWidget
{
diff --git a/examples/webkit/formextractor/formextractor.pro b/examples/webkit/formextractor/formextractor.pro
index 51e0c45..a41ed0f 100644
--- a/examples/webkit/formextractor/formextractor.pro
+++ b/examples/webkit/formextractor/formextractor.pro
@@ -6,7 +6,8 @@ SOURCES += main.cpp \
mainwindow.cpp
HEADERS += formextractor.h \
mainwindow.h
-FORMS += formextractor.ui
+FORMS += formextractor.ui \
+ formextractor_mobiles.ui
RESOURCES += formextractor.qrc
# install
@@ -18,4 +19,6 @@ INSTALLS += target sources
symbian {
TARGET.UID3 = 0xA000CF6D
include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
+ TARGET.CAPABILITY = NetworkServices
}
+maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri)
diff --git a/examples/webkit/formextractor/formextractor_mobiles.ui b/examples/webkit/formextractor/formextractor_mobiles.ui
new file mode 100644
index 0000000..4b81bc7
--- /dev/null
+++ b/examples/webkit/formextractor/formextractor_mobiles.ui
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>242</width>
+ <height>313</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tabWebForm">
+ <attribute name="title">
+ <string>Web Form</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QWebView" name="webView">
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>150</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>400</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="url">
+ <url>
+ <string>about:blank</string>
+ </url>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tabData">
+ <attribute name="title">
+ <string>Extracted Data</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="firstNameLabel">
+ <property name="text">
+ <string>First Name</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="firstNameEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="lastNameLabel">
+ <property name="text">
+ <string>Last Name</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="lastNameEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="genderLabel">
+ <property name="text">
+ <string>Gender</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLineEdit" name="genderEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="updatesLabel">
+ <property name="text">
+ <string>Receive Updates</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLineEdit" name="updatesEdit">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QWebView</class>
+ <extends>QWidget</extends>
+ <header>QtWebKit/QWebView</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>