Changeset 11413:98d8cc8906c4 in orange


Ignore:
Timestamp:
03/18/13 12:49:57 (13 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Replaced QTimer.singleShot with a QTimer instance to schedule preview item updates.

QTimer.singleShot event can outlive the PreviewModel causing a RuntimeError.

Location:
Orange/OrangeCanvas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/application/canvasmain.py

    r11411 r11413  
    11111111 
    11121112        dialog.deleteLater() 
     1113        model.deleteLater() 
    11131114 
    11141115        if status == QDialog.Accepted: 
     
    12231224 
    12241225        bottom_row = [self.get_started_action, tutorials_action, 
    1225                    self.documentation_action] 
     1226                      self.documentation_action] 
    12261227 
    12271228        self.new_action.triggered.connect(dialog.accept) 
  • Orange/OrangeCanvas/preview/previewmodel.py

    r11191 r11413  
    5050            self.insertColumn(0, items) 
    5151 
     52        self.__timer = QTimer(self) 
     53 
    5254    def delayedScanUpdate(self, delay=10): 
    5355        """Run a delayed preview item scan update. 
     
    7173            try: 
    7274                iter_scan.next() 
    73                 QTimer.singleShot(delay, process_one) 
    7475            except StopIteration: 
    75                 pass 
     76                self.__timer.timeout.disconnect(process_one) 
     77                self.__timer.stop() 
    7678 
    77         QTimer.singleShot(delay, process_one) 
     79        self.__timer.timeout.connect(process_one) 
     80        self.__timer.start(delay) 
    7881 
    7982 
Note: See TracChangeset for help on using the changeset viewer.