summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sørvig <msorvig@trolltech.com>2009-02-13 08:28:16 +0100
committerMorten Sørvig <msorvig@trolltech.com>2009-02-13 08:28:16 +0100
commit1d677fb09d1cf36e47e5878188dbc0d500c6b363 (patch)
tree9a4377c6a3e5b4634c66cf67853d41ec123511df
parentc52c64cf123e1509b3ccd9ce97bd5d6022b7934e (diff)
Add multi-user example.
-rwxr-xr-xdemos/multiuser/buttons.ui58
-rwxr-xr-xdemos/multiuser/helpdialog.ui376
-rwxr-xr-xdemos/multiuser/main.cpp40
-rwxr-xr-xdemos/multiuser/multiuser.pro9
-rwxr-xr-xdemos/multiuser/widgets.ui148
5 files changed, 631 insertions, 0 deletions
diff --git a/demos/multiuser/buttons.ui b/demos/multiuser/buttons.ui
new file mode 100755
index 0000000..ba72fc9
--- /dev/null
+++ b/demos/multiuser/buttons.ui
@@ -0,0 +1,58 @@
+<ui version="4.0" >
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>379</width>
+ <height>301</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QRadioButton" name="radioButton" >
+ <property name="text" >
+ <string>RadioButton</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton_2" >
+ <property name="text" >
+ <string>RadioButton</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="radioButton_3" >
+ <property name="text" >
+ <string>RadioButton</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="text" >
+ <string>CheckBox</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox_2" >
+ <property name="text" >
+ <string>CheckBox</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit" />
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/demos/multiuser/helpdialog.ui b/demos/multiuser/helpdialog.ui
new file mode 100755
index 0000000..e671a51
--- /dev/null
+++ b/demos/multiuser/helpdialog.ui
@@ -0,0 +1,376 @@
+<ui version="4.0" >
+ <author></author>
+ <comment>*********************************************************************
+**
+** Copyright (C) 1992-$THISYEAR$ $TROLLTECH$. All rights reserved.
+**
+** This file is part of the $MODULE$ of the Qt Toolkit.
+**
+** $TROLLTECH_DUAL_LICENSE$
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*********************************************************************</comment>
+ <exportmacro></exportmacro>
+ <class>HelpDialog</class>
+ <widget class="QWidget" name="HelpDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>274</width>
+ <height>417</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Help</string>
+ </property>
+ <property name="whatsThis" >
+ <string>&lt;b>Help&lt;/b>&lt;p>Choose the topic you want help on from the contents list, or search the index for keywords.&lt;/p></string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="whatsThis" >
+ <string>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</string>
+ </property>
+ <widget class="QWidget" name="contentPage" >
+ <attribute name="title" >
+ <string>Con&amp;tents</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>5</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QTreeWidget" name="listContents" >
+ <property name="contextMenuPolicy" >
+ <enum>Qt::CustomContextMenu</enum>
+ </property>
+ <property name="whatsThis" >
+ <string>&lt;b>Help topics organized by category.&lt;/b>&lt;p>Double-click an item to see the topics in that category. To view a topic, just double-click it.&lt;/p></string>
+ </property>
+ <property name="rootIsDecorated" >
+ <bool>true</bool>
+ </property>
+ <property name="uniformRowHeights" >
+ <bool>true</bool>
+ </property>
+ <column>
+ <property name="text" >
+ <string>column 1</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="indexPage" >
+ <attribute name="title" >
+ <string>&amp;Index</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>5</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="TextLabel1" >
+ <property name="text" >
+ <string>&amp;Look For:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>editIndex</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="editIndex" >
+ <property name="toolTip" >
+ <string>Enter keyword</string>
+ </property>
+ <property name="whatsThis" >
+ <string>&lt;b>Enter a keyword.&lt;/b>&lt;p>The list will select an item that matches the entered string best.&lt;/p></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QListView" name="listIndex" >
+ <property name="contextMenuPolicy" >
+ <enum>Qt::CustomContextMenu</enum>
+ </property>
+ <property name="whatsThis" >
+ <string>&lt;b>List of available help topics.&lt;/b>&lt;p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.&lt;/p></string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="bookmarkPage" >
+ <attribute name="title" >
+ <string>&amp;Bookmarks</string>
+ </attribute>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>5</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QTreeWidget" name="listBookmarks" >
+ <property name="contextMenuPolicy" >
+ <enum>Qt::CustomContextMenu</enum>
+ </property>
+ <property name="whatsThis" >
+ <string>Displays the list of bookmarks.</string>
+ </property>
+ <property name="uniformRowHeights" >
+ <bool>true</bool>
+ </property>
+ <column>
+ <property name="text" >
+ <string>column 1</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="buttonAdd" >
+ <property name="toolTip" >
+ <string>Add new bookmark</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Add the currently displayed page as a new bookmark.</string>
+ </property>
+ <property name="text" >
+ <string>&amp;New</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="buttonRemove" >
+ <property name="toolTip" >
+ <string>Delete bookmark</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Delete the selected bookmark.</string>
+ </property>
+ <property name="text" >
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="searchPage" >
+ <attribute name="title" >
+ <string>&amp;Search</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>5</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="3" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="TextLabel1_2" >
+ <property name="text" >
+ <string>Searching f&amp;or:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>termsEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLineEdit" name="termsEdit" >
+ <property name="toolTip" >
+ <string>Enter searchword(s).</string>
+ </property>
+ <property name="whatsThis" >
+ <string>&lt;b>Enter search word(s).&lt;/b>&lt;p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.&lt;/p></string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QListWidget" name="resultBox" >
+ <property name="contextMenuPolicy" >
+ <enum>Qt::CustomContextMenu</enum>
+ </property>
+ <property name="whatsThis" >
+ <string>&lt;b>Found documents&lt;/b>&lt;p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.&lt;/p></string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="TextLabel2" >
+ <property name="text" >
+ <string>Found &amp;Documents:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>resultBox</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>1</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QPushButton" name="helpButton" >
+ <property name="toolTip" >
+ <string>Display the help page.</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Display the help page for the full text search.</string>
+ </property>
+ <property name="text" >
+ <string>He&amp;lp</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>61</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="searchButton" >
+ <property name="toolTip" >
+ <string>Start searching.</string>
+ </property>
+ <property name="whatsThis" >
+ <string>Pressing this button starts the search.</string>
+ </property>
+ <property name="text" >
+ <string>&amp;Search</string>
+ </property>
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QFrame" name="framePrepare" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>3</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="labelPrepare" >
+ <property name="text" >
+ <string>Preparing...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="progressPrepare" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <tabstops>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>listContents</tabstop>
+ <tabstop>editIndex</tabstop>
+ <tabstop>listIndex</tabstop>
+ <tabstop>listBookmarks</tabstop>
+ <tabstop>buttonAdd</tabstop>
+ <tabstop>buttonRemove</tabstop>
+ <tabstop>termsEdit</tabstop>
+ <tabstop>searchButton</tabstop>
+ <tabstop>helpButton</tabstop>
+ <tabstop>resultBox</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/demos/multiuser/main.cpp b/demos/multiuser/main.cpp
new file mode 100755
index 0000000..026d765
--- /dev/null
+++ b/demos/multiuser/main.cpp
@@ -0,0 +1,40 @@
+#include <QtGui>
+#include <QUiLoader>
+#include <multiuserserver.h>
+
+QWidget *loadui(const QString &filename)
+{
+ QUiLoader loader;
+ QFile file(filename);
+ bool ok = file.open(QFile::ReadOnly);
+ if (!ok)
+ qWarning("WARNING: Could not open file %s", filename.toLocal8Bit().constData());
+ return loader.load(&file, 0);
+}
+
+class MyApplicationObject : public QObject
+{
+Q_OBJECT
+public slots:
+ void instantiateUi(QWidget **root, Session *session)
+ {
+ Q_UNUSED(session);
+ *root = loadui("widgets.ui");
+ }
+};
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+ app.setStyle("cleanlooks");
+
+ MultiUserServer server;
+
+ MyApplicationObject object;
+ QObject::connect(&server, SIGNAL(newSession(QWidget **, Session *)),
+ &object, SLOT(instantiateUi(QWidget **, Session *)));
+
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/demos/multiuser/multiuser.pro b/demos/multiuser/multiuser.pro
new file mode 100755
index 0000000..bdcd0d1
--- /dev/null
+++ b/demos/multiuser/multiuser.pro
@@ -0,0 +1,9 @@
+include (../../qt-web.pri)
+
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+
+CONFIG += uitools
+SOURCES += main.cpp
diff --git a/demos/multiuser/widgets.ui b/demos/multiuser/widgets.ui
new file mode 100755
index 0000000..8324c8c
--- /dev/null
+++ b/demos/multiuser/widgets.ui
@@ -0,0 +1,148 @@
+<ui version="4.0" >
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>461</width>
+ <height>369</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <widget class="QRadioButton" name="radioButton" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>30</y>
+ <width>366</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>RadioButton</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" name="radioButton_2" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>70</y>
+ <width>366</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>RadioButton</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" name="radioButton_3" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>110</y>
+ <width>366</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>RadioButton</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>153</y>
+ <width>366</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>CheckBox</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="checkBox_2" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>196</y>
+ <width>366</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>CheckBox</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" name="lineEdit" >
+ <property name="geometry" >
+ <rect>
+ <x>12</x>
+ <y>244</y>
+ <width>355</width>
+ <height>22</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QTreeWidget" name="treeWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>170</x>
+ <y>30</y>
+ <width>256</width>
+ <height>192</height>
+ </rect>
+ </property>
+ <column>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </column>
+ <item>
+ <property name="text" >
+ <string>Foo</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Bar</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Bar</string>
+ </property>
+ </item>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Foo</string>
+ </property>
+ </item>
+ <item>
+ <property name="text" >
+ <string>Foo</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Bar</string>
+ </property>
+ <item>
+ <property name="text" >
+ <string>Bar</string>
+ </property>
+ </item>
+ </item>
+ </item>
+ <item>
+ <property name="text" >
+ <string>New Item</string>
+ </property>
+ </item>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>