Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] How to clear a lineEdit when it is clicked?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] How to clear a lineEdit when it is clicked?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 5.4k 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.
  • L Offline
    L Offline
    Leon
    wrote on last edited by
    #1

    Hello, i don't see any signal for a lineedit to be activated when you click at the lineedit.

    What i want to do, is to create a lineedit, that from default it has a text like "Put text here", and when you click at the lineedit this text clears and let's you type whatever you want.. With this i clear the text

    @ ui->lineEdit->setText("");
    @

    but i don't know when to call it.. Thanks

    1 Reply Last reply
    0
    • T Offline
      T Offline
      task_struct
      wrote on last edited by
      #2

      Hello,

      I think "placeholderText":http://doc.qt.nokia.com/latest/qlineedit.html#placeholderText-prop is what you're looking for.

      "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

      • Linu...
      1 Reply Last reply
      0
      • L Offline
        L Offline
        Leon
        wrote on last edited by
        #3

        [quote author="task_struct" date="1322424422"]Hello,

        I think "placeholderText":http://doc.qt.nokia.com/latest/qlineedit.html#placeholderText-prop is what you're looking for.[/quote]

        That's exactly what i want.
        Thank you a lot! :)

        1 Reply Last reply
        0

        • Login

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