[PyQt] linking listwidget with Qgraphicsview
Matt Smith
melkor at orangepalantir.org
Wed Mar 11 19:07:56 GMT 2009
Okay I wrote a short script, the code you sent is missing the
connection, plus I don't know what "addPixmap" is, so here is a small
version of what I think you are trying to do.
If you aren't sublcassing the QGraphicsView, you can do the same thing I
am doing via the .scene() to get the QGraphicsScene
mbs
>Thanks for the hint
>
>but i have QGraphicsview widget not graphicscene, how can i implement
>QgraphicsPixmapItem?
>
>so far i came with this, is it correct?
>files = QFileDialog.getOpenFileNames(self, self.trUtf8("Add
>documentation"),
> QString("/home"), self.trUtf8("Images (*.png *.tiff *.jpg)"))
> for file_ in files:
> data = ""
> f = open(file_)
> #data = file.read()
> self.listWidget.addItem(file_)
> self.listWidget.setItemSelected(file_)
> self.my_list_item.text(file_)
> self.photosdisplay.addPixmap(file_)
>but nothing happened when i clicked?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lv_example.py
Type: text/x-python
Size: 1820 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090311/71ade76a/lv_example.py
More information about the PyQt
mailing list