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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -