4
スライダの背景をペイントしたい。私はこれを試しましたが、色はスライダー全体をカバーします。あなたがすることができ、以下はウィジェットの背景を設定しますQt drawRect in background
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();
}
ウィジェットの背景をペイントしますか?少し具体的にしてください。 –