Are you talking about the icon that appears in the top left corner of the application window's title bar?
For that, in your main() method:
int main( int argc, char ** argv )
{
a.
setWindowIcon( QIcon( ":/MyApp/Resources/MyIcon.png" );
MainWindow w;
w.show();
return a.exec();
}
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
a.setWindowIcon( QIcon( ":/MyApp/Resources/MyIcon.png" );
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
where "MyIcon.png" is the image file you have compiled into your application (under the resource path "MyApp/Resources") using the Qt resource compiler (rcc) that is part of the build process.
Bookmarks