前言

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】830. Positions of Large Groups 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.c ...

  2. hdu-5569matrix(dp)

    http://acm.hdu.edu.cn/showproblem.php?pid=5569; 题目意思: 从(1,1)点出发只能向右和向下走,到达(n,n)点时所得到的价值最小, 价值是Let th ...

  3. NetCore实现全局模型绑定异常信息统一处理

    本文主要讲解NetCore如何使用中间件捕获模型绑定的异常信息 场景 在.NET Core 中请求中,如果参数的类型错误,我们在控制器的定义的方法是不会执行的,当我们需要捕获模型绑定的异常信息时,可以 ...

  4. Dynamic Routing Between Capsules

    目录 概 主要内容 损失函数 代码 Sabour S, Frosst N, Hinton G E, et al. Dynamic Routing Between Capsules[C]. neural ...

  5. 编写Java程序,通过给定可变参数方法,计算任意给定的多个int类型数据之和

    返回本章节 返回作业目录 需求说明: 通过给定可变参数方法,计算任意给定的多个int类型数据之和. 实现思路: 定义可变形参方法,参数类型是int类型. 定义变量 sum 接受最终的和. 通过 for ...

  6. 牛掰,在IDEA中,你可以安装小傅哥写的插件了!

    作者:小傅哥 博客:https://bugstack.cn 沉淀.分享.成长,让自己和他人都能有所收获! 一.承认你优秀很难 很多码农,把路走窄了 捧一个,喷一个,很多码农都不会多一点思路看问题,总是 ...

  7. Python_列表比较大小

    比较原理 从第一个元素顺序开始比较,如果相等,则继续,返回第一个不相等元素得比较结果.如果所有元素比较均相等,则长的列表大,一样长则两列表相等. 示例 a = [5, 6, 3] b = [5, 4, ...

  8. mybatis-plus实现多表联查

    一.方法一 1.在pojo模块下新建一个VO 包路径用于提供页面展示所需的数据 2.在vo包下新建EmployInfo类,此类继承了Employees类,再把Dept类的数据复制过来 3.在Dao层中 ...

  9. CentOS7中安装pip的方法

    1.安装epel-release [root@localhost ~]# yum -y install epel-release 2.安装python-pip [root@localhost ~]# ...

  10. 华为云 Kubernetes 管理员实训 四 课后作业

    练习一 创建一个Service和一个Pod作为其后端.通过kubectl describe获得该Service和对应Endpoints的信息. Service的名称为<hwcka-004-1-s ...