Changeset 3560:e0a9ee2e112a in orange


Ignore:
Timestamp:
04/19/07 21:47:02 (7 years ago)
Author:
mitar
Branch:
default
Convert:
ccdc7771e1e54aa2dc2e9b3f99a7d54ca0320fd7
Message:

Some more QT 3.3 compatibility.

Location:
orange/OrangeWidgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/ColorPalette.py

    r3558 r3560  
    323323        pm.convertFromImage(image, QPixmap.Color); 
    324324 
    325         self.canvas.setBackgroundPixmap(pm) 
     325        # a little compatibility for QT 3.3 (on Mac at least) 
     326        if hasattr(self.canvas, "setPaletteBackgroundPixmap"): 
     327            self.canvas.setPaletteBackgroundPixmap(pm) 
     328        else: 
     329            self.canvas.setBackgroundPixmap(pm) 
    326330        self.canvas.update() 
    327331 
  • orange/OrangeWidgets/OWGUI.py

    r3555 r3560  
    691691        self.makeConsistent = Disabler(self, master, value, type = HIDER) 
    692692        if self.pixmaps != []: 
    693         # a little compatibility for QT 3.3 (on Mac at least) 
     693            # a little compatibility for QT 3.3 (on Mac at least) 
    694694            if hasattr(self, "setPaletteBackgroundPixmap"): 
    695         self.setPaletteBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
    696         else: 
    697         self.setBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
     695                self.setPaletteBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
     696            else: 
     697                self.setBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
    698698 
    699699        if widgets != []: 
     
    703703        self.master.__setattr__(self.value, not self.master.getdeepattr(self.value)) 
    704704        if self.pixmaps != []: 
    705         # a little compatibility for QT 3.3 (on Mac at least) 
    706         if hasattr(self, "setPaletteBackgroundPixmap"): 
    707         self.setPaletteBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
    708         else: 
    709             self.setBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
     705            # a little compatibility for QT 3.3 (on Mac at least) 
     706            if hasattr(self, "setPaletteBackgroundPixmap"): 
     707                self.setPaletteBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
     708            else: 
     709                self.setBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
    710710        self.makeConsistent.__call__() 
    711711 
     
    714714        self.disables = widgets or [] 
    715715        if self.pixmaps != []: 
    716         # a little compatibility for QT 3.3 (on Mac at least) 
    717         if hasattr(self, "setPaletteBackgroundPixmap"): 
    718         self.setPaletteBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
    719         else: 
    720             self.setBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
     716            # a little compatibility for QT 3.3 (on Mac at least) 
     717            if hasattr(self, "setPaletteBackgroundPixmap"): 
     718                self.setPaletteBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
     719            else: 
     720                self.setBackgroundPixmap(self.pixmaps[self.master.getdeepattr(self.value)]) 
    721721        self.makeConsistent.__call__() 
    722722 
  • orange/OrangeWidgets/OWWidget.py

    r3504 r3560  
    9393        for state, widget, icon, use in [("Warning", self._warningWidget, self._warningPixmap, self._owWarning), ("Error", self._errorWidget, self._errorPixmap, self._owError)]: 
    9494            if use and self.widgetState[state] != {}: 
    95                 widget.setBackgroundPixmap(icon) 
     95                # a little compatibility for QT 3.3 (on Mac at least) 
     96                if hasattr(widget, "setPaletteBackgroundPixmap"): 
     97                    widget.setPaletteBackgroundPixmap(icon) 
     98                else: 
     99                    widget.setBackgroundPixmap(icon) 
    96100                QToolTip.add(widget, "\n".join(self.widgetState[state].values())) 
    97101            else: 
    98                 widget.setBackgroundPixmap(QPixmap()) 
     102                # a little compatibility for QT 3.3 (on Mac at least) 
     103                if hasattr(widget, "setPaletteBackgroundPixmap"): 
     104                    widget.setPaletteBackgroundPixmap(QPixmap()) 
     105                else: 
     106                    widget.setBackgroundPixmap(QPixmap()) 
    99107                QToolTip.remove(widget) 
    100108 
Note: See TracChangeset for help on using the changeset viewer.