Reputation: 11
I am looking for how to create a QT button with multiple color in background color.
Button should look like this
Upvotes: 1
Views: 164
Reputation: 243907
Use a gradient:
button->setStyleSheet(R"(
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 0, 102, 255), stop:0.55 rgba(0, 148, 61, 255), stop:0.98 rgba(0, 255, 0, 255), stop:1 rgba(0, 0, 0, 0));
border-radius: 10px;
)");
Upvotes: 2