Windows: initialize COM in internal thread

The QWindowsDialogThread uses COM APIs, so we need to initialize COM.

Task-number: QTBUG-111625
Change-Id: Ief136ee70671034cb8996ab2f5b113e3884d2953
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d115aa90a2e2c04b4a853fa3c064c4dc5d3e73bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2023-03-06 12:06:53 +01:00 committed by Qt Cherry-pick Bot
parent d66d260e70
commit 9d64ef877b

View File

@ -31,6 +31,7 @@
#include <QtCore/qmutex.h>
#include <QtCore/quuid.h>
#include <QtCore/qtemporaryfile.h>
#include <QtCore/private/qfunctions_win_p.h>
#include <QtCore/private/qsystemerror_p.h>
#include <algorithm>
@ -257,6 +258,7 @@ private:
void QWindowsDialogThread::run()
{
qCDebug(lcQpaDialogs) << '>' << __FUNCTION__;
QComHelper comInit(COINIT_APARTMENTTHREADED);
m_dialog->exec(m_owner);
qCDebug(lcQpaDialogs) << '<' << __FUNCTION__;
}