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. [SOLVED]Custome QDockWidget Title Bar
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Custome QDockWidget Title Bar

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 9.5k 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.
  • A Offline
    A Offline
    amonR
    wrote on last edited by
    #1

    Hi Guys,

    Is it possible to customize or modify the color or the font-size of a QDockWidget Title Bar? If yes, how please?

    Cheers.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Yes, for example via stylesheet:
      @
      QDockWidget {
      color: #369;
      font-size: 20px;
      }
      @

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chaos6
        wrote on last edited by
        #3

        Yes it's possible The ::title subcontrol can be used to customize the title bar.
        Like this :-
        @QDockWidget::title
        {
        font-family: "Roboto Lt";
        font-size: 18pt;
        background: lightgray;
        padding-left: 10px;
        padding-top: 4px;
        }@

        http://smashcs.wordpress.com/

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Eslam mahgoub
          While ::title sub-control works for borders, background-color and other box properties the text itself is styled with QDockWidget{}, without the ::title.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            amonR
            wrote on last edited by
            #5

            Hi Guys,
            @Eslam, Chris is right: I tried both.

            For the font and the color of the title only Chris code works.

            Thanks a lot to both anyways.

            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