[PyQt] QGraphicsView item select
apaku at gmx.de
Wed Apr 11 07:50:55 BST 2012
On 10.04.12 20:05:19, Alfredo Junior wrote:
> Thank you for your help.
> But I can't make something like that.
> In my example only tableWidget works:
> class Init(QtGui.QMainWindow):
> def __init__(self):
> super(Init, self).__init__()
> def initUI(self):
> uic.loadUi(os.path.join(os.getcwd(), "ui/window.ui"), self)
> self.scene = QtGui.QGraphicsScene()
> pixItem = QtGui.QPixmap("picture.png")
> # my problem [begin]
> # my problem [end]
> def gameSelected(self):
> print "Selection changed"
> The scene.selectionChanged doesn't work.
> Some tip?
No, since you didn't provide a minimal example that I could try out or
provide more information on what exactly "doesn't work" means (is the
slot called at all for example). Its also not advisable to use the same
slot-function for both selection-changed signals since they have
different parameters and you'll need to write different code in each to
get the selected elements.
More information about the PyQt