Results 1 to 4 of 4

Thread: QLineEdit - red frame

  1. #1
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Question QLineEdit - red frame

    Is it possible to change the frame color of QLineEdit?
    I'm trying to have the red frame when the lineEdit is empy and usual color when the lineEdit is filled. The same with QTextEdit.
    Is it possible to do? I have looked through the manual but didn't find it. There is only "setFrame", but nothing about color of a frame.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QLineEdit - red frame

    Try style sheets: Customizing QLineEdit
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    slava (15th February 2008)

  4. #3
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Question Re: QLineEdit - red frame

    Hey! That worked! Thank you very much!!!

    But it makes the lineEdit smaller somehow. I have a font set to 12 for the whole application and the other lineEdits are big but that one gets back to 10 px.
    I put setFond to 12 after that lineEdit again but that doesn't help. The same with the textEdits...

    I did:

    lineEdit->setStyleSheet("border: 1px solid red");

  5. #4
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Smile Re: QLineEdit - red frame

    I have figured it out. Thank you!

Similar Threads

  1. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 13:35
  2. Using a frame for different functions
    By anafor2004 in forum Newbie
    Replies: 1
    Last Post: 29th January 2008, 14:45
  3. QValidator, regular expressions and QLineEdit
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 02:25
  4. a box around QLineEdit?
    By GreyGeek in forum Qt Tools
    Replies: 13
    Last Post: 8th February 2006, 16:40
  5. Multi frame management ... is it possible ?
    By yellowmat in forum Newbie
    Replies: 8
    Last Post: 25th January 2006, 11:41

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.