summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_gui_painting_qcolor.cpp
blob: c21e58987f43974291d32d19b6231f6bd9b493ce (plain)
1
2
3
4
5
6
7
8
9
//! [0]
// Specify semi-transparent red
painter.setBrush(QColor(255, 0, 0, 127));
painter.drawRect(0, 0, width()/2, height());

// Specify semi-transparent blue
painter.setBrush(QColor(0, 0, 255, 127));
painter.drawRect(0, 0, width(), height()/2);
//! [0]