天天看點

1、QT creator 黑色主題代碼風格(仿vs2019)

1、設定後的最終效果:

1、QT creator 黑色主題代碼風格(仿vs2019)

俗話說:“工欲善其事必先利其器”,今天裝修了一下QT creator,看上去舒服多了,接下來告訴大家怎麼設定啦!

2、設定步驟

①設定系統主題

主題選擇Dark,暗黑主題,Color也選擇一個比較暗黑一點的顔色,想和我的一樣直接填圖中的16進制數就ok了。

1、QT creator 黑色主題代碼風格(仿vs2019)

②建立一個樣式檔案

找到qt creator的安裝目錄,根據圖中的路徑,找到最後一級目錄styles,建立一個檔案VS2019.xml,注意要改一下檔案字尾名為xml格式。

1、QT creator 黑色主題代碼風格(仿vs2019)

③粘貼樣式代碼

把下面的代碼粘貼到剛才建立的VS2019.xml檔案中,然後關閉qt creator并重新打開。

<?xml version="1.0" encoding="UTF-8"?>
<style-scheme version="1.0" name="VS2019">
  <style name="Text" foreground="#dcdcdc" background="#2e2f30"/>
  <style name="Link" foreground="#4183c4"/>
  <style name="Selection" foreground="#ffffff" background="#3399ff"/>
  <style name="LineNumber" foreground="#2b91af"/>
  <style name="SearchResult" background="#555500"/>
  <style name="SearchScope" background="#1e1e1e"/>
  <style name="Parentheses" foreground="#dadada" background="#333333"/>
  <style name="ParenthesesMismatch" background="#ff00ff"/>
  <style name="AutoComplete" foreground="#000080" background="#c0c0ff"/>
  <style name="CurrentLine" background="#707070"/>
  <style name="CurrentLineNumber" foreground="#aaaaaa" bold="true"/>
  <style name="Occurrences"/>
  <style name="Occurrences.Unused" foreground="#3b84b1"/>
  <style name="Occurrences.Rename" foreground="#ffaaaa"/>
  <style name="Number" foreground="#b5cea8"/>
  <style name="String" foreground="#ffd68f"/>
  <style name="Type" foreground="#4ec9b0"/>
  <style name="Local" foreground="#9cdcfe"/>
  <style name="Global" foreground="#559cd6"/>
  <style name="Field" foreground="#559cd6"/>
  <style name="Static" foreground="#dcdcaa" italic="true"/>
  <style name="VirtualMethod" foreground="#dcdcaa" italic="true"/>
  <style name="Function" foreground="#dcdcaa"/>
  <style name="Keyword" foreground="#d8a0df"/>
  <style name="PrimitiveType" foreground="#559cd6"/>
  <style name="Operator" foreground="#aaaaaa"/>
  <style name="Overloaded Operator"/>
  <style name="Preprocessor" foreground="#beb7ff"/>
  <style name="Label" foreground="#2daae3"/>
  <style name="Comment" foreground="#57a64a"/>
  <style name="Doxygen.Comment" foreground="#57a64a"/>
  <style name="Doxygen.Tag" foreground="#00a0a0"/>
  <style name="VisualWhitespace" foreground="#c0c0c0"/>
  <style name="QmlLocalId" italic="true"/>
  <style name="QmlExternalId" foreground="#aaaaff" italic="true"/>
  <style name="QmlTypeId" foreground="#f3f351"/>
  <style name="QmlRootObjectProperty" italic="true"/>
  <style name="QmlScopeObjectProperty" italic="true"/>
  <style name="QmlExternalObjectProperty" foreground="#aaaaff" italic="true"/>
  <style name="JsScopeVar" foreground="#8888ff" italic="true"/>
  <style name="JsImportVar" foreground="#8888ff" italic="true"/>
  <style name="JsGlobalVar" foreground="#8888ff" italic="true"/>
  <style name="QmlStateName" italic="true"/>
  <style name="Binding" foreground="#ff5555"/>
  <style name="DisabledCode" foreground="#777777" background="#222222"/>
  <style name="AddedLine" foreground="#55ffff"/>
  <style name="RemovedLine" foreground="#ff5555"/>
  <style name="DiffFile" foreground="#57a64a"/>
  <style name="DiffLocation" foreground="#ffff55"/>
  <style name="DiffFileLine" foreground="#000000" background="#d7d700"/>
  <style name="DiffContextLine" foreground="#000000" background="#8aaab6"/>
  <style name="DiffSourceLine" background="#8c2d2d"/>
  <style name="DiffSourceChar" foreground="#000000" background="#c34141"/>
  <style name="DiffDestLine" background="#2d8c2d"/>
  <style name="DiffDestChar" foreground="#000000" background="#41c341"/>
  <style name="LogChangeLine" foreground="#c00000"/>
  <style name="Warning" underlineColor="#ffbe00" underlineStyle="SingleUnderline"/>
  <style name="WarningContext" underlineColor="#ffbe00" underlineStyle="DotLine"/>
  <style name="Error" underlineColor="#ff0000" underlineStyle="SingleUnderline"/>
  <style name="ErrorContext" underlineColor="#ff0000" underlineStyle="DotLine"/>
  <style name="Declaration" bold="true"/>
  <style name="FunctionDefinition"/>
  <style name="OutputArgument" italic="true"/>
</style-scheme>
           

繼續打開工具》》選項,找到Text Editor頁籤,在右邊的選擇清單中,找到剛才建立的VS2019,點選應用ok即可。

1、QT creator 黑色主題代碼風格(仿vs2019)

繼續閱讀