enthought / enthought/traitsui

Qt custom date editor does not update dates when month changes

Open
#968 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Initially mentioned in #962, the custom DateEditor on Qt and Mac OSX has this weird behaviour where clicking the left and right buttons to switch months do not update the calendar content.

To reproduce:
```
from traits.api import Date, HasTraits
from traitsui.api import UItem, View, DateEditor

class Model(HasTraits):

date = Date()

def default_traits_view(self):
return View(
UItem('date', editor=DateEditor(), style="custom")
)

model = Model(date=None)

if __name__ == '__main__':
model.configure_traits()

```

![Jul-06-2020 11-25-42](https://user-images.githubusercontent.com/3673984/86597034-16b0ba80-bf93-11ea-8a58-0caa584d9b60.gif)

The issue is observed with Qt 5 (5.12 and 5.14), with both PySide2 and PyQt5, and Mac OSX, but it is _not observed_ on Linux and Windows.

This eventually can also be reproduced using pure Python+Qt code free of traitsui. It is possible that it is an issue with Qt and Mac OSX. This GH issue is for tracking this known bug, and possibly a workaround within TraitsUI / Pyface.

See also this thread on Qt Forum: https://forum.qt.io/topic/116695/qcalendarwidget-does-not-update-calendar-when-month-changes-on-mac-osx

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.