Results 1 to 8 of 8

Thread: How to embed label in lineedit?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    8
    Qt products
    Qt/Embedded
    Platforms
    Windows

    Default Re: How to embed label in lineedit?

    Quote Originally Posted by Lykurg View Post
    Because painting a QLineEdit with the blinking cursor is not as trivial as it seems for beginners... But after setting the label above the line edit just use QWidget::setContentsMargins() on the line edit (with the size of the label) and the label will stop to overlay the input text.
    lineedit setContentsMargins() indents the lineedit box, it made the label out of the lineedit box.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to embed label in lineedit?

    Ups, I've ment: QLineEdit::setTextMargins().

Similar Threads

  1. QCheckBox with long text label
    By Ferdous in forum Newbie
    Replies: 5
    Last Post: 29th October 2011, 19:05
  2. How to update lineEdit
    By HelloDan in forum Qt Programming
    Replies: 9
    Last Post: 17th February 2009, 07:01
  3. tool buttons on top of label
    By McKee in forum Qt Programming
    Replies: 5
    Last Post: 2nd November 2008, 16:07
  4. Copy / Paste doesn't work with LineEdit
    By ia32 in forum Qt Tools
    Replies: 2
    Last Post: 5th May 2008, 21:44
  5. Replies: 1
    Last Post: 24th October 2006, 16:40

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.