4
슬라이더 배경을 페인트하고 싶습니다. 나는 이것을 시도했지만 색상은 전체 슬라이더를 덮는다. 당신이 할 수 있도록, 다음은 위젯의 배경을 설정합니다백그라운드에서 Qt drawRect
theSlider->setStyleSheet("QSlider { background-color: green; }");
: 이것은 당신이 스타일 시트를 설정할 수있는 위젯의 배경을 설정하려면 QSlider
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();
}
위젯의 배경을 페인트하고 싶습니까? 제발 좀 더 구체적으로 말하십시오. –