summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/plugin/qlibrary.cpp')
-rw-r--r--src/corelib/plugin/qlibrary.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 216e6e1e7c..a704b8f02d 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -127,7 +127,7 @@ static QBasicMutex qt_library_mutex;
symbol is not defined, the function pointer will be 0 and won't be
called.
- \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 0
+ \snippet code/src_corelib_plugin_qlibrary.cpp 0
The symbol must be exported as a C function from the library for
resolve() to work. This means that the function must be wrapped in
@@ -138,7 +138,7 @@ static QBasicMutex qt_library_mutex;
use if you just want to call a function in a library without
explicitly loading the library first:
- \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 1
+ \snippet code/src_corelib_plugin_qlibrary.cpp 1
\sa QPluginLoader
*/
@@ -163,6 +163,10 @@ static QBasicMutex qt_library_mutex;
If this hint is given, the filename of the library consists of
a path, which is a reference to an archive file, followed by
a reference to the archive member.
+ \value PreventUnloadHint
+ Prevents the library from being unloaded from the address space if close()
+ is called. The library's static variables are not reinitialized if open()
+ is called at a later time.
\sa loadHints
*/
@@ -1118,7 +1122,7 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver
not be resolved or if the library could not be loaded.
Example:
- \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 2
+ \snippet code/src_corelib_plugin_qlibrary.cpp 2
The symbol must be exported as a C function from the library. This
means that the function must be wrapped in an \c{extern "C"} if
@@ -1126,11 +1130,11 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver
also explicitly export the function from the DLL using the
\c{__declspec(dllexport)} compiler directive, for example:
- \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 3
+ \snippet code/src_corelib_plugin_qlibrary.cpp 3
with \c MY_EXPORT defined as
- \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 4
+ \snippet code/src_corelib_plugin_qlibrary.cpp 4
*/
QFunctionPointer QLibrary::resolve(const char *symbol)
{
@@ -1230,6 +1234,8 @@ QString QLibrary::errorString() const
to the library \c shr_64.o in the archive file named \c libGL.a. This
is only supported on the AIX platform.
+ Setting PreventUnloadHint will only apply on Unix platforms.
+
The interpretation of the load hints is platform dependent, and if
you use it you are probably making some assumptions on which platform
you are compiling for, so use them only if you understand the consequences