Re: [PyQt] saving/restoring geometry
On Mon, 2008-03-10 at 16:03 -0500, Darren Dale wrote: Could anyone suggest how to save and restore the size and position of a dock widget and an mdi subwindow? There's QMainWindow.saveState() / restoreState(), if it's not too much. -- Giovanni Bajo ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] QSqlTableModel: how to check the UPDATE statement inside the model?
Hello, somewhere in the QSqlTableModel code there must be SQL statements for UPDATE, INSERT and DELETE, to make the model editable. Right? I can't find methods to view these statements - is it necessary to dig into the C++ code to find them? Background: I'm still trying to edit data in a view (SQL view, not Qt view) joining two tables. I wrote a trigger to make this possible at all, and in the command line client the update statements I construct myself are executed correctly. Same thing in PyQt, if I use QSqlQuery instances directly. The database is Firebird 2.0.3, Qt version 4.3.4, PyQt 4.3.3, Python 2.5.1, OS Gentoo Linux. If I use a QSqlTableModel, things get complicated: with the view in the Employee example database (phone_list) all is still well, the database tables are updated using the view. With my own database I don't get any error messages, but no updates either. INSERT works as expected. If I could execute the UPDATE statement used by the model in the command line client, I might find out what happens - a bug in my trigger is quite probable. But for this I have to know this statement. Can anybody help me? Thank you, Sibylle -- Dr. Sibylle Koczian ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] The pyQT book
Hi all, sorry for posting an off-topic message, but since I accidentally bought two copies of Rapid GUI Programming with Python and Qt I would be happy if I could sell one of them. Is anyone interested in the deal? thanks guys, Alex. - Inviato da Yahoo! Mail. La web mail più usata al mondo.___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] QMutex::lock: Deadlock detected in thread -1210615616
Hi everyone, I'm new to pyqt, and i'm developing a small application. when i run it using root (i need to do it) it delivers this error message: QMutex::lock: Deadlock detected in thread -1210615616 and the program hangs. Any thoughts on what can be causing this? thank you! PS: using ubuntu 7.10 (gnome) ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] saving/restoring geometry
On Monday 10 March 2008 05:03:59 pm Darren Dale wrote: Could anyone suggest how to save and restore the size and position of a dock widget and an mdi subwindow? I found the answer to my dock question by looking through the eric4 source code: use QSettings and QMainWindow.saveState(). ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] PyKDE4-4.0.2 release
PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Jim ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] QPainter with with statement
Hi list, I was just wondering if it wasn't a good idea to add the with-statement functionality to the QPainter class. If your program happens to raise an exception while QPainter is active, QPainter.end() might never be called and that leads to a lot of annoying error messages. I just propose to add to methods to QPainter, like that: def __enter__(self): return self def __exit__(self, info): self.end() return False Then you can write code like this: with QPainter(image) as p: p.drawWhatever() and you never have the problem with a dangling QPainter. I guess someone will start yelling but that's Python 2.5. Indeed, it is. But well, the changes I propose are perfectly backwards-compatible, as it only means to add to methods to a class. Any other thoughts / ideas? Cheers, Martin ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On Dienstag, 11. März 2008, Jim Bublitz wrote: PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Hi, I have a dual installation of KDE. KDE4 is installed alongside KDE3, which is my main desktop. The environment variable KDEDIR is set to /opt/kde3 (openSUSE 10.3). This makes configure.py to pick up KDE3 instead of KDE4. Here is an excerpt of the output. PyKDE version 4.0.2 --- Python include directory is /usr/include/python2.5 Python version is 2.5.1 sip version is 4.7.5-snapshot-20080229 (4.7.5) Qt directory is /usr Qt version is 4.3.4 PyQt directory is /usr/share/sip/PyQt4 PyQt version is 4.3.4-snapshot-20080307 (4.3.4) gcc version 4.2.1 no concatenation KDE base directory is /opt/kde3 KDE include directory is /opt/kde3/include KDE lib directory is /opt/kde3/lib64 lib directory is lib KDE version is 3.5.9 (0x30509) PyKDE modules will be installed in /usr/lib64/python2.5/site-packages/PyKDE4 PyKDE .sip files will be installed in /usr/share/sip/PyKDE4 PyKDE modules to be built: kdecore solid kdeui kio kutils kparts khtml Generating the C++ source for the kdecore module... Error: Unable to create the C++ code. - I would expect configure.py to check, if the KDE version found is really a KDE4. If not, it should try the other alternatives (i.e. the default paths). Regards, Detlev -- Detlev Offenbach [EMAIL PROTECTED] ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On Dienstag, 11. März 2008, Jim Bublitz wrote: PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Hi, I have another problem compiling latest release with KDE 4.0.2 (s. below). --- g++ -c -Wno-deprecated-declarations -pipe -fPIC -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -I../extra/kde402 -I/usr/include -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtSvg -I/usr/include/solid -I/usr/include/kio -I/usr/include/kfile -I/usr/include/kssl -I/usr/include/python2.5 -I/usr/share/qt4/mkspecs/default -I/usr/X11R6/include -o sipkioKIOMetaData.o sipkioKIOMetaData.cpp sip/kio/global.sip: In function ‘int convertTo_KIO_MetaData(PyObject*, void**, int*, PyObject*)’: sip/kio/global.sip:242: error: cannot convert ‘int*’ to ‘Py_ssize_t*’ for argument ‘2’ to ‘int PyDict_Next(PyObject*, Py_ssize_t*, PyObject**, PyObject**)’ Regards, Detlev -- Detlev Offenbach [EMAIL PROTECTED] ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Qt 4.4
On Tuesday 11 March 2008, Giovanni Bajo wrote: On 10/18/2007 10:45 AM, Phil Thompson wrote: What I actually do is to start with the first release candidate. I just realised I missed a word out here - What I *might* actually do. If I might, I'd rather have an intermediate release (or even snapshot) containing support for the same modules that already existed in Qt 3.3, than having to wait weeks because of WebKit, Phonon or other new large modules. I guess that already follows the way you would work on it anyway. Yes. Existing classes, then new classes in existing modules, then new modules. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] QMutex::lock: Deadlock detected in thread -1210615616
On Tuesday 11 March 2008, Sergio Campos wrote: Hi everyone, I'm new to pyqt, and i'm developing a small application. when i run it using root (i need to do it) it delivers this error message: QMutex::lock: Deadlock detected in thread -1210615616 and the program hangs. Any thoughts on what can be causing this? thank you! PS: using ubuntu 7.10 (gnome) Nobody can help you with this information. Which version of PyQt? Which version of SIP? A small, but complete example that demonstrates the problem? Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On Tuesday 11 March 2008 10:48, Detlev Offenbach wrote: I have a dual installation of KDE. KDE4 is installed alongside KDE3, which is my main desktop. The environment variable KDEDIR is set to /opt/kde3 (openSUSE 10.3). This makes configure.py to pick up KDE3 instead of KDE4. Here is an excerpt of the output. Thanks for the report - I don't have $KDEDIR set on any systems so didn't catch this problem (I think KDE discontinued it a while ago, although PyKDE3 continued to check for it). The workaround is already in place - use the -k switch on the configure.py command line to specify the correct KDE4 base directory (which I believe is now /usr for all distributions - even SuSE finally switched). Or set $KDEDIR to nothing temporarily. Outside of this problem, there should be no difficulty is running PyKDE3 and PyKDE4 simultaneously, or running PyKDE4 under KDE3 as the desktop (assuming KDE4 is installed). Any problems should be considered bugs. The fix will be in the next release - I've removed $KDEDIR from configure.py and added a check for KDE_VERSION_MAJOR == 4. Jim ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On Dienstag, 11. März 2008, Detlev Offenbach wrote: On Dienstag, 11. März 2008, Jim Bublitz wrote: PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Hi, I have another problem compiling latest release with KDE 4.0.2 (s. below). --- g++ -c -Wno-deprecated-declarations -pipe -fPIC -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -I../extra/kde402 -I/usr/include -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtSvg -I/usr/include/solid -I/usr/include/kio -I/usr/include/kfile -I/usr/include/kssl -I/usr/include/python2.5 -I/usr/share/qt4/mkspecs/default -I/usr/X11R6/include -o sipkioKIOMetaData.o sipkioKIOMetaData.cpp sip/kio/global.sip: In function ‘int convertTo_KIO_MetaData(PyObject*, void**, int*, PyObject*)’: sip/kio/global.sip:242: error: cannot convert ‘int*’ to ‘Py_ssize_t*’ for argument ‘2’ to ‘int PyDict_Next(PyObject*, Py_ssize_t*, PyObject**, PyObject**)’ And here is the fix. Line 242 of sip/kio/global.sip should read. #if PY_VERSION_HEX = 0x0205 Py_ssize_t pos = 0; #else int pos = 0; #endif With that change, PyKDE4 compiles fine. Regards, Detlev -- Detlev Offenbach [EMAIL PROTECTED] ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On Dienstag, 11. März 2008, Jim Bublitz wrote: PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Jim ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt Hi, I have yet another question. Why is pykdeuic4 not installed? Regards, Detlev -- Detlev Offenbach [EMAIL PROTECTED] ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On Dienstag, 11. März 2008, Jim Bublitz wrote: PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Jim ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt Hi again, sorry for posting that much today but I have another question. Would it be possible to generate a (or multiple) API file(s) and install it to the API directory like it is done for PyQt4? Please don't take all these emails as criticism, I just would like PyKDE4 to be a bit better than it already is. Great job, Jim. Regards, Detlev -- Detlev Offenbach [EMAIL PROTECTED] ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On 11.03.08 18:48:21, Detlev Offenbach wrote: On Dienstag, 11. März 2008, Jim Bublitz wrote: PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Hi, I have a dual installation of KDE. KDE4 is installed alongside KDE3, which is my main desktop. The environment variable KDEDIR is set to /opt/kde3 You should set KDEDIRS, KDEDIR is deprecated since KDE 3.x (x = 2 IIRC). Andreas -- You had some happiness once, but your parents moved away, and you had to leave it behind. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] PyKDE4 -4.0.2-1 release coming
The release today has a few bugs which need fixing. The fixes are already done, but I need to test compile before uploading a new release, and that takes awhile - I have PyKDE4 on a slow machine. I also have a couple more potential bugs to check out. Although compiling on that machine doesn't catch these particular bugs anyway, but at least it'll indicate I didn't break more stuff doing the fixes. The new tarball should be up in a day or two. Workarounds are on the mailing list. Jim ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On Tuesday 11 March 2008 11:39, Detlev Offenbach wrote: On Dienstag, 11. März 2008, Detlev Offenbach wrote: On Dienstag, 11. März 2008, Jim Bublitz wrote: PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Hi, I have another problem compiling latest release with KDE 4.0.2 (s. below). --- g++ -c -Wno-deprecated-declarations -pipe -fPIC -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -I../extra/kde402 -I/usr/include -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtSvg -I/usr/include/solid -I/usr/include/kio -I/usr/include/kfile -I/usr/include/kssl -I/usr/include/python2.5 -I/usr/share/qt4/mkspecs/default -I/usr/X11R6/include -o sipkioKIOMetaData.o sipkioKIOMetaData.cpp sip/kio/global.sip: In function ‘int convertTo_KIO_MetaData(PyObject*, void**, int*, PyObject*)’: sip/kio/global.sip:242: error: cannot convert ‘int*’ to ‘Py_ssize_t*’ for argument ‘2’ to ‘int PyDict_Next(PyObject*, Py_ssize_t*, PyObject**, PyObject**)’ And here is the fix. Line 242 of sip/kio/global.sip should read. #if PY_VERSION_HEX = 0x0205 Py_ssize_t pos = 0; #else int pos = 0; #endif With that change, PyKDE4 compiles fine. Correct - SIP_SSIZE_T is a macro that does the same thing. Jim ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PyKDE4-4.0.2 release
On Tuesday 11 March 2008 11:16, Detlev Offenbach wrote: On Dienstag, 11. März 2008, Jim Bublitz wrote: PyKDE4-4.0.2 is now available at riverbankcomputing.com. It includes some minor fixes to problems that were preventing PyKDE4 from building against KDE 4.0.2, the addition to kdecore of some global functions for retrieving version info about KDE and PyKDE4 (see Using PyKDE4 in the documentation), and some additional changes to the docs. This release should build against any KDE4 version currently in release. Hi, I have another problem compiling latest release with KDE 4.0.2 (s. below). --- g++ -c -Wno-deprecated-declarations -pipe -fPIC -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -I. -I../extra/kde402 -I/usr/include -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtSvg -I/usr/include/solid -I/usr/include/kio -I/usr/include/kfile -I/usr/include/kssl -I/usr/include/python2.5 -I/usr/share/qt4/mkspecs/default -I/usr/X11R6/include -o sipkioKIOMetaData.o sipkioKIOMetaData.cpp sip/kio/global.sip: In function ‘int convertTo_KIO_MetaData(PyObject*, void**, int*, PyObject*)’: sip/kio/global.sip:242: error: cannot convert ‘int*’ to ‘Py_ssize_t*’ for argument ‘2’ to ‘int PyDict_Next(PyObject*, Py_ssize_t*, PyObject**, PyObject**)’ Around line 238 in sip//kio/global.sip change int pos = 0; to SIP_SSIZE_T pos = 0; It's a change in type from Python 2.4 to 2.5 - this seems to be the final instance, although I can't tell because I seem to get the correct type conversion when I compile and don't catch the error. SIP_SSIZE_T will work correctly for either Python version. Jim ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] The pyQT book
Date: Tue, 11 Mar 2008 14:01:36 +0100 (CET) From: Alexandre Radicchi [EMAIL PROTECTED] Subject: [PyQt] The pyQT book To: pyqt@riverbankcomputing.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 Hi all, sorry for posting an off-topic message, but since I accidentally bought two copies of Rapid GUI Programming with Python and Qt I would be happy if I could sell one of them. Is anyone interested in the deal? thanks guys, Alex. Hi Alex, pity it comes too late for me - I got it early in January. It is not just a good book - it is excellent. Very useful, concise introduction to basic Python. I thought I knew Python, before I read the first few chapters and learned a host of things that I had heard about, but had not really mastered. Highly recommended to anyone interested in Python! Disclaimer: I have no fiscal or other interest in the book, other than as a reader. I am a retired uni. NSW prof. and author in my own area (Civil Eng.). OldAl. -- Algis Kabaila (Dr) http://akabaila.pcug.org.au/StructuralAnalysis/ ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] QSqlTableModel: how to check the UPDATE statement inside the model?
Am Dienstag, 11. März 2008 schrieb Sibylle Koczian: Hello, somewhere in the QSqlTableModel code there must be SQL statements for UPDATE, INSERT and DELETE, to make the model editable. Right? I can't find methods to view these statements - is it necessary to dig into the C++ code to find them? Background: I'm still trying to edit data in a view (SQL view, not Qt view) joining two tables. I wrote a trigger to make this possible at all, and in the command line client the update statements I construct myself are executed correctly. Same thing in PyQt, if I use QSqlQuery instances directly. The database is Firebird 2.0.3, Qt version 4.3.4, PyQt 4.3.3, Python 2.5.1, OS Gentoo Linux. If I use a QSqlTableModel, things get complicated: with the view in the Employee example database (phone_list) all is still well, the database tables are updated using the view. With my own database I don't get any error messages, but no updates either. INSERT works as expected. If I could execute the UPDATE statement used by the model in the command line client, I might find out what happens - a bug in my trigger is quite probable. But for this I have to know this statement. Can anybody help me? Well, QSqlQuery/QSqlResult of Qt3 fame had a method lastQuery(). Otherwise, if you won't look into Qt itself (which was very enlightening, each time I did that), you're always open to redirect the db communication over the network, and trace that. tcpdump and wireshark are nice tools in this respect. Good luck, Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] PyQt4 'apparently' interfering with ctypes.cdll.LoadLibrary()
Context: Windows XP PyQt version from: PyQt-Py2.5-gpl-4.3.3-2.exe Python from: python-2.5.1.msi Fluid Synthesisor dll from: http://download.savannah.gnu.org/releases/fluid/fluidsynth-1.0.3-win32.zip I seem to be getting an interaction / coexistence problem with the following: ctypes.cdll.LoadLibrary() PyQt4 The dll cited above. This works fine: import ctypes ctypes.cdll.LoadLibrary('libfluidsynth-1.dll') (the dll is in the same folder as the python script) This doesn't import PyQt4.QtCore import ctypes ctypes.cdll.LoadLibrary('libfluidsynth-1.dll') ... producing: Traceback (most recent call last): File C:\pch\swdev\PetesPiano\SVN-project\src\sandpit\CtypesPyQt4Problem.py, line 3, in module ctypes.cdll.LoadLibrary('libfluidsynth-1.dll') File C:\Python25\Lib\ctypes\__init__.py, line 423, in LoadLibrary return self._dlltype(name) File C:\Python25\Lib\ctypes\__init__.py, line 340, in __init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 998] Invalid access to memory location If you try a well known and 'respectable' dll instead like 'msvcrt' it works ok. Any ideas? Thanks in anticipation. Pete ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt