From e6038135dffa857e49446d3c7107afd48c82abba Mon Sep 17 00:00:00 2001 From: Daniel Teichmann Date: Wed, 29 Jul 2020 17:40:51 +0200 Subject: Make Toasts work properly --- src/main_qmladaptor.cpp | 4 ++++ src/main_qmladaptor.h | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/main_qmladaptor.cpp b/src/main_qmladaptor.cpp index 9aafbce..620bb69 100644 --- a/src/main_qmladaptor.cpp +++ b/src/main_qmladaptor.cpp @@ -131,6 +131,10 @@ void MainQMLAdaptor::onCloseHandler() { emit onCloseSignal(); } +void MainQMLAdaptor::showToast(QString text, uint durationMs) { + emit showToastSignal(text, QString::number(durationMs)); +} + //void MainQMLAdaptor::onCloseHandler() { // qDebug() << "Inside MainQMLAdaptor::onCloseHandler()"; diff --git a/src/main_qmladaptor.h b/src/main_qmladaptor.h index 5cf2c9a..9ce6aa2 100644 --- a/src/main_qmladaptor.h +++ b/src/main_qmladaptor.h @@ -50,6 +50,8 @@ signals: void onCloseSignal(); + void showToastSignal(QString text, QString durationMs); + protected: QString _url; QString _pin; @@ -71,4 +73,6 @@ public slots: QString getPin(); void onCloseHandler(); + + void showToast(QString text, uint durationMs = 3000); }; -- cgit v1.2.3