Re: [PyQt] Help with Design of Dialog interface

2011-04-19 Thread alsaf
Thanks for that David, much appreciated. I've tried the two examples and 
it is exactly what I'm looking for.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Help with Design of Dialog interface

2011-04-18 Thread David Boddie
On Sun, 17 Apr 2011 19:43:17 +0100, alsaf wrote:

> 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:
>
> https://sourceforge.net/projects/languagesentenc/

[...]

> 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?

There is a recipe for an auto-completing line edit in the Wiki:

  http://www.diotavelli.net/PyQtWiki/Adding_auto-completion_to_a_QLineEdit

Another possibility is to present a menu when the user presses a certain
key. The following recipe uses the Tab key for this:

  http://www.diotavelli.net/PyQtWiki/Adding_tab-completion_to_a_QLineEdit

As the page says, it would probably be best to use a QCompleter instead of
a list, so perhaps you could try taking the best parts from each of these
examples.

David
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Help with Design of Dialog interface

2011-04-17 Thread alsaf

Hi

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:


https://sourceforge.net/projects/languagesentenc/

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.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt