Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    have two color of one word

    QML and Qt Quick
    2
    5
    833
    Loading More Posts
    • 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.
    • B
      beh_zad last edited by

      I am looking for a way to change the first letter color of a single word, in other work I want to have one word with two different color.
      What should I do in Text QML?

      1 Reply Last reply Reply Quote 0
      • R
        Rem-Kolomna last edited by

        I think you can use this:

        Label {
            text: "<font color=\"blue\">H</font>ello"
        }
        
        B 1 Reply Last reply Reply Quote 0
        • B
          beh_zad last edited by

          thanks for replying, but I have several columns and each of columns filled with several text, I created a TextField to prepare a search tool for user, when user type a letter in TextField I want the color of these letters that match is change.

          1 Reply Last reply Reply Quote 0
          • R
            Rem-Kolomna last edited by

            I think you should use TextArea instead and listen to keyboard events and add formatted text (like in label) as you need

            1 Reply Last reply Reply Quote 0
            • B
              beh_zad @Rem-Kolomna last edited by

              @Rem-Kolomna I did it, Thanks for your help

              1 Reply Last reply Reply Quote 0
              • First post
                Last post