|
QImage这么用不行吗?
望指点。
- #include <qapplication.h>
- #include <qimage.h>
- #include <qstring.h>
- int main (int argc, char** argv) {
- QApplication app (argc, argv);
- QString fn="tao.png";
- QImage ima (fn);
- app.setMainWidget (&ima); // line11
- ima.show ();
- return app.exec ();
- }
复制代码
[root@localhost image]# make
g++ -c -pipe -Wall -W -O2 -g -pipe -march=i386 -mcpu=i686 -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG -I/usr/lib/qt-3.1/mkspecs/default -I. -I. -I/usr/lib/qt-3.1/include -o main.o main.cpp
main.cpp: In function `int main(int, char**)':
main.cpp:11: error: no matching function for call to `QApplication::
setMainWidget(QImage*)'
/usr/lib/qt-3.1/include/qapplication.h:119: error: candidates are: virtual void
QApplication::setMainWidget(QWidget*)
main.cpp:12: error: `show' undeclared (first use this function)
main.cpp:12: error: (Each undeclared identifier is reported only once for each
function it appears in.)
make: *** [main.o] Error 1
[root@localhost image]# |
|