[PyKDE] Re: About PyQt4

Phil Thompson phil at riverbankcomputing.co.uk
Mon Dec 12 12:51:27 GMT 2005


On Sunday 11 December 2005 3:09 pm, Douglas Andrade wrote:
> Hi !
>
> Porting the "windowflags" example, I had a problem comparing two
> QtCore.Qt.WindowFlags.
>
> Example:
>
> In previewwindow.py i had the following code:
>
> flag_type = (flags & QtCore.Qt.WindowType_Mask)
>
> if (flag_type == QtCore.Qt.Window):
>
> But when i try to make the flag_type comparisons it is always false.
>
> To solve the problem, i had to put this line of code below before of the
> other two lines of code:
>
> flags = int(flags)
>
> I dont know if i could explain it well, can you take a look at
> previewwindow.py from the "windowflags" example, please ?

The next snapshot will include extra operators to QFlags to make it more 
natural to use.

> Is this the correct behaviour ? Do we have to explicit convert the
> QtCore.Qt.WindowFlags object to a "int" ?
>
> Another thing, looking at QtCore i did not found QFlags, is it there ?

It's a template class - it doesn't exist at runtime.

I've finished the port of windowflags.py. It segfaults (unless you build a 
debug version of PyQt4) but I don't have enough evidence yet to track it 
down.

Phil




More information about the PyQt mailing list