Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] OWNomogram: Do not paint scene until the widget is not open #2202

Merged
merged 1 commit into from
Apr 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Orange/widgets/visualize/ownomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ def __init__(self):
self.hidden_vertical_line = None
self.old_target_class_index = self.target_class_index
self.markers_set = False
self.repaint = False

# GUI
box = gui.vBox(self.controlArea, "Target class")
Expand Down Expand Up @@ -765,6 +766,7 @@ def _cont_feature_dim_combo_changed(self):

def eventFilter(self, obj, event):
if obj is self.view.viewport() and event.type() == QEvent.Resize:
self.repaint = True
values = [item.dot.value for item in self.feature_items]
self.feature_marker_values = self.scale_back(values)
self.update_scene()
Expand Down Expand Up @@ -877,6 +879,8 @@ def calculate_log_reg_coefficients(self):
self.log_reg_cont_data_extremes.append([None])

def update_scene(self):
if not self.repaint:
return
self.clear_scene()
if self.domain is None or not len(self.points[0]):
return
Expand Down
1 change: 1 addition & 0 deletions Orange/widgets/visualize/tests/test_ownomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def setUpClass(cls):

def setUp(self):
self.widget = self.create_widget(OWNomogram)
self.widget.repaint = True

def test_input_nb_cls(self):
"""Check naive bayes classifier on input"""
Expand Down