我正在尝试使用Qt和C ++在Arch Linux下创建一个表单应用程序,但是当我尝试运行下面的应用程序时:
#include <QMainWindow>
#include <QLabel>
#include <QPushButton>
#include <QLineEdit>
#include <QLayout>
class firstWindow:public QMainWindow
{
Q_OBJECT
public:
QLabel *lbl;
QPushButton *btn;
QLineEdit *row;
firstWindow():QMainWindow()
{
setWindowTitle("First Window");
QWidget *win = new QWidget(this);
setCentralWidget(win);
lbl = new QLabel("Hello Universe", win);
btn = new QPushButton("Click Click", win);
row = new QLineEdit(win);
QVBoxLayout *main = new QVBoxLayout(win);
main->addWidget(win);
QHBoxLayout *nextTo = new QHBoxLayout();
nextTo->addWidget(row);
nextTo->addWidget(btn);
main->addLayout(nextTo);
resize(200,50);
win->show();
}
};
编译后,我收到此错误:
#qmake -project
#qmake
#make
# ./QtFirstWindow
(process:21806): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
(process:21806): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
(process:21806): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported
它不会停止或终止应用程序,但它也不会运行它。我认为该错误与我编写的代码无关,因为它只是一个小样本。那我怎么处理呢?有什么想法吗?