4
我想畫一個滑塊的背景。我嘗試過,但顏色覆蓋了整個滑塊。這是在繼承的類的QSliderQt drawRect在後臺
void paintEvent(QPaintEvent *e) {
QPainter painter(this);
painter.begin(this);
painter.setBrush(/*not important*/);
// This covers up the control. How do I make it so the color is in
// the background and the control is still visible?
painter.drawRect(rect());
painter.end();
}
你想要做的是繪製一個小部件的背景?請更具體一點。 –