Add test for expected visibility behaviour for sub-widgets.
Make visible equivalent to (not isHidden()); add a test for this.
Add tests from PR review, comments about what tests are doing.
Simplify changes to visibility.
Showing 1 of 2 files from the diff.
pyface/ui/qt4/widget.py
changed.
Other files ignored by Codecov
pyface/tests/test_widget.py
has changed.
@@ -105,6 +105,10 @@
Loading
105 | 105 | class WidgetEventFilter(QtCore.QObject): |
|
106 | 106 | """ An internal class that watches for certain events on behalf of the |
|
107 | 107 | Widget instance. |
|
108 | + | ||
109 | + | This filter watches for show and hide events to make sure that visible |
|
110 | + | state of the widget is the opposite of Qt's isHidden() state. This is |
|
111 | + | needed in case other code hides the toolkit widget |
|
108 | 112 | """ |
|
109 | 113 | ||
110 | 114 | def __init__(self, widget): |
@@ -122,6 +126,6 @@
Loading
122 | 126 | event_type = event.type() |
|
123 | 127 | ||
124 | 128 | if event_type in {QtCore.QEvent.Show, QtCore.QEvent.Hide}: |
|
125 | - | widget.visible = widget.control.isVisible() |
|
129 | + | widget.visible = not widget.control.isHidden() |
|
126 | 130 | ||
127 | 131 | return False |
Files | Coverage |
---|---|
pyface | 40.81% |
Project Totals (508 files) | 40.81% |
1825.1
TRAVIS_OS_NAME=linux
1825.2
TRAVIS_OS_NAME=linux
1825.3
TRAVIS_OS_NAME=osx
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.