如何在 Qt Creator 中应用 one dark pro 主题
前言
Qt Creator 自带了几款主题,但是并不好看。在博客 《Qt Creator打造VScode one dark pro主题配色》 中给出了 one dark pro 主题的配置文件,但是效果并不好,所以这里给出改进后的主题文件(只针对代码部分)。
配置文件
在 D:\Qt\Tools\QtCreator\share\qtcreator\styles 中创建一个 onedark.xml 文件,然后在文件里面写入以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="One Dark">
<style name="Text" foreground="#abb2bf" background="#282c34"/>
<style name="Link" underlineStyle="SingleUnderline"/>
<style name="Selection" background="#3e4451"/>
<style name="LineNumber" foreground="#4b5363"/>
<style name="SearchResult" background="#324365"/>
<style name="SearchScope" background="#3e4451"/>
<style name="Parentheses" background="#515a6b" />
<style name="ParenthesesMismatch" foreground="#000000" background="#c678dd"/>
<style name="AutoComplete" background="#3e4451"/>
<style name="CurrentLine" background="#3a3f4b"/>
<style name="CurrentLineNumber" foreground="#abb2bf" />
<style name="Occurrences" background="#324365"/>
<style name="Occurrences.Unused" underlineColor="#d19a66" underlineStyle="DashUnderline"/>
<style name="Occurrences.Rename" background="#e06c75"/>
<style name="Number" foreground="#d19a66"/>
<style name="String" foreground="#98c379"/>
<style name="Type" foreground="#61afef"/>
<style name="Local" foreground="#e06c75" />
<style name="Parameter" foreground="#e06c75" />
<style name="Global" foreground="#e06c75" />
<style name="Field" foreground="#e06c75"/>
<style name="Static" foreground="#56b6c2" />
<style name="VirtualMethod" foreground="#61afef" italic="true"/>
<style name="Function" foreground="#61afef"/>
<style name="Keyword" foreground="#c678dd"/>
<style name="PrimitiveType" foreground="#c678dd"/>
<style name="Type" foreground="#e5c07b" />
<style name="Operator" foreground="#56b6c2" />
<style name="Overloaded Operator" foreground="#c678dd"/>
<style name="Punctuation"/>
<style name="Preprocessor" foreground="#c678dd"/>
<style name="Label" foreground="#e06c75" bold="true"/>
<style name="Comment" foreground="#5c6370" italic="true"/>
<style name="Doxygen.Comment" foreground="#5c6370" italic="true"/>
<style name="Doxygen.Tag" foreground="#61afef"/>
<style name="VisualWhitespace" foreground="#3c4049"/>
<style name="QmlLocalId" foreground="#61afef"/>
<style name="QmlExternalId"/>
<style name="QmlTypeId" foreground="#61afef"/>
<style name="QmlRootObjectProperty" foreground="#61afef"/>
<style name="QmlScopeObjectProperty" foreground="#61afef"/>
<style name="QmlExternalObjectProperty"/>
<style name="JsScopeVar"/>
<style name="JsImportVar" foreground="#d19a66"/>
<style name="JsGlobalVar" foreground="#d19a66"/>
<style name="QmlStateName" foreground="#61afef"/>
<style name="Binding" foreground="#c678dd"/>
<style name="DisabledCode" foreground="#5c6370"/>
<style name="AddedLine" foreground="#98c379"/>
<style name="RemovedLine" foreground="#e06c75"/>
<style name="DiffFile" foreground="#61afef"/>
<style name="DiffLocation" foreground="#d19a66"/>
<style name="DiffFileLine" foreground="#000000" background="#e5c07b"/>
<style name="DiffContextLine" foreground="#000000" background="#56b6c2"/>
<style name="DiffSourceLine" foreground="#000000" background="#be5046"/>
<style name="DiffSourceChar" foreground="#000000" background="#e06c75"/>
<style name="DiffDestLine" foreground="#000000" background="#789353"/>
<style name="DiffDestChar" foreground="#000000" background="#98c379"/>
<style name="LogChangeLine" foreground="#e06c75"/>
<style name="LogAuthorName" foreground="#61afef"/>
<style name="LogCommitDate" foreground="#98c379"/>
<style name="LogCommitHash" foreground="#e06c75"/>
<style name="LogCommitSubject"/>
<style name="LogDecoration" foreground="#c678dd"/>
<style name="Warning" underlineColor="#d19a66" underlineStyle="SingleUnderline"/>
<style name="WarningContext" underlineColor="#d19a66" underlineStyle="DotLine"/>
<style name="Error" underlineColor="#e06c75" underlineStyle="SingleUnderline"/>
<style name="ErrorContext" underlineColor="#e06c75" underlineStyle="DotLine"/>
<style name="Declaration"/>
<style name="FunctionDefinition"/>
<style name="OutputArgument" italic="true"/>
<style name="LastStyleSentinel"/>
</style-scheme>
然后在 Qt Creator 中的 工具 --> 选项 --> 文本编辑器 中将主题换成 One Dark 即可。重启之后就可以看到代码样式的变化了,至于 Qt Creator 界面的主题可以参照上述博客中的配置。
界面截图
配置完成之后的界面如下图所示,有 VS Code 的 one dark pro 的感觉了,当然代码编辑体验还是差了点,想要完全使用 VS Code 来开发 Qt 的话可以参见之前的博客 《如何在 VS Code 中搭建 Qt 开发环境》。

如何在 Qt Creator 中应用 one dark pro 主题的更多相关文章
- Qt Creator打造VScode one dark pro主题配色
1.缘由 我之前习惯使用 vscode 进行开发,对 vscode 的 one dark pro 主题情有独钟.无奈公司需要使用 Qt Creator 进行日常开发,只能暂时舍弃 vscode,采用曲 ...
- 如何在Qt Creator中导入图标资源
本文主要描述如何在Qt Creator中创建资源文件,并的打入导入图标文件. 查看图标资源文件时,可以在项目的工程文件上鼠标单击右键-Open With-资源编辑器,效果如下图所示: 在项目的工程文件 ...
- 如何在Qt Creator中创建pri文件,以及pri文件的说明
初学Qt的人可还不会接触到这个问题,但是一旦你开始编写某个较大项目的时候,这个问题就不可避免需要解决. 对于大神们来讲可能这是个很简单的问题,但是对于新手来说,想要搞清楚需要下很大功夫. 怎么创建pr ...
- 如何在Qt Creator中添加库文件和头文件目录
在使用QtCreator开发图像处理程序的时候想加入Opencv库来处理图形,添加头文件,需要编辑工程文件夹下的.pro文件在文件中添加以下内容,即可包含头文件的文件夹: INCLUDEPATH += ...
- Windows XP 下如何使用Qt Creator中的Git版本控制功能
原文地址:http://www.qtcn.org/bbs/simple/?t16960.html Qt Creator是针对Qt应用开发平台专门设计的IDE开发工具,集成了很多功能,分别有win ...
- Qt Creator中的3D绘图及动画教程(参照NeHe)
Qt Creator中的3D绘图及动画教程(参照NeHe) http://blog.csdn.net/cly116/article/details/47184729 刚刚学习了Qt Creator,发 ...
- 如何在Qt Creator 创建一个.pri文件
如何在Qt Creator 创建一个.pri文件 2013年10月09日 ⁄ 综合 ⁄ 共 254字 ⁄ 字号 小 中 大 ⁄ 评论关闭 这个问题很少人写,因为比较简单,但是让却让我花了好大功夫才 ...
- qt creator中使用qwt插件
前提:我用mingw编译的qwt. 将qwt插件集成到qt designer非常easy.仅仅要把qwt编译的qwt_designer_plugin.dll复制到C:\Qt\Qt5.3.1\5.3\m ...
- Qt在VS2013或Qt Creator 中的控制台输出方式设置
首先值得注意的是:在写程序的时候,项目保存路径不要涉及到中文,否则容易出错! 一.Qt在VS2013中的控制台输出方式: 注意:这里是而不是Qt Application. 然后直接点击finish即可 ...
随机推荐
- codeforces B. Island Puzzle
B. Island Puzzle time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...
- C1. 组队活动 Small(BNUOJ)
C1. 组队活动 Small Time Limit: 1000ms Memory Limit: 131072KB 64-bit integer IO format: %lld Java cl ...
- Sum of Consecutive Prime Numbers(poj2739)
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22019 Ac ...
- 教学日志:javaSE-循环语句
一.while循环和do...while循环 /* while循环:先判断条件,再执行逻辑代码 四部分组成: 1.初始化:循环的初始化变量 2.条件判断:条件返回必须是true或false 3.循环体 ...
- element 表格只展开一行(点击下一行上一行关闭)
源码:第一步 <el-table :data="tableData" border :row-class-name="tableRowClassName" ...
- [C++]vector去除重复元素
#include <iostream> #include <vector> #include <algorithm> #include <set> us ...
- 20道JavaScript经典面试题
该篇文章整理了一些前端经典面试题,附带详解,涉及到JavaScript多方面知识点,满满都是干货-建议收藏阅读 前言 如果这篇文章有帮助到你,️关注+点赞️鼓励一下作者,文章公众号首发,关注 前端南玖 ...
- Swoole 中使用通道(Channel)实现协程间通讯(消息队列)
通道 Coroutine\Channel 使用本地内存,不同的进程之间内存是隔离的. 只能在同一进程的不同协程内进行 push 和 pop 操作. Co::set(['hook_flags'=> ...
- springboot插件打包跳过单元测试
只需在pom.xml添加如下即可 <skipTests>true</skipTests> pom文件如下 <?xml version="1.0" en ...
- 什么是css Modules
具体请参考阮一峰老师的博客(http://www.ruanyifeng.com/blog/2016/06/css_modules.html)