• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

使用Qt显示ubuntu(Linux)通知

用户头像
it1352
帮助1

问题说明

我正在Qt上使用Phonon多媒体框架,它会弹出一条消息(如音量更改消息会在音量改变时弹出),因为我的音频设备未完全配置,是否可以启动我自己的通知来自Qt?

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?

请参见上图.

非常感谢您.

正确答案

#1

使用libnotify的AFAIK是可行的方法,如果您不想使用这种方法,我会在网上进行一些挖掘后发现:

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");

-t参数用于通知超时.

the -t parameter is for the notification timeout.

您可以在此处阅读有关通知发送的信息:

you can read up on notify-send here:

ubuntu论坛操作方法:使用通知发送

一个很好的示例,说明如何使用KDE和GNOME中的Qt

感谢发布教程的好心人:)特别是第二篇;非常聪明.

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

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfijck
系列文章
更多 icon
同类精品
更多 icon
继续加载