Can't find setting to style QML type properties in Qt Creator color schemes



  • I'm unable to find the setting in order to change the color of QML type properties in Qt Creator color schemes. In the following snippet from main.qml in the Qt Quick Controls - Basic Layouts Example, the properties of mainLayout default to the gray color of the "Text" style even though I've set colors for all of the QML-specific styles. It appears that there may not currently be a style setting for this.

    Can anyone verify this one way or the other?

    Thanks

    QML type property color style.png


  • Lifetime Qt Champion

    Hi,

    IIRC, you can do that by modifying the settings in Text Editor -> Fonts and Colors



  • @SGaist said:

    Hi,

    IIRC, you can do that by modifying the settings in Text Editor -> Fonts and Colors

    Another way to do it is to create/modify a color scheme xml file which resides in [Qt install dir]\Tools\QtCreator\share\qtcreator\styles and will show up in the "Color Scheme" dropdown list. The one I'm working with and the results as they show up in the options dialog are below.

    As I mentioned in my original post, I've set colors for all of the QML-specific styles (actually except for QmlStateName which is set to italic) but the QML type properties still default to the gray color of the "Text" style (not italic). There are no other styles in this xml file that are using the same color as the "Text" style and nothing else shows up with this color (not italic) in the options dialog so the only conclusion that I can come up with is that there is no style setting for QML type properties.

    Hopefully this clarifies things a bit.

    <?xml version="1.0" encoding="UTF-8"?>
    <style-scheme version="1.0" name="Wombat (mod)">
      <style name="AddedLine" foreground="#00aa00"/>
      <style name="Binding" foreground="#ff5555"/>
      <style name="Comment" foreground="#00a0a0" italic="true"/>
      <style name="CurrentLine" foreground="#000000" background="#c2e1ff"/>
      <style name="CurrentLineNumber" foreground="#3399ff" background="#000000" bold="true"/>
      <style name="DiffContextLine" background="#afd7e7"/>
      <style name="DiffDestChar" background="#afffaf"/>
      <style name="DiffDestLine" background="#dfffdf"/>
      <style name="DiffFile" foreground="#000080"/>
      <style name="DiffFileLine" background="#ffff00"/>
      <style name="DiffLocation" foreground="#0000ff"/>
      <style name="DiffSourceChar" background="#ffafaf"/>
      <style name="DiffSourceLine" background="#ffdfdf"/>
      <style name="DisabledCode" foreground="#545454"/>
      <style name="Doxygen.Comment" foreground="#9c998e"/>
      <style name="Doxygen.Tag" foreground="#bcb9ac" bold="true"/>
      <style name="Field" foreground="#cb6ecb"/>
      <style name="Function" foreground="#00ab00" bold="true"/>
      <style name="JsGlobalVar" foreground="#0055af" italic="true"/>
      <style name="JsImportVar" foreground="#0055af" italic="true"/>
      <style name="JsScopeVar" foreground="#2985c7" italic="true"/>
      <style name="Keyword" foreground="#3399ff" bold="true"/>
      <style name="Label" foreground="#95e454"/>
      <style name="LineNumber" foreground="#8b8bcd" background="#2e2e2e"/>
      <style name="Link" foreground="#0000ff"/>
      <style name="Local" foreground="#efb216"/>
      <style name="Number" foreground="#ff6464" bold="true"/>
      <style name="Occurrences" foreground="#000000" background="#b4b4b4"/>
      <style name="Occurrences.Rename" foreground="#000000" background="#ff6464"/>
      <style name="Occurrences.Unused" foreground="#808000"/>
      <style name="Operator" foreground="#cfbfad"/>
      <style name="Parentheses" foreground="#e3e0d7" bold="true"/>
      <style name="Preprocessor" foreground="#e5786d"/>
      <style name="PrimitiveType" foreground="#d4d987"/>
      <style name="QmlExternalId" foreground="#000080" italic="true"/>
      <style name="QmlExternalObjectProperty" foreground="#000080" italic="true"/>
      <style name="QmlLocalId" foreground="#efb216" italic="true"/>
      <style name="QmlRootObjectProperty" foreground="#c13197" italic="true"/>
      <style name="QmlScopeObjectProperty" foreground="#cb6ecb" italic="true"/>
      <style name="QmlStateName" italic="true"/>
      <style name="QmlTypeId" foreground="#55ff55"/>
      <style name="RemovedLine" foreground="#ff0000"/>
      <style name="SearchResult" foreground="#ffffff" background="#2572b8"/>
      <style name="SearchScope" foreground="#000000" background="#e2efff"/>
      <style name="Selection" foreground="#ffffff" background="#3399ff"/>
      <style name="Static" foreground="#ff6464" italic="true"/>
      <style name="String" foreground="#e6db74"/>
      <style name="Text" foreground="#a9b7c6" background="#000000"/>
      <style name="Type" foreground="#55ff55"/>
      <style name="VirtualMethod" foreground="#b3ff01" italic="true"/>
      <style name="VisualWhitespace" foreground="#c0c0c0"/>
    </style-scheme>
    

    Wombat (mod)-all.png


  • Lifetime Qt Champion

    Ok, I see, that might be something missing from Qt Creator, which version are you using ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.