WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names throu

来源:互联网 发布:grub2 引导linux 编辑:程序博客网 时间:2024/05/17 05:59

 http://blog.csdn.net/makuiyu/article/details/7417830

用Qt写了个播放器,却出现了以下警告:

    WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface 

    原来是没有给application命名,只要在QApplication a(argc,argv)下加入a.setApplicationName("XXX");即可。

    如下:

        #include <QtGui/QApplication>
        #include <QTextCodec>
        #include "player.h"

        int main(int argc, char *argv[])
        {
            QApplication a(argc, argv);
            a.setApplicationName("Player");
            QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));//设置编码格式
            Player w;
            w.show();
            return a.exec();
        }

0 0