标题:如何在qvfb中运行HelloQt程序
作者:bull9god
日期:2008-04-27 17:52
内容:
我自己写了一小段程序,就是带有一个按钮的小窗口,保存为HelloQt.cpp
# qmake -project
# qmake
# make
# ./HelloQt
运行出来一个X窗口的小程序,非常开心
但是后来想在qvfb中运行这个窗口
# ./qvfb &
# ./HelloQt -qws
可是出来的还是X窗口的小程序,非常郁闷
不知道该怎么办了
#1 [bull9god 04-27 17:59]
我的小窗口源代码是:
#include
#include
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello Qt!", 0);
hello.resize(100,30);
hello.show();
return app.exec();
}
#2 [bull9god 04-27 18:01]
我的小窗口源代码是:
#include
#include
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello Qt!", 0);
hello.resize(100,30);
hello.show();
return app.exec();
#3 [ynshisss 04-28 13:10]
1、确保你的qvfb是qt-x11版本下tools中的qvfb
2、下载和你qt-x11相应版本的qtopia-core-opensource.src.tar,在本机下configure、编译qt-core版本
3、用编译安装好的qtopia-core中bin目录下的qmake来编译你的程序
4、运行qt-x11下的qvfb,然后运行你的程序
#4 [bull9god 04-28 23:54]
谢谢楼上的
我的Qt是qtopia-opensource-4.3.1,我用的就是他编译出来的
#5 [sophyyoung 04-29 10:08]
你用 qtopia 的库编译的 helloqt ,而不是 qt 的库,却能跑在 x窗口??你确定??