Changeset 7727:37a05f384ca4 in orange


Ignore:
Timestamp:
03/07/11 15:00:45 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
a2f12d6e231f3d2fb882bfa27fe548ec76ec7f8b
Message:

Fixed a problem with sip 4.12.1 (any attribute lookup fails (even getattr(_,_,_) with "underlying C/C++ object has been deleted" before the QDialog init is called).

Location:
orange/OrangeWidgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/OWBaseWidget.py

    r7117 r7727  
    5050#            obj.__dict__[lastname] = value 
    5151 
    52     controlledAttributes = getattr(self, "controlledAttributes", None) 
     52    controlledAttributes = hasattr(self, "controlledAttributes") and getattr(self, "controlledAttributes", None) 
    5353    controlCallback = controlledAttributes and controlledAttributes.get(name, None) 
    5454    if controlCallback: 
     
    136136 
    137137    def __init__(self, parent = None, signalManager = None, title="Orange BaseWidget", modal=FALSE, savePosition = False, resizingEnabled = 1, **args): 
     138        if resizingEnabled: 
     139            QDialog.__init__(self, parent, Qt.Window) 
     140        else: 
     141            QDialog.__init__(self, parent, Qt.Dialog | Qt.MSWindowsFixedSizeDialogHint)# | Qt.WindowMinimizeButtonHint) 
     142             
    138143        # do we want to save widget position and restore it on next load 
    139144        self.savePosition = savePosition 
    140145        if savePosition: 
    141146            self.settingsList = getattr(self, "settingsList", []) + ["widgetWidth", "widgetHeight", "widgetXPosition", "widgetYPosition", "widgetShown", "savedWidgetGeometry"] 
    142  
    143         if resizingEnabled: QDialog.__init__(self, parent, Qt.Window) 
    144         else:               QDialog.__init__(self, parent, Qt.Dialog | Qt.MSWindowsFixedSizeDialogHint)# | Qt.WindowMinimizeButtonHint) 
    145147 
    146148        # directories are better defined this way, otherwise .ini files get written in many places 
  • orange/OrangeWidgets/OWkNNOptimization.py

    r7120 r7727  
    2222 
    2323    def __init__(self, parentWidget = None, signalManager = None, graph = None, visualizationMethod = SCATTERPLOT, parentName = "Visualization widget"): 
     24        OWWidget.__init__(self, None, signalManager, "VizRank Dialog", savePosition = True, wantMainArea = 0, wantStatusBar = 1) 
    2425        VizRank.__init__(self, visualizationMethod, graph) 
    25         OWWidget.__init__(self, None, signalManager, "VizRank Dialog", savePosition = True, wantMainArea = 0, wantStatusBar = 1) 
    2626 
    2727        self.parentWidget = parentWidget 
Note: See TracChangeset for help on using the changeset viewer.