• 5681阅读
  • 1回复

求助,急,qtopia-2.2.0下编译QFileDialog出现错误 [复制链接]

上一主题 下一主题
离线hxfirefox
 

只看楼主 倒序阅读 楼主  发表于: 2009-09-10
写了一个小程序,编译之后提示错误invalid use of undefined type `struct QFileDialog` ../qtopia-2.2.0-FriendlyARM/qt2/include/qfiledialog.h:45:forward declaration of 'struct QFileDialog',我也不知道问题出在什么地方,感觉 qt-2.2.0自己不认识自己的类了,不知道各位大侠有没有遇到过这样的问题,恳请大家帮忙解决下,谢谢了。
源程序:
#include <qapplication.h>
#include <qwidget.h>
#include <qfiledialog.h>
#include <qstring.h>

class MyMainWindow : public QWidget
{
public:
MyMainWindow();
private:
QFileDialog *fdialog;
QString file;
};

MyMainWindow::MyMainWindow()
{
setGeometry(100, 100, 200, 50);
file = fdialog->getOpenFileName("/", ".txt");
}

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MyMainWindow w;
a.setMainWidget(&w);
w.show();
return a.exec();
}
离线shiroki

只看该作者 1楼 发表于: 2009-09-14
这个类默认没有编译进qte, 属于被裁剪掉的部分。 需要编辑qconfig-qpe.h, 去掉其中的 ...NO_FILEDIALOG 宏定义, 再重新configure和make
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
快速回复
限100 字节
 
上一个 下一个