diff options
Diffstat (limited to 'doc/src/examples/application.qdoc')
-rw-r--r-- | doc/src/examples/application.qdoc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/doc/src/examples/application.qdoc b/doc/src/examples/application.qdoc index 5fe3e42..96e81b3 100644 --- a/doc/src/examples/application.qdoc +++ b/doc/src/examples/application.qdoc @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the documentation of the Qt Toolkit. @@ -21,9 +20,10 @@ ** 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.1, included in the file LGPL_EXCEPTION.txt in this package. +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. @@ -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. @@ -289,7 +289,7 @@ When restoring the position and size of a window, it's important to call QWidget::resize() before QWidget::move(). The reason why - is given in the \l{geometry.html}{Window Geometry} overview. + is given in the \l{Window Geometry} overview. \snippet examples/mainwindows/application/mainwindow.cpp 37 \snippet examples/mainwindows/application/mainwindow.cpp 39 |