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. qaction icon
QtWS25 Last Chance

qaction icon

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 706 Views
  • 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.
  • U Offline
    U Offline
    user4592357
    wrote on last edited by
    #1

    say i have a qaction on which i set an icon.

    auto action = new QAction;
    action->setIcon(QIcon(":/icons/icon"));
    

    i've set an icon this way, it worked. then i replaced the image file with another image file with the same name, but the old image appeared on the action. so i did a clean build but still the old one appears. when i comment out the setIcon line, only the action's text appears on the action which is okay, since it doesn't have an icon. but why would this happen?

    raven-worxR 1 Reply Last reply
    0
    • U user4592357

      say i have a qaction on which i set an icon.

      auto action = new QAction;
      action->setIcon(QIcon(":/icons/icon"));
      

      i've set an icon this way, it worked. then i replaced the image file with another image file with the same name, but the old image appeared on the action. so i did a clean build but still the old one appears. when i comment out the setIcon line, only the action's text appears on the action which is okay, since it doesn't have an icon. but why would this happen?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @user4592357
      show your qrc file pls

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • U Offline
        U Offline
        user4592357
        wrote on last edited by
        #3

        it's nothing special, it works for other images, this really weird

        <qresource prefix="/icons">
            <file alias="icon">some_name.png</file>
        </qresource>
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          How did you do your clean re-build ?

          To ensure it's 100% clean, delete the build folder completely by hand.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2

          • Login

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