nimingzhe2008
9th September 2012, 06:59
here is my code
ICON.qrc
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/accept.png</file>
</qresource>
</RCC>
main.cpp
#include <QApplication>
#include<QIcon>
#include<QPushButton>
#include<QAction>
int main( int argc, char** argv )
{
QApplication app( argc, argv );
QIcon w("/images/accept.png");
QPushButton a;
QAction *b=new QAction(w,QString("Icon"),0);
a.addAction(b);
a.show();
return app.exec();
}
empty2.pro
SOURCES += \
main.cpp \
buttondialog.cpp
HEADERS += \
buttondialog.h
RESOURCES += \
ICON.qrc
When I build the project,Qt Creator shows†[release/qrc_ICON.cpp] Error 1:File not foundâ€.
I don’t know why.
ICON.qrc
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>images/accept.png</file>
</qresource>
</RCC>
main.cpp
#include <QApplication>
#include<QIcon>
#include<QPushButton>
#include<QAction>
int main( int argc, char** argv )
{
QApplication app( argc, argv );
QIcon w("/images/accept.png");
QPushButton a;
QAction *b=new QAction(w,QString("Icon"),0);
a.addAction(b);
a.show();
return app.exec();
}
empty2.pro
SOURCES += \
main.cpp \
buttondialog.cpp
HEADERS += \
buttondialog.h
RESOURCES += \
ICON.qrc
When I build the project,Qt Creator shows†[release/qrc_ICON.cpp] Error 1:File not foundâ€.
I don’t know why.