qt:pyqt_ide_autocompletion_testing
Table of Contents
Autocompletion and calltip tests for PyQt4 on various IDEs
Tempalate
- main.py
if __name__ == '__main__': # create application app = QApplication(sys.argv) app.setApplicationName('My PyQt4 QtGui Project') # create widget w = MainWindow() w.setWindowTitle('My PyQt4 QtGui Project') w.show() # connection QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()')) # execute application sys.exit(app.exec_()) ############################ open()
This is from my EvalPyQt example project (except for the last line). All IDEs were set up with this project. Then everything after
if __name__ == '__main__':
in main.py
was removed and the document saved. Then the code was retyped.
Eclipse + PyDev
if __name__ == '__main__': # create application app = QApplication(sys.argv) # good app.setApplicationName('My PyQt4 QtGui Project') # requesting completion removed calltip # create widget w = MainWindow() # good w.setWindowTitle('My PyQt4 QtGui Project') # w's setWindowTitle not detected, no calltip w.show() # w's show not detected # connection QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()')) # completion inserted useful placeholders :-))) # execute application sys.exit(app.exec_()) # good ############################ open() # good, placeholder inserted
⇒ Major disadvantage over Spyder: calltips disappear the instant you hit a completing ')' – even when auto-close brackets is enabled. Disabling autoclose ')' also disables autoclose of ']', and '}' Syntax error markers can be slow and obtrusive.
Editra
if __name__ == '__main__': # create application app = QApplication(sys.argv) # good app.setApplicationName('My PyQt4 QtGui Project') # good # create widget w = MainWindow() # didn't find MainWindow w.setWindowTitle('My PyQt4 QtGui Project') # didn't find setWindowTitle w.show() # didn't find show # connection QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()')) # good # execute application sys.exit(app.exec_()) #good ############################ open() # calltip very helpful
Calltips remain onscreen throughout typing.
Eric (Assistant handles both)
if __name__ == '__main__': # create application app = QApplication(sys.argv) # didn't detect sys.argv app.setApplicationName('My PyQt4 QtGui Project') # slow to find stuff # create widget w = MainWindow() # good w.setWindowTitle('My PyQt4 QtGui Project') # suggested all sorts of irrelevant stuff w.show() # suggested all sorts of irrelevant stuff # connection QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()')) # suggested all sorts of irrelevant stuff, calltip useful # found and suggested SIGNAL and SLOT! # execute application sys.exit(app.exec_()) # found app.exec_ but also suggested all sorts of irrelevant stuff ############################ open() # didn't find built-in open but suggested many others
Calltips remain onscreen throughout typing.
Eric (Rope for autocomplete, Assistant for calltips)
if __name__ == '__main__': # create application app = QApplication(sys.argv) # good app.setApplicationName('My PyQt4 QtGui Project') # good # create widget w = MainWindow() # good w.setWindowTitle('My PyQt4 QtGui Project') # ac, didn't find setWindowTitle method; calltip suggested useful stuff w.show() # ac, didn't find show method; calltip suggested useful stuff # connection QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()')) # good; didn't find SIGNAL ac but found calltip # execute application sys.exit(app.exec_()) # app.exec_ calling was irrelevant ############################ open() # didn't find built-in open but suggested many others
Calltips remain onscreen throughout typing.
Spyder
if __name__ == '__main__': # create application app = QApplication(sys.argv) # worked, but calltip/doc not that helpful app.setApplicationName('My PyQt4 QtGui Project') # good # create widget w = MainWindow() # good w.setWindowTitle('My PyQt4 QtGui Project') # w's setWindowTitle not detected, no calltip w.show() # w's show not detected # connection QObject.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()')) # good, calltip/doc not that helpful # no help at all in suggesting signals and slots # execute application sys.exit(app.exec_()) # no ac until 'sys.e', calltip not helpful; ac at 'app.e', calltip helpful! ############################ open() # completion at 'o', calltip/doc is helpful
A huge win for Spyder is that the docs remain onscreen after the calltips have disappeared. Syntax error markers can be very slow.
qt/pyqt_ide_autocompletion_testing.txt · Last modified: 2011/04/17 11:22 by mithat