Hello,

I've got a small problem with an application i'm trying to port from sarge to etch. Here is the minimal application which mimics the problem. It's a simple QDialog with a QPushButton which triggers a KDirLister and print the result on stdout. It works well as long as i don't import khtml or kparts.

I'm running a clean debian etch system :
kdelibs : 4:3.5.5a.dfsg.1-8
python-kde3 : 3.15.2+20060422-3
python-qt3 : 3.16-1.2

The same code sample runs well on debian sarge but crash on debian etch and ubuntu feisty. It seems that's i'm doing something wrong here.

Thank you for your help !

Here is the code sample :

======================================================================
# -*- coding: utf-8 -*-

import sys

from qt import QDialog, QPushButton, SIGNAL
from kdecore import KCmdLineArgs, KApplication, KURL
from kio import KDirLister

# Remove one or both of the comment to crash the application
#from khtml import *
#from kparts import * #

class TestCrash(QDialog):
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        button = QPushButton("Run kdirlister", self)
        self._dirLister = KDirLister()
        self.connect(button, SIGNAL("clicked()"), self._openHome)
self.connect(self._dirLister, SIGNAL("newItems(const KFileItemList&)"),
                     self._slotNewItems)

    def _openHome(self):
       self._dirLister.openURL(KURL("/"))


    def _slotNewItems(self, items):
        print "="*50
        for item in items:
            print item.url().prettyURL()
        print "="*50


def main():
    try:
KCmdLineArgs.init(sys.argv, "crash test", "crash test","crash test")
        app = KApplication(True, True)

        widget = TestCrash()
        widget.show()
        app.setMainWidget(widget)
        res = app.exec_loop()

        print "Return value", res

    except Exception, what:
        print "Exception catched:", str(what)
        sys.exit(-1)


if __name__=="__main__":
    main()

======================================================================


_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to