[SOLVED] Qt Creator 5.2 - Changing Background Color of Left Hand Pane
-
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
-
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.
-
qtenvy or ray4qt: Any tips on how to most easily load a custom Qt Creator stylesheet on OS X?
-
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.
-
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.
-
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.