#601610 When idle is launched from kde menu to run PyQt code it crashes but not when started from terminal

#601610#5
Date:
2010-10-27 19:28:26 UTC
From:
To:
To reproduce:
1. Start idle from the KDE menu or from krunner (Alt-F2)
2. Open a Python program which displays a PyQt form.
3. Run the program, and close the PyQt window
4. Repeat step 3. idle crashes

Reproducible every time.


However, starting idle from a console never crashes.
When running idle from a console, the python shell embedded in idle displays the text message "RESTART" each time the python program in the other window is executed. This message does not appear when idle is run from krunner.

Example program that causes the bug (it seems that any simple PyQt program causes this)o


mport sys

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

class Form(QDialog):
    def __init__(self,parent=None):
    super(Form,self).__init__(parent)
    grid=QGridLayout()
    #add widgets
    interestLabel = QLabel("Interest:")
    self.interestSpinBox = QDoubleSpinBox()
    self.interestSpinBox.setRange(0.0,20.0)
    self.interestSpinBox.setValue(1.0)
    self.interestSpinBox.setSingleStep(0.1)
    self.interestSpinBox.setSuffix("%")
    self.interestSpinBox.setDecimals(1)
    grid.addWidget(interestLabel,0,0)
    grid.addWidget(self.interestSpinBox,0,1)
    self.setLayout(grid)
    self.setWindowTitle("Compound Interest Calculator")




app = QApplication(sys.argv)
form = Form()
form.show()
app.exec_()

#601610#10
Date:
2010-11-05 10:55:33 UTC
From:
To:
  This bug is caused by idle being launched as idle -n
remove the  -n via the KDE menu editor, and the problem goes away.