From 1d677fb09d1cf36e47e5878188dbc0d500c6b363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Fri, 13 Feb 2009 08:28:16 +0100 Subject: Add multi-user example. --- demos/multiuser/buttons.ui | 58 +++++++ demos/multiuser/helpdialog.ui | 376 ++++++++++++++++++++++++++++++++++++++++++ demos/multiuser/main.cpp | 40 +++++ demos/multiuser/multiuser.pro | 9 + demos/multiuser/widgets.ui | 148 +++++++++++++++++ 5 files changed, 631 insertions(+) create mode 100755 demos/multiuser/buttons.ui create mode 100755 demos/multiuser/helpdialog.ui create mode 100755 demos/multiuser/main.cpp create mode 100755 demos/multiuser/multiuser.pro create mode 100755 demos/multiuser/widgets.ui 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 @@ + + Dialog + + + + 0 + 0 + 379 + 301 + + + + Dialog + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + CheckBox + + + + + + + CheckBox + + + + + + + + + + + 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 @@ + + + ********************************************************************* +** +** 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. +** +********************************************************************* + + HelpDialog + + + + 0 + 0 + 274 + 417 + + + + Help + + + <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> + + + + 0 + + + 6 + + + + + Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. + + + + Con&tents + + + + 5 + + + 6 + + + + + Qt::CustomContextMenu + + + <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> + + + true + + + true + + + + column 1 + + + + + + + + + &Index + + + + 5 + + + 6 + + + + + &Look For: + + + editIndex + + + + + + + Enter keyword + + + <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> + + + + + + + Qt::CustomContextMenu + + + <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> + + + + + + + + &Bookmarks + + + + 5 + + + 6 + + + + + Qt::CustomContextMenu + + + Displays the list of bookmarks. + + + true + + + + column 1 + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + Add new bookmark + + + Add the currently displayed page as a new bookmark. + + + &New + + + + + + + Delete bookmark + + + Delete the selected bookmark. + + + &Delete + + + + + + + + + + &Search + + + + 5 + + + 6 + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Searching f&or: + + + termsEdit + + + + + + + Enter searchword(s). + + + <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> + + + + + + + Qt::CustomContextMenu + + + <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> + + + + + + + Found &Documents: + + + resultBox + + + + + + + 1 + + + 6 + + + + + Display the help page. + + + Display the help page for the full text search. + + + He&lp + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 61 + 21 + + + + + + + + Start searching. + + + Pressing this button starts the search. + + + &Search + + + false + + + + + + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 3 + + + 6 + + + + + Preparing... + + + + + + + + + + + + + + tabWidget + listContents + editIndex + listIndex + listBookmarks + buttonAdd + buttonRemove + termsEdit + searchButton + helpButton + resultBox + + + + 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 +#include +#include + +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 @@ + + Dialog + + + + 0 + 0 + 461 + 369 + + + + Dialog + + + + + 10 + 30 + 366 + 21 + + + + RadioButton + + + + + + 10 + 70 + 366 + 21 + + + + RadioButton + + + + + + 10 + 110 + 366 + 21 + + + + RadioButton + + + + + + 10 + 153 + 366 + 21 + + + + CheckBox + + + + + + 10 + 196 + 366 + 21 + + + + CheckBox + + + + + + 12 + 244 + 355 + 22 + + + + + + + 170 + 30 + 256 + 192 + + + + + 1 + + + + + Foo + + + + Bar + + + + + Bar + + + + + + Foo + + + + + Foo + + + + Bar + + + + Bar + + + + + + + New Item + + + + + + + -- cgit v1.2.3