Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. setWindowIcon doesn't work after create shorcut qt6
Forum Updated to NodeBB v4.3 + New Features

setWindowIcon doesn't work after create shorcut qt6

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 726 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anton Beresnev
    wrote on last edited by Anton Beresnev
    #1

    Hi, I want to change the icon in the taskbar depending on the application state, it works normal when i just build and run app, but after installing and creating a shortcut, it doesn’t work. Found a little trick - after pin/unpin at taskbar, icon changes normally, can anyone help me for work without this trick?(it's not easy task pin/unpin programatically)) I'm using QT6.5.1, function setWindowIcon(QIcon). Windows 11

    Axel SpoerlA 1 Reply Last reply
    0
    • A Anton Beresnev

      Hi, I want to change the icon in the taskbar depending on the application state, it works normal when i just build and run app, but after installing and creating a shortcut, it doesn’t work. Found a little trick - after pin/unpin at taskbar, icon changes normally, can anyone help me for work without this trick?(it's not easy task pin/unpin programatically)) I'm using QT6.5.1, function setWindowIcon(QIcon). Windows 11

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      @Anton-Beresnev
      Please show a minimal reproducing example.

      Software Engineer
      The Qt Company, Oslo

      A 1 Reply Last reply
      0
      • Axel SpoerlA Axel Spoerl

        @Anton-Beresnev
        Please show a minimal reproducing example.

        A Offline
        A Offline
        Anton Beresnev
        wrote on last edited by Anton Beresnev
        #3

        @Axel-Spoerl sorry for late answer https://github.com/aberesnev2009/IconChanging after building, create shortcut to .exe and place to desktop. icon at Taskbar doesn't change, there are 2 possible solution:

        1. delete shortcut, all works fine.
        2. when exe started, pin and then unpin at taskbar and all works fine
        Christian EhrlicherC 1 Reply Last reply
        0
        • A Anton Beresnev

          @Axel-Spoerl sorry for late answer https://github.com/aberesnev2009/IconChanging after building, create shortcut to .exe and place to desktop. icon at Taskbar doesn't change, there are 2 possible solution:

          1. delete shortcut, all works fine.
          2. when exe started, pin and then unpin at taskbar and all works fine
          Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          A shortcut has nothing to do with the application - it's using it's own copy of an icon and does not look at any executable so your observation is correct but can't be changed by Qt. A shortcut can even live without the link destination still exists.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          A 1 Reply Last reply
          1
          • Christian EhrlicherC Christian Ehrlicher

            A shortcut has nothing to do with the application - it's using it's own copy of an icon and does not look at any executable so your observation is correct but can't be changed by Qt. A shortcut can even live without the link destination still exists.

            A Offline
            A Offline
            Anton Beresnev
            wrote on last edited by
            #5

            @Christian-Ehrlicher it's sad) I hope QT developers can improve it by any way) I try to use windows API lib's for automatic pin/unpin to taskbars, but Microsoft locked this methods)

            Christian EhrlicherC 1 Reply Last reply
            0
            • A Anton Beresnev

              @Christian-Ehrlicher it's sad) I hope QT developers can improve it by any way) I try to use windows API lib's for automatic pin/unpin to taskbars, but Microsoft locked this methods)

              Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Anton-Beresnev said in setWindowIcon doesn't work after create shorcut qt6:

              I hope QT developers can improve it by any way

              I don't understand what Qt has to do with windows shortcuts...

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved