View Single Post
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#2703
After the last CSSU update my custom widgets no longer show the background if I use a QLinearGradient. Here there is the code I use to get it; the ones with a simple QColor keep showing it.

Code:
protected:
    void paintEvent(QPaintEvent *event)
    {
        QPainter p(this);
        QLinearGradient gradient(0, 0, gradiantWidth, 0);
        gradient.setColorAt(0, QColor(0, 0, 0, alpha0));
        gradient.setColorAt(1, QColor(0, 0, 0, alpha1));
        p.setBrush(gradient);
        p.setPen(Qt::NoPen);
        p.drawRoundedRect(rect(), 8, 8);
        p.end();

        QWidget::paintEvent(event);
    }