summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2022-08-17 20:02:10 +0800
committerYuhang Zhao <2546789017@qq.com>2022-08-23 11:24:06 +0800
commit00618db5ffbe9afb14a1a86e722c826cc6e865d0 (patch)
tree2f3ab9a260a00544f5093000d0fbaead25541324 /src/corelib/plugin
parentc2bcba0d3cf550ede0488b40b8a5f81be817a65c (diff)
QSystemLibrary: Use in-class initialization
Initialize the member variables in class. It's more modern and also saves some typing in some constructor functions. Change-Id: Ib4d942610a57e0af3f22248c00207d7cdb683763 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qsystemlibrary_p.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/corelib/plugin/qsystemlibrary_p.h b/src/corelib/plugin/qsystemlibrary_p.h
index ebdcaa7b74..0b4ad7dbc2 100644
--- a/src/corelib/plugin/qsystemlibrary_p.h
+++ b/src/corelib/plugin/qsystemlibrary_p.h
@@ -28,15 +28,11 @@ public:
explicit QSystemLibrary(const QString &libraryName)
{
m_libraryName = libraryName;
- m_handle = nullptr;
- m_didLoad = false;
}
explicit QSystemLibrary(const wchar_t *libraryName)
{
m_libraryName = QString::fromWCharArray(libraryName);
- m_handle = nullptr;
- m_didLoad = false;
}
bool load(bool onlySystemDirectory = true)
@@ -66,10 +62,11 @@ public:
}
static Q_CORE_EXPORT HINSTANCE load(const wchar_t *lpFileName, bool onlySystemDirectory = true);
+
private:
- HINSTANCE m_handle;
- QString m_libraryName;
- bool m_didLoad;
+ HINSTANCE m_handle = nullptr;
+ QString m_libraryName = {};
+ bool m_didLoad = false;
};
QT_END_NAMESPACE