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. set different background colors on qt widget
Forum Updated to NodeBB v4.3 + New Features

set different background colors on qt widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 381 Views 1 Watching
  • 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.
  • JoeCFDJ Offline
    JoeCFDJ Offline
    JoeCFD
    wrote on last edited by
    #1

    Somehow I need to set two different background colors(for example: 50-50) on a qt widget. Is it possible?

    A 1 Reply Last reply
    0
    • JoeCFDJ JoeCFD

      Somehow I need to set two different background colors(for example: 50-50) on a qt widget. Is it possible?

      A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      @JoeCFD I don't think it's possible with a default qwidget. You could use a gradient in a stylesheet but that's not a 50/50. It's possible there is some css trick that could do it, but I'm not very good with css. And Qt doesn't handle pure css but more of just the pieces it cares about. So even if there is a css trick it may not work.

      You can also derive from qwidget and handle your own background drawing, in which case doing the 50/50 is very easy.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      2
      • JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by
        #3

        got it. Thanks.

        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