From c610cfe328d911a3cc145f09dade2cd61e5153e2 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 13 Jul 2023 03:01:46 +0300 Subject: Mention QChronoTimer in API docs Change-Id: Iaf9fb31994f1580b2051dbd0b1b8eef2a218aa39 Reviewed-by: Thiago Macieira --- src/widgets/dialogs/qprogressdialog.cpp | 9 +++++---- src/widgets/kernel/qapplication.cpp | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp index d241d50faf..9761bcc828 100644 --- a/src/widgets/dialogs/qprogressdialog.cpp +++ b/src/widgets/dialogs/qprogressdialog.cpp @@ -197,10 +197,11 @@ void QProgressDialogPrivate::_q_disconnectOnClose() A modeless progress dialog is suitable for operations that take place in the background, where the user is able to interact with the - application. Such operations are typically based on QTimer (or - QObject::timerEvent()) or QSocketNotifier; or performed - in a separate thread. A QProgressBar in the status bar of your main window - is often an alternative to a modeless progress dialog. + application. Such operations are typically based on a timer class, + such as QChronoTimer (or the more low-level QObject::timerEvent()) or + QSocketNotifier; or performed in a separate thread. A QProgressBar in + the status bar of your main window is often an alternative to a modeless + progress dialog. You need to have an event loop to be running, connect the canceled() signal to a slot that stops the operation, and call \l diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index f5236d910e..6925ee8909 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2535,8 +2535,9 @@ int QApplication::startDragDistance() exec(), because modal widgets call exec() to start a local event loop. To make your application perform idle processing, i.e., executing a special - function whenever there are no pending events, use a QTimer with 0 timeout. - More advanced idle processing schemes can be achieved using processEvents(). + function whenever there are no pending events, use a QChronoTimer with 0ns + timeout. More advanced idle processing schemes can be achieved using + processEvents(). We recommend that you connect clean-up code to the \l{QCoreApplication::}{aboutToQuit()} signal, instead of putting it in your -- cgit v1.2.3