##// END OF EJS Templates
fix to QTRD-1519:Setting color for a BarSet has no effect. Theme was overriding the color, which was defined on QML side
sauimone -
r1788:9c93fca09947
parent child
Show More
@@ -481,8 +481,15 QColor QBarSet::color()
481 void QBarSet::setColor(QColor color)
481 void QBarSet::setColor(QColor color)
482 {
482 {
483 QBrush b = brush();
483 QBrush b = brush();
484 if (b.color() != color) {
484 if ((b.color() != color) || (b.style() == Qt::NoBrush)) {
485 b.setColor(color);
485 b.setColor(color);
486 if (b.style() == Qt::NoBrush) {
487 // Set tyle to Qt::SolidPattern. (Default is Qt::NoBrush)
488 // This prevents theme to override color defined in QML side:
489 // BarSet { label: "Bob"; color:"red"; values: [1,2,3] }
490 // The color must be obeyed, since user wanted it.
491 b.setStyle(Qt::SolidPattern);
492 }
486 setBrush(b);
493 setBrush(b);
487 emit colorChanged(color);
494 emit colorChanged(color);
488 }
495 }
General Comments 0
You need to be logged in to leave comments. Login now