From 868366e562f00bb7ae17242705e6cf6cea8feaa3 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Thu, 4 Apr 2024 13:19:54 +0200 Subject: [PATCH] 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.5 6.2 Change-Id: Id3994e577a8a676220ac8d9f95d01c054839c143 Reviewed-by: Assam Boudjelthia (cherry picked from commit f54953a0abfe7db796a294c9239b943ebec91a2f) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 913bd8d19b83b16b2e4a6378616f8ca74e9a02ec) --- examples/corelib/platform/androidnotifier/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/corelib/platform/androidnotifier/main.cpp b/examples/corelib/platform/androidnotifier/main.cpp index 33e77c7018d..07eff5d2b0a 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]