Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [SOLVED] Qt Creator 5.2 - Changing Background Color of Left Hand Pane
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt Creator 5.2 - Changing Background Color of Left Hand Pane

Scheduled Pinned Locked Moved Qt Creator and other tools
22 Posts 9 Posters 32.7k 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.
  • S Offline
    S Offline
    Slion
    wrote on last edited by
    #13

    Thanks ray4qt for helping out.

    I've pretty much given up on stylesheet for now as there are too many bugs with the code editor. QML code font color also get messed after debug.

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qtenvy
      wrote on last edited by
      #14

      Let's not give up on this discussion.

      I fell in love with qtCreator a couple of years ago. And to respond to ray4qt, there has always been interest, on my part, in customizing qtCreator. And like everyone on this thread has noticed, there is not much information out there.

      I have scoured the web for quite a while now and have come up with a stylesheet that I like. dcbdbis (Dave), you may want to give it try. I am curious if you like. Unfortunately, there are a couple of things about my stylesheet that I have not yet addressed. 1) In debug mode, the font for the value column in the Locals and Expressions window gets changed to red. Red is hard on the eyes with a dark background. Not sure how that got changed. Not sure how to fix. 2) The tabs in dialog windows are a bit cobbled together (not as distinct). Again, not sure what caused that.

      Note that this stylesheet does not mess with the settings I chose for my text editor colors (which is the Inkpot scheme).

      I am using qtCreator 3.0.1 on Linux Mint.

      Anway, here is my stylesheet. Hope it helps someone.

      @QMainWindow,
      QAbstractItemView,
      QTreeView::branch,
      QTabBar::tab{
      color: #EAEAEA;
      background: #5e5e57;
      font-size: 9pt;
      }

      /* This attribute change the listed text in the help menu */
      QListView {
      color: #FFF8DC;
      }

      QAbstractItemView::item:selected {
      color: #EAEAEA;
      background-color: #151515;
      }

      QScrollBar {
      border: none;
      background: #333333;
      height: 6px;
      width: 6px;
      margin: 0px;
      }

      QScrollBar::handle{
      background: #494949;
      min-width: 10px;
      min-height: 10px;
      }

      QScrollBar::add-line, QScrollBar::sub-line {
      background: none;
      border: none;
      }

      QScrollBar::add-page, QScrollBar::sub-page {
      background: none;
      }

      /* Add the horizontal arrow keys to the dir/file list (left pane) /
      QTreeView::branch:has-children:!has-siblings:closed,
      QTreeView::branch:closed:adjoins-item:has-children {
      border-image: none;
      image: url(:/qmldesigner/images/triangle_horz.png);
      /

      margin: 6px;
      height: 6px;
      width: 6px;
      border-radius: 3px;
      */
      }

      /* Add the vertical arrow keys to the dir/file list (left pane) */
      QTreeView::branch:open:has-children:!has-children,
      QTreeView::branch:open:adjoins-item:has-children {
      border-image: none;
      image: url(:/qmldesigner/images/triangle_vert.png);
      }

      QTabBar::tab:selected {
      font: bold;
      border-color: #9B9B9B;
      border-bottom-color: #C2C7CB;
      }

      QTabBar::tab:!selected {
      margin-top: 2px;
      }

      QHeaderView::section {
      background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
      stop:0 #616161, stop: 0.5 #505050,
      stop: 0.6 #434343, stop:1 #656565);
      color: white;
      padding-left: 4px;
      border: 1px solid #6c6c6c;
      }

      QToolBar {
      border-style: solid;
      border-style: outset;
      color: #EAEAEA;
      background: #333333;
      font-size: 9pt;
      }@

      Brock

      1 Reply Last reply
      0
      • R Offline
        R Offline
        ray4qt
        wrote on last edited by
        #15

        Thanks for posting! Gave your stylesheet a try and it looks good.

        Hope I'm wrong, but I don't think you will be able to change the red font in Debug mode as I suspect it is hard coded. Little things like this mean we are not able to get everything exactly as we would like, which is frustrating.

        Regarding the tabs, you could try setting a minimum width property:

        @QTabBar::tab
        {
        min-width: 125px;
        }@

        Adjust to suit, of course.

        This looks okay in Design mode, but is too wide for dialogs.
        They can have their own width setting:

        @QDialog QTabBar::tab
        {
        min-width: 75px;
        }@

        Do you use Design mode? I see a couple of issues there with unreadable fonts in the Object Inspector and Property Editor - on my Windows 8.1 system.

        Try these (again, adjust to suit) if you want a fix:

        @QObject[windowTitle="Object Inspector"] QTreeView
        {
        color: #EAEAEA;
        alternate-background-color: black;
        }@

        @QObject[windowTitle="Property Editor"] QTreeView
        {
        color: black;
        }@

        Like Slion, I've given up on stylesheets, at least for now, because of the editor font issue. I notice this is not a problem on Qt Creator version 3.0.0, which I have on my laptop, so perhaps you are not affected by it. If you update to a later version I think you will be. Well, at present I am reluctant to post anything that doesn't work correctly.

        Once again Brock, thanks for posting. Nearly 3000 views makes me think there is interest out there, even if you are the only one who has bothered to post.

        Regards, Ray.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qtenvy
          wrote on last edited by
          #16

          Thanks for the tips Ray. I will give them a try today.

          No, I don't usually use Design mode.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrtypography
            wrote on last edited by
            #17

            qtenvy or ray4qt: Any tips on how to most easily load a custom Qt Creator stylesheet on OS X?

            1 Reply Last reply
            0
            • R Offline
              R Offline
              ray4qt
              wrote on last edited by
              #18

              The principle will be the same regardless of the operating system being used.
              You just need to add a parameter to the command that launches Qt Creator.

              I think it will look like this under a Unix-like o/s (path/to/qtcreator will already be there):

              path/to/qtcreator -stylesheet path/to/your/stylesheet.css

              I'm a Windows guy so I was hoping someone who knows Macs would answer. As they haven't perhaps this will help.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mrtypography
                wrote on last edited by
                #19

                Figured this out with the help of someone on IRC.

                In Terminal.app or iTerm.app:

                @~/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator -stylesheet ~/.config/qtcreator_custom.css@

                Notes:

                • The first part of the command is necessary (~/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator)
                • The second part of the command can point anywhere you have a .css file with custom QSS styling for Qt Creator. I chose ~/.config/ because it persists Qt uninstalls, reinstalls, upgrades.
                1 Reply Last reply
                0
                • idlefrogI Offline
                  idlefrogI Offline
                  idlefrog
                  wrote on last edited by
                  #20

                  For Qt Creator 5.0:

                  Tools->Options->Environment->Interface
                  On the 'Interface' tab select 'Theme:' and then select 'dark'.

                  1 Reply Last reply
                  2
                  • O Offline
                    O Offline
                    oulav83
                    wrote on last edited by
                    #21

                    Thank you very much @idlefrog !!

                    1 Reply Last reply
                    0
                    • osirisgothraO Offline
                      osirisgothraO Offline
                      osirisgothra
                      wrote on last edited by
                      #22

                      The problem? PLUGIN writers are not respecting/inheriting QPalette properly, and are using hard coded defaults and saying "ah good enough". It seriously sucks having to forfiet the entire dark mode just because state charts are white--but i couldnt stand the constant going back/forth from dark to white. So in essence, for me, dark mode isn't useful.

                      Yes there is dark mode, no plugin and qch help makers are ignoring the palette and giving us no possible way to customize it.

                      I'm truly glad you r/offmychess t finally, but please don't go too far, because you r/beyondvoxels and that implies that u r/donewithlife. Oh well time to git back to the lab, because azure sea here, I have a lot of work to do...

                      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