Results 1 to 2 of 2

Thread: change default icon app (Dock - Taskbar) QTcreator QT6.8 - Ubuntu 24 LTS

  1. #1
    Join Date
    Jan 2025
    Posts
    1
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default 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.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,266
    Thanks
    308
    Thanked 868 Times in 855 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default 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:

    Qt Code:
    1. int main( int argc, char ** argv )
    2. {
    3. QApplication a( argc, argv );
    4. a.setWindowIcon( QIcon( ":/MyApp/Resources/MyIcon.png" );
    5.  
    6. MainWindow w;
    7. w.show();
    8.  
    9. return a.exec();
    10. }
    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.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Different Icon for each widget in taskbar
    By Ini in forum Qt Programming
    Replies: 2
    Last Post: 14th March 2016, 09:31
  2. Propper dimension for a taskbar icon.
    By robgeek in forum Newbie
    Replies: 1
    Last Post: 11th February 2016, 21:38
  3. Tray icon & taskbar app button hide
    By been_1990 in forum Qt Programming
    Replies: 23
    Last Post: 12th March 2011, 23:28
  4. Hide QMainWindow without removing taskbar icon?
    By bigchiller in forum Qt Programming
    Replies: 5
    Last Post: 15th March 2009, 23:54
  5. change txt file type default icon
    By mismael85 in forum Qt Programming
    Replies: 8
    Last Post: 20th February 2008, 23:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.