我的开发环境
winxp sp2
mingw5.0.2
qt4.1.3
抄C++ GUI Programming with Qt 3的源程序作相应修改如下:
#define QT3_SUPPORT
#include<qapplication.h>
#include<Q3HBox.h>
#include<qslider.h>
#include<qspinbox.h>
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
Q3HBox *hbox = new Q3HBox(0);
hbox->setCaption("Enter your age");
hbox->setMargin(6);
hbox->setSpacing(6);
QSpinBox *spinbox = new QSpinBox(hbox);
QSlider *slider = new QSlider(Qt::Horizontal,hbox);
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);
app.setMainWidget(hbox);
hbox->show();
return(app.exec());
}
为什么make的时候总是提示:q3hbox.h: no such file or directory
但是我在qt安装目录的include目录下面可以搜索到q3hbox.h文件
[ 此贴被XChinux在2006-05-23 16:13重新编辑 ]