From 50c838d4b5cde32db6bfcf8dda4dfbf5c34b9b17 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 14 Mar 2021 09:53:08 -0700 Subject: [PATCH] Make the exit() methods in QEventLoop and QThread be slots The documentation for QCoreApplication::exit() even refers to it as such. Instead of refactoring the documentation to explain that it isn't, just make it a slot and do the same for the other classes. Complements 2e6c37fe51b5f6073db0c7335c4a4272269d482f. [ChangeLog][QtCore][QEventLoop] exit() is now a slot, like quit(). [ChangeLog][QtCore][QThread] exit() is now a slot, like quit(). Change-Id: Ic42004c9bf71440eb433fffd167f4a1b89bcac80 Reviewed-by: David Faure --- src/corelib/kernel/qeventloop.h | 2 +- src/corelib/thread/qthread.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qeventloop.h b/src/corelib/kernel/qeventloop.h index 26828515a7..9b83d692fa 100644 --- a/src/corelib/kernel/qeventloop.h +++ b/src/corelib/kernel/qeventloop.h @@ -70,7 +70,6 @@ public: void processEvents(ProcessEventsFlags flags, int maximumTime); int exec(ProcessEventsFlags flags = AllEvents); - void exit(int returnCode = 0); bool isRunning() const; void wakeUp(); @@ -78,6 +77,7 @@ public: bool event(QEvent *event) override; public Q_SLOTS: + void exit(int returnCode = 0); void quit(); }; diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h index e5db44638d..51cd3eadcc 100644 --- a/src/corelib/thread/qthread.h +++ b/src/corelib/thread/qthread.h @@ -99,8 +99,6 @@ public: void setStackSize(uint stackSize); uint stackSize() const; - void exit(int retcode = 0); - QAbstractEventDispatcher *eventDispatcher() const; void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher); @@ -115,6 +113,7 @@ public: public Q_SLOTS: void start(Priority = InheritPriority); void terminate(); + void exit(int retcode = 0); void quit(); public: