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. Add icon to the tab when QDockWidget tabified

Add icon to the tab when QDockWidget tabified

Scheduled Pinned Locked Moved Solved General and Desktop
qdockwidget
3 Posts 2 Posters 1.9k 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.
  • divergerD Offline
    divergerD Offline
    diverger
    wrote on last edited by
    #1

    As known, we can add a icon to the tabs of QTabWidget. When QDockWidget tabified, it's very similar to a QTabWidget, but how to add icons to the tabs?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi,

      There's no public API to access the QTabBars used in QMainWindow. So you would have to rely on a hack to do that. Basically find all QTabBar children of your QMainWindow and then find the one matching your QDockWidget and then modify it. Note that you might be going against the GUI guide lines of your platform. You should check them.

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

      divergerD 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        There's no public API to access the QTabBars used in QMainWindow. So you would have to rely on a hack to do that. Basically find all QTabBar children of your QMainWindow and then find the one matching your QDockWidget and then modify it. Note that you might be going against the GUI guide lines of your platform. You should check them.

        divergerD Offline
        divergerD Offline
        diverger
        wrote on last edited by
        #3

        @SGaist Yes, I've 'hacked' that. For now, it works all well.

        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