[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] QClipboard Problem
From:       Doug Bell <dougb () bellz ! org>
Date:       2006-07-25 11:12:53
Message-ID: 20060725111253.GA27994 () bellz ! org
[Download RAW message or body]

Hi -

I'm having problems with QClipboard's dataChanged() signal in PyQt4 on
Windows.  It works fine during program execution, but the program
crashes at exit if the contents of the clipboard had been changed with
the signal connected.

I'm not sure whether this is a bug in PyQt or Qt, but, since I couldn't
find anything about it in the Qt mailing list, I'm trying here.  Also,
this bug does not occur in Linux.

A short example that produces the problem is attached.  If the button is
pressed during the run, the program crashes at exit.

I'm using the latest binary builds for Windows - Python 2.4.3, Qt 4.1.4
and PyQt 4.0.1.

Thanks,
Doug.

["tst.py" (text/x-python)]

#!/usr/bin/env python

import sys
from PyQt4 import QtGui, QtCore


class Button(QtGui.QPushButton):
    def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, 'Copy Text', parent)
        self.connect(self, QtCore.SIGNAL('clicked()'), self.copy)
        self.connect(QtGui.QApplication.clipboard(),
                     QtCore.SIGNAL('dataChanged()'), self.checkChange)

    def copy(self):
        clip = QtGui.QApplication.clipboard()
        clip.setText('Test Text')

    def checkChange(self):
        print QtGui.QApplication.clipboard().text()


if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    win = Button()
    win.show()
    app.exec_()



_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic