c++ - QCalendarWidget - How to disable dates -
i'm trying use qcalendarwidget enabled or disabled dates (and not range dates) it's impossible (https://bugreports.qt.io/browse/qtbug-198).
do know if possible paintevent method (or else) ?
thank's reading :)
i've done research. calendar widget contains regular qtableview
subclass (qcalendarview
) regular model (qcalendarmodel
). attempt add proxy model view , change data()
, flags()
functions return disabled state dates wanted disable. needed know date displayed on cell. there qcalendarmodel::dateforcell
method that, it's inaccessible code. it's rather complicated , depends on implementation of qcalendarmodel
.
so think hardly possible. way see copy qcalendarwidget
source project , rename classes avoid conflicts along existing qt classes. can change implementation. in place minimum , maximum date used (e.g. in qcalendarmodel::flags
function) should replace use of enabled/disabled class list.
in case find useful in attempt, i've published code here. proxy model incepted , cells' background made green.
Comments
Post a Comment