good day all, I'm currently writing a Plasmoid for KDE, so I'm not 100% certain who's lap to lay this in, but I'll try here first.
I'm using a Plasma.Frame which inherits a QGraphicsWidget, in my subclass I have reimplemented the itemChange function so I can set the element prefix of the SVG used to paint the frame. when i press each item with the left mouse button, everything works as expected :) however if i right click an item, its ElementPrefix changes ok and the menu pops up, but the other item that is selected doesn't deselect. and i end up with 2 selected items until i click one again. Martin here is a snippet of the code... def itemChange(self, change, value): if change == QGraphicsItem.ItemSelectedChange: print "selection changed" if value == QVariant(True): self.border.setElementPrefix("selected") else: self.border.setElementPrefix("normal") self.update() return value def mousePressEvent(self, event): if event.button() == 1: self.setSelected(1) self.update() if event.button() == 2: self.setSelected(1) self.update() self.menu.exec_(QCursor.pos())
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt