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