diff options
Diffstat (limited to 'examples/webkit/previewer')
-rw-r--r-- | examples/webkit/previewer/main.cpp | 6 | ||||
-rw-r--r-- | examples/webkit/previewer/previewer.cpp | 5 | ||||
-rw-r--r-- | examples/webkit/previewer/previewer.desktop | 11 | ||||
-rw-r--r-- | examples/webkit/previewer/previewer.h | 6 | ||||
-rw-r--r-- | examples/webkit/previewer/previewer.pro | 5 | ||||
-rw-r--r-- | examples/webkit/previewer/previewer_mobiles.ui | 96 |
6 files changed, 126 insertions, 3 deletions
diff --git a/examples/webkit/previewer/main.cpp b/examples/webkit/previewer/main.cpp index 03aa831..89e9f39 100644 --- a/examples/webkit/previewer/main.cpp +++ b/examples/webkit/previewer/main.cpp @@ -46,7 +46,11 @@ int main(int argc, char * argv[]) { QApplication app(argc, argv); MainWindow mainWindow; - mainWindow.show(); + #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR + mainWindow.showMaximized(); + #else + mainWindow.show(); + #endif return app.exec(); } //! [0] diff --git a/examples/webkit/previewer/previewer.cpp b/examples/webkit/previewer/previewer.cpp index 40c5da4..06cba16 100644 --- a/examples/webkit/previewer/previewer.cpp +++ b/examples/webkit/previewer/previewer.cpp @@ -60,5 +60,10 @@ void Previewer::on_previewButton_clicked() // Update the contents in web viewer QString text = plainTextEdit->toPlainText(); webView->setHtml(text, baseUrl); + + // In mobile devices, change the tab + #if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR + tabWidget->setCurrentWidget(tabHTMLPreview); + #endif } //! [1] diff --git a/examples/webkit/previewer/previewer.desktop b/examples/webkit/previewer/previewer.desktop new file mode 100644 index 0000000..51c570d --- /dev/null +++ b/examples/webkit/previewer/previewer.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=Previewer +Exec=/opt/usr/bin/previewer +Icon=previewer +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/webkit/previewer/previewer.h b/examples/webkit/previewer/previewer.h index f59efbf..771b21f 100644 --- a/examples/webkit/previewer/previewer.h +++ b/examples/webkit/previewer/previewer.h @@ -41,7 +41,11 @@ #ifndef PREVIEWER_H #define PREVIEWER_H -#include "ui_previewer.h" +#if defined Q_OS_SYMBIAN || defined Q_WS_HILDON || defined Q_WS_MAEMO_5 || defined Q_WS_SIMULATOR + #include "ui_previewer_mobiles.h" +#else + #include "ui_previewer.h" +#endif //! [0] class Previewer : public QWidget, public Ui::Form diff --git a/examples/webkit/previewer/previewer.pro b/examples/webkit/previewer/previewer.pro index 525dbb2..371695e 100644 --- a/examples/webkit/previewer/previewer.pro +++ b/examples/webkit/previewer/previewer.pro @@ -4,7 +4,8 @@ HEADERS = previewer.h \ SOURCES = main.cpp \ previewer.cpp \ mainwindow.cpp -FORMS = previewer.ui +FORMS = previewer.ui \ + previewer_mobiles.ui # install target.path = $$[QT_INSTALL_EXAMPLES]/webkit/previewer @@ -15,4 +16,6 @@ INSTALLS += target sources symbian { TARGET.UID3 = 0xA000CF6F include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) + TARGET.CAPABILITY = NetworkServices } +maemo5: include($$QT_SOURCE_TREE/examples/maemo5pkgrules.pri) diff --git a/examples/webkit/previewer/previewer_mobiles.ui b/examples/webkit/previewer/previewer_mobiles.ui new file mode 100644 index 0000000..b65a88e --- /dev/null +++ b/examples/webkit/previewer/previewer_mobiles.ui @@ -0,0 +1,96 @@ +<?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>259</width> + <height>177</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QTabWidget" name="tabWidget"> + <property name="currentIndex"> + <number>0</number> + </property> + <widget class="QWidget" name="tabHTMLPreview"> + <attribute name="title"> + <string>HTML Preview</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QWebView" name="webView"> + <property name="url"> + <url> + <string>about:blank</string> + </url> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QWidget" name="tabHTMLEditor"> + <attribute name="title"> + <string>HTML Editor</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QPlainTextEdit" name="plainTextEdit"/> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="clearButton"> + <property name="text"> + <string>Clear</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="previewButton"> + <property name="text"> + <string>Preview</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </widget> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>QWebView</class> + <extends>QWidget</extends> + <header>QtWebKit/QWebView</header> + </customwidget> + </customwidgets> + <resources/> + <connections> + <connection> + <sender>clearButton</sender> + <signal>clicked()</signal> + <receiver>plainTextEdit</receiver> + <slot>clear()</slot> + <hints> + <hint type="sourcelabel"> + <x>56</x> + <y>653</y> + </hint> + <hint type="destinationlabel"> + <x>98</x> + <y>551</y> + </hint> + </hints> + </connection> + </connections> +</ui> |