tags:

views:

253

answers:

1

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.

  1. ./configure -qt-gfx-vnc
  2. make
  3. 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

+1  A: 

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.

Intransigent Parsnip
Thanks Jones. we configured with -embedded option and it started working. Now we are able to start VNC server and then from VNC client we are able to see the applications.Any way very thanks Jones..
muchala123