Show ubuntu (linux) notifications with Qt

半腔热情 提交于 2019-12-04 08:56:19

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!