diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2024-04-04 13:19:54 +0200 |
---|---|---|
committer | Axel Spoerl <axel.spoerl@qt.io> | 2024-04-04 19:29:23 +0200 |
commit | f54953a0abfe7db796a294c9239b943ebec91a2f (patch) | |
tree | f5654cd7aa5c32257c98c852420ea4f5237fbd95 /examples | |
parent | a07519f51f2733447aab07442a895d227bcfbbb0 (diff) |
Android notification example: Correct connect statements
The example breaks building 6.7 with examples on Android, due to
QObject::connect() to a lambda without context object.
Add context object.
Fixes: QTBUG-123989
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: Id3994e577a8a676220ac8d9f95d01c054839c143
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/corelib/platform/androidnotifier/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/corelib/platform/androidnotifier/main.cpp b/examples/corelib/platform/androidnotifier/main.cpp index 33e77c7018..07eff5d2b0 100644 --- a/examples/corelib/platform/androidnotifier/main.cpp +++ b/examples/corelib/platform/androidnotifier/main.cpp @@ -41,11 +41,11 @@ int main(int argc, char *argv[]) widget.setLayout(&mainLayout); //! [Connect button signals] - QObject::connect(&happyButton, &QPushButton::clicked, []() { + QObject::connect(&happyButton, &QPushButton::clicked, &happyButton, []() { NotificationClient().setNotification("The user is happy!"); }); - QObject::connect(&sadButton, &QPushButton::clicked, []() { + QObject::connect(&sadButton, &QPushButton::clicked, &happyButton, []() { NotificationClient().setNotification("The user is sad!"); }); //! [Connect button signals] |