Skip to content

Commit

Permalink
Backport fix for integer division in Qt RangeEditor and BoundsEditor (#…
Browse files Browse the repository at this point in the history
…1001)

* FIX: Fix for PyQt 5.15 int (#999)

* Fix a true division to be integer division (#1000)

`setWidth` expects an integer rather than a float.

See also #999.

* Update changelog for #999 and #1000

Co-authored-by: Eric Larson <[email protected]>
Co-authored-by: Mark Dickinson <[email protected]>
  • Loading branch information
3 people authored Jul 15, 2020
1 parent 04740d8 commit 557a90b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ This is a bugfix release that fixes a number of issues since the 7.0.0 release.
It includes fixes to various editors, improvements to tests and fixes to the
demo application.

Thanks to Ieva Cerny, Kit Choi, Robert Kern, Federico Miorelli,
Joris Vankerschaver, Corran Webster.
Thanks to Ieva Cerny, Kit Choi, Mark Dickinson, Robert Kern, Eric Larson,
Federico Miorelli, Joris Vankerschaver, Corran Webster.

Fixes
~~~~~
* Fix error from true division of integers for Qt RangeEditor and BoundsEditor
(#999, #1000)
* Fix handling of minimum and maximum datetimes in Qt DatetimeEditor (#803)
* Fix error in wx TabularEditor (#969)
* Fix wx panel error due to alignments (#829)
Expand Down
4 changes: 2 additions & 2 deletions traitsui/qt4/extra/bounds_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def init(self, parent):

# The default size is a bit too big and probably doesn't need to grow.
sh = self._label_lo.sizeHint()
sh.setWidth(sh.width() / 2)
sh.setWidth(sh.width() // 2)
self._label_lo.setMaximumSize(sh)

self.control.slider = slider = RangeSlider(QtCore.Qt.Horizontal)
Expand All @@ -71,7 +71,7 @@ def init(self, parent):

# The default size is a bit too big and probably doesn't need to grow.
sh = self._label_hi.sizeHint()
sh.setWidth(sh.width() / 2)
sh.setWidth(sh.width() // 2)
self._label_hi.setMaximumSize(sh)

self.set_tooltip(slider)
Expand Down
4 changes: 2 additions & 2 deletions traitsui/qt4/range_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def init(self, parent):

# The default size is a bit too big and probably doesn't need to grow.
sh = text.sizeHint()
sh.setWidth(sh.width() / 2)
sh.setWidth(sh.width() // 2)
text.setMaximumSize(sh)

panel.addWidget(text)
Expand Down Expand Up @@ -417,7 +417,7 @@ def init(self, parent):

# The default size is a bit too big and probably doesn't need to grow.
sh = text.sizeHint()
sh.setWidth(sh.width() / 2)
sh.setWidth(sh.width() // 2)
text.setMaximumSize(sh)

panel.addWidget(text)
Expand Down

0 comments on commit 557a90b

Please sign in to comment.