Results 1 to 2 of 2

Thread: Line Edit "hint" text

  1. #1
    Join Date
    Jun 2010
    Posts
    142
    Thanks
    11
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Line Edit "hint" text

    How do I make a QLineEdit show some predetermined gray text only when it's unfocused and empty? Kind of like the Filter box above the list of widgets in Qt Designer, so you know what I mean.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Line Edit "hint" text

    In Qt 4.7 this is a property of the line edit, in older versions you have to subclass QLineEdit and implement it yourself. You can also use QwwButtonLineEdit and its placeholderText property.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 8th December 2011, 19:21
  2. Replies: 3
    Last Post: 26th August 2010, 08:57
  3. Replies: 4
    Last Post: 5th March 2010, 18:03
  4. Replies: 0
    Last Post: 22nd January 2009, 18:15
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.