--6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Phil Thompson wrote: > On Tuesday 25 July 2006 12:12 pm, Doug Bell wrote: > > 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. > > I've been playing with this but can't get to the root of the problem. The > crash is happening in the QApplication dtor and I'm beginning to suspect that > it is a Qt bug. > > I'd be interested in playing with your C++ version. You might try explicitly > deleting the button then the QApplication just before returning from main(). > This would more closely mimic what PyQt is doing. I changed the C++ version to delete the widget and the application before exit, but it still doesn't duplicate the crash of the PyQt version. I attached the C++ files for you to play try. Thanks, Doug. --6TrnltStXW4iwmi0 Content-Type: text/x-chdr; charset=us-ascii Content-Disposition: attachment; filename="tst.h" #include class MyWidget : public QWidget { Q_OBJECT public: MyWidget(QWidget *parent = 0); public slots: void copyClip(); void checkChange(); }; --6TrnltStXW4iwmi0 Content-Type: text/x-c++src; charset=us-ascii Content-Disposition: attachment; filename="tst.cpp" #include #include #include #include #include #include #include "tst.h" MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { QPushButton *cp = new QPushButton("Copy Text"); connect(cp, SIGNAL(clicked()), this, SLOT(copyClip())); connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(checkChange())); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(cp); setLayout(layout); } void MyWidget::copyClip() { QClipboard* clip = QApplication::clipboard(); clip->setText("Test Text"); } void MyWidget::checkChange() { QMessageBox::information(0, "Here", "Changed"); } int main(int argc, char *argv[]) { QApplication *app = new QApplication(argc, argv); MyWidget *widget = new MyWidget; widget->show(); int result = app->exec(); delete widget; delete app; return result; } --6TrnltStXW4iwmi0 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde --6TrnltStXW4iwmi0--