前言

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 主题的更多相关文章

  1. Qt Creator打造VScode one dark pro主题配色

    1.缘由 我之前习惯使用 vscode 进行开发,对 vscode 的 one dark pro 主题情有独钟.无奈公司需要使用 Qt Creator 进行日常开发,只能暂时舍弃 vscode,采用曲 ...

  2. 如何在Qt Creator中导入图标资源

    本文主要描述如何在Qt Creator中创建资源文件,并的打入导入图标文件. 查看图标资源文件时,可以在项目的工程文件上鼠标单击右键-Open With-资源编辑器,效果如下图所示: 在项目的工程文件 ...

  3. 如何在Qt Creator中创建pri文件,以及pri文件的说明

    初学Qt的人可还不会接触到这个问题,但是一旦你开始编写某个较大项目的时候,这个问题就不可避免需要解决. 对于大神们来讲可能这是个很简单的问题,但是对于新手来说,想要搞清楚需要下很大功夫. 怎么创建pr ...

  4. 如何在Qt Creator中添加库文件和头文件目录

    在使用QtCreator开发图像处理程序的时候想加入Opencv库来处理图形,添加头文件,需要编辑工程文件夹下的.pro文件在文件中添加以下内容,即可包含头文件的文件夹: INCLUDEPATH += ...

  5. Windows XP 下如何使用Qt Creator中的Git版本控制功能

     原文地址:http://www.qtcn.org/bbs/simple/?t16960.html Qt Creator是针对Qt应用开发平台专门设计的IDE开发工具,集成了很多功能,分别有win ...

  6. Qt Creator中的3D绘图及动画教程(参照NeHe)

    Qt Creator中的3D绘图及动画教程(参照NeHe) http://blog.csdn.net/cly116/article/details/47184729 刚刚学习了Qt Creator,发 ...

  7. 如何在Qt Creator 创建一个.pri文件

    如何在Qt Creator 创建一个.pri文件 2013年10月09日 ⁄ 综合 ⁄ 共 254字 ⁄ 字号 小 中 大 ⁄ 评论关闭   这个问题很少人写,因为比较简单,但是让却让我花了好大功夫才 ...

  8. qt creator中使用qwt插件

    前提:我用mingw编译的qwt. 将qwt插件集成到qt designer非常easy.仅仅要把qwt编译的qwt_designer_plugin.dll复制到C:\Qt\Qt5.3.1\5.3\m ...

  9. Qt在VS2013或Qt Creator 中的控制台输出方式设置

    首先值得注意的是:在写程序的时候,项目保存路径不要涉及到中文,否则容易出错! 一.Qt在VS2013中的控制台输出方式: 注意:这里是而不是Qt Application. 然后直接点击finish即可 ...

随机推荐

  1. 【LeetCode】622. Design Circular Queue 解题报告(Python & C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 用直的代替弯的 数组循环利用 日期 题目地址:htt ...

  2. 第二十七个知识点:什么是对称密码加密的AEAD安全定义?

    第二十七个知识点:什么是对称密码加密的AEAD安全定义? AEAD 在之前的博客里,Luke描述了一种被广泛使用的操作模式(ECB,CBC和CTR)对块密码.我们也可能会想我们加密方案的完整性,完整性 ...

  3. rsync 守护进程及实时同步

    目录 rsync 守护进程及实时同步 rsync简介 rsync特性 rsync应用场景 cp命令 scp命令 rsync的传输方式 rsync的传输模式 rsync实际使用 rsync命令 案例 r ...

  4. request参数获取,参数校验,参数处理

    需求: 1.post接口,需要在过滤器中进行参数校验,校验通过之后再执行方法 2.原有代码中使用x-www-form-urlencoded传参,新需求要使用json格式 3.原有代码校验过滤器使用Se ...

  5. SpringBoot集成Actuator监控管理

    1.说明 本文详细介绍Spring Boot集成Actuator监控管理的方法, 基于已经创建好的Spring Boot工程, 然后引入Actuator依赖, 介绍监控管理相关功能的使用. Sprin ...

  6. C#读取注释的方法

    友好的注释能提高代码的可读性,几乎所有的编程语言都支持注释. 在C#中,注释不是可执行代码的一部分,因此注释不会被编译到程序集中去,但是我们可以提取注释[右键项目]-[属性]-[生成]-[输出]-[X ...

  7. 【JAVA今法修真】 第八章 仙道万维网 圣地元宇宙

    您好,我是南橘,万法仙门的掌门,刚刚从九州世界穿越到地球,因为时空乱流的影响导致我的法力全失,现在不得不通过这个平台向广大修真天才们借去力量.你们的每一个点赞,每一个关注都是让我回到九州世界的助力,兄 ...

  8. python float运算时存在浮点误差,结果小数点带.00002及解决方法

    背景: 返回一个json字符串,result结果里面嵌套多个内容一样,只有具体数据不一样的列表[字典],现在需要从里面取指定的key值,来计算最后的总额. 原来使用的类型,float 通过取到json ...

  9. 初识python:多线程

    多线程:在一个程序中,独立运行的程序片断叫作"线程"(Thread),利用它编程的概念就叫作"多线程处理".即:一个进程中,多个线程. 举个例说明:就像是一列火 ...

  10. python 之 pip、pypdf2 安装与卸载

    pip是个啥? pip 是一个现代的,通用的 Python 包管理工具.提供了对 Python 包的查找.下载.安装.卸载的功能. 第一步:pip 下载:https://pypi.org/projec ...