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. Qt/C++/CSS: QTooltip stylesheet background colour
QtWS25 Last Chance

Qt/C++/CSS: QTooltip stylesheet background colour

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 6.4k 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.
  • K Offline
    K Offline
    Kirennian
    wrote on last edited by
    #1

    Hi there,

    I've recently come across a problem developing for the Windows platform, relating to Windows own 'themes'. I have been developing a program with Windows Basic display but upon running the program with a Theme enabled (e.g. Windows Aero), my QTooltips change their background colour, even though the font colour remains correct.

    I have linked my stylesheets which work 100% in Basic mode where I declare how to display the QTooltip:
    @QToolTip{
    color: #8f8;
    background-repeat:no-repeat;
    background-position:center;
    background-color: #222;
    }@

    The background colour when using a Windows theme simply remains white. I have tried declaring this code within my C++ application, both directly before AND after objects are created to no avail. Using a separate .css file and loading the stylesheet to the parent window also doesn't seem to affect the background-colour. I have been looking around for a solution for some time now (returning to the problem on occasion for the last few months) but have not come across anyone with a similar issue.

    Any help would be highly appreciated.

    Kind Regards,
    Kirennian.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hostel
      wrote on last edited by
      #2

      I try your QSS on Linux with KDE and I think that on KDE is similar situation. I found an "old bug with code":https://bugreports.qt-project.org/browse/QTBUG-2849. On my system when I add to QToolTip QSS
      @
      border-style: none;
      /* border-style: outset; works too */
      @
      then backgorund-color starts working. Maybe this will help you.

      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