summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/src/examples/application.qdoc16
-rw-r--r--doc/src/qnamespace.qdoc19
-rw-r--r--doc/src/qthelp.qdoc95
-rw-r--r--doc/src/qtnetwork.qdoc66
-rw-r--r--doc/src/snippets/code/src_gui_qproxystyle.cpp15
-rw-r--r--doc/src/snippets/qprocess-environment/main.cpp2
-rw-r--r--doc/src/tutorials/addressbook.qdoc10
7 files changed, 116 insertions, 107 deletions
diff --git a/doc/src/examples/application.qdoc b/doc/src/examples/application.qdoc
index 32e8c10..0408a4a 100644
--- a/doc/src/examples/application.qdoc
+++ b/doc/src/examples/application.qdoc
@@ -45,7 +45,7 @@
The Application example shows how to implement a standard GUI
application with menus, toolbars, and a status bar. The example
- itself is a simple text editor program built around QTextEdit.
+ itself is a simple text editor program built around QPlainTextEdit.
\image application.png Screenshot of the Application example
@@ -103,7 +103,7 @@
\snippet examples/mainwindows/application/mainwindow.cpp 1
\snippet examples/mainwindows/application/mainwindow.cpp 2
- In the constructor, we start by creating a QTextEdit widget as a
+ In the constructor, we start by creating a QPlainTextEdit widget as a
child of the main window (the \c this object). Then we call
QMainWindow::setCentralWidget() to tell that this is going to be
the widget that occupies the central area of the main window,
@@ -114,9 +114,9 @@
functions that set up the user interface. After that, we call \c
readSettings() to restore the user's preferences.
- We establish a signal-slot connection between the QTextEdit's
+ We establish a signal-slot connection between the QPlainTextEdit's
document object and our \c documentWasModified() slot. Whenever
- the user modifies the text in the QTextEdit, we want to update
+ the user modifies the text in the QPlainTextEdit, we want to update
the title bar to show that the file was modified.
At the end, we set the window title using the private
@@ -141,7 +141,7 @@
The \c newFile() slot is invoked when the user selects
\menu{File|New} from the menu. We call \c maybeSave() to save any
pending changes and if the user accepts to go on, we clear the
- QTextEdit and call the private function \c setCurrentFile() to
+ QPlainTextEdit and call the private function \c setCurrentFile() to
update the window title and clear the
\l{QWidget::windowModified}{windowModified} flag.
@@ -187,7 +187,7 @@
\snippet examples/mainwindows/application/mainwindow.cpp 16
The \c documentWasModified() slot is invoked each time the text
- in the QTextEdit changes because of user edits. We call
+ in the QPlainTextEdit changes because of user edits. We call
QWidget::setWindowModified() to make the title bar show that the
file was modified. How this is done varies on each platform.
@@ -227,8 +227,8 @@
\snippet examples/mainwindows/application/mainwindow.cpp 24
The \gui{Edit|Cut} and \gui{Edit|Copy} actions must be available
- only when the QTextEdit contains selected text. We disable them
- by default and connect the QTextEdit::copyAvailable() signal to
+ only when the QPlainTextEdit contains selected text. We disable them
+ by default and connect the QPlainTextEdit::copyAvailable() signal to
the QAction::setEnabled() slot, ensuring that the actions are
disabled when the text editor has no selection.
diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc
index 3f84c00..7ba3af5 100644
--- a/doc/src/qnamespace.qdoc
+++ b/doc/src/qnamespace.qdoc
@@ -531,7 +531,7 @@
\value UniqueConnection Same as AutoConnection, but there will be a check that the signal is
not already connected to the same slot before connecting, otherwise,
the connection will fail.
- \since 4.6
+ This value was introduced in Qt 4.6.
With queued connections, the parameters must be of types that are known to
Qt's meta-object system, because Qt needs to copy the arguments to store them
@@ -2067,9 +2067,9 @@
should be taken over by the target application,
i.e., the source application should not delete
the data.
-
- On X11 this value is used to do a move.
-
+ \br
+ On X11 this value is used to do a move.
+ \br
TargetMoveAction is not used on the Mac.
*/
@@ -2680,13 +2680,16 @@
\enum Qt::TileRule
\since 4.6
- This enum describes how to repeat or stretch the parts of an image when drawing.
+ This enum describes how to repeat or stretch the parts of an image
+ when drawing.
\value Stretch Scale the image to fit to the available area.
- \value Repeat Tile the image until there is no more space. May crop the last image.
- \value Round Like Repeat, but scales the images down to ensure that the last image is not cropped.
- \sa QPixmapBorders, qDrawBorderPixmap()
+ \value Repeat Tile the image until there is no more space. May crop
+ the last image.
+
+ \value Round Like Repeat, but scales the images down to ensure that
+ the last image is not cropped.
*/
/*! \enum Qt::GestureType
diff --git a/doc/src/qthelp.qdoc b/doc/src/qthelp.qdoc
index 05bf3e3..2182606 100644
--- a/doc/src/qthelp.qdoc
+++ b/doc/src/qthelp.qdoc
@@ -96,7 +96,7 @@
generation of the compressed help file.
As already mentioned, the Qt compressed help file contains all
- data, so there is no need any longer to ship all single html
+ data, so there is no need any longer to ship all single html
files. Instead, only the compressed help file and optionally the
collection file has to be distributed. The collection file is
optional since any existing collection file, e.g. from an older
@@ -211,7 +211,7 @@
\section2 Using QHelpEngine API
Instead of showing the help in an external application like the
- Qt Assistant, it is also possible to embed the online help in
+ Qt Assistant, it is also possible to embed the online help in
the application. The contents can then be retrieved via the
QHelpEngine class and can be displayed in nearly any form.
Showing it in a QTextBrowser is probably the most common way, but
@@ -238,7 +238,7 @@
Qt Commercial Edition licensees that wish to distribute applications that
use these features of the QtHelp module need to be aware of their
- obligations under the GNU Lesser General Public License (LGPL).
+ obligations under the GNU Lesser General Public License (LGPL).
Developers using the Open Source Edition can choose to redistribute
the module under the appropriate version of the GNU LGPL; version 2.1
@@ -269,23 +269,23 @@
/*!
\page qthelpproject.html
\title Qt Help Project
-
+
A Qt help project collects all data necessary to generate a
compressed help file. Along with the actual help data, like
the table of contents, index keywords and help documents, it
contains some extra information like a namespace to identify
the help file. One help project stands for one documentation,
e.g. the Qt Assistant manual.
-
+
\section1 Qt Help Project File Format
-
+
The file format is XML based. For a better understanding of
the format we'll discuss the following example:
-
+
\snippet doc/src/snippets/code/doc_src_qthelp.qdoc 7
-
+
\section2 Namespace
-
+
To enable the QHelpEngine to retrieve the proper documentation to
a given link, every documentation set has to have a unique
identifier. A unique identifier makes is also possible for the
@@ -293,10 +293,10 @@
on its file name. The Qt help system uses a namespace as identifier
which is defined by the mandatory namespace tags. In the example
above, the namespace is "mycompany.com.myapplication.1_0".
-
+
\target Virtual Folders
\section2 Virtual Folders
-
+
Having a namespace for every documentation naturally means that
the documentation sets are quite separated. From the help engines
point of view this is beneficial, but from the documentors view
@@ -304,84 +304,86 @@
manual to another without having to specify absolute links. To
solve this problem, the help system introduced the concept of
virtual folders.
-
+
A virtual folder will become the root directory of all files
referenced in a compressed help file. When two documentations
share the same virtual folder, they can use relative paths when
defining hyperlinks pointing to the other documentation. If a
file is contained in both documentations or manuals, the one
from the current manual has precedence over the other.
-
+
\snippet doc/src/snippets/code/doc_src_qthelp.qdoc 8
-
+
The above example specifies 'doc' as virtual folder. If another
manual, e.g. for a small helper tool for 'My Application'
specifies the same folder, it is sufficient to write
'doc.html#section1' to reference the first section in the
'My Application' manual.
-
+
The virtual folder tag is mandatory and the folder must not
contain any '/'.
-
+
\target Custom Filters
\section2 Custom Filters
-
+
Next in the Qt help project file are the optional definitions of
- custom filters. A custom filter contains a list of filter
+ custom filters. A custom filter contains a list of filter
attributes which will be used later to display only the documentation
which has all those attributes assigned to. So, when setting the
current filter in the QHelpEngine to "My Application 1.0" only
the documentation which has "myapp" and "1.0" set as filter
attributes will be shown.
-
+
\snippet doc/src/snippets/code/doc_src_qthelp.qdoc 9
-
+
It is possible to define any number of custom filters in a help
project file. Important to know is, that the filter attributes have
not to be specified in the same project file; they can be defined
in any other help file. The definition of a filter attributes
takes place by specifying them in a filter section.
-
+
\target Filter Section
- \section2 Filter Section
-
+ \section2 Filter Section
+
A filter section contains the actual documentation. One Qt help project
file may contain more than one filter sections. Every filter section
consists of four parts, the filter attributes section, the table of
contents, the keywords and the files list. In theory all parts are
optional but not specifying anything there will result in an empty
documentation.
-
+
\section3 Filter Attributes
-
+
Every filter section should have filter attributes assigned to it, to
enable documentation filtering. If no filter attribute is defined, the
documentation will only be shown if no filtering occurs, meaning the
current custom filter in the QHelpEngine does not contain any filter
attributes.
-
+
\snippet doc/src/snippets/code/doc_src_qthelp.qdoc 10
-
+
In this case, the filter attributes 'myapp' and '1.0' are assigned
to the filter section, i.e. all contents specified in this section
will only be shown if the current custom filter has 'myapp' or '1.0'
or both as filter attributes.
-
+
\section3 Table of contents
-
+
\snippet doc/src/snippets/code/doc_src_qthelp.qdoc 11
-
+
One section tag represents one item in the table of contents. The
sections can be nested to any degree, but from a users perspective
- it shouldn't be more than four or five levels. A section is defined
- by its title and reference. The reference, like all file references
- in a Qt help project file are relative to the help project file
- itself.
-
+ it should not be more than four or five levels. A section is defined
+ by its title and reference. The reference, like all file references in a Qt
+ help project, are relative to the help project file itself.
+ \note The referenced files must be inside the same directory (or within a
+ subdirectory) as the help project file. An absolute file path is not supported
+ either.
+
\section3 Keywords
-
+
\snippet doc/src/snippets/code/doc_src_qthelp.qdoc 12
-
+
The keyword section lists all keywords of this filter section. A
keyword consists basically of a name and a file reference. If the
attribute 'name' is used then the keyword specified there will appear in
@@ -389,15 +391,18 @@
If 'id' is used, the keyword does not appear in the index and is
only accessible via the linksForIdentifier() function of the
QHelpEngineCore. 'name' and 'id' can be specified at the same time.
-
+
\section3 Files
-
+
\snippet doc/src/snippets/code/doc_src_qthelp.qdoc 13
-
+
Finally, the actual documentation files have to be listed. Make sure
- that all files neccessary to display the help are mentioned, i.e.
- stylesheets or similar files need to be there as well. All listed files
- will be compressed and written to the Qt compressed help file. So, in the
- end, one single Qt help file contains all documentation files along with
- the contents and indices.
+ that all files neccessary to display the help are mentioned, i.e.
+ stylesheets or similar files need to be there as well. The file, like all
+ file references in a Qt help project, are relative to the help project file
+ itself. All listed files will be compressed and written to the Qt compressed
+ help file. So, in the end, one single Qt help file contains all
+ documentation files along with the contents and indices. \note The
+ referenced files must be inside the same directory (or within a subdirectory)
+ as the help project file. An absolute file path is not supported either.
*/
diff --git a/doc/src/qtnetwork.qdoc b/doc/src/qtnetwork.qdoc
index 2be7457..3773c81 100644
--- a/doc/src/qtnetwork.qdoc
+++ b/doc/src/qtnetwork.qdoc
@@ -51,7 +51,7 @@
write TCP/IP clients and servers.
The network module provides classes to make network programming
- easier and portable. It offers classes such as QHttp and QFtp that
+ easier and portable. It offers classes such as QFtp that
implement specific application-level protocols, lower-level classes
such as QTcpSocket, QTcpServer and QUdpSocket that represent low
level network concepts, and high level classes such as QNetworkRequest,
@@ -81,7 +81,7 @@
\snippet doc/src/snippets/code/doc_src_qtnetwork.qdoc 1
- \section1 High Level Network Operations
+ \section1 High Level Network Operations for HTTP and FTP
The Network Access API is a collection of classes for performing
common network operations. The API provides an abstraction layer
@@ -94,6 +94,8 @@
with a request, such as any header information and the encryption
used. The URL specified when a request object is constructed
determines the protocol used for a request.
+ Currently HTTP, FTP and local file URLs are supported for uploading
+ and downloading.
The coordination of network operations is performed by the
QNetworkAccessManager class. Once a request has been created,
@@ -113,65 +115,50 @@
Each application or library can create one or more instances of
QNetworkAccessManager to handle network communication.
+
+ \section1 Writing FTP Clients with QFtp
- \section1 Writing HTTP and FTP Clients with QHttp and QFtp
+ FTP (File Transfer Protocol) is a protocol used almost exclusively
+ for browsing remote directories and for transferring files.
- HTTP (Hypertext Transfer Protocol) is an application-level
- network protocol used mainly for downloading HTML and XML files,
- but it is also used as a high-level transport protocol for many
- other types of data, from images and movies to purchase orders
- and banking transactions. In contrast, FTP (File Transfer
- Protocol) is a protocol used almost exclusively for browsing
- remote directories and for transferring files.
+ \image httpstack.png FTP Client and Server
- \image httpstack.png HTTP Client and Server
-
- HTTP is a simpler protocol than FTP in many ways. It uses only
- one network connection, while FTP uses two (one for sending
- commands, and one for transferring data). HTTP is a stateless
- protocol; requests and responses are always self-contained. The
+ FTP uses two network connections, one for sending
+ commands and one for transferring data. The
FTP protocol has a state and requires the client to send several
commands before a file transfer takes place.
+ FTP clients establish a connection
+ and keeps it open throughout the session. In each session, multiple
+ transfers can occur.
- In practice, HTTP clients often use separate connections for
- separate requests, whereas FTP clients establish one connection
- and keep it open throughout the session.
-
- The QHttp and QFtp classes provide client-side support for HTTP
- and FTP. Since the two protocols are used to solve the same
- problems, the QHttp and QFtp classes have many features in
- common:
-
+ The QFtp class provides client-side support for FTP.
+ It has the following characteristics:
\list
- \o \e{Non-blocking behavior.} QHttp and QFtp are asynchronous.
- You can schedule a series of commands (also called "requests" for
- HTTP). The commands are executed later, when control returns to
- Qt's event loop.
+ \o \e{Non-blocking behavior.} QFtp is asynchronous.
+ You can schedule a series of commands which are executed later,
+ when control returns to Qt's event loop.
\o \e{Command IDs.} Each command has a unique ID number that you
can use to follow the execution of the command. For example, QFtp
emits the \l{QFtp::commandStarted()}{commandStarted()} and
\l{QFtp::commandFinished()}{commandFinished()} signal with the
- command ID for each command that is executed. QHttp has a
- \l{QHttp::requestStarted()}{requestStarted()} and a
- \l{QHttp::requestFinished()}{requestFinished()} signal that work
- the same way.
+ command ID for each command that is executed.
- \o \e{Data transfer progress indicators.} QHttp and QFtp emit
+ \o \e{Data transfer progress indicators.} QFtp emits
signals whenever data is transferred
(QFtp::dataTransferProgress(), QHttp::dataReadProgress(), and
QHttp::dataSendProgress()). You could connect these signals to
QProgressBar::setProgress() or QProgressDialog::setProgress(),
for example.
- \o \e{QIODevice support.} Both classes support convenient
+ \o \e{QIODevice support.} The class supports convenient
uploading from and downloading to \l{QIODevice}s, in addition to a
QByteArray-based API.
\endlist
- There are two main ways of using QHttp and QFtp. The most common
+ There are two main ways of using QFtp. The most common
approach is to keep track of the command IDs and follow the
execution of every command by connecting to the appropriate
signals. The other approach is to schedule all commands at once
@@ -182,10 +169,9 @@
commands based on the result of a previous command. It also
enables you to provide detailed feedback to the user.
- The \l{network/http}{HTTP} and \l{network/ftp}{FTP} examples
- illustrate how to write an HTTP and an FTP client.
-
- Writing your own HTTP or FTP server is possible using the
+ The \l{network/ftp}{FTP} example
+ illustrates how to write an FTP client.
+ Writing your own FTP (or HTTP) server is possible using the
lower-level classes QTcpSocket and QTcpServer.
\section1 Using TCP with QTcpSocket and QTcpServer
diff --git a/doc/src/snippets/code/src_gui_qproxystyle.cpp b/doc/src/snippets/code/src_gui_qproxystyle.cpp
new file mode 100644
index 0000000..7633160
--- /dev/null
+++ b/doc/src/snippets/code/src_gui_qproxystyle.cpp
@@ -0,0 +1,15 @@
+//! [0]
+class MyProxyStyle : public QProxyStyle
+{
+public:
+
+ int styleHint(StyleHint hint, const QStyleOption *option = 0,
+ const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const
+ {
+ if (hint == QStyle::SH_UnderlineShortcut)
+ return 1;
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+};
+
+//! [0]
diff --git a/doc/src/snippets/qprocess-environment/main.cpp b/doc/src/snippets/qprocess-environment/main.cpp
index 148518b..c8681e7 100644
--- a/doc/src/snippets/qprocess-environment/main.cpp
+++ b/doc/src/snippets/qprocess-environment/main.cpp
@@ -62,7 +62,7 @@ env.insert("TMPDIR", "C:\\MyApp\\temp"); // Add an environment variable
env["PATH"] += ";C:\\Bin";
process.setEnvironment(env);
process.start("myapp");
-//! [0]
+//! [1]
}
}
diff --git a/doc/src/tutorials/addressbook.qdoc b/doc/src/tutorials/addressbook.qdoc
index 465eb91..ec5ea67 100644
--- a/doc/src/tutorials/addressbook.qdoc
+++ b/doc/src/tutorials/addressbook.qdoc
@@ -646,11 +646,11 @@
\snippet tutorials/addressbook/part4/addressbook.cpp update interface() part 1
- For \c NavigationMode, however, we include conditions within the
- parameters of the QPushButton::setEnabled(). This is to ensure that
- the \c editButton and \c removeButton push buttons are enabled when there
- is at least one contact in the address book; \c nextButton and \c previousButton
- are only enabled when there is more than one contact in the address book.
+ For \c NavigationMode, however, we include conditions within the parameters
+ of the QPushButton::setEnabled() function. This is to ensure that
+ \c editButton and \c removeButton are enabled when there is at least one
+ contact in the address book; \c nextButton and \c previousButton are only
+ enabled when there is more than one contact in the address book.
\snippet tutorials/addressbook/part4/addressbook.cpp update interface() part 2