[PyKDE] More documention?

Ken Godee ken at perfect-image.com
Tue Aug 5 23:34:01 BST 2003


>  Between the example programs packaged with PyQt and Boudewijn Rempt's book, 
> I've been able to make pretty decent headway in learning PyQt through trial 
> and error. However, at this point, I'm mostly parroting what I see, with only 
> a vague comprehension as to what's going on. For example, take QMessageBox. 
> What are the arguments that can be passed to it? I tried
> >>> help(QMessageBox)
> but that was decidedly _un_helpful. I'm currently using this code:
> 
> message = QMessageBox.warning(self, "Unsaved Record",
>                 "Warning, changes have not been saved. Quit?",
>                 "Yes", "No", None, 1, 0)
> 
> If "Yes" is selected, then it returns "0", otherwise "1". Great. I assume that 
> the "1" argument is responsible, but what arguments do "None" and "0" supply?
>  Is there anything that lists PyQt's functions and their arguments somewhere? 
> Surely there must be some more nitty-gritty documentation as to how 
> everything works?
>  :Peter

Peter,
One of things that make PyQt great (in my opinion) is the Qt docs, they give
you a wealth of information, even though it's in c++, after awhile it becomes 
second nature. I just took a quick look at "QMessageBox.warning" and
read the follwing for your example above;

None = this would be for a third button, if used
The "1" follwing None = default button # setting.
The "0" following the "1" = button default for escape, -1 = no action, 0 = "1st button", etc.






More information about the PyQt mailing list