QWindowsDialogHelperBase: use QBasicTimer instead of using raw timer IDs
Change-Id: I0124defa420e70f6d50a1e3f1fd02f14865d8e83 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
769392c3a8
commit
d91bfbcf65
@ -37,6 +37,8 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
// #define USE_NATIVE_COLOR_DIALOG /* Testing purposes only */
|
// #define USE_NATIVE_COLOR_DIALOG /* Testing purposes only */
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -269,7 +271,7 @@ bool QWindowsDialogHelperBase<BaseClass>::show(Qt::WindowFlags,
|
|||||||
// timer is stopped and dialog->exec() is called directly.
|
// timer is stopped and dialog->exec() is called directly.
|
||||||
cleanupThread();
|
cleanupThread();
|
||||||
if (modal) {
|
if (modal) {
|
||||||
m_timerId = this->startTimer(0);
|
m_timer.start(0ns, this);
|
||||||
} else {
|
} else {
|
||||||
startDialogThread();
|
startDialogThread();
|
||||||
}
|
}
|
||||||
@ -289,10 +291,7 @@ void QWindowsDialogHelperBase<BaseClass>::startDialogThread()
|
|||||||
template <class BaseClass>
|
template <class BaseClass>
|
||||||
void QWindowsDialogHelperBase<BaseClass>::stopTimer()
|
void QWindowsDialogHelperBase<BaseClass>::stopTimer()
|
||||||
{
|
{
|
||||||
if (m_timerId) {
|
m_timer.stop();
|
||||||
this->killTimer(m_timerId);
|
|
||||||
m_timerId = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class BaseClass>
|
template <class BaseClass>
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <QtCore/qt_windows.h>
|
#include <QtCore/qt_windows.h>
|
||||||
#include <qpa/qplatformdialoghelper.h>
|
#include <qpa/qplatformdialoghelper.h>
|
||||||
#include <qpa/qplatformtheme.h>
|
#include <qpa/qplatformtheme.h>
|
||||||
|
#include <QtCore/qbasictimer.h>
|
||||||
#include <QtCore/qstringlist.h>
|
#include <QtCore/qstringlist.h>
|
||||||
#include <QtCore/qsharedpointer.h>
|
#include <QtCore/qsharedpointer.h>
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ private:
|
|||||||
|
|
||||||
QWindowsNativeDialogBasePtr m_nativeDialog;
|
QWindowsNativeDialogBasePtr m_nativeDialog;
|
||||||
HWND m_ownerWindow = nullptr;
|
HWND m_ownerWindow = nullptr;
|
||||||
int m_timerId = 0;
|
QBasicTimer m_timer;
|
||||||
QThread *m_thread = nullptr;
|
QThread *m_thread = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user