\example painting/affine
\title Affine Transformations
- In this demo we show Qt's ability to perform affine transformations
+ In this example we show Qt's ability to perform affine transformations
on painting operations.
\image affine-demo.png
/*!
\example sql/books
- \title Books Demonstration
+ \title Books
- The Books demonstration shows how Qt's SQL classes can be used with the model/view
+ The Books example shows how Qt's SQL classes can be used with the model/view
framework to create rich user interfaces for information stored in a database.
\image books-demo.png
****************************************************************************/
/*!
- \example embedded/styledemo
+ \example embedded/styleexample
\title Embedded Styles
\image styledemo-demo.png
\section2 4.2 Qt Documentation
- Qt 4.7 comes with 17 examples and 2 Demonstrations for model/view.
+ Qt 5.0 comes with 19 examples for model/view.
The examples can be found on the \l{Item Views Examples} page.
\table
\o QStandardItemModel
\o
\row
+ \o Interview
+ \o Multiple
+ \o Custom item model
+ \o Multiple views
+ \row
\o Pixelator
\o QTableView
\o Custom table model
\o QStandardItemModel
\o Custom delegate that uses a spin box as a cell editor
\row
+ \o Spreadsheet
+ \o {2, 1} QTableView
+ \o Custom delegates
+ \row
\o Star Delegate
\o {2, 1} QTableWidget
\o Comprehensive custom delegate example.
\endtable
- \l{Qt Demonstrations}{Demonstrations} are similar to examples except that no
- walkthrough is provided for the code. Demonstrations are typically more
- feature rich than examples.
-
- \list
- \o The \bold Interview demonstration shows the same model and
- selection being shared between three different views.
- \o The \bold Spreadsheet demonstration illustrates the use of a
- table view as a spreadsheet, using custom delegates to render
- each item according to the type of data it contains.
- \endlist
-
A \l{Model/View Programming}{reference document} for model/view technology
is also available.
*/
-Qt is supplied with a number of example applications and demonstrations that
-have been written to provide developers with examples of the Qt API in use,
+Qt is supplied with a number of example applications that have been
+written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.
-The example and demo launcher can be used to explore the different categories
-available. It provides an overview of each example, lets you view the
-documentation in Qt Assistant, and is able to launch examples and demos.
-Documentation for examples can be found in the Tutorials and Examples section
+Documentation for examples can be found in the Examples section
of the Qt documentation.
-
-
-Finding the Qt Examples and Demos launcher
-==========================================
-
-On Windows:
-
-The launcher can be accessed via the Windows Start menu. Select the menu
-entry entitled "Qt Examples and Demos" entry in the submenu containing
-the Qt tools.
-
-On Mac OS X:
-
-For the binary distribution, the qtdemo executable is installed in the
-/Developer/Applications/Qt directory. For the source distribution, it is
-installed alongside the other Qt tools on the path specified when Qt is
-configured.
-
-On Unix/Linux:
-
-The qtdemo executable is installed alongside the other Qt tools on the path
-specified when Qt is configured.
-
-On all platforms:
-
-The source code for the launcher can be found in the demos/qtdemo directory
-in the Qt package. This example is built at the same time as the Qt libraries,
-tools, examples, and demonstrations.
TEMPLATE = subdirs
-SUBDIRS = styledemo raycasting flickable digiflip
+SUBDIRS = styleexample raycasting flickable digiflip
SUBDIRS += lightmaps
SUBDIRS += flightinfo
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- Q_INIT_RESOURCE(styledemo);
+ Q_INIT_RESOURCE(styleexample);
app.setApplicationName("style");
app.setOrganizationName("Nokia");
HEADERS += stylewidget.h
FORMS += stylewidget.ui
SOURCES += main.cpp stylewidget.cpp
-RESOURCES += styledemo.qrc
+RESOURCES += styleexample.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/embedded/styledemo
+target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/embedded/styleexample
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.html
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/embedded/styledemo
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/embedded/styleexample
INSTALLS += target sources
symbian {
</layout>
</widget>
<resources>
- <include location="StyleDemo.qrc"/>
+ <include location="styleexample.qrc"/>
</resources>
<connections>
<connection>
layout->addWidget(vSplitter);
setLayout(layout);
- setWindowTitle(tr("Chip Demo"));
+ setWindowTitle(tr("Chip Example"));
}
void MainWindow::populateScene()
view.setBackgroundBrush(QPixmap(":/No-Ones-Laughing-3.jpg"));
view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
view.show();
- view.setWindowTitle("Embedded Dialogs Demo");
+ view.setWindowTitle("Embedded Dialogs Example");
return app.exec();
}
#include <qdebug.h>
static const char * const message =
- "<p><b>Qt Main Window Demo</b></p>"
+ "<p><b>Qt Main Window Example</b></p>"
"<p>This is a demonstration of the QMainWindow, QToolBar and "
"QDockWidget classes.</p>"
: QMainWindow(parent, flags)
{
setObjectName("MainWindow");
- setWindowTitle("Qt Main Window Demo");
+ setWindowTitle("Qt Main Window Example");
center = new QTextEdit(this);
center->setReadOnly(true);
// defaults
view->reset();
vectorType->setChecked(true);
- textEditor->setText("Qt Affine Transformation Demo");
+ textEditor->setText("Qt Affine Transformation Example");
textEditor->setEnabled(false);
animateButton->animateClick();
<html>
-<h1>Demo for composition modes</h1>
+<h1>Example for composition modes</h1>
<p>
- This demo shows some of the more advanced composition modes supported by Qt.
+ This example shows some of the more advanced composition modes supported by Qt.
</p>
<p>
-<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>QTextEdit Demonstration</title><style type="text/css">
+<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>QTextEdit Example</title><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:20pt; font-weight:600;">QTextEdit</span></p>
<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">The QTextEdit widget is an advanced editor that supports formatted rich text. It can be used to display HTML and other rich document formats. Internally, QTextEdit uses the QTextDocument class to describe both the high-level structure of each document and the low-level formatting of paragraphs.</span></p>
-<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">If you are viewing this document in the <span style=" font-style:italic;">textedit</span> demo, you can edit this document to explore Qt's rich text editing features. We have included some comments in each of the following sections to encourage you to experiment. </p>
+<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">If you are viewing this document in the <span style=" font-style:italic;">textedit</span> example, you can edit this document to explore Qt's rich text editing features. We have included some comments in each of the following sections to encourage you to experiment. </p>
<p style=" margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:18pt; font-weight:600;"><span style=" font-size:16pt;">Font and Paragraph Styles</span></p>
<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">QTextEdit supports </span><span style=" font-size:11pt; font-weight:600;">bold</span><span style=" font-size:11pt;">, </span><span style=" font-size:11pt; font-style:italic;">italic</span><span style=" font-size:11pt;">, and </span><span style=" font-size:11pt; text-decoration: underline;">underlined</span><span style=" font-size:11pt;"> font styles, and can display </span><span style=" font-size:11pt; font-weight:600; color:#00007f;">multicolored</span><span style=" font-size:11pt;"> </span><span style=" font-size:11pt; font-weight:600; color:#aa0000;">text</span><span style=" font-size:11pt;">. Font families such as </span><span style=" font-family:'Times'; font-size:11pt; font-weight:600;">Times New Roman</span><span style=" font-size:11pt;"> and </span><span style=" font-family:'Courier'; font-size:11pt; font-weight:600;">Courier</span><span style=" font-size:11pt;"> can also be used directly. </span><span style=" font-size:11pt; font-style:italic;">If you place the cursor in a region of styled text, the controls in the tool bars will change to reflect the current style.</span></p>
<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Paragraphs can be formatted so that the text is left-aligned, right-aligned, centered, or fully justified.</p>
\o \inlineimage qpainter-compositiondemo.png
\o
- \bold {Composition Modes Demo}
+ \bold {Composition Modes Example}
The \l {painting/composition}{Composition Modes} example, available in
Qt's examples directory, allows you to experiment with the various
Simulator:
----------
-configure -qpa -xplatform qws/macx-iphonesimulator-g++ -arch i386 -developer-build -opengl es1 -no-accessibility -no-qt3support -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations
+configure -qpa -xplatform qws/macx-iphonesimulator-g++ -arch i386 -developer-build -opengl es1 -no-accessibility -no-qt3support -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake docs -nomake examples -nomake translations
Device:
-------
-configure -qpa -xplatform qws/macx-iphonedevice-g++ -arch armv7 -developer-build -release -opengl es1 -no-accessibility -no-qt3support -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake demos -nomake docs -nomake examples -nomake translations
+configure -qpa -xplatform qws/macx-iphonedevice-g++ -arch armv7 -developer-build -release -opengl es1 -no-accessibility -no-qt3support -no-multimedia -no-phonon -no-phonon-backend -no-svg -no-webkit -no-scripttools -no-openssl -no-sql-mysql -no-sql-odbc -no-cups -no-iconv -no-dbus -static -nomake tools -nomake docs -nomake examples -nomake translations
2) XCode setup:
- there are examples in the examples subdirectory of the platform plugin
void tst_qurl::qmlPropertyWriteUseCase()
{
- QUrl base("file:///home/user/qt/demos/declarative/samegame/SamegameCore/");
+ QUrl base("file:///home/user/qt/examples/declarative/samegame/SamegameCore/");
QString str("pics/redStar.png");
QBENCHMARK {
layout->addWidget(view);
setLayout(layout);
- setWindowTitle(tr("Chip Demo"));
+ setWindowTitle(tr("Chip Example"));
}
void MainWindow::populateScene()
populateScene();
setScene(scene);
- setWindowTitle(tr("Chip Demo"));
+ setWindowTitle(tr("Chip Example"));
}
void ChipTester::setAntialias(bool enabled)