ChatGPT解决这个技术问题 Extra ChatGPT

Qt Creator color scheme

I like the dark "FakeVim" color scheme in Qt Creator. However it only makes the editor part dark while everything else stays normal, which is a bit disturbing. Is there any way to make such dark scheme global for Qt Creator?

https://i.stack.imgur.com/Rcrew.png

https://i.stack.imgur.com/2Hr97.png

Qt Creator version 3.5.1 says it fixed this problem here.

o
ololuki

I found some trick for your problem! Here you can see it: Habrahabr -- Redesigning Qt Creator by your hands (russian lang.)

According to that article, that trick is kind of not so dirty, but "hack" (probably it wouldn't harm your system, but it can leave some artifacts on your interface).

You don't need to patch something (there is possibility, but I don't recommend).

Main idea is to use stylesheet like this stylesheet.css:

// on Linux
qtcreator -stylesheet='.qt-stylesheet.css' 
// on Windows
[pathToQt]\QtCreator\bin\qtcreator.exe -stylesheet [pathToStyleSheet]

https://i.stack.imgur.com/xoKvC.png

To customize by your needs, you may need to read documentation: Qt Style Sheets Reference, Qt Style Sheets Examples and so on.

This wiki page is dedicated to custom Qt Creator styling.

P.S. If you'll got better stylesheet, share it, I'll be happy! :)

UPD (10.12.2014): Hopefully, now we can close this topic. Thanks, Simon G., Things have changed once again. Users may use custom themes since QtCreator 3.3. So hacky stylesheets are no longer needed.

Everyone can take a look at todays update: Qt 5.4 released. There you can find information that Qt 5.4, also comes with a brand new version of Qt Creator 3.3. Just take a look at official video at Youtube.

So, to apply dark theme you need go to "Tools" -> "Options" -> "Environment" -> "General" tab, and there you need to change "Theme".

See more information about its configuring here: Configuring Qt Creator.


Has anybody had luck styling the Search Results, Compile Output, Application Output tabs, or General Messages panes?
Did someone try that stylesheet.css with last qt creator? I have white background, no matter what editor theme is selected.
How to use it on Mac?
Ok, so things have changed a bit. Here is a css that works less bad with QtCreator 3.1.2 github.com/victorhaggqvist/qtcreator-style
Things have changed once again. Users may use custom themes since QtCreator 3.3. So hacky stylesheets are no longer needed.
V
Vinoj John Hosan

Simple in two line

Go to "Tools" -> "Options" -> "Environment" -> "General" tab, Change "Theme" to dark


this should be the top answer. Not a .CSS hack.
i
iM71

In newer versions of Qt Creator (Currently using 4.4.1), you can follow these simple steps:
Tools > Options > Environment > Interface

Here you can change the theme to Flat Dark.

It will change the whole Qt Creator theme, not just the editor window.

https://i.stack.imgur.com/Qiyjt.png


Currently, as this comment is written, flat dark theme does not look good (at least not for my display). Try Project -> Build -> Build Environemnt -> Detail. My display shows all those environment variables in dark text on a dark background.
A
Andrey Izman

Here is my dark theme (based on Darcula IntelliJ Theme):
https://github.com/mervick/Qt-Creator-Darcula

https://i.stack.imgur.com/vwXck.png


Hi, guy. How to do it on Mac?
Thank you so much !
Is here anyway to open the qtcreator by default with your theme without using command line ? the setting using ur Tools>>option>>text editor>>color scheme>> Dacula is not the same as running using command line
J
Jonathan

QTcreator obeys your kde-wide configurations. If you choose "obsidian-coast" as the system-wide color scheme qt creator will be all dark as well. I know it is a partial solution but it works.


however if you use the help viewer (even new versions) the text that is not in tables will be black, which is a problem with main qt documentation. Other documentations such as the kde, gcc, and generic c++ documentation in .qch format works fine, noting that .qch is actually just a sqlite3 database of all the html files and stylesheets contained in it. You might be able to grab a style sheet out of there and redesign it using the !important keyword externally starting qtcreator with it's -stylesheet option (that flag seems to work on any other qt app as well as you consume QApplication propr)
B
Borzh

My Dark Color scheme for QtCreator is at:

https://github.com/borzh/qt-creator-css/blob/master/qt-creator.css

To use with Vim (dark) scheme.

Hope it is useful for someone.


Installed but background becomes white when outside "highlight blocks" (background is always white for *.txt files). Do you use your CSS with Qt Creator 3.2 ? Yep I have Color Scheme = Vim (dark)
Sorry it's been a while since I used Qt Creator, I moved to XCode. If you fix it, please make a push request so I can merge it.
No worries I have just installed darcula and this is fine. Anyway I have upvoted your answer, thanks for sharing ;-)
N
Nathaniel Ford

I found a way to change the Application Output theme and everything that can't be edited from .css.

If you use osX:

Navigate to your Qt install directory. Right click Qt Creator application and select "Show Package Contents" Copy the following file to your desktop> Contents/Resources/themes/dark.creatortheme or /default.creatortheme. Depending on if you are using dark theme or default theme. Edit the file in text editor. Under [Palette], there is a line that says error=ffff0000. Set a new color, save, and override the original file.


A
Artem Vasilev

Linux, Qt Creator >= 3.4:

You could edit theese themes:

/usr/share/qtcreator/themes/default.creatortheme
/usr/share/qtcreator/themes/dark.creatortheme

s
steventaitinger

Here is a theme that I copied all the important parts of the Visual Studio 2013 dark theme.

**Update 08/Sep/15 - Qt Creator 3.5.1/Qt 5.5.1 might have fixed the rest of Qt not being dark properly and hard to read.