2013-08-24 16 views
6

ich mit PyQt4 bin ab und bin ein coredump zugewandt ist, wenn in der einfachsten der Beispiele QGraphicsScene/betrachten:Core-Dump mit PyQt4

#!/usr/bin/python 

import sys 
from PyQt4.QtCore import * 
from PyQt4.QtGui import * 

app = QApplication(sys.argv) 

grview = QGraphicsView() 
scene = QGraphicsScene() 
grview.setScene(scene) 

grview.show() 

sys.exit(app.exec_()) 

Das Programm läuft, aber wenn es zu schließen gibt es Tonnen von GTK Fehler (mit Ubuntu) und schließlich dem Core-Dump (Segmentierungsfehler):

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_container_add: assertion `GTK_IS_CONTAINER (container)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 

(python:2732): Gtk-CRITICAL **: IA__gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed 
Violación de segmento (`core' generado) 

ich nehme an, das etwas mit meinem linux-Setup zu tun hat. Wer hat das schon einmal erlebt?

Danke!

Antwort

9

Die GTK-Fehler haben wahrscheinlich nichts mit dem segfault zu tun. Ich verwende KDE (und daher nicht das GTK-Thema), daher sehe ich keine GTK-Fehler, aber ich bekomme einen segfault.

Die segfault geschieht im Destruktor des QGraphicsScene:

#0 0x00007ffff6f09037 in raise() from /lib/x86_64-linux-gnu/libc.so.6 
#1 0x00007ffff6f0c698 in abort() from /lib/x86_64-linux-gnu/libc.so.6 
#2 0x00007ffff5b465c2 in qt_message_output(QtMsgType, char const*)() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 
#3 0x00007ffff5b46938 in ??() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 
#4 0x00007ffff5b46ac4 in qFatal(char const*, ...)() from /usr/lib/x86_64-linux-gnu/libQtCore.so.4 
#5 0x00007ffff389231e in ??() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 
#6 0x00007ffff3893401 in QPixmap::QPixmap()() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 
#7 0x00007fffea0a8c86 in Oxygen::Helper::Helper(QByteArray const&)() from /usr/lib/liboxygenstyle.so.4 
#8 0x00007fffea3450e0 in ??() from /usr/lib/kde4/plugins/styles/oxygen.so 
#9 0x00007fffea32f757 in ??() from /usr/lib/kde4/plugins/styles/oxygen.so 
#10 0x00007fffea33c7bc in ??() from /usr/lib/kde4/plugins/styles/oxygen.so 
#11 0x00007ffff3ab64e6 in QStyleFactory::create(QString const&)() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 
#12 0x00007ffff37c74cf in QApplication::style()() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 
#13 0x00007ffff37fe488 in QWidget::isActiveWindow() const() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 
#14 0x00007ffff3dd5ccc in QGraphicsView::setScene(QGraphicsScene*)() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 
#15 0x00007ffff3da47d1 in QGraphicsScene::~QGraphicsScene()() from /usr/lib/x86_64-linux-gnu/libQtGui.so.4 
#16 0x00007ffff46b6bb9 in ??() from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so 
#17 0x00007ffff46b4ad6 in ??() from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so 
#18 0x00007ffff4c6115e in ??() from /usr/lib/python2.7/dist-packages/sip.so 
#19 0x00007ffff4c62aa9 in ??() from /usr/lib/python2.7/dist-packages/sip.so 
#20 0x00000000004af4f0 in ??() 
#21 0x00000000004dbbc7 in ??() 
#22 0x00007ffff4c6058b in ??() from /usr/lib/python2.7/dist-packages/sip.so 
#23 0x00007ffff4c62a22 in ??() from /usr/lib/python2.7/dist-packages/sip.so 
#24 0x00007ffff4c62ab1 in ??() from /usr/lib/python2.7/dist-packages/sip.so 
#25 0x00000000004af4f0 in ??() 
#26 0x00000000004b8bca in ??() 
#27 0x00000000004a4460 in PyDict_SetItem() 
#28 0x00000000004a46d7 in _PyModule_Clear() 
#29 0x0000000000509514 in PyImport_Cleanup() 
#30 0x0000000000423bca in Py_Finalize() 
#31 0x0000000000424470 in Py_Exit() 
#32 0x00000000004245ac in ??() 
#33 0x000000000042254e in PyErr_PrintEx() 
#34 0x0000000000465e0d in PyRun_SimpleFileExFlags() 
#35 0x0000000000466b78 in Py_Main() 
#36 0x00007ffff6ef3ea5 in __libc_start_main() from /lib/x86_64-linux-gnu/libc.so.6 
#37 0x00000000004e0d95 in _start() 

machen grview die Eltern von scene sollte dieses Problem beheben:

#!/usr/bin/python 

import sys 
from PyQt4.QtCore import * 
from PyQt4.QtGui import * 

app = QApplication(sys.argv) 

grview = QGraphicsView() 
scene = QGraphicsScene(grview) 

grview.setScene(scene) 

grview.show() 

sys.exit(app.exec_()) 

QObject s ohne Eltern aufgebaut sind owned by PyQt and not by Qt, dieser Fehler ist wahrscheinlich ein Ergebnis, wenn der Destruktor beim Beenden zweimal aufgerufen wird.

+0

Es hat funktioniert. Aber ich verstehe nicht, warum es scheiterte. Warum ist der Aufruf von setScene nicht ausreichend? Wie auch immer, gute Antwort. Ich akzeptiere es und schließe die Frage. Vielen Dank! – victor

+1

Ich kann nur spekulieren, dass der Destruktor auf der Qt-Seite aufgerufen wird, wenn die QGraphicsView zerstört ist, und dass er auch von PyQt aufgerufen wird, wenn "Szene" [Müll gesammelt] ist (http://pyqt.sourceforge.net/Docs/ PyQt4/gotchas.html # marble-collection) - aber ich kann nicht wirklich sagen, was zuerst passiert. – mata

+1

Der letzte Satz sollte wahrscheinlich lauten: "QObject constructed _with_ parent gehört Qt anstelle von PyQt", da die [doc] (http://pyqt.sourceforge.net/Docs/PyQt4/qobject.html#QObject) "The Übergeordnetes Argument, wenn "_not_ None" bewirkt, dass self Qt anstelle von PyQt gehört "? – ederag