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.6 6.5 6.2 Change-Id: Id3994e577a8a676220ac8d9f95d01c054839c143 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit f54953a0abfe7db796a294c9239b943ebec91a2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
1d9ff052fa
commit
913bd8d19b
@ -41,11 +41,11 @@ int main(int argc, char *argv[])
|
|||||||
widget.setLayout(&mainLayout);
|
widget.setLayout(&mainLayout);
|
||||||
|
|
||||||
//! [Connect button signals]
|
//! [Connect button signals]
|
||||||
QObject::connect(&happyButton, &QPushButton::clicked, []() {
|
QObject::connect(&happyButton, &QPushButton::clicked, &happyButton, []() {
|
||||||
NotificationClient().setNotification("The user is happy!");
|
NotificationClient().setNotification("The user is happy!");
|
||||||
});
|
});
|
||||||
|
|
||||||
QObject::connect(&sadButton, &QPushButton::clicked, []() {
|
QObject::connect(&sadButton, &QPushButton::clicked, &happyButton, []() {
|
||||||
NotificationClient().setNotification("The user is sad!");
|
NotificationClient().setNotification("The user is sad!");
|
||||||
});
|
});
|
||||||
//! [Connect button signals]
|
//! [Connect button signals]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user