enthought / enthought/traitsui

Qt date editor SimpleEditor missing calendar drop down

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

Description

Qt implementation of `SimpleEditor` for `DateEditor` is different from the wx implementation, and is missing a calendar drop down feature.

The [Qt `SimpleEditor`](https://github.com/enthought/traitsui/blob/master/traitsui/qt4/date_editor.py) initializes the `self.control = QtGui.QDateEdit()` attribute, but does not set the calendar drop down option via `self.control.setCalendarPopup(True)`.

I would consider this is an issue for two reasons:
- The wx implementation does provide this functionality by setting `style=wx.adv.DP_DROPDOWN`:
https://github.com/enthought/traitsui/blob/3e2ce8604f8916ac68025c78fdc1985001d9c18b/traitsui/wx/date_editor.py#L56-L59
And having a consitent behaviour is useful.
- We can have the existing behaviour as the default one, but it would be nice to have an option to control it via the factory attribute.

This is a small UX improvement, and it can be possibly done by adding this:
```
if hasattr(self.factory, "calendar_popup"):
self.control.setCalendarPopup(self.factory.calendar_popup)
```
to the Qt `SimpleEditor`, and a respective attribute to the traitsui factory.

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.