Commits

Aleš Erjavec committed 877a0e7

Fixed scene alignment (align left to prevent scene jittering when resizing). Fixed an RuntimeError due to a deleted QGraphicsWidget whose reference was still held from Python. Fixed an error when changing the distance measure with no input to the widget.

Comments (0)

Files changed (1)

widgets/OWQualityControl.py

         self.scene = QGraphicsScene()
         self.scene_view = QualityGraphicsView(self.scene)
         self.scene_view.setRenderHints(QPainter.Antialiasing)
+        self.scene_view.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
         self.mainArea.layout().addWidget(self.scene_view)
         
         self.connect(self.scene_view,
         with disable_updates(self):
             self.split_by_model[:] = []
             self.sort_by_model[:] = []
-
+        
+        self.main_widget = None
         self.scene.clear()
         self.info_box.setText("\n")
         self._cached_distances = {}
     def on_distance_measure_changed(self):
         """Distance measure has changed
         """
-        with widget_disable(self):
-            self.update_distances()
-            self.replot_experiments()
+        if self.data is not None:
+            with widget_disable(self):
+                self.update_distances()
+                self.replot_experiments()
         
     def on_view_resize(self, size):
         """The view with the quality plot has changed
         """
         if self.main_widget:
             current = self.main_widget.size()
-            self.main_widget.resize(size.width() - 2, 
+            self.main_widget.resize(size.width() - 6, 
                                     current.height())
             
             self.scene.setSceneRect(self.scene.itemsBoundingRect())
         self.unique_pos = sorted(self.unique_pos.items(),
                                  key=lambda t: map(float_if_posible, t[0]))
         
-#        pprint(self.groups)
-#        pprint(self.unique_pos)
         
         if self.groups:
             if sort_labels:
                             tooltip = experiment_description(attr)
                             rug_item.setToolTip(tooltip)
                             rug_item.group_index = indices.index(i)
+                            rug_item.setZValue(rug_item.zValue() + 1)
                         else:
                             rug_item = ClickableRugItem(dist_vec[i] / max_dist,
                                            0.85, self.on_rug_item_clicked)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.