Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
Some future release
-
None
-
11b8c46d2acf5421a8c57c02a55c3a36a11cf4f2
Description
Sometimes, it is useful to have a slot just be triggered once when a signal fires, and then stop listening. There are of course several ways to do that, but they all require a bit of code to keep track of the connection manually or even a second connection to trigger the disconnect of the first.
It would be convenient to have a special connection type for this: Qt::singleShotConnection. The idea would be that specifying this as the connection type, the connection would be automatically broken after the first time it was triggered.
Attachments
Issue Links
- is replaced by
-
QTBUG-26406 Function Pointer Syntax / Lambda support for QTimer::singleShot()
- Closed
For Gerrit Dashboard: QTBUG-44219 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
311098,6 | QObject: add a single shot connection flag | dev | qt/qtbase | Status: MERGED | +2 | 0 |