Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Watermark in QTextEdit

    General and Desktop
    2
    5
    2981
    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.
    • G
      GrahamL last edited by

      Hi
      I have a QTextEdit in which I want to display a watermark
      Could someone tell me if this is possible and how I can achieve this

      Thanks

      1 Reply Last reply Reply Quote 0
      • A
        adnan last edited by

        Do you want a permanent background watermark or the one which disappears with a click like usernames and passwords

        1 Reply Last reply Reply Quote 0
        • G
          GrahamL last edited by

          Hi
          Thanks for your reply
          I require a permanent background watermark

          1 Reply Last reply Reply Quote 0
          • A
            adnan last edited by

            You can have a temporary watermark using
            @setPlaceholderText ("some text")@

            .

            1 Reply Last reply Reply Quote 0
            • A
              adnan last edited by

              For permanent watermark
              @lineEdit->setFrame(false);
              QLineEdit {
              image: url(:/images/watermark.png);
              }
              @

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