Qt support for VNC
i want to test whether qt is supporting VNC or not. For that i have written a small layout program using Qt library.
the source code for the layout program is as follows:
layout.cpp
#include <QApplication>
#include <QHBoxLayout>
#include <QSlider>
#include <QSpinBox>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget *window = new QWidget;
window->setWindowTitle("Enter The Age of the person");
QSpinBox *spinBox = new QSpinBox;
QSlider *slider = new QSlider(Qt::Horizontal);
spinBox->setRange(0, 130);
slider->setRange(0, 130);
QObject::connect(spinBox, SIGNAL(valueChanged(int)),
slider, SLOT(setValue(int)));
QObject::connect(slider, SIGNAL(valueChanged(int)),
spinBox, SLOT(setValue(int)));
开发者_开发知识库 spinBox->setValue(35);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(spinBox);
layout->addWidget(slider);
window->setLayout(layout);
window->show();
return app.exec();
}
i want to run this as server application on my linux PC.For that what i configured Qt and installed like this.
- ./configure -qt-gfx-vnc
- make
- make install
The program is working fine. But if i run the application as VNC server application like
./layout -qws -display VNC:0
i am encountering an error.it says that "_X11TransSocketINETConnect() can't get address for VNC:6000: Temporary failure in name resolution"..
pls help me what i need to do.
Thanks
You did not configure Qt to use QWS, which is what you wanted.
For this reason, it looks like your app is silently ignoring the -qws
option, and the -display VNC:0
option is causing it to try to connect to the X11 display number 0 on host VNC, which doesn't exist.
You need to pass the -embedded
option when configuring Qt if you want to use QWS.
精彩评论