Results 1 to 7 of 7

Thread: validating input to QLineEdit while seting it through "setText()" method.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: validating input to QLineEdit while seting it through "setText()" method.

    Quote Originally Posted by d_stranz View Post
    Anyway, why would you want to display text like that in a line edit when it is forbidden for the user to type the same text? If you are trying to describe what the line edit should be used for, then either implement a tool tip on it or put a label next to it.
    The QLineEdit already has a the placeholderText property to provide an in-widget prompt without actually putting the text in the editor's text buffer (since Qt 4.7, Sept 2010).
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  2. The following user says thank you to ChrisW67 for this useful post:

    d_stranz (5th December 2020)

Similar Threads

  1. QPushButton - setText with "\n" not working
    By gboelter in forum Newbie
    Replies: 7
    Last Post: 10th February 2008, 03:27
  2. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  3. Replies: 11
    Last Post: 10th July 2007, 15:58
  4. Replies: 6
    Last Post: 3rd November 2006, 11:53
  5. QHttp "PUT METHOD" QT Problem File Upload. RFC 2616
    By patrik08 in forum Qt Programming
    Replies: 7
    Last Post: 25th October 2006, 22:02

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
  •  
Qt is a trademark of The Qt Company.