QWidget Semi-transparent Background Color

From Qt Wiki
Revision as of 17:35, 14 January 2015 by Maintenance script (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

English Български

QWidget Semi-transparent Background Color

This code snippet shows how to make the background color of QWidget [qt.io] semi-transparent by overloading paintEvent() [qt.io].

  • Declare overload of paintEvent

.h file

  • Implement the overload of paintEvent

.cpp file

The code snippet is inspired by solution proposed by Antonio Di Monaco at this forum thread [developer.qt.nokia.com].

See Also

How to Change the Background Color of QWidget [qt.io]