用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();
}