User Tools

Site Tools


qt:pyqt_ide_options

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
qt:pyqt_ide_options [2011/04/17 11:06] – [Project support] mithatqt:pyqt_ide_options [2011/04/20 20:44] (current) mithat
Line 22: Line 22:
  
 In almost all cases, getting good autocompletion/calltips requires adding api files, references to libs, or possibly both. In almost all cases, getting good autocompletion/calltips requires adding api files, references to libs, or possibly both.
 +
 +===== PyQt specific stuff =====
 +The following are needed specifically for easy PyQt4 development:
 +  * A wizard for starting a project that creates a default form and gives stuff the names that you want
 +  * A wizard that creates new forms, including the ''<formname>.ui'' file as well as a ''<formname>.py'' file that defines a ''<FormName>'' class.
 +  * A wizard for creating and an interface for managing ''*.qrc'' Qt resource files
  
 ===== The candidates ===== ===== The candidates =====
Line 55: Line 61:
  
 ===== The results ===== ===== The results =====
-means good,+:-) means good,
 ~ means eh, ~ means eh,
 -- means available but sucks, -- means available but sucks,
Line 61: Line 67:
 ext means handled externally automatically or by specifying a user command ext means handled externally automatically or by specifying a user command
  
-==== Project support ==== +==== Yes/No/Maybe? ==== 
-^ IDE           ^ Y/N? ^ UI  ^ survival  ^ IDE proj ^ PyQt proj ^ PyQt files ^ designer  ^ hg  ^ install  ^ debugging +^ IDE           ^ Y/N? ^ 
-^ Eclipse+PyDev |  Y   | +~  |  + (py +) |  +        ✘        |  ?†        | + (both)‡ |  p  |  --      |  +        +^ Eclipse+PyDev |  Yes    
-^ Editra        | maybe +  |  ~        |  ✘        ✘        |  t?        | :-\ (ext) |  +  |  +~      |  ~ ext    +^ Editra        |  maybe  | 
-^ Eric 4        | maybe +* |  ~        |  +        --        ?         | + (ext)    ✘  |  ~        +        +^ Eric 4        |  maybe  | 
-^ Monkey Studio |  N    +  |  --        ?        +        |  +         | + (int)    ✘  |  +        ~ ext    +^ Monkey Studio |  no     
-^ Netbeans+Py   |  N    +  |  + (py ~) |  ?        ✘        |  ?         | + (ext)    +  |  +        --       +^ Netbeans+Py   |  no     
-^ Spyder        | maybe +  |  ~        |  ✘        ✘        |  t?        | :-\ (ext) |  ✘  |  +~      |  ~        +^ Spyder        |  maybe  | 
-^ Stani's IDE     |  ~  |  ~        |  ?        ?        |  ?          ?        |  ?  |  ?        ?        |+^ Stani's IDE        |
  
-* After manual intervention\\+==== General IDE support ==== 
 +^ IDE           ^ UI    ^ survival    ^ project ^ hg    ^ install  ^ debugging (py)^ 
 +^ Eclipse+PyDev |  :-)~ |  :-)        |  :-)    |  p    |  --      |  :-)          | 
 +^ Editra        |  :-)  |  ~          |  ✘      |  :-)  |  :-)~    |  ~ ext        | 
 +^ Eric 4        |  :-)* |  ~          |  :-)    |  ✘    |  ~        :-)          | 
 +^ Monkey Studio |  :-)  |  --          ?      |  ✘    |  :-)      ~ ext        | 
 +^ Netbeans+Py    :-)  |  :-) (py ~) |  ?      |  :-)  |  :-)      --           | 
 +^ Spyder        |  :-)  |  ~          |  ✘      |  ✘    |  :-)~    |  ~            | 
 +^ Stani's IDE    ~    |  ~          |  ?      |  ?    |  ?        ?            | 
 + 
 +* After significant manual intervention 
 + 
 +==== PyQt-specific project support ==== 
 +^ IDE           ^ PyQt proj ^ PyQt forms ^ qrc files ^ designer   ^ 
 +^ Eclipse+PyDev |  ✘        |  ?†        |  ~*       | :-)‡       | 
 +^ Editra        |  ✘        |  t?        |  ✘        | !!! (ext)  | 
 +^ Eric 4        |  --        --††      |  :-)      | :-) (ext)  | 
 +^ Monkey Studio |  :-)      |  :-)        ✘        | :-) (int)  | 
 +^ Netbeans+Py    ✘        |  ?          ?        | :-) (ext)  | 
 +^ Spyder        |  ✘        |  t?        |  ✘        | !!! (ext)  | 
 +^ Stani's IDE    ?        |  ?          ?        |  ?         | 
 + 
 +* With Qt support from Nokia, has nice GUI for adding resources, but compile with pyrcc4 for python must be done manually. \\
 † Need to check what happens w/ Qt for Eclipse stuff from Nokia\\ † Need to check what happens w/ Qt for Eclipse stuff from Nokia\\
 ‡ With just Eclipse+PyDev, it's external. With the Qt for Eclipse stuff from Nokia, it's either.\\ ‡ With just Eclipse+PyDev, it's external. With the Qt for Eclipse stuff from Nokia, it's either.\\
 p means untested plugin available\\ p means untested plugin available\\
 t means template, not wizard\\ t means template, not wizard\\
-:-\ means it's ill on Linux because of MIME issues (works with GNOME, Xfce (I think), and KDE (maybe), but not in others)\\ +!!! means it's ill on Linux because of MIME issues (works with GNOME, Xfce (I think), and KDE (maybe), but not in others)\\ 
-==== Code writing support ====+†† has facility to add ''*.ui'' files (as XML) but not the corresponding ''*.py'' file. 
 + 
 +==== Python and PyQt code writing support ==== 
 + 
 +^ IDE           ^ autocomp. ^ calltips ^ nav.   ^ refac. ^ check  ^ rt err. ^ 
 +^ Eclipse+PyDev |  :-)†      :-)†    |  :-)    :-)    ~      :-)    | 
 +^ Editra        |  :-)      |  :-)      ✘      ✘      ~      ✘      | 
 +^ Eric 4        |  :-)~*    |  :-)*†    :-)~‡ |  :-)    :-)    ✘      | 
 +^ Monkey Studio |  ~*        ~*      |  ✘      ✘      ✘      ✘      | 
 +^ Netbeans+Py    --        ?        :-)    ~      ~      ~      | 
 +^ Spyder        |  :-)†      :-)†    |  :-)    ✘      :-)    :-)    | 
 +^ Stani's IDE    ?        |  ?        ?      ?      ?      ?      | 
 + 
 +* API based\\ 
 +† Needs custom config (adding lib to PYTHONPATH or tweaking Rope config or similar)\\ 
 +‡ With Eric4's Rope plugin you can select the identifier, and then do navigation with //Refactoring -> Query -> <an option>//, then double click on an entry (or assign a keyboard shortcut to bring up the dialog and enter to dismiss and goto.) 
  
-^ IDE           ^ autocomp^ calltips ^ nav. ^ refac. ^ check  ^ rt err. ^ +I have some results in [[pyqt ide autocompletion testing]].
-^ Eclipse+PyDev |  +        |  ?        +    +      ~      +      | +
-^ Editra        |  +        |  ?        ✘    ✘      ~      ✘      | +
-^ Eric 4        |  +~        ?        ✘    +      +      ✘      | +
-^ Monkey Studio |  ~        |  ?        ✘    ✘      ✘      ✘      | +
-^ Netbeans+Py    --        ?        +    ~      ~      ~      | +
-^ Spyder        |  +        |  ?        +    ✘      +      +      | +
-^ Stani's IDE    ?        |  ?        ?    ?      ?      ?      |+
 ==== Comments ==== ==== Comments ====
 If project wizards were not available or were poopy, evaluations were made using {{:qt:evalpyqt.zip|this project}} that originated with Monkey Studio. If project wizards were not available or were poopy, evaluations were made using {{:qt:evalpyqt.zip|this project}} that originated with Monkey Studio.
Line 98: Line 135:
 === Eclipse+Pydev === === Eclipse+Pydev ===
  
-It's freaking heavy and bit obtuse. Setting up is a multi-step process. Once set up, to get code completion to work, you need to add PyQt lib path to project. (This is true of a lot of the IDEs.) Even then, the code completion doesn't seem to always pick up variables declared in the file itself--unless it's just slow or requires a Ctrl+Space to make go. This needs testing. But once it gets going, it seems to be really nice.+It's freaking heavy and bit obtuse. Setting up is a multi-step process. Once set up, to get code completion to work, you need to add the PyQt lib path (''/usr/lib/pymodules/python2.6/PyQt4''to project's PYTHONPATH. (You need to specify extra info for PyQt to a lot of IDEs, but this is one of the cases where the info needs to be provided on a *per project* basis.) Even then, the code completion doesn't seem to always pick up variables declared in the file itself--unless it's just slow or requires a Ctrl+Space to make go. This needs testing. But once it gets going, it seems to be really nice.
  
   * Enable/disable bracket completion?   * Enable/disable bracket completion?
Line 108: Line 145:
   * Eclipse + PyDev + Qt stuff for CDT from Nokia   * Eclipse + PyDev + Qt stuff for CDT from Nokia
   * Eclipse + PyDev + Qt stuff for CDT from Nokia + CDT   * Eclipse + PyDev + Qt stuff for CDT from Nokia + CDT
 +    * Has wizard for adding ''*.ui'' form files, but not the associated *.py (obviously)
 +    * Has wizard for adding ''*.qrc'' resource files along with a nice resource manager interface
  
 == Conclusion == == Conclusion ==
-Yes. Autocompletion needs more testing. Biggest con: it's a resource hog and then some.+Yes. Autocompletion needs more testing. Biggest con: it's a resource hog. Setting up is a bit of a PITA. Setting the per-project PyQt4 stuff is definitely a PITA.
  
 === Editra == === Editra ==
 Designed as a text editor, with plugins makes a decent IDE. It's in alpha now but usable. Designed as a text editor, with plugins makes a decent IDE. It's in alpha now but usable.
  
-    * Autocomplete seems promising!+    * Autocomplete seems promising
       * No config was required out of the box (IIRC)       * No config was required out of the box (IIRC)
-      * Nice icons with code completion -- definitely adds to usabilitypossibly more than Spyder's object browser.+      * Nice icons with code completion -- definitely adds to usability (possibly as much or more than Spyder's object browser).
       * Does not seem to AC from the source file. Definitely doesn't read up the definition stack to get completions.       * Does not seem to AC from the source file. Definitely doesn't read up the definition stack to get completions.
       * Hover over stuff brings up calltip info (if it can figure it out)       * Hover over stuff brings up calltip info (if it can figure it out)
Line 123: Line 162:
     * Debug can be set up with external call to winpd or something else (in Launch bar)     * Debug can be set up with external call to winpd or something else (in Launch bar)
     * Needs a **refactoring** tool     * Needs a **refactoring** tool
-    * Getting *.ui files to open in Designer not working consistently+    * Getting *.ui files to open in Designer not working consistently (in Linux at least)
       * This is a mime issue: GNOME works as expected, Xfce also I think. But xdg-open is messed up.       * This is a mime issue: GNOME works as expected, Xfce also I think. But xdg-open is messed up.
       * Drag and drop to designer does not work       * Drag and drop to designer does not work
Line 133: Line 172:
  
 === Eric 4 === === Eric 4 ===
-UI is painful by default but can be tweaked. Rope handles refactoring. Hg support listed on homepage but is only available in Eric 5. PyLint plugin available. Lotsa custom tweaks and plugin downloading required.+The default UI is painful by default but can be tweaked. Rope handles refactoring. Hg support listed on homepage but is only available in Eric 5. PyLint plugin available. Lotsa custom tweaks and plugin downloading required.
  
-A project wizard exists but doesn't really make a PyQt4 project. Adding forms is a little different but doable -- but I can't figure out how to add custom slots to e.g. ''mainwindow.py'' because any changes to the ''mainwindow.ui'' file requires "recompiling" to ''mainwindow.py'', nuking all your changes. This may be fixable with a change to the template so it uses the same +A project wizard exists but doesn't really make a PyQt4 project. Adding forms is a little different but doable -- but I can't figure out how to add custom slots to e.g. ''mainwindow.py'' because any changes to the ''mainwindow.ui'' file requires "recompiling" to ''mainwindow.py'', nuking all your changes. Solution seem to be not to use the "Eric way" of building forms--i.e., compiling the py files from ui files--and instead use the "Monkey Studio way" of reading the ui file into a module when it runs. This may be fixable with a change to the template so it uses the same 
 <code python> <code python>
 from PyQt4 import uic from PyQt4 import uic
Line 154: Line 193:
  
 == Autocompletion == == Autocompletion ==
-There are there autocompletion/calltip providers available: QScintilla, Rope (a plugin that also handles refactoring), and Assitant (a plugin).+There are three autocompletion/calltip providers available: QScintilla, Rope (a plugin that also handles refactoring), and Assitant (a plugin). 
 == QScintilla == == QScintilla ==
-To get QScintilla to give decent results, you need to point it to API files. This can be done by installing package eric-api-files and manually pointing Eric at them (//Settings->Preferences->Editor->API//). There's also a script eric4-api to make apis for you. The resulting files are full of ?4 and other strange things the meanings of which are unknown to me.+To get QScintilla to give decent results, you need to point it to API files. This can be done by installing package eric-api-files and manually pointing Eric at them (//Settings->Preferences->Editor->API//). There's also a script eric4-api to make apis for you. The resulting files are full of ?4 and other strange things the meanings of which are unknown to me. You only need to configure the API file location once. However--and this is the major problem with API-based autocomplete/calltips--if the API changes you'll have to manually update it. And you will forget to do that. 
 == Rope == == Rope ==
 Rope's offerings were quite poor until I changed its config to this one (which takes its values from a Rope testing script I downloaded from the Spyder Google Project Hosting site): Rope's offerings were quite poor until I changed its config to this one (which takes its values from a Rope testing script I downloaded from the Spyder Google Project Hosting site):
Line 258: Line 299:
  
 == Assistant == == Assistant ==
-Setting up Assistant . Supposedly it "adds support for icons in completions determined from document."((http://eric-ide.python-projects.org/eric-news-2008.html)) Like the QScintilla autocompletion, it requires API files.+Setting up Assistant also requires API files. Supposedly it "adds support for icons in completions determined from document."((http://eric-ide.python-projects.org/eric-news-2008.html))
  
 == The experience == == The experience ==
 If the problem with Rope calltips can be solved (no arguments shown) then Eric4 would be the one to use. The best interim solution seems to be to let Rope do autocomplete and Assistant do calltips. This is a usable but imperfect setup. Eric ships with a command-line tool for generating API files from source files. If the problem with Rope calltips can be solved (no arguments shown) then Eric4 would be the one to use. The best interim solution seems to be to let Rope do autocomplete and Assistant do calltips. This is a usable but imperfect setup. Eric ships with a command-line tool for generating API files from source files.
  
-Eric Assistant makes minimal use of icons in popups -- subjectively better than Spyder (but without the extra info) and not as nice as Editra (but more complete).+Eric Assistant makes minimal use of icons in its popups -- subjectively better than Spyder (but without the extra info) and not as nice as Editra (but more complete).
  
-At the moment, I am inclined to rate Spyder and Editra's tied for first (for different reasons) and Eric'in third -- but this very well may change.+At the moment, I am inclined to rate Spyder and Editra's tied (for different reasons) and just ahead of Eric's -- but this very well may change.
  
 == Other == == Other ==
Line 274: Line 315:
  
 Debugger works but doesn't seem that friendly. Debugger works but doesn't seem that friendly.
 +
 +Has qt resource file support.
  
 == Conclusion ==  == Conclusion == 
-Maybe. Major hassle setting it up but can be simplified with by distributing an ''*.ini'' file, icons, api files (for autocompletion) and instructions. If project and form adding/handling can be sorted out, it's a possibility (but doing this within the IDE structure is looking increasingly grim). Getting rid of the "arguments" dialog when executing would be nice, as would better GUI icons in general (which I have taken care of). Biggest con: Autocomplete/calltip needs API files (rather than being ) and an odd mixture of tools.+Maybe. Major hassle setting it up but can be simplified with by distributing an ''*.ini'' file, icons, API files and instructions. If project and form adding/handling can be sorted out, it's a possibility (but doing this within the IDE structure is looking increasingly grim). Getting rid of the "arguments" dialog when executing would be nice, as would better GUI icons in general (which I have taken care of). Biggest con: Autocomplete/calltip needs API files (rather than being ) and an odd mixture of tools.
  
 === Monkey Studio === === Monkey Studio ===
Line 302: Line 345:
   * Built-in CLI debugger (pdb) with menubar access to winpdb   * Built-in CLI debugger (pdb) with menubar access to winpdb
     * Winpdb doesn't work with at least one example though (though it starts file from the command line). [[https://code.google.com/p/spyderlib/issues/detail?id=623|Bug report]] filed.     * Winpdb doesn't work with at least one example though (though it starts file from the command line). [[https://code.google.com/p/spyderlib/issues/detail?id=623|Bug report]] filed.
 +    * If the project path has spaces in it, opening files in external editors seems not to work. (More testing with a project whose name does not start with a number is required before submitting a bug.)
     * No way I found to add "user commands"     * No way I found to add "user commands"
   * Good looking PyLint results   * Good looking PyLint results
qt/pyqt_ide_options.1303038408.txt.gz · Last modified: 2011/04/17 11:06 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki