summaryrefslogtreecommitdiffstats
path: root/examples/assistant/simpletextviewer
diff options
context:
space:
mode:
Diffstat (limited to 'examples/assistant/simpletextviewer')
-rw-r--r--examples/assistant/simpletextviewer/documentation/about.txt9
-rw-r--r--examples/assistant/simpletextviewer/documentation/browse.html34
-rw-r--r--examples/assistant/simpletextviewer/documentation/filedialog.html48
-rw-r--r--examples/assistant/simpletextviewer/documentation/findfile.html32
-rw-r--r--examples/assistant/simpletextviewer/documentation/images/browse.pngbin21553 -> 0 bytes
-rw-r--r--examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.pngbin9589 -> 0 bytes
-rw-r--r--examples/assistant/simpletextviewer/documentation/images/filedialog.pngbin12318 -> 0 bytes
-rw-r--r--examples/assistant/simpletextviewer/documentation/images/handbook.pngbin1060 -> 0 bytes
-rw-r--r--examples/assistant/simpletextviewer/documentation/images/mainwindow.pngbin12769 -> 0 bytes
-rw-r--r--examples/assistant/simpletextviewer/documentation/images/open.pngbin11697 -> 0 bytes
-rw-r--r--examples/assistant/simpletextviewer/documentation/images/wildcard.pngbin11266 -> 0 bytes
-rw-r--r--examples/assistant/simpletextviewer/documentation/index.html41
-rw-r--r--examples/assistant/simpletextviewer/documentation/intro.html28
-rw-r--r--examples/assistant/simpletextviewer/documentation/openfile.html36
-rw-r--r--examples/assistant/simpletextviewer/documentation/simpletextviewer.adp40
-rw-r--r--examples/assistant/simpletextviewer/documentation/wildcardmatching.html57
-rw-r--r--examples/assistant/simpletextviewer/findfiledialog.cpp221
-rw-r--r--examples/assistant/simpletextviewer/findfiledialog.h99
-rw-r--r--examples/assistant/simpletextviewer/main.cpp52
-rw-r--r--examples/assistant/simpletextviewer/mainwindow.cpp154
-rw-r--r--examples/assistant/simpletextviewer/mainwindow.h91
-rw-r--r--examples/assistant/simpletextviewer/simpletextviewer.pro16
22 files changed, 0 insertions, 958 deletions
diff --git a/examples/assistant/simpletextviewer/documentation/about.txt b/examples/assistant/simpletextviewer/documentation/about.txt
deleted file mode 100644
index eeab35f4a..000000000
--- a/examples/assistant/simpletextviewer/documentation/about.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-The Simple Text Viewer enables the user to select and view existing
-files.
-
-HTML files is displayed using rich text, while other files are
-presented as plain text. The application provides a file dialog
-allowing the user to search for files using wildcard matching. The
-search is performed within in the specified directory, and the user is
-given an option to browse the existing file system to find the
-relevant directory.
diff --git a/examples/assistant/simpletextviewer/documentation/browse.html b/examples/assistant/simpletextviewer/documentation/browse.html
deleted file mode 100644
index 987abf31f..000000000
--- a/examples/assistant/simpletextviewer/documentation/browse.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Browse</title>
- </head>
- <body style="font-size:12pt;font-family:helvetica">
-
- <p><center><h2>Browse</h2></center></p>
-
- <p>
- The file dialog let you browse the current file system to
- specify the directory in which the file you want to open
- resides.
- Note that only the specified directory will be searched, any
- subdirectories will simply be ignored.
- </p>
-
- <br />
- <br />
- <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%">
- <tr valign="top" bgcolor="#f0f0f0">
- <td><center><img src="images/browse.png" /></center></td>
- </tr>
- </table>
-
- <br />
- <br />
- <p>
- See also: <a href="filedialog.html">File Dialog</a>, <a href="wildcardmatching.html">Wildcard Matching</a>,
- <a href="findfile.html">Find File</a>
- </p>
- </body>
-</html>
-
diff --git a/examples/assistant/simpletextviewer/documentation/filedialog.html b/examples/assistant/simpletextviewer/documentation/filedialog.html
deleted file mode 100644
index afa65ed57..000000000
--- a/examples/assistant/simpletextviewer/documentation/filedialog.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>File Dialog</title>
- </head>
- <body style="font-size:12pt;font-family:helvetica">
-
- <p><center><h2>File Dialog</h2></center></p>
-
- <p>
- In the file dialog you can name a particular file name, or
- search for files using wildcard matching, i.e. specify a
- file name containing wildcards. In addition you must specify
- the directory in which the file you search for resides.
- </p>
-
- <br />
- <br />
- <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%">
- <tr valign="top" bgcolor="#f0f0f0">
- <td><center><img src="images/filedialog.png" /></center></td>
- </tr>
- </table>
-
- <br />
- <br />
- <p>
- By default the dialog will search for all files (*) in the
- current directory (the directory the application is run from).
- </p>
-
- <p>
- When editing the file name and directory parameters, an
- overview of the matching files are displayed in the
- dialog. The overview is updated whenever the parameters
- change.
- </p>
-
- <br />
- <br />
- <p>
- See also: <a href="browse.html">Browse</a>, <a href="wildcardmatching.html">Wildcard Matching</a>,
- <a href="findfile.html">Find File</a>
- </p>
- </body>
-</html>
-
-
diff --git a/examples/assistant/simpletextviewer/documentation/findfile.html b/examples/assistant/simpletextviewer/documentation/findfile.html
deleted file mode 100644
index 32e014718..000000000
--- a/examples/assistant/simpletextviewer/documentation/findfile.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Find File</title>
- </head>
- <body style="font-size:12pt;font-family:helvetica">
-
- <p><center><h2>Find File</h2></center></p>
-
- <p>
- To open and view a file in the Simple Text Viewer, select the
- 'Open...' option in the 'File' menu. The application will then
- provide you with a file dialog that you can use to search for
- any existing file.
- </p>
-
- <br />
- <br />
- <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%">
- <tr valign="top" bgcolor="#f0f0f0">
- <td><center><img src="images/fadedfilemenu.png" /></center></td>
- </tr>
- </table>
-
- <br />
- <br />
- <p>
- See also: <a href="openfile.html">Open File</a>, <a href="filedialog.html">File Dialog</a>
- </p>
- </body>
-</html>
-
diff --git a/examples/assistant/simpletextviewer/documentation/images/browse.png b/examples/assistant/simpletextviewer/documentation/images/browse.png
deleted file mode 100644
index 86db6b19e..000000000
--- a/examples/assistant/simpletextviewer/documentation/images/browse.png
+++ /dev/null
Binary files differ
diff --git a/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png b/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png
deleted file mode 100644
index fde0e43f6..000000000
--- a/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png
+++ /dev/null
Binary files differ
diff --git a/examples/assistant/simpletextviewer/documentation/images/filedialog.png b/examples/assistant/simpletextviewer/documentation/images/filedialog.png
deleted file mode 100644
index 883a33a26..000000000
--- a/examples/assistant/simpletextviewer/documentation/images/filedialog.png
+++ /dev/null
Binary files differ
diff --git a/examples/assistant/simpletextviewer/documentation/images/handbook.png b/examples/assistant/simpletextviewer/documentation/images/handbook.png
deleted file mode 100644
index 3bd2b928b..000000000
--- a/examples/assistant/simpletextviewer/documentation/images/handbook.png
+++ /dev/null
Binary files differ
diff --git a/examples/assistant/simpletextviewer/documentation/images/mainwindow.png b/examples/assistant/simpletextviewer/documentation/images/mainwindow.png
deleted file mode 100644
index c28d5e9ff..000000000
--- a/examples/assistant/simpletextviewer/documentation/images/mainwindow.png
+++ /dev/null
Binary files differ
diff --git a/examples/assistant/simpletextviewer/documentation/images/open.png b/examples/assistant/simpletextviewer/documentation/images/open.png
deleted file mode 100644
index 1e5bba3c8..000000000
--- a/examples/assistant/simpletextviewer/documentation/images/open.png
+++ /dev/null
Binary files differ
diff --git a/examples/assistant/simpletextviewer/documentation/images/wildcard.png b/examples/assistant/simpletextviewer/documentation/images/wildcard.png
deleted file mode 100644
index 6e83a56cc..000000000
--- a/examples/assistant/simpletextviewer/documentation/images/wildcard.png
+++ /dev/null
Binary files differ
diff --git a/examples/assistant/simpletextviewer/documentation/index.html b/examples/assistant/simpletextviewer/documentation/index.html
deleted file mode 100644
index 5a7b1d5fa..000000000
--- a/examples/assistant/simpletextviewer/documentation/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Manual</title>
- </head>
- <body style="font-size:12pt;font-family:helvetica">
-
- <p><center><h2>Simple Text Viewer</h2></center></p>
-
- <p>
- The Simple Text Viewer enables the user to select and view
- existing files.
- </p>
-
- <p><center>
- <img src="images/mainwindow.png" />
- </center></p>
-
- <p>
- HTML files is displayed using rich text, while
- other files are presented as plain text. The application
- provides a file dialog allowing the user to search for files
- using wildcard matching. The search is performed within in the
- specified directory, and the user is given an option to browse
- the existing file system to find the relevant directory.
- </p>
-
- <ul>
- <li><a href="findfile.html">Find File</a></li>
- <ul>
- <li><a href="filedialog.html">File Dialog</a></li>
- <li><a href="wildcardmatching.html">WildCard Matching</a></li>
- <li><a href="browse.html">Browse</a></li>
- </ul>
- <li><a href="openfile.html">Open File</a></li>
- </ul>
- </body>
-</html>
-
-
-
diff --git a/examples/assistant/simpletextviewer/documentation/intro.html b/examples/assistant/simpletextviewer/documentation/intro.html
deleted file mode 100644
index 2e2aa40de..000000000
--- a/examples/assistant/simpletextviewer/documentation/intro.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Manual</title>
- </head>
- <body style="font-size:12pt;font-family:helvetica">
-
- <p><center><h2>Simple Text Viewer</h2></center></p>
-
- <p>
- The Simple Text Viewer enables the user to select and view
- existing files.
- </p>
-
- <p><center>
- <img src="images/mainwindow.png" />
- </center></p>
-
- <p>
- The application provides its own custom documentation that is
- available through the <b>Help</b> menu in the main window's menubar
- and through the <b>Help</b> button in the application's find file
- dialog.
- </p>
-
- </body>
-</html>
-
diff --git a/examples/assistant/simpletextviewer/documentation/openfile.html b/examples/assistant/simpletextviewer/documentation/openfile.html
deleted file mode 100644
index e172de95e..000000000
--- a/examples/assistant/simpletextviewer/documentation/openfile.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Open File</title>
- </head>
- <body style="font-size:12pt;font-family:helvetica">
-
- <p><center><h2>Open File</h2></center></p>
-
- <p>
- Once the file you want to view appears in the dialog's
- display, you can open it in two different ways.
- </p>
-
- <p>
- By pressing the 'Open' button the currently selected file will
- be opened. By default, the first file in the list of matching
- files is selected. Another way of opening a file is to simply
- double click the displayed file name.
- </p>
-
- <br />
- <br />
- <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%">
- <tr valign="top" bgcolor="#f0f0f0">
- <td><center><img src="images/open.png" /></center></td>
- </tr>
- </table>
-
- <br />
- <br />
- <p>
- See also: <a href="findfile.html">Find File</a>
- </p>
- </body>
-</html>
diff --git a/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp b/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp
deleted file mode 100644
index 660df4f38..000000000
--- a/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE DCF>
-
-<assistantconfig version="3.2.0">
-
-<profile>
- <property name="name">simpletextviewer</property>
- <property name="title">Simple Text Viewer</property>
- <property name="applicationicon">images/handbook.png</property>
- <property name="startpage">index.html</property>
- <property name="aboutmenutext">About Simple Text Viewer</property>
- <property name="abouturl">about.txt</property>
- <property name="assistantdocs">.</property>
-</profile>
-
-<DCF ref="index.html" icon="images/handbook.png" title="Simple Text Viewer">
- <section ref="./findfile.html" title="Find File">
- <keyword ref="./index.html">Display</keyword>
- <keyword ref="./index.html">Rich text</keyword>
- <keyword ref="./index.html">Plain text</keyword>
- <keyword ref="./findfile.html">Find</keyword>
- <keyword ref="./findfile.html">File menu</keyword>
- <keyword ref="./filedialog.html">File name</keyword>
- <keyword ref="./filedialog.html">File dialog</keyword>
- <keyword ref="./wildcardmatching.html">File globbing</keyword>
- <keyword ref="./wildcardmatching.html">Wildcard matching</keyword>
- <keyword ref="./wildcardmatching.html">Wildcard syntax</keyword>
- <keyword ref="./browse.html">Browse</keyword>
- <keyword ref="./browse.html">Directory</keyword>
- <keyword ref="./openfile.html">Open</keyword>
- <keyword ref="./openfile.html">Select</keyword>
-
- <section ref="./filedialog.html" title="File Dialog" />
- <section ref="./wildcardmatching.html" title="Wildcard Matching" />
- <section ref="./browse.html" title="Browse" />
- </section>
- <section ref="./openfile.html" title="Open File" />
-</DCF>
-
-</assistantconfig>
-
diff --git a/examples/assistant/simpletextviewer/documentation/wildcardmatching.html b/examples/assistant/simpletextviewer/documentation/wildcardmatching.html
deleted file mode 100644
index eb1839a06..000000000
--- a/examples/assistant/simpletextviewer/documentation/wildcardmatching.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Wildcard Matching</title>
- </head>
- <body style="font-size:12pt;font-family:helvetica">
-
- <p><center><h2>Wildcard Matching</h2></center></p>
-
- <p>
- Most command shells such as bash or cmd.exe support "file
- globbing", the ability to identify a group of files by using
- wildcards.
-
- <br />
- <br />
- <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%">
- <tr valign="top" bgcolor="#f0f0f0">
- <td><center><img src="images/wildcard.png" /></center></td>
- </tr>
- </table>
-
- <br />
- <br />
- <p>
- Wildcard matching provides four features:
- </p>
-
- <ul>
- <li>Any character represents itself apart from those
- mentioned below. Thus 'c' matches the character 'c'.
- </li>
- <li>The '?' character matches any single character.</li>
- <li>The '*' matches zero or more of any characters.</li>
- <li>Sets of characters can be represented in square brackets.
- Within the character class, like outside, backslash
- has no special meaning.
- </li>
- </ul>
-
- <p>
- For example we could identify HTML files with
- <code>*.html</code>. This will match zero or more characters
- followed by a dot followed by 'h', 't', 'm' and 'l'.
- </p>
-
- <br />
- <br />
- <p>
- See also: <a href="browse.html">Browse</a>, <a href="filedialog.html">File Dialog</a>,
- <a href="findfile.html">Find File</a>
- </p>
- </body>
-</html>
-
-
-
diff --git a/examples/assistant/simpletextviewer/findfiledialog.cpp b/examples/assistant/simpletextviewer/findfiledialog.cpp
deleted file mode 100644
index 8c28f4773..000000000
--- a/examples/assistant/simpletextviewer/findfiledialog.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-#include "findfiledialog.h"
-
-//! [0]
-FindFileDialog::FindFileDialog(QTextEdit *editor, QAssistantClient *assistant,
- QWidget *parent)
- : QDialog(parent)
-{
- currentAssistantClient = assistant;
- currentEditor = editor;
-//! [0]
-
- createButtons();
- createComboBoxes();
- createFilesTree();
- createLabels();
- createLayout();
-
- directoryComboBox->addItem(QDir::toNativeSeparators(QDir::currentPath()));
- fileNameComboBox->addItem("*");
- findFiles();
-
- setWindowTitle(tr("Find File"));
-//! [1]
-}
-//! [1]
-
-void FindFileDialog::browse()
-{
- QString currentDirectory = directoryComboBox->currentText();
- QString newDirectory = QFileDialog::getExistingDirectory(this,
- tr("Select Directory"), currentDirectory);
- if (!newDirectory.isEmpty()) {
- directoryComboBox->addItem(QDir::toNativeSeparators(newDirectory));
- directoryComboBox->setCurrentIndex(directoryComboBox->count() - 1);
- update();
- }
-}
-
-//! [2]
-void FindFileDialog::help()
-{
- currentAssistantClient->showPage(QLibraryInfo::location(QLibraryInfo::ExamplesPath) +
- QDir::separator() + "assistant/simpletextviewer/documentation/filedialog.html");
-}
-//! [2]
-
-void FindFileDialog::openFile(QTreeWidgetItem *item)
-{
- if (!item) {
- item = foundFilesTree->currentItem();
- if (!item)
- return;
- }
-
- QString fileName = item->text(0);
- QString path = directoryComboBox->currentText() + QDir::separator();
-
- QFile file(path + fileName);
- if (file.open(QIODevice::ReadOnly)) {
- QString data(file.readAll());
-
- if (fileName.endsWith(".html"))
- currentEditor->setHtml(data);
- else
- currentEditor->setPlainText(data);
- }
- close();
-}
-
-void FindFileDialog::update()
-{
- findFiles();
- buttonBox->button(QDialogButtonBox::Open)->setEnabled(
- foundFilesTree->topLevelItemCount() > 0);
-}
-
-void FindFileDialog::findFiles()
-{
- QRegExp filePattern(fileNameComboBox->currentText() + "*");
- filePattern.setPatternSyntax(QRegExp::Wildcard);
-
- QDir directory(directoryComboBox->currentText());
-
- QStringList allFiles = directory.entryList(QDir::Files | QDir::NoSymLinks);
- QStringList matchingFiles;
-
- foreach (QString file, allFiles) {
- if (filePattern.exactMatch(file))
- matchingFiles << file;
- }
- showFiles(matchingFiles);
-}
-
-void FindFileDialog::showFiles(const QStringList &files)
-{
- foundFilesTree->clear();
-
- for (int i = 0; i < files.count(); ++i) {
- QTreeWidgetItem *item = new QTreeWidgetItem(foundFilesTree);
- item->setText(0, files[i]);
- }
-
- if (files.count() > 0)
- foundFilesTree->setCurrentItem(foundFilesTree->topLevelItem(0));
-}
-
-void FindFileDialog::createButtons()
-{
- browseButton = new QToolButton;
- browseButton->setText(tr("..."));
- connect(browseButton, SIGNAL(clicked()), this, SLOT(browse()));
-
- buttonBox = new QDialogButtonBox(QDialogButtonBox::Open
- | QDialogButtonBox::Cancel
- | QDialogButtonBox::Help);
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(openFile()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
- connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(help()));
-}
-
-void FindFileDialog::createComboBoxes()
-{
- directoryComboBox = new QComboBox;
- fileNameComboBox = new QComboBox;
-
- fileNameComboBox->setEditable(true);
- fileNameComboBox->setSizePolicy(QSizePolicy::Expanding,
- QSizePolicy::Preferred);
-
- directoryComboBox->setMinimumContentsLength(30);
- directoryComboBox->setSizeAdjustPolicy(
- QComboBox::AdjustToMinimumContentsLength);
- directoryComboBox->setSizePolicy(QSizePolicy::Expanding,
- QSizePolicy::Preferred);
-
- connect(fileNameComboBox, SIGNAL(editTextChanged(const QString &)),
- this, SLOT(update()));
- connect(directoryComboBox, SIGNAL(currentIndexChanged(const QString &)),
- this, SLOT(update()));
-}
-
-void FindFileDialog::createFilesTree()
-{
- foundFilesTree = new QTreeWidget;
- foundFilesTree->setColumnCount(1);
- foundFilesTree->setHeaderLabels(QStringList(tr("Matching Files")));
- foundFilesTree->setRootIsDecorated(false);
- foundFilesTree->setSelectionMode(QAbstractItemView::SingleSelection);
-
- connect(foundFilesTree, SIGNAL(itemActivated(QTreeWidgetItem *, int)),
- this, SLOT(openFile(QTreeWidgetItem *)));
-}
-
-void FindFileDialog::createLabels()
-{
- directoryLabel = new QLabel(tr("Search in:"));
- fileNameLabel = new QLabel(tr("File name (including wildcards):"));
-}
-
-void FindFileDialog::createLayout()
-{
- QHBoxLayout *fileLayout = new QHBoxLayout;
- fileLayout->addWidget(fileNameLabel);
- fileLayout->addWidget(fileNameComboBox);
-
- QHBoxLayout *directoryLayout = new QHBoxLayout;
- directoryLayout->addWidget(directoryLabel);
- directoryLayout->addWidget(directoryComboBox);
- directoryLayout->addWidget(browseButton);
-
- QVBoxLayout *mainLayout = new QVBoxLayout;
- mainLayout->addLayout(fileLayout);
- mainLayout->addLayout(directoryLayout);
- mainLayout->addWidget(foundFilesTree);
- mainLayout->addStretch();
- mainLayout->addWidget(buttonBox);
- setLayout(mainLayout);
-}
diff --git a/examples/assistant/simpletextviewer/findfiledialog.h b/examples/assistant/simpletextviewer/findfiledialog.h
deleted file mode 100644
index 99ca132df..000000000
--- a/examples/assistant/simpletextviewer/findfiledialog.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef FINDFILEDIALOG_H
-#define FINDFILEDIALOG_H
-
-#include <QAssistantClient>
-#include <QDialog>
-
-QT_BEGIN_NAMESPACE
-class QComboBox;
-class QDialogButtonBox;
-class QLabel;
-class QTextEdit;
-class QToolButton;
-class QTreeWidget;
-class QTreeWidgetItem;
-QT_END_NAMESPACE
-
-//! [0]
-class FindFileDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- FindFileDialog(QTextEdit *editor, QAssistantClient *assistant,
- QWidget *parent = 0);
-
-private slots:
- void browse();
- void help();
- void openFile(QTreeWidgetItem *item = 0);
- void update();
-
-private:
- void findFiles();
- void showFiles(const QStringList &files);
-
- void createButtons();
- void createComboBoxes();
- void createFilesTree();
- void createLabels();
- void createLayout();
-
- QAssistantClient *currentAssistantClient;
- QTextEdit *currentEditor;
- QTreeWidget *foundFilesTree;
-
- QComboBox *directoryComboBox;
- QComboBox *fileNameComboBox;
-
- QLabel *directoryLabel;
- QLabel *fileNameLabel;
-
- QDialogButtonBox *buttonBox;
-
- QToolButton *browseButton;
-};
-//! [0]
-
-#endif
diff --git a/examples/assistant/simpletextviewer/main.cpp b/examples/assistant/simpletextviewer/main.cpp
deleted file mode 100644
index b82b56866..000000000
--- a/examples/assistant/simpletextviewer/main.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QApplication>
-
-#include "mainwindow.h"
-
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
- MainWindow window;
- window.show();
- return app.exec();
-}
diff --git a/examples/assistant/simpletextviewer/mainwindow.cpp b/examples/assistant/simpletextviewer/mainwindow.cpp
deleted file mode 100644
index 672db9afa..000000000
--- a/examples/assistant/simpletextviewer/mainwindow.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtGui>
-
-#include "mainwindow.h"
-#include "findfiledialog.h"
-
-//! [0]
-MainWindow::MainWindow()
-{
- textViewer = new QTextEdit;
- textViewer->setReadOnly(true);
- QFile file("documentation/intro.html");
- if (file.open(QIODevice::ReadOnly))
- textViewer->setHtml(file.readAll());
-
- setCentralWidget(textViewer);
-
- createActions();
- createMenus();
-
- initializeAssistant();
-
- setWindowTitle(tr("Simple Text Viewer"));
- resize(750, 400);
-}
-//! [0]
-
-//! [1]
-void MainWindow::closeEvent(QCloseEvent *)
-{
- if (assistantClient)
- assistantClient->closeAssistant();
-}
-//! [1]
-
-void MainWindow::about()
-{
- QMessageBox::about(this, tr("About Simple Text Viewer"),
- tr("This example demonstrates how to use\n" \
- "Qt Assistant as help system for your\n" \
- "own application."));
-}
-
-//! [2]
-void MainWindow::assistant()
-{
- assistantClient->showPage(QLibraryInfo::location(QLibraryInfo::ExamplesPath) +
- QDir::separator() +
- "assistant/simpletextviewer/documentation/index.html");
-}
-//! [2]
-
-//! [3]
-void MainWindow::open()
-{
- FindFileDialog dialog(textViewer, assistantClient);
- dialog.exec();
-}
-//! [3]
-
-void MainWindow::createActions()
-{
- assistantAct = new QAction(tr("Help Contents"), this);
- assistantAct->setShortcuts(QKeySequence::HelpContents);
- connect(assistantAct, SIGNAL(triggered()), this, SLOT(assistant()));
-
- openAct = new QAction(tr("&Open..."), this);
- openAct->setShortcuts(QKeySequence::Open);
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
-
- clearAct = new QAction(tr("&Clear"), this);
- clearAct->setShortcut(tr("Ctrl+C"));
- connect(clearAct, SIGNAL(triggered()), textViewer, SLOT(clear()));
-
- exitAct = new QAction(tr("E&xit"), this);
- exitAct->setShortcuts(QKeySequence::Quit);
- connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
-
- aboutAct = new QAction(tr("&About"), this);
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-}
-
-void MainWindow::createMenus()
-{
- fileMenu = new QMenu(tr("&File"), this);
- fileMenu->addAction(openAct);
- fileMenu->addAction(clearAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- helpMenu = new QMenu(tr("&Help"), this);
- helpMenu->addAction(assistantAct);
- helpMenu->addSeparator();
- helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
-
-
- menuBar()->addMenu(fileMenu);
- menuBar()->addMenu(helpMenu);
-}
-
-//! [4]
-void MainWindow::initializeAssistant()
-{
- assistantClient = new QAssistantClient(QLibraryInfo::location(QLibraryInfo::BinariesPath), this);
-
- QStringList arguments;
- arguments << "-profile" << QString("documentation") + QDir::separator() + QString("simpletextviewer.adp");
- assistantClient->setArguments(arguments);
-}
-//! [4]
diff --git a/examples/assistant/simpletextviewer/mainwindow.h b/examples/assistant/simpletextviewer/mainwindow.h
deleted file mode 100644
index b93827614..000000000
--- a/examples/assistant/simpletextviewer/mainwindow.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QAssistantClient>
-#include <QMainWindow>
-#include <QTextEdit>
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- MainWindow();
-
-private slots:
- void about();
-//! [0]
- void assistant();
-//! [0]
- void open();
-
-protected:
-//! [1]
- void closeEvent(QCloseEvent *event);
-//! [1]
-
-private:
- void createActions();
- void createMenus();
-//! [2]
- void initializeAssistant();
-//! [2]
-
-//! [3]
- QAssistantClient *assistantClient;
-//! [3]
- QTextEdit *textViewer;
-
- QMenu *fileMenu;
- QMenu *helpMenu;
-
- QAction *assistantAct;
- QAction *clearAct;
- QAction *openAct;
- QAction *exitAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
-};
-
-#endif
diff --git a/examples/assistant/simpletextviewer/simpletextviewer.pro b/examples/assistant/simpletextviewer/simpletextviewer.pro
deleted file mode 100644
index 4b66edb3c..000000000
--- a/examples/assistant/simpletextviewer/simpletextviewer.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-CONFIG += assistant
-
-QT += network
-
-HEADERS = mainwindow.h \
- findfiledialog.h
-SOURCES = main.cpp \
- mainwindow.cpp \
- findfiledialog.cpp
-
-# install
-target.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer
-sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer
-INSTALLS += target sources
-