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. How to change QDockWidget close/etc icons style?
QtWS25 Last Chance

How to change QDockWidget close/etc icons style?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qstyleqstylesheetqdockwidget
3 Posts 2 Posters 1.3k 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.
  • D Offline
    D Offline
    Dariusz
    wrote on 14 Aug 2022, 13:14 last edited by
    #1

    Hey

    I'm hitting walls left and right. can some1 help out with how to style the thing?

    QDockWidget{
        font-weight: bold;
        icon-size: 20px;
    
        titlebar-close-icon: url(:/controls/CloseWidget_normal);
        titlebar-normal-icon: url(:/controls/CloseWidget_normal);
    
    }
    
    QDockWidget::close-button, QDockWidget::float-button {
    subcontrol-position: right;
            icon-size: 20px;
    }
    
    QDockWidget::close-button {
    right: 5px;
    }
    
    QDockWidget::float-button {
    right: 25px;
    }
    
    QDockWidget::close-button:hover {
    right: 5px;
    color: rgb(255,255,0);
    background-color: rgb(255,0,255);
    }
    
    QDockWidget::float-button:hover {
    right: 25px;
    titlebar-normal-icon: url(:/controls/CloseWidget_hover);
    icon: url(:/controls/CloseWidget_hover);
    }
    
    

    None of it works :/

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 14 Aug 2022, 14:20 last edited by mrjj
      #2

      Hi
      In what way "not works"?

      Your images don't have an extension. not sure that will work well.
      Does the files have extensions ?

      alt text

      D 1 Reply Last reply 14 Aug 2022, 21:35
      2
      • M mrjj
        14 Aug 2022, 14:20

        Hi
        In what way "not works"?

        Your images don't have an extension. not sure that will work well.
        Does the files have extensions ?

        alt text

        D Offline
        D Offline
        Dariusz
        wrote on 14 Aug 2022, 21:35 last edited by
        #3

        @mrjj I'm using aliases, but your code does not specivy hover action ?
        Darn sorry, I didnt specify question well :/

        I cant change hover action. Not icon itself.
        QDockWidget::float-button:hover does not quite work.
        Also any idea where I can find other "button types?" Maximize, Minimize, etc etc?

        1 Reply Last reply
        0

        2/3

        14 Aug 2022, 14:20

        • Login

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