Changeset 8147:04239aa4c946 in orange


Ignore:
Timestamp:
08/04/11 11:46:10 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
0bfb820c9a01ecd4d872e025f57cee1a706aa3a9
Message:

Commented out the code for graphics effects (see #799).

Location:
orange/OrangeCanvas
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeCanvas/orngCanvasItems.py

    r8124 r8147  
    99WARNING = 1 
    1010 
    11 def _graphicsEffect(item): 
    12     if hasattr(item, "graphicsEffect"): 
    13         return item.graphicsEffect() 
    14     else: 
    15         return None 
     11#def _graphicsEffect(item): 
     12#    if hasattr(item, "graphicsEffect"): 
     13#        return item.graphicsEffect() 
     14#    else: 
     15#        return None 
    1616     
    1717class TempCanvasLine(QGraphicsPathItem): 
     
    2626        self.setPen(QPen(QColor(180, 180, 180), 3, Qt.SolidLine)) 
    2727         
    28         if qVersion() >= "4.6" and canvasDlg.settings["enableCanvasDropShadows"]: 
    29             effect = QGraphicsDropShadowEffect(self.scene()) 
    30             effect.setOffset(QPointF(0.0, 0.0)) 
    31             effect.setBlurRadius(7) 
    32             self.setGraphicsEffect(effect)         
     28#        if qVersion() >= "4.6" and canvasDlg.settings["enableCanvasDropShadows"]: 
     29#            effect = QGraphicsDropShadowEffect(self.scene()) 
     30#            effect.setOffset(QPointF(0.0, 0.0)) 
     31#            effect.setBlurRadius(7) 
     32#            self.setGraphicsEffect(effect)         
    3333         
    3434    def setStartWidget(self, widget): 
     
    120120        self.setAcceptHoverEvents(True) 
    121121        self.hoverState = False 
    122         if qVersion() >= "4.6" and canvasDlg.settings["enableCanvasDropShadows"]: 
    123             effect = QGraphicsDropShadowEffect(self.scene()) 
    124             effect.setOffset(QPointF(0.0, 0.0)) 
    125             effect.setBlurRadius(7) 
    126             self.setGraphicsEffect(effect) 
     122         
     123#        if qVersion() >= "4.6" and canvasDlg.settings["enableCanvasDropShadows"]: 
     124#            effect = QGraphicsDropShadowEffect(self.scene()) 
     125#            effect.setOffset(QPointF(0.0, 0.0)) 
     126#            effect.setBlurRadius(7) 
     127#            self.setGraphicsEffect(effect) 
     128#            self.prepareGeometryChange() 
     129             
    127130        if scene is not None: 
    128131            scene.addItem(self) 
     
    190193        return stroke.createStroke(self.path()) 
    191194     
    192     def boundingRect(self): 
    193         rect = QGraphicsPathItem.boundingRect(self) 
    194         if _graphicsEffect(self): 
    195             textRect = self.captionItem.boundingRect() ## Should work without this but for some reason if using graphics effects the text gets clipped 
    196             textRect.moveTo(self.captionItem.pos()) 
    197             return rect.united(textRect) 
    198         else: 
    199             return rect 
     195#    def boundingRect(self): 
     196#        rect = QGraphicsPathItem.boundingRect(self) 
     197#        if _graphicsEffect(self): 
     198#            textRect = self.captionItem.boundingRect() ## Should work without this but for some reason if using graphics effects the text gets clipped 
     199#            textRect.moveTo(self.captionItem.pos()) 
     200#            return rect.united(textRect) 
     201#        else: 
     202#            return rect 
    200203 
    201204    def paint(self, painter, option, widget = None): 
     
    306309        self.setFlags(QGraphicsItem.ItemIsSelectable)# | QGraphicsItem.ItemIsMovable) 
    307310         
    308         if qVersion() >= "4.6" and self.canvasDlg.settings["enableCanvasDropShadows"]: 
    309             effect = QGraphicsDropShadowEffect() 
    310             effect.setOffset(QPointF(1.1, 3.1)) 
    311             effect.setBlurRadius(7) 
    312             self.setGraphicsEffect(effect) 
     311#        if qVersion() >= "4.6" and self.canvasDlg.settings["enableCanvasDropShadows"]: 
     312#            effect = QGraphicsDropShadowEffect() 
     313#            effect.setOffset(QPointF(1.1, 3.1)) 
     314#            effect.setBlurRadius(7) 
     315#            self.setGraphicsEffect(effect) 
     316#            self.prepareGeometryChange() 
    313317             
    314318        if scene is not None: 
     
    432436        rect = QRectF(QPointF(0, 0), self.widgetSize).adjusted(-11, -6, 11, 6)#.adjusted(-100, -100, 100, 100) #(-10-width, -4, +10+width, +25) 
    433437        rect.setTop(rect.top() - 20 - 21) ## Room for progress bar and warning, error, info icons 
    434         if _graphicsEffect(self): 
    435             textRect = self.captionItem.boundingRect() ## Should work without this but for some reason if using graphics effects the text gets clipped 
    436             textRect.moveTo(self.captionItem.pos()) 
    437             return rect.united(textRect) 
    438         else: 
    439             return rect  
     438#        if _graphicsEffect(self): 
     439#            textRect = self.captionItem.boundingRect() ## Should work without this but for some reason if using graphics effects the text gets clipped 
     440#            textRect.moveTo(self.captionItem.pos())  
     441        return rect 
    440442 
    441443    # is mouse position inside the left signal channel 
  • orange/OrangeCanvas/orngDlgs.py

    r8042 r8147  
    461461        generalBox = OWGUI.widgetBox(GeneralTab, "General Options") 
    462462        self.snapToGridCB = OWGUI.checkBox(generalBox, self.settings, "snapToGrid", "Snap widgets to grid", debuggingEnabled = 0) 
    463         self.enableCanvasDropShadowsCB = OWGUI.checkBox(generalBox, self.settings, "enableCanvasDropShadows", "Enable drop shadows in canvas", debuggingEnabled = 0) 
     463#        self.enableCanvasDropShadowsCB = OWGUI.checkBox(generalBox, self.settings, "enableCanvasDropShadows", "Enable drop shadows in canvas", debuggingEnabled = 0) 
    464464        self.writeLogFileCB  = OWGUI.checkBox(generalBox, self.settings, "writeLogFile", "Save content of the Output window to a log file", debuggingEnabled = 0) 
    465465        self.showSignalNamesCB = OWGUI.checkBox(generalBox, self.settings, "showSignalNames", "Show signal names between widgets", debuggingEnabled = 0) 
Note: See TracChangeset for help on using the changeset viewer.