Show ubuntu (linux) notifications with Qt
Asked Answered
W

2

7

I was working with Phonon multimedia framework in Qt, and it popups a message (like the volume notification message that popups when one changes the volume), because my audio device is not fully configurated, is it possible to launch my own notification from Qt?

Please see the image above.

The notification message

Thank you very much.

Watersoak answered 22/3, 2012 at 7:24 Comment(0)
U
6

AFAIK using libnotify is the way to go, if you dont want to use this method I found after some digging around on the net:

system("notify-send 'The Message Title' 'Your Message Text' '-t' 5000");

the -t parameter is for the notification timeout.

you can read up on notify-send here:

ubuntu forums how-to: using notify-send

a good example how how to do it in Qt in both KDE and GNOME

Thanks to the kind persons who posted the tutorials :) especially the second one; very smart.

Uneasy answered 4/7, 2013 at 3:10 Comment(0)
B
3

This is Ubuntu specific so you cannot achieve (AFAIK) what you want through Qt. In Ubuntu libnotify is used in order to send desktop notifications. You should link your application with it and use the API in order to display the desired notifications. You can find an example here.

Bentham answered 22/3, 2012 at 8:16 Comment(1)
Thank you very much webclectic, I'll try that, I really appreciate your helpWatersoak

© 2022 - 2024 — McMap. All rights reserved.