[PyQt] Help with Design of Dialog interface

alsaf alfraealba at gmail.com
Sun Apr 17 19:43:17 BST 2011


I am currently writing a project which takes vocabulary words from a XML 
file which is created through the KDE application Parley and generates 
sentences based on them. The project page is here:


This is done through the user firstly creating sentence templates  which 
contains a number of word-types put in order of how a sentence would be. 
The program then uses these templates to extracts vocabulary words from 
the XML file that are associated with these word-types and creates 
sentences.   An example of this is if a sentence template is 'adjective 
adverb noun' then it will extract all adjectives adverb and nouns and 
generate sentences in that order.

I have written a command line version of this and in the process of 
adding a GUI interface using PYQT. I've only used PYQT a few times and 
would like some advice on how to go about designing an interface for 
part of it.

The part I am stuck at is the maintenance of the sentence templates. 
This part of the GUI will extract all the word types from the XML file 
which will used to validate the input the user enters when creating the 
sentence template.  The only way I think I can do this is to create a 
widget that contains a drop down list and a button. The user selects the 
word type from the list and when the button is pressed the contents of 
the drop down list is then appended to the sentence template. This 
sounds a bit clunky and cumbersome to do. Is there any easier way like a 
line edit button which has an auto-complete option or some other method 
is input that I can use?

I hope I have explained this properly. If not, I'm happy to explain 
further any questions.

More information about the PyQt mailing list