我用的是qtopia2.2.0版本
简单的程序以下显示:
#include "MyLed.h"
#include <qpushbutton.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <qpicture.h>
MyLed::MyLed(QWidget* parent, const char* name, WFlags f)
:QWidget(parent)
{
l1_on = new QPushButton("LED1_on", this);
l1_on->setGeometry(30,40,80,30);
QPicture *pict;
pict = new QPicture;
}
QPushButton编译过去没问题,QPicture就死活不行,
MyLed.cpp: In constructor 'MyLed::MyLed(QWidget*, const char*, uint)':
MyLed.cpp:16: error: invalid use of incomplete type 'struct QPicture'
/opt/qtopia-free-2.2.0/qt2/include/qwindowdefs.h:78: error: forward declaration of 'struct QPicture'
然后我进/opt/qtopia-free-2.2.0/qt2/include/qwindowdefs.h 看了一下
有class QPicture;
所以请大侠帮忙一下~~