用Qtopia2.2写了一个按一个按钮可以弹出进度框的程序,但是编译出错。
槽部分程序如下:
QProgressDialog progress=new QProgressDialog(QString::fromLocal8Bit("progress"),QString::fromLocal8Bit("fhghj"),100,this,"progress",TRUE);
progress->show();
int x=0;
int i=0;
while(x<=100)
{
for(i=0;i<ytime;i++)
{
progress->setProgress(x);
x++;
}
}
错误如下:
rm -f .obj/release-shared/moc_display.o
rm -f .moc/release-shared/moc_display.cpp
rm -f .obj/release-shared/display.o .obj/release-shared/main.o
rm -f *~ core *.core
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -Os -DQT_NO_QWS_VFB -DQTOPIA_DATA_LINKING -DQCONFIG=\"qconfig-qpe.h\" -DQTOPIA_TARGET=\"display\" -DQTOPIA_TRTARGET=\"display\" -DQT_NO_DEBUG -I/opt/s3c2410/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/mkspecs/qws/linux-arm-g++ -I. -I../qtopia-2.2.0-FriendlyARM/qtopia/include -I../qtopia-2.2.0-FriendlyARM/qt2/include -I.ui/release-shared/ -I.moc/release-shared/ -o .obj/release-shared/display.o display.cpp
display.cpp: In member function 'void Form1::showInfo1()':
display.cpp:265: error: 'QProgressDialog' was not declared in this scope
display.cpp:265: error: expected `;' before 'progress'
display.cpp:266: error: 'progress' was not declared in this scope