Change editor colors

You can select one of the predefined color schemes for the text editor or create customized color schemes.

{Font & Colors tab in Text Editor preferences}

To create a color scheme:

  1. Select Preferences > Text Editor > Font & Colors > Copy.
  2. Enter a name for the color scheme and click OK.
  3. In the Foreground field, specify the color of the selected code element or message.
  4. In the Background field, select the background color for the code element or message.

    The background of the Text element determines the background of the code editor.

  5. In Font, select Bold or Italic to format the text of the selected code element or message by making it bold or italic.
  6. In Underline, select the color and style to use for underlining code elements or messages.

When you copy code from Qt Creator, it is copied in both plain text and HTML format. The latter makes sure that syntax highlighting is preserved when pasting to a rich-text editor.

Export and import color schemes

To share color schemes with others, export and import them as XML files. To export a color scheme, select Preferences > Text Editor > Font & Colors > Export, and then select the filename and location for the XML file.

To import a color scheme, select Import, and then select the XML file to import. In the Import Color Scheme dialog, enter a name for the color scheme in Color scheme name:

"Import Color Scheme dialog"

When you select OK, the color scheme is added to the list of color schemes in the Font & Colors tab.

See also Behavior and Font & Colors.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.