1 Attachment(s)
change default icon app (Dock - Taskbar) QTcreator QT6.8 - Ubuntu 24 LTS
Greetings! I'm getting started in programming with QT Creator, the application I created is an interface to communicate with an ESP32, so far so good.
I want to customize the application before launching it and I have managed to modify the icon with the .desktop file, what I have not been able to do is change the default icon when opening the application, which is the icon that is seen in the taskbar!
Could you help me with a little guidance, perhaps it would be very good for me.
Re: change default icon app (Dock - Taskbar) QTcreator QT6.8 - Ubuntu 24 LTS
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:
Code:
int main( int argc, char ** argv )
{
a.
setWindowIcon( QIcon( ":/MyApp/Resources/MyIcon.png" );
MainWindow w;
w.show();
return a.exec();
}
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.