SHARE
TWEET

Untitled

a guest Feb 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PixmapItemDelegate(QtGui.QStyledItemDelegate):    
  2.     def paint(self, painter, option, index):        
  3.         painter.save()
  4.  
  5.         if (option.state & QtGui.QStyle.State_MouseOver):            
  6.             pen = QtGui.QPen(QtCore.Qt.yellow)            
  7.         else:
  8.             pen = QtGui.QPen(QtCore.Qt.transparent)
  9.         pen.setWidth(2)
  10.         painter.setPen(pen)
  11.         painter.setBrush(QtGui.QBrush(QtCore.Qt.transparent))
  12.         painter.drawRect(option.rect)
  13.  
  14.         painter.restore()
  15.  
  16.         super(PixmapItemDelegate, self).paint(painter, option, index)
  17.    
  18. if ( option.state & QtGui.QStyle.State_MouseOver and
  19.     not option.state & QtGui.QStyle.State_Selected ):
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top