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. Changing Background color
Qt 6.11 is out! See what's new in the release blog

Changing Background color

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 349 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
    mahd96
    wrote on last edited by
    #1

    i need to set my widget background color in PaintEvent() .
    how can i do it?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mahd96
      wrote on last edited by mahd96
      #2
      QColor backgroundColor =color;
      QPainter customPainter(this);
      customPainter.fillRect(rect(),backgroundColor);
      
      1 Reply Last reply
      2

      • Login

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