我正在尝试使用 Qt 和 C++ 在 Arch Linux 下制作表单应用程序,但是当我尝试运行以下应用程序时:
第一个窗口.h
#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
它不会停止或终止应用程序,但也不会运行它。我认为该错误与我编写的代码无关,因为它只是一个小示例。那么我该如何处理呢?任何想法?