summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2023-05-09 09:53:54 +0200
committerAxel Spoerl <axel.spoerl@qt.io>2023-06-04 01:18:19 +0200
commiteda71105ff9a516059c6dd6643ff446a82edac81 (patch)
tree42484a77262cdd6e9c6c5e2533cb3f9dc0b6c4fd /src
parent27906b7da84c22b244b612a557f57606d8d4d626 (diff)
Move widgets Application example to manual tests
With 6e77da640aa84c1efe330d4a5224c9c7425ece57, the documentviewer demo's TxtViewer plugin has been fully documented in order to replace the Application example. This patch moves the application example to manual tests. Pick-to: 6.5 Change-Id: I67d975e478c7bc840613c8af1301a4eafe8f1a42 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/src/resource-system.qdoc33
-rw-r--r--src/gui/kernel/qevent.cpp4
2 files changed, 10 insertions, 27 deletions
diff --git a/src/corelib/doc/src/resource-system.qdoc b/src/corelib/doc/src/resource-system.qdoc
index a0d253799a..16f76902d4 100644
--- a/src/corelib/doc/src/resource-system.qdoc
+++ b/src/corelib/doc/src/resource-system.qdoc
@@ -52,15 +52,15 @@
Here's an example \c .qrc file:
- \quotefile resource-system/application.qrc
+ \quotefile resource-system/mainwindow.qrc
Each \c <file> element in the XML identifies a file in the application's
source tree. The path is resolved relative to the directory containing
the \c .qrc file.
The path is also used by default to identify the file's content at runtime.
- That is, the file \c copy.png will be available in the resource system as
- \c{:/images/copy.png} or \c{qrc:/images/copy.png}.
+ That is, the file \c titlebarLeft.png will be available in the resource system as
+ \c{:/res/titlebarLeft.png} or \c{qrc:/res/titlebarLeft.png}.
To override this default run-time name, see \l{Prefixes} and \l{Aliases}.
\e{Qt Creator}, \e{Qt Design Studio}, \QD, and \e{Qt Visual Studio Tools}
@@ -102,22 +102,16 @@
variable. If you add a \c .qrc file path to the variable, the listed
resource files will be embedded into the generated library or executable:
- \snippet resource-system/application.pro 0
-
- For simple applications, it is also possible to let qmake generate the
- \c .qrc file for you, avoiding the need for an additional file to be
- maintained:
-
- \snippet resource-system/application.pro 1
+ \snippet resource-system/mainwindow.pro qrc
This creates a resource of several \c{.png} files, that are addressable
- like this: \c{":/images/copy.png"}.
+ like this: \c{":/res/titlebarLeft.png"}.
If the directory layout of the files you want to embed into the resource
doesn't match the expectations of the application, you can specify
\c{resources.base}. \c base is a path prefix that denotes the root point of
the file's alias. In the example above, if \c{resources.base} is set to
- \c{"images"}, then \c{copy.png} is addressable as \c{":/copy.png"}.
+ \c{"res"}, then \c{titlebarLeft.png} is addressable as \c{":/titlebarLeft.png"}.
\section1 Runtime API
@@ -136,7 +130,7 @@
\snippet resource-system/main.cpp url
- See the \l{mainwindows/application}{Application} example for an actual
+ See the \l{mainwindows/mainwindow}{Mainwindow} example for an actual
application that uses Qt's resource system to store its icons.
\section1 Advanced Topics
@@ -216,14 +210,7 @@
resource file's content and metadata is then done after the compilation and
linking phase, through another rcc call.
- For qmake, this is enabled by adding \c resources_big to the \c CONFIG
- variable:
-
- \snippet resource-system/application.pro 2
-
- For CMake, you need to use the \l{qt_add_big_resources} function:
-
- \snippet resource-system/CMakeLists.txt qt_add_big_resources
+ For CMake, you need to use the \l{qt_add_big_resources} function.
\section2 External Resource Files
@@ -251,13 +238,13 @@
resource compiler \l rcc:
\code
- rcc -g python application.qrc > application_rc.py
+ rcc -g python mainwindow.qrc > mainwindow_rc.py
\endcode
The module can then be imported in the application:
\code
- import application_rc.py
+ import mainwindow_rc.py
\endcode
\section2 Compression
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 6eebac9934..19fdcdc97f 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1837,10 +1837,6 @@ Q_IMPL_EVENT_COMMON(QResizeEvent)
special handling, you should reimplement the event handler and
ignore() the event.
- The \l{mainwindows/application#close event handler}{closeEvent() in the
- Application example} shows a close event handler that
- asks whether to save a document before closing.
-
If you want the widget to be deleted when it is closed, create it
with the Qt::WA_DeleteOnClose flag. This is very useful for
independent top-level windows in a multi-window application.