[PyQt] Errors when quitting event loop

2012-04-12 Thread Jugdish
I'm getting some strange error messages every time I close my PyQt app, but not in consistent places. Errors such as these: *pyqtSignal must be bound to a QObject, not 'ImageLoader'* (ImageLoader is a subclass of QObject, and I make sure to call the super's constructor in the __init__) *QObject

[PyQt] drag & drop issue with ItemViews on OSX

2012-03-13 Thread Jugdish
I've run into what looks to be a bug with drag/drop and TreeViews on OSX, which appears to be specific to PyQt, as the same issue does goes away when running equivalent C++ code against the same version of Qt. When dragging from one TreeView to another, as soon as one of the QDragMoveEvents gets i

[PyQt] multiple inheritance + QtCore.pyqtSignal()

2010-07-12 Thread Jugdish
Is there any way to have a class inherit from multiple classes that emit signals? I know that PyQt4 doesn't support inheriting from one than one QObject class, so I've got one of the superclasses declared as a subclass QObject and the other as a subclass of object. However, I'm not able to define s

[PyQt] Connect a signal to a signal

2010-06-09 Thread Jugdish
Hi, what is the proper way to connect a signal to another signal using the new-style signal/slot syntax? I've been doing it like this: myObj1.mySignal.connect(lambda arg1, arg2: myObj2.mySignal.emit(arg1,arg2)) but is there a way to do it without using a lambda function? Thanks _

[PyQt] catch a Segmentation Fault from PyQt?

2010-04-22 Thread Jugdish
Is there any way to catch a segfault caused by Qt (for example, to log it to a file, etc)? I've tried installing a handler for the SIGSEGV signal, but it doesn't seem to work when a segfault occurs within PyQt. Example: # # install a signal handler import signal def handler(si

[PyQt] OSX segfault emitting signal with dict argument

2010-04-20 Thread Jugdish
I've tested the following bit of code under these 2 setups: 1. Mac OSX 10.6.2 Intel Python 2.6.5 Qt 4.6.2 PyQt 4.7.2 2. GNU/Linux x64 Fedora 8 Python 2.6.2 Qt 4.6.2 PyQt 4.7 The code runs fine on the Linux setup, but results in a segfault on OSX. Interestingly, if I declare the

[PyQt] SIP API v2: datetime not being converted to QDateTime?

2010-04-20 Thread Jugdish
I'm trying to format Python datetime objects into strings using QLocale, but it seems that under SIP API v2, the time information is lost? Are datetime objects being interpreted as QDate rather than QDateTime? Here's an example: # # API v1 # from PyQt4.QtCore import

[PyQt] QSettings boolean converted to unicode with SIP API v2

2010-04-15 Thread Jugdish
When using v2 of the API for QString and QVariant, if you write a boolean value to a QSettings file and then read the value back in from a different session, it comes back as a unicode string. Example: ## # write out the qsettings file ## import sip sip.setapi('QVar

[PyQt] QStyle.styleHint() returning negative value for rgb

2010-03-23 Thread Jugdish
I'm trying to get the color value for the table grid by making the following call: QtGui.QApplication.style().styleHint(QtGui.QStyle.SH_Table_GridLineColor, option, self) but this returns -3684409, which is not a valid qRgb (throws an error when constructing a QColor from it). Looking at the inte

Re: [PyQt] Passing python objects in QDataStream with SIP api v2

2010-03-10 Thread Jugdish
Aha! Thanks On Wed, Mar 10, 2010 at 12:52 PM, Phil Thompson wrote: > On Wed, 10 Mar 2010 11:58:48 +0000, Jugdish wrote: > > How do you pass an arbitrary python object in/out of a QDataStream when > you > > have the SIP API set to version 2 for QVariants? > > > >&g

[PyQt] Passing python objects in QDataStream with SIP api v2

2010-03-10 Thread Jugdish
How do you pass an arbitrary python object in/out of a QDataStream when you have the SIP API set to version 2 for QVariants? >>> import sip >>> sip.setapi('QVariant', 2) >>> from PyQt4 import QtCore >>> data = QtCore.QByteArray() >>> outstream = QtCore.QDataStream(data, QtCore.QIODevice.WriteOnly)

[PyQt] SIP API v2 at compile time?

2010-03-04 Thread Jugdish
Is there any way to compile SIP so that it uses v2 of its API for things like QString, QVariant, QDate, etc.? I would rather not do: import sip sip.setapi('QString', 2) at runtime because I can not always guarantee that PyQt4 hasn't been imported before I am able to make the above call. Instead,

[PyQt] How to cast QStyleOption objects in PyQt4?

2010-03-02 Thread Jugdish
How do I convert a QStyleOptionViewItem into a QStyleOptionViewItemV4? Qt has the qstyleoption_cast() method, but no such method exists in PyQt4. I have my own subclass of QStyledItemDelegate and have overridden the initStyleOption() method so that I can provide my own foreground/background colors

Re: [PyQt] Multiple inheritance with item views

2010-02-22 Thread Jugdish
rk if BaseView had no base class. Any ideas of a better way to achieve this without duplicating code between the 2 views? Thanks On Mon, Feb 22, 2010 at 8:45 PM, Andreas Pakulat wrote: > On 22.02.10 19:45:31, Jugdish wrote: > > I have my own subclasses of QTreeView and QTableView, called MyT

[PyQt] Multiple inheritance with item views

2010-02-22 Thread Jugdish
I have my own subclasses of QTreeView and QTableView, called MyTableView and MyTreeView. There is a lot of code that is common between my 2 classes, so to avoid having tons of duplicate code, I was thinking of having a base class derived from QAbstractItemView that they both derive from. This resul

[PyQt] QLabel word wrap causes incorrect sizeHint

2010-01-18 Thread Jugdish
If you run this, you see that the label with wordWrap enabled has a larger top and bottom margin, and the sizeHint returned is 112x33 whereas the one without wordWrap has a sizeHint of 169x18. Any ideas why this is and how to avoid it? Thanks, -Jugdish __

Re: [PyQt] setting Popup windowFlag causes system to become unresponsive

2009-11-30 Thread Jugdish
Bug report filed here: http://bugreports.qt.nokia.com/browse/QTBUG-6355 On Fri, Nov 27, 2009 at 8:50 PM, Hans-Peter Jansen wrote: > On Friday 27 November 2009, 19:34:31 Jugdish wrote: > > For some reason if I set the windowFlag "Popup" on a QListWidget, the > > widget

[PyQt] setting Popup windowFlag causes system to become unresponsive

2009-11-27 Thread Jugdish
For some reason if I set the windowFlag "Popup" on a QListWidget, the widget takes modal focus and it is impossible to give focus back to any widget. In fact, my entire system becomes unresponsive. Only the QListWidget responds to input, and I have no way of killing the process. Here is a very stri

[PyQt] Re-implemented function doesn't get called from internal Qt methods

2009-11-25 Thread Jugdish
t() method, so I should be seeing my print statement on every paint event. Any idea what I'm doing wrong? Thanks, -Jugdish ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Semi-transparent QDrag pixmap

2009-09-30 Thread Jugdish
Is there any way to make the pixmap on a QDrag object be semi-transparent? Here is the code I've got right now: def startDrag(self, supportedActions): drag = QDrag(self) pixmap = QPixmap("/path/to/my/image.png") alphaChannel = QPixmap

[PyQt] Why is QStackedLayout so tall?

2009-09-09 Thread Jugdish
I'd like to use QStackedLayout to put some QLineEdit widgets in, with only one visible at a time. For some reason, whenever I put a widget inside a QStackedLayout, it displays much taller than it normally would. Below is a small example to demonstrate this -- compare the height of the QLineEdit out