Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/util/qlayoutpolicy.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | void QLayoutPolicy::setControlType(ControlType type) | - | ||||||
5 | { | - | ||||||
6 | int i = 0; | - | ||||||
7 | while (true) { | - | ||||||
8 | if (type & (0x1 << i)
| 0 | ||||||
9 | bits.ctype = i; | - | ||||||
10 | return; never executed: return; | 0 | ||||||
11 | } | - | ||||||
12 | ++i; | - | ||||||
13 | } never executed: end of block | 0 | ||||||
14 | } never executed: end of block | 0 | ||||||
15 | - | |||||||
16 | QLayoutPolicy::ControlType QLayoutPolicy::controlType() const | - | ||||||
17 | { | - | ||||||
18 | return never executed: QLayoutPolicy::ControlType(1 << bits.ctype);return QLayoutPolicy::ControlType(1 << bits.ctype); never executed: return QLayoutPolicy::ControlType(1 << bits.ctype); | 0 | ||||||
19 | } | - | ||||||
20 | QDataStream &operator<<(QDataStream &stream, const QLayoutPolicy &policy) | - | ||||||
21 | { | - | ||||||
22 | - | |||||||
23 | quint32 data = (policy.bits.horPolicy | | - | ||||||
24 | policy.bits.verPolicy << 4 | | - | ||||||
25 | policy.bits.hfw << 8 | | - | ||||||
26 | policy.bits.ctype << 9 | | - | ||||||
27 | policy.bits.wfh << 14 | | - | ||||||
28 | - | |||||||
29 | policy.bits.verStretch << 16 | | - | ||||||
30 | policy.bits.horStretch << 24); | - | ||||||
31 | return never executed: stream << data;return stream << data; never executed: return stream << data; | 0 | ||||||
32 | } | - | ||||||
33 | QDataStream &operator>>(QDataStream &stream, QLayoutPolicy &policy) | - | ||||||
34 | { | - | ||||||
35 | quint32 data; | - | ||||||
36 | stream >> data; | - | ||||||
37 | policy.bits.horPolicy = ((data >> 0) & ((1 << 4) -1)); | - | ||||||
38 | policy.bits.verPolicy = ((data >> 4) & ((1 << 4) -1)); | - | ||||||
39 | policy.bits.hfw = ((data >> 8) & ((1 << 1) -1)); | - | ||||||
40 | policy.bits.ctype = ((data >> 9) & ((1 << 5) -1)); | - | ||||||
41 | policy.bits.wfh = ((data >> 14) & ((1 << 1) -1)); | - | ||||||
42 | policy.bits.padding = 0; | - | ||||||
43 | policy.bits.verStretch = ((data >> 16) & ((1 << 8) -1)); | - | ||||||
44 | policy.bits.horStretch = ((data >> 24) & ((1 << 8) -1)); | - | ||||||
45 | return never executed: stream;return stream; never executed: return stream; | 0 | ||||||
46 | } | - | ||||||
47 | - | |||||||
48 | - | |||||||
49 | - | |||||||
50 | QDebug operator<<(QDebug dbg, const QLayoutPolicy &p) | - | ||||||
51 | { | - | ||||||
52 | QDebugStateSaver saver(dbg); | - | ||||||
53 | dbg.nospace() << "QLayoutPolicy(horizontalPolicy = " << p.horizontalPolicy() | - | ||||||
54 | << ", verticalPolicy = " << p.verticalPolicy() << ')'; | - | ||||||
55 | return never executed: dbg;return dbg; never executed: return dbg; | 0 | ||||||
56 | } | - | ||||||
57 | - | |||||||
58 | - | |||||||
59 | - | |||||||
Switch to Source code | Preprocessed file |