summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/classes.qdoc123
-rw-r--r--doc/src/classes/exportedfunctions.qdoc6
-rw-r--r--doc/src/examples/qtscriptcalculator.qdoc6
-rw-r--r--doc/src/examples/qxmlstreambookmarks.qdoc42
-rw-r--r--doc/src/howtos/restoring-geometry.qdoc39
-rw-r--r--doc/src/index.qdoc2
-rw-r--r--doc/src/legal/commercialeditions.qdoc12
-rw-r--r--doc/src/modules.qdoc52
-rw-r--r--doc/src/platforms/winsystem.qdoc4
-rw-r--r--doc/src/scripting/scripting.qdoc38
-rw-r--r--doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp19
11 files changed, 175 insertions, 168 deletions
diff --git a/doc/src/classes.qdoc b/doc/src/classes.qdoc
index 864445f..24acce1 100644
--- a/doc/src/classes.qdoc
+++ b/doc/src/classes.qdoc
@@ -41,58 +41,85 @@
/*!
\group classlists
- \title Class and Function Indexes
- \brief Collections of classes and functions grouped together into lists.
+ \title Class and Function Documentation
+ \brief Lists and Indexes of classes, functions, and types.
- The following documents contain collections of classes, grouped by
- subject area or related to particular functionality, or comprehensive
- lists of classes and functions.
+ Links to indexes and lists for finding class and function
+ reference documentation.
+
+ \section2 Class Lists
+
+ \annotatedlist classlists
+
+ \section2 Function Lists
+
+ \annotatedlist funclists
- \generatelist{related}
*/
/*!
- \group groups
- \title Grouped Classes
+ \page classes.html
+ \title All Qt Classes (main index)
\ingroup classlists
- This page provides a way of navigating Qt's classes by grouping
- related classes together. Some classes may appear in more than one group.
+ \brief If you know the name of the class you want, find it here.
- \generatelist{related}
+ This is a list of all Qt classes. For a list of the classes
+ provided for compatibility with Qt3, see \l{Qt3 Support
+ Classes}. For classes that have been deprecated, see the
+ \l{Obsolete Classes} list.
+
+ \generatelist classes
+ \sa {Qt3 Support Classes}, {All Qt Modules}, {Obsolete Classes}
*/
/*!
- \page classes.html
- \title Qt's Classes
+ \page annotated.html
+ \title Annotated Class List
\ingroup classlists
- This is a list of all Qt classes. For a list of the classes provided
- for compatibility with Qt3, see \l{Qt 3 compatibility classes}. For
- classes that have been deprecated, see the \l{Obsolete Classes} list.
+ \brief If you don't know the name of the class you want, but you
+ know what the class should do, you might try looking here.
- \generatelist classes
+ Qt classes with brief descriptions:
- \sa {Qt 3 Compatibility Classes}, {Qt's Modules}, {Obsolete Classes}
+ \generatelist annotatedclasses
*/
/*!
- \page namespaces.html
- \title Qt's Namespaces
+ \group groups
+ \title Groups Of Related Classes
\ingroup classlists
- This is a list of the main namespaces in Qt. For a list of classes in
- Qt, see \l{Qt's Classes}.
+ \brief If you know what kind of class you want (GUI, painting,
+ I.O, etc), look here.
- \generatelist{namespaces}
+ This is a list of functional groups of Qt classes. A class can
+ appear in more than one functional group.
+
+ \generatelist{related}
+
+*/
+
+/*!
+ \page hierarchy.html
+
+ \title Inheritance Hierarchy
+ \ingroup classlists
+
+ \brief The C++ class inheritance hierarchy for all classes in the
+ Qt API.
+
+ \generatelist classhierarchy
*/
/*!
\page obsoleteclasses.html
\title Obsolete Classes
\ingroup classlists
-
+
+ \brief These classes are obsolete and should not be used in new code.
This is a list of Qt classes that are obsolete (deprecated). These
classes are provided to keep old source code working but they are
@@ -101,52 +128,46 @@
\generatelist obsoleteclasses
- \sa {Qt's Classes}, {Qt's Modules}
*/
/*!
- \page annotated.html
- \title Annotated Class Index
+ \page compatclasses.html
+ \title Qt3 Support Classes
\ingroup classlists
- Qt's classes with brief descriptions:
+ \brief These classes ease the porting of code from Qt 3 to Qt 4.
- \generatelist annotatedclasses
-*/
-
-/*!
- \page functions.html
- \title Member Function Index
- \ingroup classlists
+ These are the classes that Qt provides for compatibility with Qt
+ 3. Most of these are provided by the Qt3Support module.
- Here is the list of all the documented member functions in the Qt
- API with links to the class documentation for each function.
+ \generatelist compatclasses
- \generatelist functionindex
*/
/*!
- \page hierarchy.html
+ \page functions.html
+ \title All Functions (main index)
+ \ingroup funclists
- \title Class Inheritance Hierarchy
- \ingroup classlists
+ \brief All documented Qt functions listed alphabetically with a
+ link to where each one is declared.
- This list shows the C++ class inheritance relations between the
- classes in the Qt API.
+ This is the list of all documented member functions and global
+ functions in the Qt API. Each function has a link to the class or
+ header file where it is declared and documented.
- \generatelist classhierarchy
+ \generatelist functionindex
*/
+
/*!
- \page compatclasses.html
- \title Qt 3 Compatibility Classes
+ \page namespaces.html
+ \title All Qt Namespaces
\ingroup classlists
- This is a list of the classes that Qt provides for compatibility
- with Qt 3. The vast majority of these are provided by the
- Qt3Support module.
+ \brief A Qt namespace contains enum types, functions, and sometimes classes.
- \generatelist compatclasses
+ This is a list of the main namespaces in Qt.
- \sa {Qt's Classes}, {Qt's Modules}
+ \generatelist{namespaces}
*/
diff --git a/doc/src/classes/exportedfunctions.qdoc b/doc/src/classes/exportedfunctions.qdoc
index c51ace4..a0e3904 100644
--- a/doc/src/classes/exportedfunctions.qdoc
+++ b/doc/src/classes/exportedfunctions.qdoc
@@ -41,8 +41,10 @@
/*!
\page exportedfunctions.html
- \title Special-Purpose Global Functions Exported by Qt
- \ingroup classlists
+ \title Platform-Specific Functions
+ \ingroup funclists
+
+ \brief Exported functions for fine tuning Qt applications.
Qt provides a few low-level global functions for fine-tuning
applications. Most of these perform very specific tasks and are
diff --git a/doc/src/examples/qtscriptcalculator.qdoc b/doc/src/examples/qtscriptcalculator.qdoc
index 0e6e153..7adce5a 100644
--- a/doc/src/examples/qtscriptcalculator.qdoc
+++ b/doc/src/examples/qtscriptcalculator.qdoc
@@ -89,10 +89,8 @@
\snippet examples/script/calculator/calculator.js 1
- The digitClicked() function uses the special local variable
- __qt_sender__ to access the object that triggered the signal;
- this gives us a simple way to retrieve the value of the digit
- that was clicked.
+ The digitClicked() function is called when a digit button is
+ clicked, with the input digit as argument.
\snippet examples/script/calculator/calculator.js 2
diff --git a/doc/src/examples/qxmlstreambookmarks.qdoc b/doc/src/examples/qxmlstreambookmarks.qdoc
index 26964c4..904cd6d 100644
--- a/doc/src/examples/qxmlstreambookmarks.qdoc
+++ b/doc/src/examples/qxmlstreambookmarks.qdoc
@@ -51,10 +51,10 @@
\section1 XbelWriter Class Definition
- The \c XbelWriter class is a subclass of QXmlStreamReader, which provides
- an XML parser with a streaming API. \c XbelWriter also contains a private
- instance of QTreeWidget in order to display the bookmarks according to
- hierarchies.
+ The \c XbelWriter class contains a private instance of QXmlStreamWriter,
+ which provides an XML writer with a streaming API. \c XbelWriter also
+ has a reference to the QTreeWidget instance where the bookmark hierarchy
+ is stored.
\snippet examples/xml/streambookmarks/xbelwriter.h 0
@@ -75,7 +75,7 @@
\snippet examples/xml/streambookmarks/xbelwriter.cpp 1
- The \c writeItem() function accepts a QTreeWidget object and writes it
+ The \c writeItem() function accepts a QTreeWidgetItem object and writes it
to the stream, depending on its \c tagName, which can either be a "folder",
"bookmark", or "separator".
@@ -83,9 +83,10 @@
\section1 XbelReader Class Definition
- The \c XbelReader class is a subclass of QXmlStreamReader, the pendent
- class for QXmlStreamWriter. \c XbelReader contains a private instance
- of QTreeWidget to group bookmarks according to their hierarchies.
+ The \c XbelReader contains a private instance of QXmlStreamReader, the
+ companion class to QXmlStreamWriter. \c XbelReader also contains a
+ reference to the QTreeWidget that is used to group the bookmarks according
+ to their hierarchy.
\snippet examples/xml/streambookmarks/xbelreader.h 0
@@ -102,21 +103,26 @@
\snippet examples/xml/streambookmarks/xbelreader.cpp 0
The \c read() function accepts a QIODevice and sets it using
- \l{QXmlStreamReader::setDevice()}{setDevice()}. The actual process
- of reading only takes place if the file is a valid XBEL 1.0 file.
- Note that the XML input needs to be well-formed to be accepted by
- QXmlStreamReader. Otherwise, the \l{QXmlStreamReader::raiseError()}
- {raiseError()} function is used to display an error message. Since the
- XBEL reader is only concerned with reading XML elements, it makes
- extensive use of the \l{QXmlStreamReader::readNextStartElement()}
+ \l{QXmlStreamReader::}{setDevice()}. The actual process of reading only
+ takes place if the file is a valid XBEL 1.0 file. Note that the XML input
+ needs to be well-formed to be accepted by QXmlStreamReader. Otherwise, the
+ \l{QXmlStreamReader::}{raiseError()} function is used to display an error
+ message. Since the XBEL reader is only concerned with reading XML elements,
+ it makes extensive use of the \l{QXmlStreamReader::}{readNextStartElement()}
convenience function.
\snippet examples/xml/streambookmarks/xbelreader.cpp 1
+ The \c errorString() function is used if an error occurred, in order to
+ obtain a description of the error complete with line and column number
+ information.
+
+ \snippet examples/xml/streambookmarks/xbelreader.cpp 2
+
The \c readXBEL() function reads the name of a startElement and calls
the appropriate function to read it, depending on whether if its a
"folder", "bookmark" or "separator". Otherwise, it calls
- \l{QXmlStreamReader::skipCurrentElement()}. The Q_ASSERT() macro is used
+ \l{QXmlStreamReader::}{skipCurrentElement()}. The Q_ASSERT() macro is used
to provide a pre-condition for the function.
\snippet examples/xml/streambookmarks/xbelreader.cpp 3
@@ -126,8 +132,8 @@
\snippet examples/xml/streambookmarks/xbelreader.cpp 4
The \c readSeparator() function creates a separator and sets its flags.
- The text is set to 30 "0xB7", the HEX equivalent for period, and then
- read using \c readElementText().
+ The text is set to 30 "0xB7", the HEX equivalent for period. The element
+ is then skipped using \l{QXmlStreamReader::}{skipCurrentElement()}.
\snippet examples/xml/streambookmarks/xbelreader.cpp 5
diff --git a/doc/src/howtos/restoring-geometry.qdoc b/doc/src/howtos/restoring-geometry.qdoc
index c9e6f4f..cc6f3e1 100644
--- a/doc/src/howtos/restoring-geometry.qdoc
+++ b/doc/src/howtos/restoring-geometry.qdoc
@@ -45,25 +45,28 @@
\ingroup best-practices
- This document describes how to save and restore a window's
- geometry using the geometry properties. On Windows, this is
- basically storing the result of QWidget::geometry() and calling
- QWidget::setGeometry() in the next session before calling
- \l{QWidget::show()}{show()}.
+ This document describes how to save and restore a \l{Window
+ Geometry}{window's geometry} using the geometry properties. On
+ Windows, this is basically storing the result of
+ QWidget::geometry() and calling QWidget::setGeometry() in the next
+ session before calling \l{QWidget::show()}{show()}.
- On X11, this won't work because an invisible window doesn't have
- a frame yet. The window manager will decorate the window later.
- When this happens, the window shifts towards the bottom/right
- corner of the screen depending on the size of the decoration frame.
- Although X provides a way to avoid this shift, most window managers
- fail to implement this feature.
+ On X11, this might not work because an invisible window does not
+ have a frame yet. The window manager will decorate the window
+ later. When this happens, the window shifts towards the
+ bottom/right corner of the screen depending on the size of the
+ decoration frame. Although X provides a way to avoid this shift,
+ some window managers fail to implement this feature.
Since version 4.2, Qt provides functions that saves and restores a
window's geometry and state for you. QWidget::saveGeometry()
saves the window geometry and maximized/fullscreen state, while
QWidget::restoreGeometry() restores it. The restore function also
checks if the restored geometry is outside the available screen
- geometry, and modifies it as appropriate if it is.
+ geometry, and modifies it as appropriate if it is:
+
+ \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 0
+ \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 1
If those functions are not available or cannot be used, then a
workaround is to call \l{QWidget::setGeometry()}{setGeometry()}
@@ -74,14 +77,6 @@
\l{QWidget::pos()}{pos()} and \l{QWidget::size()}{size()} and to
restore the geometry using \l{QWidget::resize()} and
\l{QWidget::move()}{move()} before calling
- \l{QWidget::show()}{show()}, as demonstrated in the following
- code snippets (from the \l{mainwindows/application}{Application}
- example):
-
- \snippet examples/mainwindows/application/mainwindow.cpp 35
- \codeline
- \snippet examples/mainwindows/application/mainwindow.cpp 38
-
- This method works on Windows, Mac OS X, and most X11 window
- managers.
+ \l{QWidget::show()}{show()}, as demonstrated in the
+ \l{mainwindows/application}{Application} example.
*/
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index b0695b8..4d92157 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -81,7 +81,7 @@
</td>
<td valign="top">
<ul>
- <li><a href="classlists.html">C++ Class Documentation</a></li>
+ <li><a href="classlists.html">Class and Function Documentation</a></li>
<li><a href="frameworks-technologies.html">Frameworks and Technologies</a></li>
<li><a href="best-practices.html">How-To&#39;s and Best Practices</a></li>
</ul>
diff --git a/doc/src/legal/commercialeditions.qdoc b/doc/src/legal/commercialeditions.qdoc
index 761a53b..93dc194 100644
--- a/doc/src/legal/commercialeditions.qdoc
+++ b/doc/src/legal/commercialeditions.qdoc
@@ -91,8 +91,8 @@
following pages:
\list
- \o \l{Qt GUI Framework Edition Classes}
- \o \l{Qt Full Framework Edition Classes}
+ \o \l{Qt GUI Framework Edition}
+ \o \l{Qt Full Framework Edition}
\endlist
Please see the \l{Supported Platforms}{list of supported
@@ -119,16 +119,20 @@
/*!
\page full-framework-edition-classes.html
- \title Qt Full Framework Edition Classes
+ \title Qt Full Framework Edition
\ingroup classlists
+ \brief The list of Qt classes included in the Full Framework Edition.
+
\generatelist{classesbyedition Desktop}
*/
/*!
\page gui-framework-edition-classes.html
- \title Qt GUI Framework Edition Classes
+ \title Qt GUI Framework Edition
\ingroup classlists
+ \brief The list of Qt classes included in the GUI Framework Edition.
+
\generatelist{classesbyedition DesktopLight}
*/
diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc
index 2fc6eaf..786122e 100644
--- a/doc/src/modules.qdoc
+++ b/doc/src/modules.qdoc
@@ -41,14 +41,14 @@
/*!
\group modules
- \title Qt's Modules
+ \title All Qt Modules
\startpage index.html Qt Reference Documentation
\nextpage QtCore
\ingroup classlists
- Qt 4 consists of several modules, each of which lives in a
- separate library.
+ \brief Qt 4 comprises several modules. Each module is a separate
+ library.
\table 80%
\header \o {2,1} \bold{Modules for general software development}
@@ -89,14 +89,14 @@
or other build tools such as CMake, you also need to link against
the \c qtmain library.
- \sa {Qt's Classes}
+ \sa {Class and Function Documentation}
*/
/*!
\module QtCore
\title QtCore Module
- \contentspage Qt's Modules
- \previouspage Qt's Modules
+ \contentspage All Qt Modules
+ \previouspage All Qt Modules
\nextpage QtGui
\ingroup modules
@@ -116,7 +116,7 @@
/*!
\module QtGui
\title QtGui Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtCore
\nextpage QtNetwork
\ingroup modules
@@ -135,7 +135,7 @@
/*!
\module QtMultimedia
\title QtMultimedia Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtCore
\nextpage QtNetwork
\ingroup modules
@@ -159,7 +159,7 @@
/*!
\module QtNetwork
\title QtNetwork Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtMultimedia
\nextpage QtOpenGL
\ingroup modules
@@ -184,7 +184,7 @@
/*!
\module QtOpenGL
\title QtOpenGL Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtNetwork
\nextpage QtOpenVG
\ingroup modules
@@ -236,7 +236,7 @@
\module QtOpenVG
\title QtOpenVG Module
\since 4.6
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtOpenGL
\nextpage QtScript
\ingroup modules
@@ -291,7 +291,7 @@
\module QtScript
\title QtScript Module
\since 4.3
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtOpenVG
\nextpage QtScriptTools
\ingroup modules
@@ -321,7 +321,7 @@
\module QtScriptTools
\title QtScriptTools Module
\since 4.5
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtScript
\nextpage QtSql
\ingroup modules
@@ -350,7 +350,7 @@
/*!
\module QtSql
\title QtSql Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtScript
\nextpage QtSvg
\ingroup modules
@@ -373,7 +373,7 @@
\module QtSvg
\title QtSvg Module
\since 4.1
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtSql
\nextpage QtWebKit
\ingroup modules
@@ -428,7 +428,7 @@
/*!
\module QtXml
\title QtXml Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtSvg
\nextpage QtXmlPatterns
\ingroup modules
@@ -458,7 +458,7 @@
\module QtXmlPatterns
\title QtXmlPatterns Module
\since 4.4
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtXml
\nextpage Phonon Module
\ingroup modules
@@ -533,7 +533,7 @@
\page phonon-module.html
\module Phonon
\title Phonon Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtXmlPatterns
\nextpage Qt3Support
\ingroup modules
@@ -604,7 +604,7 @@
/*!
\module Qt3Support
\title Qt3Support Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage Phonon Module
\nextpage QtDesigner
\ingroup modules
@@ -645,7 +645,7 @@
/*!
\module QtDesigner
\title QtDesigner Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage Qt3Support
\nextpage QtUiTools
\ingroup modules
@@ -676,7 +676,7 @@
\module QtUiTools
\title QtUiTools Module
\since 4.1
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtDesigner
\nextpage QtHelp
\ingroup modules
@@ -716,7 +716,7 @@
/*!
\module QtHelp
\title QtHelp Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtUiTools
\nextpage QtTest
\ingroup modules
@@ -779,7 +779,7 @@
/*!
\module QtTest
\title QtTest Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtHelp
\nextpage QAxContainer
\ingroup modules
@@ -809,7 +809,7 @@
/*!
\module QAxContainer
\title QAxContainer Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QtTest
\nextpage QAxServer
\ingroup modules
@@ -859,7 +859,7 @@
/*!
\module QAxServer
\title QAxServer Module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QAxContainer
\nextpage QtDBus module
\ingroup modules
@@ -909,7 +909,7 @@
/*!
\module QtDBus
\title QtDBus module
- \contentspage Qt's Modules
+ \contentspage All Qt Modules
\previouspage QAxServer
\ingroup modules
diff --git a/doc/src/platforms/winsystem.qdoc b/doc/src/platforms/winsystem.qdoc
index 5afa1f7..c20973b 100644
--- a/doc/src/platforms/winsystem.qdoc
+++ b/doc/src/platforms/winsystem.qdoc
@@ -51,8 +51,8 @@
appropriate \c{#ifdef} directives (see below).
Qt provides a few low-level global functions for fine-tuning
- applications on specific platforms. See \l{Special-Purpose Global
- Functions Exported by Qt} for details.
+ applications on specific platforms. See \l{Platform-Specific
+ Functions} for details.
\tableofcontents
diff --git a/doc/src/scripting/scripting.qdoc b/doc/src/scripting/scripting.qdoc
index 5fcf8b2..2973f09 100644
--- a/doc/src/scripting/scripting.qdoc
+++ b/doc/src/scripting/scripting.qdoc
@@ -1224,44 +1224,6 @@
for it, evaluate the script, and finally restore the old context.
\endlist
- \section2 Nested Functions and the Scope Chain
-
- This is an advanced topic; feel free to skip it.
-
- A nested function can be used to "capture" the execution context in which a
- nested function object is created; this is typically referred to as creating
- a \e closure. When, at some later time, the nested function is invoked, it
- can access the variables that were created when the enclosing function was
- invoked. This can perhaps best be illustrated through a small example:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 70
-
- The \c{counter()} function initializes a local variable to zero,
- and returns a nested function. The nested function increments
- the "outer" variable and returns its new value. The variable
- persists over function calls, as shown in the following example:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 71
-
- The \c{counter()} function can be implemented as a native function, too
- \mdash or rather, as a pair of native functions: One for the outer and
- one for the inner. The definition of the outer function is as follows:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 72
-
- The function creates a local variable and initializes it to zero.
- Then it wraps the inner native function, and sets the scope of
- the resulting function object to be the activation object associated
- with this (the outer) function call. The inner function accesses
- the "outer" activation through the scope of the callee:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 73
-
- It is also possible to have a hybrid approach, where the outer function
- is a native function and the inner function is defined by a script:
-
- \snippet doc/src/snippets/code/doc_src_qtscript.qdoc 74
-
\section2 Property Getters and Setters
A script object property can be defined in terms of a getter/setter
diff --git a/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp b/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp
new file mode 100644
index 0000000..0e4040a
--- /dev/null
+++ b/doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp
@@ -0,0 +1,19 @@
+//! [0]
+void MyMainWindow::closeEvent(QCloseEvent *event)
+{
+ QSettings settings("MyCompany", "MyApp");
+ settings.setValue("geometry", saveGeometry());
+ settings.setValue("windowState", saveState());
+ QMainWindow::closeEvent(event);
+}
+//! [0]
+
+
+//! [1]
+void MainWindow::readSettings()
+{
+ QSettings settings("MyCompany", "MyApp");
+ restoreGeometry(settings.value("myWidget/geometry").toByteArray());
+ restoreState(settings.value("myWidget/windowState").toByteArray());
+}
+//! [1]