Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Generated QLineEdit has transparent background colour; how to set to local default background.

Generated QLineEdit has transparent background colour; how to set to local default background.

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Moschops
    wrote on last edited by Moschops
    #1

    I have a subclass of a QStyledItemDelegate. When the user double-clicks a particular index in a view, the createEditor function is called and in some simple cases, all I do is create a QLineEdit and pass back a pointer to it.

    However, on some target operating-system/window-manager combos (Ubuntu running Gnome, in this case), the text that was visible in that location before is still visible, through the QLineEdit. Like a background, painted on the QLineEdit. Those characters are not part of the QLineEdit text; the cursor is at the start, and as I type the new characters appear over the top of the other, visible characters. It's as if the QLineEdit begins life with the background colour set to "transparent". I can set my own background colour

    lineEdit->setStyleSheet("QLineEdit{background: red;}");
    

    but that's ugly; I'd really like the background colour to match whatever the current default background colour is, so that it remains pretty across all OS/window-manager combos. So is there a "local background" colour or some such?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved