Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to change the "selectionColor" property of TextEdit for the whole QML application
Qt 6.11 is out! See what's new in the release blog

How to change the "selectionColor" property of TextEdit for the whole QML application

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 411 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Creaperdown
    wrote on last edited by
    #1

    Hey, the default selection color for the TextEdit is a dark blue, which I don't really like. I'd like my whole application to have a lightblue selection color. Now my project contains a lot of QML code, and I don't want to change all of it manually, is there a way I can set it as the default for the whole application?

    1 Reply Last reply
    0
    • Marko StankeM Offline
      Marko StankeM Offline
      Marko Stanke
      wrote on last edited by
      #2

      There's two ways that I know of.

      1. Use Material, define accent and theme.
      2. Wrap the TextEdit in your component (for example CustomTextEdit), and set the color there. Then instead of TextEdit, use CustomTextEdit everywhere.
      C 1 Reply Last reply
      0
      • Marko StankeM Marko Stanke

        There's two ways that I know of.

        1. Use Material, define accent and theme.
        2. Wrap the TextEdit in your component (for example CustomTextEdit), and set the color there. Then instead of TextEdit, use CustomTextEdit everywhere.
        C Offline
        C Offline
        Creaperdown
        wrote on last edited by
        #3

        @Marko-Stanke Thanks, the second way seems easy enough using search/replace tools to apply to to my whole project.

        1 Reply Last reply
        0
        • C Creaperdown has marked this topic as solved on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved