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. QTabWidget - Icons disappear when tab selected
Qt 6.11 is out! See what's new in the release blog

QTabWidget - Icons disappear when tab selected

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k Views 1 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.
  • P Offline
    P Offline
    PhilWilkins
    wrote on last edited by
    #1

    Hi all,

    I am using Ui Designer. I am building a QTabWidget. I have added my icons to the tabs, and added an icon for each state, yet when built when the tab is selected, it goes grey and the icon disappears. I could mess about with this for a few hours and make it work, however, i want to know if there is something I am missing in UI designer.

    Any suggestions?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tucnak
      wrote on last edited by
      #2

      Code, we need code!!! More code.

      1. In which way do you link icon (absolute way or resource) - maybe icon's way is broken.
      2. Maybe you have some external code which remove it (review yourself).
      1 Reply Last reply
      0
      • P Offline
        P Offline
        PhilWilkins
        wrote on last edited by
        #3

        Hi, sorry, the functionality was created entirely with UI designer so below I include my ui file
        to answer your question, I am using a resource file for the icons

        Below is my UI file

        @<widget class="QWidget" name="tab_2">
        <attribute name="icon">
        <iconset resource="Icons.qrc">
        <normaloff>:/new/prefix1/WorkRules.png</normaloff>
        <normalon>:/new/prefix1/WorkRules.png</normalon>
        <activeoff>:/new/prefix1/WorkRules.png</activeoff>
        <activeon>:/new/prefix1/WorkRules.png</activeon>
        <selectedoff>:/new/prefix1/WorkRules.png</selectedoff>
        <selectedon>:/new/prefix1/WorkRules.png</selectedon>:/new/prefix1/WorkRules.png</iconset>
        </attribute>@

        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