Hello.

I'm getting the same backtrace as mentioned in [1]. Please find attached
a minimal C++ example application that successfully saves its state, and
a Python equivalent that crashes when logging out of KDE.

Note that the crash is not related to using config, just providing an
empty saveProperties() crahses as well.

  [1] http://www.riverbankcomputing.com/pipermail/pyqt/2007-February/015426.html

Cheers,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
We may not return the affection of those who like us, but we always
respect their good judgement.
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kmainwindow.h>
#include <kconfig.h>

class MainWindow : public KMainWindow
{
    Q_OBJECT;

    public:
      MainWindow() {}
      ~MainWindow() {}

      void saveProperties(KConfig *);
};

void MainWindow::saveProperties(KConfig *config)
{
    config->writeEntry("foo", "bar");
}

int
main (int argc, char **argv)
{
    KCmdLineArgs::init(argc, argv, "test", "test", "test", "1.0");
    KApplication app;
    MainWindow *window = new MainWindow;

    app.setTopWidget(window);
    window->show();
    return app.exec();
}

#include "session_moc.cc"
#! /usr/bin/env python

import sys

import kdeui
import kdecore

def main():
    kdecore.KCmdLineArgs.init(sys.argv, 'test', 'test', 'test', '1.0')
    application = kdecore.KApplication()
    main_window = MainWindow()
    main_window.show()
    application.exec_loop()

class MainWindow(kdeui.KMainWindow):
    def saveProperties(self, config):
        config.writeEntry('foo.py', 'bar.py')

if __name__ == '__main__':
    main()
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to