[Qt-interest] what is this syntax?

Donal O'Connor donaloconnor at gmail.com
Sun Sep 12 01:11:58 CEST 2010


It's defining bit fields , 4 bits.

http://en.wikipedia.org/wiki/Bit_field

<http://en.wikipedia.org/wiki/Bit_field>In a class you can access these bits
directly then and assign values or do bit ops.



On Sun, Sep 12, 2010 at 12:07 AM, pmqt71 <pmqt71 at gmail.com> wrote:

> Hi all,
>
> could you tell me what the following statement means? What is : 4after window_state definition?
>
>     uint window_state : 4;
>
>
> I found this syntax in qwidget.h
>
> ...
> class QWidgetData
> {
> public:
>     WId winid;
>     uint widget_attributes;
>     Qt::WindowFlags window_flags;
>     uint window_state : 4;
>     uint focus_policy : 4;
>     uint sizehint_forced :1;
>     ...
>
>
>
> thanks
> pm
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100912/bced8922/attachment.html 


More information about the Qt-interest-old mailing list