Arkhan6
Arkhan6

Reputation: 157

How to use Delegate with QCalendarWidget?

I need modify the delegate in a QCalenderWidget. I want to change the background-color of cell when the user select a specific day.

I would like getting a simple example.

Upvotes: 1

Views: 279

Answers (1)

Sajmplus
Sajmplus

Reputation: 272

You could use QWidget::setStyleSheet(const QString & styleSheet) and set selection-background-color value:

auto calendar = new QCalendarWidget(this);
calendar->setStyleSheet("selection-background-color:black");

Upvotes: 1

Related Questions