31 const QString iconUrl = map.value(
QSL(
"icon")).toString();
33 const QString iconPath = fileUtils.
resolve(iconUrl);
34 const QPixmap icon = QPixmap(iconPath);
35 const QString heading = map.value(
QSL(
"heading")).toString();
36 const QString message = map.value(
QSL(
"message")).toString();
37 mApp->desktopNotifications()->showNotification(icon, heading, message);
The QmlFileUtils class, exposed to QML as FileUtils.
Q_INVOKABLE QString resolve(const QString &filePath)
Get the path of the file within the plugin directory. If the filePath provided is resolved to be outs...
Q_INVOKABLE void create(const QVariantMap &map)
Create and display a notification.
QmlNotifications(QObject *parent=nullptr)
void setPluginPath(const QString &path)