Results 1 to 2 of 2

Thread: QLineEdit not respecting setBackgroundRole?

  1. #1

    Default QLineEdit not respecting setBackgroundRole?

    Hello,

    I'm trying to get a sequence of QLineEdit object to alternate background colors, but the QLineEdit seems to not respect the setBackgroundRole, and instead always use QPalette::Base. Am I missing something?

    Thanks,
    Kevin

  2. #2
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QLineEdit not respecting setBackgroundRole?

    I don't think setBackgroundRole does anything any more. But you can set the background color using style sheets. For example,
    Qt Code:
    1. lineEdit->setStyleSheet("background-color:palette(window)");
    To copy to clipboard, switch view to plain text mode 
    uses QPalette::WindowRole for the background.

Similar Threads

  1. Replies: 1
    Last Post: 12th October 2010, 22:20
  2. help with QLineEdit
    By benlyboy in forum Newbie
    Replies: 2
    Last Post: 18th February 2010, 01:39
  3. QLineEdit
    By sonuani in forum Qt Tools
    Replies: 1
    Last Post: 21st February 2008, 07:52
  4. QLineEdit
    By sonuani in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2008, 11:40
  5. Qt Layout engine not respecting minimum size?
    By Mike in forum Qt Programming
    Replies: 2
    Last Post: 28th August 2007, 13:27

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.