Re: [PyQt] dip Snapshot Support for Python v2.6 and v2.7
On Sun, 25 Jul 2010 17:30:28 -0400, Darren Dale dsdal...@gmail.com wrote: On Sat, Jul 24, 2010 at 2:26 PM, Phil Thompson p...@riverbankcomputing.com wrote: The current dip snapshots now support Python v2.6 and v2.7 as well as Python v3. The API should be identical for all versions of Python. I had some trouble enabling MQ (hg qpush -a returned no patches in series), so I installed the snapshot for py26. Make sure you use qclone rather than clone. I ran dip-builder, and when I tried to make a distutils distribution, I got the following: File /home/darren/.local/lib/python2.6/site-packages/dip/ui/toolkits/qt/qlistwidget_editor.py, line 234 rows = list({index.row() for index in indexes}) ^ SyntaxError: invalid syntax I don't think set comprehensions are available in python2. Should be fixed now. Note that dip snapshots are updated on a push rather than being done overnight. Other packages will be moved to this behaviour over time. Thanks, Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] using xembed with pyqt/pykde
i'm trying to find a working example of a pyqt/pykde application that uses xembed to embed a gtk/gnome based app. don't know if it's important but i'm embedding gvim into a pykde app. any docs or examples are appreciated. Aljosa Mohorovic ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] dip Snapshot Support for Python v2.6 and v2.7
On Mon, Jul 26, 2010 at 4:00 AM, Phil Thompson p...@riverbankcomputing.com wrote: On Sun, 25 Jul 2010 17:30:28 -0400, Darren Dale dsdal...@gmail.com wrote: On Sat, Jul 24, 2010 at 2:26 PM, Phil Thompson p...@riverbankcomputing.com wrote: The current dip snapshots now support Python v2.6 and v2.7 as well as Python v3. The API should be identical for all versions of Python. I had some trouble enabling MQ (hg qpush -a returned no patches in series), so I installed the snapshot for py26. Make sure you use qclone rather than clone. Oh, sorry. You were right, I overlooked qclone. I ran dip-builder, and when I tried to make a distutils distribution, I got the following: File /home/darren/.local/lib/python2.6/site-packages/dip/ui/toolkits/qt/qlistwidget_editor.py, line 234 rows = list({index.row() for index in indexes}) ^ SyntaxError: invalid syntax I don't think set comprehensions are available in python2. Should be fixed now. It is. Thanks. Darren ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Strange observation with latest stable releases
On Sonntag, 25. Juli 2010, Phil Thompson wrote: On Sun, 25 Jul 2010 19:11:00 +0200, Antonio Valentino antonio.valent...@tiscali.it wrote: Hi, Il giorno Sun, 25 Jul 2010 18:26:15 +0200 detlev det...@die-offenbachs.de ha scritto: Hi, in the past code like @pyqtSlot(QTreeWidgetItem, QTreeWidgetItem) def on_logTree_currentItemChanged(self, current, previous): used to work. Such a method got called, whenever the current item of the tree changed. However, with latest stable releases this is not the case anymore. If I remove the decorator line, everything is back at normal. What is going on here? Regards, Detlev Should be fixed in tonight's PyQt snapshot. I'm experimenting similar effects with @QtCore.pyqtSlot(QtCore.QModelIndex) @QtCore.pyqtSlot(QtCore.QModelIndex, int, int) @QtCore.pyqtSlot(QtGui.QListWidgetItem, QtGui.QListWidgetItem) @QtCore.pyqtSlot(QtGui.QGraphicsScene, QtCore.QPointF, QtCore.Qt.MouseButtons) I've still not investigated but by sure by sure after upgrading sip 4.10 -- 4.10.5 PyQt4 4.7 -- 4.7.4 the behavior is changed. The fix is for QListWidgetItem, QTableWidgetItem and QTreeWidgetItem. If there are still issues with other classes (eg. QModelIndex) then it's a different problem. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt The fix seems to work. Thanks Phil. Detlev -- Detlev Offenbach det...@die-offenbachs.de ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] pyqt treewidget and multiselection/drag selection event?
Hi there, first post to this mailing list :) Im having real issues with getting my treewidget to behave how i need, im hoping someone can point me in the right direction. Ok so I have a GUI that is heavily based on the QtGui.QTreeWidget. I have set this how i need with the itemClicked method. i.e I select an item, it selects all children items, changes the childrens icons, deselects the all parent items and changes the parents icons. That bit is working great. But I want to replicate the same functionality when people drag/multi select the items with one mouse press/move. I tried using the itemEntered method, but seems to be unpredictable due to the children selection changes. So is there a way to know when a drag/multi selection has occurred, im unsure of how to make a custom event todo this? If i could catch all items selected I can run my set up in a for loop quite easily. Any help would be great. Thanks Nick -- View this message in context: http://old.nabble.com/pyqt-treewidget-and-multiselection-drag-selection-event--tp29268421p29268421.html Sent from the PyQt mailing list archive at Nabble.com. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Preview of a QtGraphicsItem
Hi all, I'm developing a cad application with pyqt: PythonCad I get some truble(crash,Sometimes the line is not rendered,..) creating a preview system for rendering the QtGraphicsItem during the command execution. I follow this steps to create the preview. When the user execute a command es: Segment. I create a QtGraphicsItem, and I grap the mouse moveevent for updating the line . So when the user change the mouse position the line is updated. There is any more smart way to do such a thing, any idea,..? Regards, Matteo ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Book: Advanced Qt Programming [C++/Qt]
On Wednesday 21 July 2010 10:53:28 Mark Summerfield wrote: Hi, I am delighted to announce that a new book, Advanced Qt Programming (ISBN 0321635906), is now available in the U.S., and soon elsewhere. The book is aimed at C++/Qt programmers and covers ideas and techniques that are too advanced or specialized (but not necessarily difficult) for a first book on Qt. I believe that this book will be helpful and useful to PyQt4 programmers who have a basic familiarity with C++ since most of the Qt techniques shown apply equally to C++ and PyQt4. Just ordered it, to take its rightful place on my desk alongside your other invaluable tomes :-) Thanks Mark! John. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Trigger mouse click on arbitrary coordinate using Webkit?
Hi, I'm using Qt Webkit to load a a webpage and interact with it. Is there a way to programmatically trigger a mouse click given the X, Y coordinates of a webpage? So far, I was able to use QWebFrame.hitTestContent(QPoint) to get the QWebElement under the given QPoint. However, the element is a Flash object, and I'd like to trigger a mouse click somewhere on that Flash object. Any suggestions? Thanks, Yao ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Issue with pyqtSlot(QModelIndex, QModelIndex)
Dear list, I've just upgraded from PyQt 4.6 (PyQt-Py2.6-gpl-4.6-1.exe) to version 4.7.4 (PyQt-Py2.6-gpl-4.7.4-1.exe), and the upgrade introduced a crash in my program. I've narrowed it down to this example: from PyQt4 import QtCore, QtGui class Dialog(QtGui.QDialog): def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.resultsModel = QtGui.QStandardItemModel() self.resultsModel.appendRow(QtGui.QStandardItem('Item 1')) self.resultsModel.appendRow(QtGui.QStandardItem('Item 2')) self.resultsModel.appendRow(QtGui.QStandardItem('Item 3')) self.layout = QtGui.QVBoxLayout(self) self.resultsView = QtGui.QTreeView(self) self.resultsView.setModel(self.resultsModel) self.layout.addWidget(self.resultsView) smodel = self.resultsView.selectionModel() smodel.currentChanged.connect(self.on_change) @QtCore.pyqtSlot(QtCore.QModelIndex, QtCore.QModelIndex) def on_change(self, current, previous): print 'Changed from %s to %s' % (previous.row(), current.row()) app = QtGui.QApplication([]) win = Dialog() win.show() app.exec_() The program crashes with this error: Traceback (most recent call last): File qttest.py, line 26, in module win = Dialog() File qttest.py, line 19, in __init__ smodel.currentChanged.connect(self.on_change) TypeError: on_change() has no overload that is compatible with currentChanged(QModelIndex,QModelIndex) When I remove the @QtCore.pyqtSlot() decorator the code runs just fine. It's a workaround, but I would prefer a clearner solution, or at least an understanding as to the cause of the exception. The exception occurs when running on PyQt 4.7.4, Qt 4.6.2 and Python 2.6 on Windows XP. The same code runs without error on PyQt 4.7.3, Qt 4.6.3 and Python 2.6 on Ubuntu Linux. Regards, -- Sybren Stüvel http://stuvel.eu/ signature.asc Description: Digital signature ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Issue with pyqtSlot(QModelIndex, QModelIndex)
On Tue, Jul 27, 2010 at 12:36:02PM +0800, 机械唯物主义 : linjunhalida wrote: in my OS, works OK. pythonxy 4.6 What's pythonxy? And what is your OS? try: smodel.currentChanged[QtCore.QModelIndex, QtCore.QModelIndex].connect(self.on_change) Thanks for the suggestion. Unfortunately, it doesn't work: Running on Qt 4.6.2 Traceback (most recent call last): File qttest.py, line 28, in module win = Dialog() File qttest.py, line 19, in __init__ smodel.currentChanged[QtCore.QModelIndex, QtCore.QModelIndex].connect(self.on_change) TypeError: on_change() has no overload that is compatible with currentChanged(QModelIndex,QModelIndex) Regards, -- Sybren Stüvel http://stuvel.eu/ signature.asc Description: Digital signature ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Issue with pyqtSlot(QModelIndex, QModelIndex)
pythonxy is this: http://www.pythonxy.com/ my os is windows. I'm still using 4.6, sorry cannot help... 2010/7/27 Sybren A. Stüvel syb...@stuvel.eu On Tue, Jul 27, 2010 at 12:36:02PM +0800, 机械唯物主义 : linjunhalida wrote: in my OS, works OK. pythonxy 4.6 What's pythonxy? And what is your OS? try: smodel.currentChanged[QtCore.QModelIndex, QtCore.QModelIndex].connect(self.on_change) Thanks for the suggestion. Unfortunately, it doesn't work: Running on Qt 4.6.2 Traceback (most recent call last): File qttest.py, line 28, in module win = Dialog() File qttest.py, line 19, in __init__ smodel.currentChanged[QtCore.QModelIndex, QtCore.QModelIndex].connect(self.on_change) TypeError: on_change() has no overload that is compatible with currentChanged(QModelIndex,QModelIndex) Regards, -- Sybren Stüvel http://stuvel.eu/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFMTnI/8ZTyn8Yy+5MRAl4+AJ9XVheTtrcDPhGyRsHXyPHKdB+MMwCaA2NL CFx5zzlFhQGCqaKDElEMoJc= =b7oy -END PGP SIGNATURE- ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Issue with pyqtSlot(QModelIndex, QModelIndex)
On Tue, Jul 27, 2010 at 06:12:23AM +0200, Sybren A. Stüvel wrote: smodel = self.resultsView.selectionModel() smodel.currentChanged.connect(self.on_change) PS: This does work in concert with the @QtCore.pyqtSignal(...) decorator: QtCore.QObject.connect(smodel, QtCore.SIGNAL('currentChanged(QModelIndex,QModelIndex)'), self.on_changed) -- Sybren Stüvel http://stuvel.eu/ signature.asc Description: Digital signature ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt