qdockarealayout.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qdockarealayout.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);-
9-
10enum { StateFlagVisible = 1, StateFlagFloating = 2 };-
11-
12-
13-
14-
15-
16QPlaceHolderItem::QPlaceHolderItem(QWidget *w)-
17{-
18 objectName = w->objectName();-
19 hidden = w->isHidden();-
20 window = w->isWindow();-
21 if (window
windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
22 topLevelRect = w->geometry();
never executed: topLevelRect = w->geometry();
0
23}
never executed: end of block
0
24-
25-
26-
27-
28-
29QDockAreaLayoutItem::QDockAreaLayoutItem(QLayoutItem *_widgetItem)-
30 : widgetItem(_widgetItem), subinfo(0), placeHolderItem(0), pos(0), size(-1), flags(NoFlags)-
31{-
32}
never executed: end of block
0
33-
34QDockAreaLayoutItem::QDockAreaLayoutItem(QDockAreaLayoutInfo *_subinfo)-
35 : widgetItem(0), subinfo(_subinfo), placeHolderItem(0), pos(0), size(-1), flags(NoFlags)-
36{-
37}
never executed: end of block
0
38-
39QDockAreaLayoutItem::QDockAreaLayoutItem(QPlaceHolderItem *_placeHolderItem)-
40 : widgetItem(0), subinfo(0), placeHolderItem(_placeHolderItem), pos(0), size(-1), flags(NoFlags)-
41{-
42}
never executed: end of block
0
43-
44QDockAreaLayoutItem::QDockAreaLayoutItem(const QDockAreaLayoutItem &other)-
45 : widgetItem(other.widgetItem), subinfo(0), placeHolderItem(0), pos(other.pos),-
46 size(other.size), flags(other.flags)-
47{-
48 if (other.subinfo != 0
other.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
49 subinfo = new QDockAreaLayoutInfo(*other.subinfo);
never executed: subinfo = new QDockAreaLayoutInfo(*other.subinfo);
0
50 else if (other.placeHolderItem != 0
other.placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
51 placeHolderItem = new QPlaceHolderItem(*other.placeHolderItem);
never executed: placeHolderItem = new QPlaceHolderItem(*other.placeHolderItem);
0
52}
never executed: end of block
0
53-
54QDockAreaLayoutItem::~QDockAreaLayoutItem()-
55{-
56 delete subinfo;-
57 delete placeHolderItem;-
58}
never executed: end of block
0
59-
60bool QDockAreaLayoutItem::skip() const-
61{-
62 if (placeHolderItem != 0
placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
63 return
never executed: return true;
true;
never executed: return true;
0
64-
65 if (flags & GapItem
flags & GapItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
66 return
never executed: return false;
false;
never executed: return false;
0
67-
68 if (widgetItem != 0
widgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
69 return
never executed: return widgetItem->isEmpty();
widgetItem->isEmpty();
never executed: return widgetItem->isEmpty();
0
70-
71 if (subinfo != 0
subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
72 for (int i = 0; i < subinfo->item_list.count()
i < subinfo->item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
73 if (!subinfo->item_list.at(i).skip()
!subinfo->item...t.at(i).skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
74 return
never executed: return false;
false;
never executed: return false;
0
75 }
never executed: end of block
0
76 }
never executed: end of block
0
77-
78 return
never executed: return true;
true;
never executed: return true;
0
79}-
80-
81QSize QDockAreaLayoutItem::minimumSize() const-
82{-
83 if (widgetItem != 0
widgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
84 int left, top, right, bottom;-
85 widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);-
86 return
never executed: return widgetItem->minimumSize() + QSize(left+right, top+bottom);
widgetItem->minimumSize() + QSize(left+right, top+bottom);
never executed: return widgetItem->minimumSize() + QSize(left+right, top+bottom);
0
87 }-
88 if (subinfo != 0
subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
89 return
never executed: return subinfo->minimumSize();
subinfo->minimumSize();
never executed: return subinfo->minimumSize();
0
90 return
never executed: return QSize(0, 0);
QSize(0, 0);
never executed: return QSize(0, 0);
0
91}-
92-
93QSize QDockAreaLayoutItem::maximumSize() const-
94{-
95 if (widgetItem != 0
widgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
96 int left, top, right, bottom;-
97 widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);-
98 return
never executed: return widgetItem->maximumSize()+ QSize(left+right, top+bottom);
widgetItem->maximumSize()+ QSize(left+right, top+bottom);
never executed: return widgetItem->maximumSize()+ QSize(left+right, top+bottom);
0
99 }-
100 if (subinfo != 0
subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
101 return
never executed: return subinfo->maximumSize();
subinfo->maximumSize();
never executed: return subinfo->maximumSize();
0
102 return
never executed: return QSize(((1<<24)-1), ((1<<24)-1));
QSize(((1<<24)-1), ((1<<24)-1));
never executed: return QSize(((1<<24)-1), ((1<<24)-1));
0
103}-
104-
105bool QDockAreaLayoutItem::hasFixedSize(Qt::Orientation o) const-
106{-
107 return
never executed: return perp(o, minimumSize()) == perp(o, maximumSize());
perp(o, minimumSize()) == perp(o, maximumSize());
never executed: return perp(o, minimumSize()) == perp(o, maximumSize());
0
108}-
109-
110bool QDockAreaLayoutItem::expansive(Qt::Orientation o) const-
111{-
112 if ((
(flags & GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
flags & GapItem)
(flags & GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
|| placeHolderItem != 0
placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
113 return
never executed: return false;
false;
never executed: return false;
0
114 if (widgetItem != 0
widgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
115 return
never executed: return ((widgetItem->expandingDirections() & o) == o);
((widgetItem->expandingDirections() & o) == o);
never executed: return ((widgetItem->expandingDirections() & o) == o);
0
116 if (subinfo != 0
subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
117 return
never executed: return subinfo->expansive(o);
subinfo->expansive(o);
never executed: return subinfo->expansive(o);
0
118 return
never executed: return false;
false;
never executed: return false;
0
119}-
120-
121QSize QDockAreaLayoutItem::sizeHint() const-
122{-
123 if (placeHolderItem != 0
placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
124 return
never executed: return QSize(0, 0);
QSize(0, 0);
never executed: return QSize(0, 0);
0
125 if (widgetItem != 0
widgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
126 int left, top, right, bottom;-
127 widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);-
128 return
never executed: return widgetItem->sizeHint() + QSize(left+right, top+bottom);
widgetItem->sizeHint() + QSize(left+right, top+bottom);
never executed: return widgetItem->sizeHint() + QSize(left+right, top+bottom);
0
129 }-
130 if (subinfo != 0
subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
131 return
never executed: return subinfo->sizeHint();
subinfo->sizeHint();
never executed: return subinfo->sizeHint();
0
132 return
never executed: return QSize(-1, -1);
QSize(-1, -1);
never executed: return QSize(-1, -1);
0
133}-
134-
135QDockAreaLayoutItem-
136 &QDockAreaLayoutItem::operator = (const QDockAreaLayoutItem &other)-
137{-
138 widgetItem = other.widgetItem;-
139 if (other.subinfo == 0
other.subinfo == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
140 subinfo = 0;
never executed: subinfo = 0;
0
141 else-
142 subinfo = new QDockAreaLayoutInfo(*other.subinfo);
never executed: subinfo = new QDockAreaLayoutInfo(*other.subinfo);
0
143-
144 delete placeHolderItem;-
145 if (other.placeHolderItem == 0
other.placeHolderItem == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
146 placeHolderItem = 0;
never executed: placeHolderItem = 0;
0
147 else-
148 placeHolderItem = new QPlaceHolderItem(*other.placeHolderItem);
never executed: placeHolderItem = new QPlaceHolderItem(*other.placeHolderItem);
0
149-
150 pos = other.pos;-
151 size = other.size;-
152 flags = other.flags;-
153-
154 return
never executed: return *this;
*this;
never executed: return *this;
0
155}-
156-
157-
158-
159-
160-
161-
162static quintptr tabId(const QDockAreaLayoutItem &item)-
163{-
164 if (item.widgetItem == 0
item.widgetItem == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
165 return
never executed: return 0;
0;
never executed: return 0;
0
166 return
never executed: return reinterpret_cast<quintptr>(item.widgetItem->widget());
reinterpret_cast<quintptr>(item.widgetItem->widget());
never executed: return reinterpret_cast<quintptr>(item.widgetItem->widget());
0
167}-
168-
169-
170static const int zero = 0;-
171-
172QDockAreaLayoutInfo::QDockAreaLayoutInfo()-
173 : sep(&zero), dockPos(QInternal::LeftDock), o(Qt::Horizontal), mainWindow(0)-
174-
175 , tabbed(false), tabBar(0), tabBarShape(QTabBar::RoundedSouth)-
176-
177{-
178}
never executed: end of block
0
179-
180QDockAreaLayoutInfo::QDockAreaLayoutInfo(const int *_sep, QInternal::DockPosition _dockPos,-
181 Qt::Orientation _o, int tbshape,-
182 QMainWindow *window)-
183 : sep(_sep), dockPos(_dockPos), o(_o), mainWindow(window)-
184-
185 , tabbed(false), tabBar(0), tabBarShape(static_cast<QTabBar::Shape>(tbshape))-
186-
187{-
188-
189-
190-
191}
never executed: end of block
0
192-
193QSize QDockAreaLayoutInfo::size() const-
194{-
195 return
never executed: return isEmpty() ? QSize(0, 0) : rect.size();
isEmpty() ? QSize(0, 0) : rect.size();
never executed: return isEmpty() ? QSize(0, 0) : rect.size();
0
196}-
197-
198void QDockAreaLayoutInfo::clear()-
199{-
200 item_list.clear();-
201 rect = QRect();-
202-
203 tabbed = false;-
204 tabBar = 0;-
205-
206}
never executed: end of block
0
207-
208bool QDockAreaLayoutInfo::isEmpty() const-
209{-
210 return
never executed: return next(-1) == -1;
next(-1) == -1;
never executed: return next(-1) == -1;
0
211}-
212-
213QSize QDockAreaLayoutInfo::minimumSize() const-
214{-
215 if (isEmpty()
isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
216 return
never executed: return QSize(0, 0);
QSize(0, 0);
never executed: return QSize(0, 0);
0
217-
218 int a = 0, b = 0;-
219 bool first = true;-
220 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
221 const QDockAreaLayoutItem &item = item_list.at(i);-
222 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
223 continue;
never executed: continue;
0
224-
225 QSize min_size = item.minimumSize();-
226-
227 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
228 a = qMax(a, pick(o, min_size));-
229 }
never executed: end of block
else
0
230-
231 {-
232 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
233 a += *sep;
never executed: a += *sep;
0
234 a += pick(o, min_size);-
235 }
never executed: end of block
0
236 b = qMax(b, perp(o, min_size));-
237-
238 first = false;-
239 }
never executed: end of block
0
240-
241 QSize result;-
242 rpick(o, result) = a;-
243 rperp(o, result) = b;-
244-
245-
246 QSize tbm = tabBarMinimumSize();-
247 if (!tbm.isNull()
!tbm.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
248 switch (tabBarShape) {-
249 case
never executed: case QTabBar::RoundedNorth:
QTabBar::RoundedNorth:
never executed: case QTabBar::RoundedNorth:
0
250 case
never executed: case QTabBar::RoundedSouth:
QTabBar::RoundedSouth:
never executed: case QTabBar::RoundedSouth:
0
251 case
never executed: case QTabBar::TriangularNorth:
QTabBar::TriangularNorth:
never executed: case QTabBar::TriangularNorth:
0
252 case
never executed: case QTabBar::TriangularSouth:
QTabBar::TriangularSouth:
never executed: case QTabBar::TriangularSouth:
0
253 result.rheight() += tbm.height();-
254 result.rwidth() = qMax(tbm.width(), result.width());-
255 break;
never executed: break;
0
256 case
never executed: case QTabBar::RoundedEast:
QTabBar::RoundedEast:
never executed: case QTabBar::RoundedEast:
0
257 case
never executed: case QTabBar::RoundedWest:
QTabBar::RoundedWest:
never executed: case QTabBar::RoundedWest:
0
258 case
never executed: case QTabBar::TriangularEast:
QTabBar::TriangularEast:
never executed: case QTabBar::TriangularEast:
0
259 case
never executed: case QTabBar::TriangularWest:
QTabBar::TriangularWest:
never executed: case QTabBar::TriangularWest:
0
260 result.rheight() = qMax(tbm.height(), result.height());-
261 result.rwidth() += tbm.width();-
262 break;
never executed: break;
0
263 default
never executed: default:
:
never executed: default:
0
264 break;
never executed: break;
0
265 }-
266 }-
267-
268-
269 return
never executed: return result;
result;
never executed: return result;
0
270}-
271-
272QSize QDockAreaLayoutInfo::maximumSize() const-
273{-
274 if (isEmpty()
isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
275 return
never executed: return QSize(((1<<24)-1), ((1<<24)-1));
QSize(((1<<24)-1), ((1<<24)-1));
never executed: return QSize(((1<<24)-1), ((1<<24)-1));
0
276-
277 int a = 0, b = ((1<<24)-1);-
278-
279 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
280 a = ((1<<24)-1);
never executed: a = ((1<<24)-1);
0
281-
282-
283 int min_perp = 0;-
284-
285 bool first = true;-
286 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
287 const QDockAreaLayoutItem &item = item_list.at(i);-
288 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
289 continue;
never executed: continue;
0
290-
291 QSize max_size = item.maximumSize();-
292 min_perp = qMax(min_perp, perp(o, item.minimumSize()));-
293-
294-
295 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
296 a = qMin(a, pick(o, max_size));-
297 }
never executed: end of block
else
0
298-
299 {-
300 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
301 a += *sep;
never executed: a += *sep;
0
302 a += pick(o, max_size);-
303 }
never executed: end of block
0
304 b = qMin(b, perp(o, max_size));-
305-
306 a = qMin(a, int(((1<<24)-1)));-
307 b = qMin(b, int(((1<<24)-1)));-
308-
309 first = false;-
310 }
never executed: end of block
0
311-
312 b = qMax(b, min_perp);-
313-
314 QSize result;-
315 rpick(o, result) = a;-
316 rperp(o, result) = b;-
317-
318-
319 QSize tbh = tabBarSizeHint();-
320 if (!tbh.isNull()
!tbh.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
321 switch (tabBarShape) {-
322 case
never executed: case QTabBar::RoundedNorth:
QTabBar::RoundedNorth:
never executed: case QTabBar::RoundedNorth:
0
323 case
never executed: case QTabBar::RoundedSouth:
QTabBar::RoundedSouth:
never executed: case QTabBar::RoundedSouth:
0
324 result.rheight() += tbh.height();-
325 break;
never executed: break;
0
326 case
never executed: case QTabBar::RoundedEast:
QTabBar::RoundedEast:
never executed: case QTabBar::RoundedEast:
0
327 case
never executed: case QTabBar::RoundedWest:
QTabBar::RoundedWest:
never executed: case QTabBar::RoundedWest:
0
328 result.rwidth() += tbh.width();-
329 break;
never executed: break;
0
330 default
never executed: default:
:
never executed: default:
0
331 break;
never executed: break;
0
332 }-
333 }-
334-
335-
336 return
never executed: return result;
result;
never executed: return result;
0
337}-
338-
339QSize QDockAreaLayoutInfo::sizeHint() const-
340{-
341 if (isEmpty()
isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
342 return
never executed: return QSize(0, 0);
QSize(0, 0);
never executed: return QSize(0, 0);
0
343-
344 int a = 0, b = 0;-
345 int min_perp = 0;-
346 int max_perp = ((1<<24)-1);-
347 const QDockAreaLayoutItem *previous = 0;-
348 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
349 const QDockAreaLayoutItem &item = item_list.at(i);-
350 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
351 continue;
never executed: continue;
0
352-
353 bool gap = item.flags & QDockAreaLayoutItem::GapItem;-
354-
355 QSize size_hint = item.sizeHint();-
356 min_perp = qMax(min_perp, perp(o, item.minimumSize()));-
357 max_perp = qMin(max_perp, perp(o, item.maximumSize()));-
358-
359-
360 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
361 a = qMax(a, gap ? item.size : pick(o, size_hint));-
362 }
never executed: end of block
else
0
363-
364 {-
365 if (previous
previousDescription
TRUEnever evaluated
FALSEnever evaluated
&& !gap
!gapDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(previous->flags & QDockAreaLayoutItem::GapItem)
!(previous->fl...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
0
366 && !previous->hasFixedSize(o)
!previous->hasFixedSize(o)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
367 a += *sep;-
368 }
never executed: end of block
0
369 a += gap
gapDescription
TRUEnever evaluated
FALSEnever evaluated
? item.size : pick(o, size_hint);
0
370 }
never executed: end of block
0
371 b = qMax(b, perp(o, size_hint));-
372-
373 previous = &item;-
374 }
never executed: end of block
0
375-
376 max_perp = qMax(max_perp, min_perp);-
377 b = qMax(b, min_perp);-
378 b = qMin(b, max_perp);-
379-
380 QSize result;-
381 rpick(o, result) = a;-
382 rperp(o, result) = b;-
383-
384-
385 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
386 QSize tbh = tabBarSizeHint();-
387 switch (tabBarShape) {-
388 case
never executed: case QTabBar::RoundedNorth:
QTabBar::RoundedNorth:
never executed: case QTabBar::RoundedNorth:
0
389 case
never executed: case QTabBar::RoundedSouth:
QTabBar::RoundedSouth:
never executed: case QTabBar::RoundedSouth:
0
390 case
never executed: case QTabBar::TriangularNorth:
QTabBar::TriangularNorth:
never executed: case QTabBar::TriangularNorth:
0
391 case
never executed: case QTabBar::TriangularSouth:
QTabBar::TriangularSouth:
never executed: case QTabBar::TriangularSouth:
0
392 result.rheight() += tbh.height();-
393 result.rwidth() = qMax(tbh.width(), result.width());-
394 break;
never executed: break;
0
395 case
never executed: case QTabBar::RoundedEast:
QTabBar::RoundedEast:
never executed: case QTabBar::RoundedEast:
0
396 case
never executed: case QTabBar::RoundedWest:
QTabBar::RoundedWest:
never executed: case QTabBar::RoundedWest:
0
397 case
never executed: case QTabBar::TriangularEast:
QTabBar::TriangularEast:
never executed: case QTabBar::TriangularEast:
0
398 case
never executed: case QTabBar::TriangularWest:
QTabBar::TriangularWest:
never executed: case QTabBar::TriangularWest:
0
399 result.rheight() = qMax(tbh.height(), result.height());-
400 result.rwidth() += tbh.width();-
401 break;
never executed: break;
0
402 default
never executed: default:
:
never executed: default:
0
403 break;
never executed: break;
0
404 }-
405 }-
406-
407-
408 return
never executed: return result;
result;
never executed: return result;
0
409}-
410-
411bool QDockAreaLayoutInfo::expansive(Qt::Orientation o) const-
412{-
413 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
414 if (item_list.at(i).expansive(o)
item_list.at(i).expansive(o)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
415 return
never executed: return true;
true;
never executed: return true;
0
416 }
never executed: end of block
0
417 return
never executed: return false;
false;
never executed: return false;
0
418}-
419static int realMinSize(const QDockAreaLayoutInfo &info)-
420{-
421 int result = 0;-
422 bool first = true;-
423 for (int i = 0; i < info.item_list.size()
i < info.item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
424 const QDockAreaLayoutItem &item = info.item_list.at(i);-
425 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
426 continue;
never executed: continue;
0
427-
428 int min = 0;-
429 if ((
(item.flags & ...tem::KeepSize)Description
TRUEnever evaluated
FALSEnever evaluated
item.flags & QDockAreaLayoutItem::KeepSize)
(item.flags & ...tem::KeepSize)Description
TRUEnever evaluated
FALSEnever evaluated
&& item.size != -1
item.size != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
430 min = item.size;
never executed: min = item.size;
0
431 else-
432 min = pick(info.o, item.minimumSize());
never executed: min = pick(info.o, item.minimumSize());
0
433-
434 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
435 result += *info.sep;
never executed: result += *info.sep;
0
436 result += min;-
437-
438 first = false;-
439 }
never executed: end of block
0
440-
441 return
never executed: return result;
result;
never executed: return result;
0
442}-
443-
444static int realMaxSize(const QDockAreaLayoutInfo &info)-
445{-
446 int result = 0;-
447 bool first = true;-
448 for (int i = 0; i < info.item_list.size()
i < info.item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
449 const QDockAreaLayoutItem &item = info.item_list.at(i);-
450 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
451 continue;
never executed: continue;
0
452-
453 int max = 0;-
454 if ((
(item.flags & ...tem::KeepSize)Description
TRUEnever evaluated
FALSEnever evaluated
item.flags & QDockAreaLayoutItem::KeepSize)
(item.flags & ...tem::KeepSize)Description
TRUEnever evaluated
FALSEnever evaluated
&& item.size != -1
item.size != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
455 max = item.size;
never executed: max = item.size;
0
456 else-
457 max = pick(info.o, item.maximumSize());
never executed: max = pick(info.o, item.maximumSize());
0
458-
459 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
460 result += *info.sep;
never executed: result += *info.sep;
0
461 result += max;-
462-
463 if (result >= ((1<<24)-1)
result >= ((1<<24)-1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
464 return
never executed: return ((1<<24)-1);
((1<<24)-1);
never executed: return ((1<<24)-1);
0
465-
466 first = false;-
467 }
never executed: end of block
0
468-
469 return
never executed: return result;
result;
never executed: return result;
0
470}-
471-
472void QDockAreaLayoutInfo::fitItems()-
473{-
474-
475 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
476 return;
never executed: return;
0
477 }-
478-
479-
480 QVector<QLayoutStruct> layout_struct_list(item_list.size()*2);-
481 int j = 0;-
482-
483 int size = pick(o, rect.size());-
484 int min_size = realMinSize(*this);-
485 int max_size = realMaxSize(*this);-
486 int last_index = -1;-
487-
488 const QDockAreaLayoutItem *previous = 0;-
489 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
490 QDockAreaLayoutItem &item = item_list[i];-
491 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
492 continue;
never executed: continue;
0
493-
494 bool gap = item.flags & QDockAreaLayoutItem::GapItem;-
495 if (previous
previousDescription
TRUEnever evaluated
FALSEnever evaluated
&& !gap
!gapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
496 if (!(previous->flags & QDockAreaLayoutItem::GapItem)
!(previous->fl...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
497 QLayoutStruct &ls = layout_struct_list[j++];-
498 ls.init();-
499 ls.minimumSize = ls.maximumSize = ls.sizeHint = previous->hasFixedSize(o)
previous->hasFixedSize(o)Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : *sep;
0
500 ls.empty = false;-
501 }
never executed: end of block
0
502 }
never executed: end of block
0
503-
504 if (item.flags & QDockAreaLayoutItem::KeepSize
item.flags & Q...Item::KeepSizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
505-
506-
507-
508 if (size < min_size
size < min_sizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
509-
510 item.flags &= ~QDockAreaLayoutItem::KeepSize;-
511 min_size -= item.size;-
512 min_size += pick(o, item.minimumSize());-
513 min_size = qMax(0, min_size);-
514 }
never executed: end of block
else if (size > max_size
size > max_sizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
515-
516 item.flags &= ~QDockAreaLayoutItem::KeepSize;-
517 max_size -= item.size;-
518 max_size += pick(o, item.maximumSize());-
519 max_size = qMin<int>(((1<<24)-1), max_size);-
520 }
never executed: end of block
0
521 }
never executed: end of block
0
522-
523 last_index = j;-
524 QLayoutStruct &ls = layout_struct_list[j++];-
525 ls.init();-
526 ls.empty = false;-
527 if (item.flags & QDockAreaLayoutItem::KeepSize
item.flags & Q...Item::KeepSizeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
528 ls.minimumSize = ls.maximumSize = ls.sizeHint = item.size;-
529 ls.expansive = false;-
530 ls.stretch = 0;-
531 }
never executed: end of block
else {
0
532 ls.maximumSize = pick(o, item.maximumSize());-
533 ls.expansive = item.expansive(o);-
534 ls.minimumSize = pick(o, item.minimumSize());-
535 ls.sizeHint = item.size == -1
item.size == -1Description
TRUEnever evaluated
FALSEnever evaluated
? pick(o, item.sizeHint()) : item.size;
0
536 ls.stretch = ls.expansive
ls.expansiveDescription
TRUEnever evaluated
FALSEnever evaluated
? ls.sizeHint : 0;
0
537 }
never executed: end of block
0
538-
539 item.flags &= ~QDockAreaLayoutItem::KeepSize;-
540 previous = &item;-
541 }
never executed: end of block
0
542 layout_struct_list.resize(j);-
543-
544-
545-
546 if (size > max_size
size > max_sizeDescription
TRUEnever evaluated
FALSEnever evaluated
&& last_index != -1
last_index != -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
547 layout_struct_list[last_index].maximumSize = ((1<<24)-1);-
548 layout_struct_list[last_index].expansive = true;-
549 }
never executed: end of block
0
550-
551 qGeomCalc(layout_struct_list, 0, j, pick(o, rect.topLeft()), size, 0);-
552-
553 j = 0;-
554 bool prev_gap = false;-
555 bool first = true;-
556 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
557 QDockAreaLayoutItem &item = item_list[i];-
558 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
559 continue;
never executed: continue;
0
560-
561 bool gap = item.flags & QDockAreaLayoutItem::GapItem;-
562 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
&& !gap
!gapDescription
TRUEnever evaluated
FALSEnever evaluated
&& !prev_gap
!prev_gapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
563 ++
never executed: ++j;
j;
never executed: ++j;
0
564-
565 const QLayoutStruct &ls = layout_struct_list.at(j++);-
566 item.size = ls.size;-
567 item.pos = ls.pos;-
568-
569 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
570 item.subinfo->rect = itemRect(i);-
571 item.subinfo->fitItems();-
572 }
never executed: end of block
0
573-
574 prev_gap = gap;-
575 first = false;-
576 }
never executed: end of block
0
577}
never executed: end of block
0
578-
579static QInternal::DockPosition dockPosHelper(const QRect &rect, const QPoint &_pos,-
580 Qt::Orientation o,-
581 bool nestingEnabled,-
582 QDockAreaLayoutInfo::TabMode tabMode)-
583{-
584 if (tabMode == QDockAreaLayoutInfo::ForceTabs
tabMode == QDo...nfo::ForceTabsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
585 return
never executed: return QInternal::DockCount;
QInternal::DockCount;
never executed: return QInternal::DockCount;
0
586-
587 QPoint pos = _pos - rect.topLeft();-
588-
589 int x = pos.x();-
590 int y = pos.y();-
591 int w = rect.width();-
592 int h = rect.height();-
593-
594 if (tabMode != QDockAreaLayoutInfo::NoTabs
tabMode != QDo...utInfo::NoTabsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
595-
596 if (nestingEnabled
nestingEnabledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
597 QRect center(w/6, h/6, 2*w/3, 2*h/3);-
598 if (center.contains(pos)
center.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
599 return
never executed: return QInternal::DockCount;
QInternal::DockCount;
never executed: return QInternal::DockCount;
0
600 }
never executed: end of block
else if (o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
601 if (x > w/6
x > w/6Description
TRUEnever evaluated
FALSEnever evaluated
&& x < w*5/6
x < w*5/6Description
TRUEnever evaluated
FALSEnever evaluated
)
0
602 return
never executed: return QInternal::DockCount;
QInternal::DockCount;
never executed: return QInternal::DockCount;
0
603 }
never executed: end of block
else {
0
604-
605-
606-
607-
608-
609-
610-
611 if (y > h/6
y > h/6Description
TRUEnever evaluated
FALSEnever evaluated
&& y < 5*h/6
y < 5*h/6Description
TRUEnever evaluated
FALSEnever evaluated
)
0
612 return
never executed: return QInternal::DockCount;
QInternal::DockCount;
never executed: return QInternal::DockCount;
0
613 }
never executed: end of block
0
614 }-
615-
616-
617 if (nestingEnabled
nestingEnabledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
618 if (o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
619 if (x < w/3
x < w/3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
620 return
never executed: return QInternal::LeftDock;
QInternal::LeftDock;
never executed: return QInternal::LeftDock;
0
621 if (x > 2*w/3
x > 2*w/3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
622 return
never executed: return QInternal::RightDock;
QInternal::RightDock;
never executed: return QInternal::RightDock;
0
623 if (y < h/2
y < h/2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
624 return
never executed: return QInternal::TopDock;
QInternal::TopDock;
never executed: return QInternal::TopDock;
0
625 return
never executed: return QInternal::BottomDock;
QInternal::BottomDock;
never executed: return QInternal::BottomDock;
0
626 } else {-
627-
628-
629-
630-
631-
632-
633-
634 if (y < h/3
y < h/3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
635 return
never executed: return QInternal::TopDock;
QInternal::TopDock;
never executed: return QInternal::TopDock;
0
636 if (y > 2*h/3
y > 2*h/3Description
TRUEnever evaluated
FALSEnever evaluated
)
0
637 return
never executed: return QInternal::BottomDock;
QInternal::BottomDock;
never executed: return QInternal::BottomDock;
0
638 if (x < w/2
x < w/2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
639 return
never executed: return QInternal::LeftDock;
QInternal::LeftDock;
never executed: return QInternal::LeftDock;
0
640 return
never executed: return QInternal::RightDock;
QInternal::RightDock;
never executed: return QInternal::RightDock;
0
641 }-
642 } else {-
643 if (o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
644 return
never executed: return x < w/2 ? QInternal::LeftDock : QInternal::RightDock;
x < w/2
never executed: return x < w/2 ? QInternal::LeftDock : QInternal::RightDock;
0
645 ? QInternal::LeftDock
never executed: return x < w/2 ? QInternal::LeftDock : QInternal::RightDock;
0
646 : QInternal::RightDock;
never executed: return x < w/2 ? QInternal::LeftDock : QInternal::RightDock;
0
647 } else {-
648 return
never executed: return y < h/2 ? QInternal::TopDock : QInternal::BottomDock;
y < h/2
never executed: return y < h/2 ? QInternal::TopDock : QInternal::BottomDock;
0
649 ? QInternal::TopDock
never executed: return y < h/2 ? QInternal::TopDock : QInternal::BottomDock;
0
650 : QInternal::BottomDock;
never executed: return y < h/2 ? QInternal::TopDock : QInternal::BottomDock;
0
651 }-
652 }-
653}-
654-
655QList<int> QDockAreaLayoutInfo::gapIndex(const QPoint& _pos,-
656 bool nestingEnabled, TabMode tabMode) const-
657{-
658 QList<int> result;-
659 QRect item_rect;-
660 int item_index = 0;-
661-
662-
663 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
664 item_rect = tabContentRect();-
665 }
never executed: end of block
else
0
666-
667 {-
668 int pos = pick(o, _pos);-
669-
670 int last = -1;-
671 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
672 const QDockAreaLayoutItem &item = item_list.at(i);-
673 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
674 continue;
never executed: continue;
0
675-
676 last = i;-
677-
678 if (item.pos + item.size < pos
item.pos + item.size < posDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
679 continue;
never executed: continue;
0
680-
681 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
682-
683 && !item.subinfo->tabbed
!item.subinfo->tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
0
684-
685 ) {-
686 result = item.subinfo->gapIndex(_pos, nestingEnabled,-
687 tabMode);-
688 result.prepend(i);-
689 return
never executed: return result;
result;
never executed: return result;
0
690 }-
691-
692 item_rect = itemRect(i);-
693 item_index = i;-
694 break;
never executed: break;
0
695 }-
696-
697 if (item_rect.isNull()
item_rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
698 result.append(last + 1);-
699 return
never executed: return result;
result;
never executed: return result;
0
700 }-
701 }
never executed: end of block
0
702-
703 ((!(!item_rect.isNull())) ? qt_assert("!item_rect.isNull()",__FILE__,793) : qt_noop());-
704-
705 QInternal::DockPosition dock_pos-
706 = dockPosHelper(item_rect, _pos, o, nestingEnabled, tabMode);-
707-
708 switch (dock_pos) {-
709 case
never executed: case QInternal::LeftDock:
QInternal::LeftDock:
never executed: case QInternal::LeftDock:
0
710 if (o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
711 result << item_index;
never executed: result << item_index;
0
712 else-
713 result << item_index << 0;
never executed: result << item_index << 0;
0
714-
715 break;
never executed: break;
0
716 case
never executed: case QInternal::RightDock:
QInternal::RightDock:
never executed: case QInternal::RightDock:
0
717 if (o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
718 result << item_index + 1;
never executed: result << item_index + 1;
0
719 else-
720 result << item_index << 1;
never executed: result << item_index << 1;
0
721 break;
never executed: break;
0
722 case
never executed: case QInternal::TopDock:
QInternal::TopDock:
never executed: case QInternal::TopDock:
0
723 if (o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
724 result << item_index << 0;
never executed: result << item_index << 0;
0
725 else-
726 result << item_index;
never executed: result << item_index;
0
727 break;
never executed: break;
0
728 case
never executed: case QInternal::BottomDock:
QInternal::BottomDock:
never executed: case QInternal::BottomDock:
0
729 if (o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
730 result << item_index << 1;
never executed: result << item_index << 1;
0
731 else-
732 result << item_index + 1;
never executed: result << item_index + 1;
0
733 break;
never executed: break;
0
734 case
never executed: case QInternal::DockCount:
QInternal::DockCount:
never executed: case QInternal::DockCount:
0
735 result << (-item_index - 1) << 0;-
736-
737-
738 break;
never executed: break;
0
739 default
never executed: default:
:
never executed: default:
0
740 break;
never executed: break;
0
741 }-
742-
743 return
never executed: return result;
result;
never executed: return result;
0
744}-
745-
746static inline int shrink(QLayoutStruct &ls, int delta)-
747{-
748 if (ls.empty
ls.emptyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
749 return
never executed: return 0;
0;
never executed: return 0;
0
750 int old_size = ls.size;-
751 ls.size = qMax(ls.size - delta, ls.minimumSize);-
752 return
never executed: return old_size - ls.size;
old_size - ls.size;
never executed: return old_size - ls.size;
0
753}-
754-
755static inline int grow(QLayoutStruct &ls, int delta)-
756{-
757 if (ls.empty
ls.emptyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
758 return
never executed: return 0;
0;
never executed: return 0;
0
759 int old_size = ls.size;-
760 ls.size = qMin(ls.size + delta, ls.maximumSize);-
761 return
never executed: return ls.size - old_size;
ls.size - old_size;
never executed: return ls.size - old_size;
0
762}-
763-
764static int separatorMoveHelper(QVector<QLayoutStruct> &list, int index, int delta, int sep)-
765{-
766-
767 int pos = -1;-
768 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
769 const QLayoutStruct &ls = list.at(i);-
770 if (!ls.empty
!ls.emptyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
771 pos = ls.pos;-
772 break;
never executed: break;
0
773 }-
774 }
never executed: end of block
0
775 if (pos == -1
pos == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
776 return
never executed: return 0;
0;
never executed: return 0;
0
777-
778 if (delta > 0
delta > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
779 int growlimit = 0;-
780 for (int i = 0; i<=index
i<=indexDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
781 const QLayoutStruct &ls = list.at(i);-
782 if (ls.empty
ls.emptyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
783 continue;
never executed: continue;
0
784 if (ls.maximumSize == QLAYOUTSIZE_MAX
ls.maximumSize...LAYOUTSIZE_MAXDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
785 growlimit = QLAYOUTSIZE_MAX;-
786 break;
never executed: break;
0
787 }-
788 growlimit += ls.maximumSize - ls.size;-
789 }
never executed: end of block
0
790 if (delta > growlimit
delta > growlimitDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
791 delta = growlimit;
never executed: delta = growlimit;
0
792-
793 int d = 0;-
794 for (int i = index + 1; d < delta
d < deltaDescription
TRUEnever evaluated
FALSEnever evaluated
&& i < list.count()
i < list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
795 d += shrink(list[i], delta - d);
never executed: d += shrink(list[i], delta - d);
0
796 delta = d;-
797 d = 0;-
798 for (int i = index; d < delta
d < deltaDescription
TRUEnever evaluated
FALSEnever evaluated
&& i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i)
0
799 d += grow(list[i], delta - d);
never executed: d += grow(list[i], delta - d);
0
800 }
never executed: end of block
else if (delta < 0
delta < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
801 int growlimit = 0;-
802 for (int i = index + 1; i < list.count()
i < list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
803 const QLayoutStruct &ls = list.at(i);-
804 if (ls.empty
ls.emptyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
805 continue;
never executed: continue;
0
806 if (ls.maximumSize == QLAYOUTSIZE_MAX
ls.maximumSize...LAYOUTSIZE_MAXDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
807 growlimit = QLAYOUTSIZE_MAX;-
808 break;
never executed: break;
0
809 }-
810 growlimit += ls.maximumSize - ls.size;-
811 }
never executed: end of block
0
812 if (-
-delta > growlimitDescription
TRUEnever evaluated
FALSEnever evaluated
delta > growlimit
-delta > growlimitDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
813 delta = -growlimit;
never executed: delta = -growlimit;
0
814-
815 int d = 0;-
816 for (int i = index; d < -delta
d < -deltaDescription
TRUEnever evaluated
FALSEnever evaluated
&& i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i)
0
817 d += shrink(list[i], -delta - d);
never executed: d += shrink(list[i], -delta - d);
0
818 delta = -d;-
819 d = 0;-
820 for (int i = index + 1; d < -delta
d < -deltaDescription
TRUEnever evaluated
FALSEnever evaluated
&& i < list.count()
i < list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
821 d += grow(list[i], -delta - d);
never executed: d += grow(list[i], -delta - d);
0
822 }
never executed: end of block
0
823-
824-
825 bool first = true;-
826 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
827 QLayoutStruct &ls = list[i];-
828 if (ls.empty
ls.emptyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
829 ls.pos = pos + (first
firstDescription
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep);
0
830 continue;
never executed: continue;
0
831 }-
832 if (!first
!firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
833 pos += sep;
never executed: pos += sep;
0
834 ls.pos = pos;-
835 pos += ls.size;-
836 first = false;-
837 }
never executed: end of block
0
838-
839 return
never executed: return delta;
delta;
never executed: return delta;
0
840}-
841-
842int QDockAreaLayoutInfo::separatorMove(int index, int delta)-
843{-
844-
845 ((!(!tabbed)) ? qt_assert("!tabbed",__FILE__,935) : qt_noop());-
846-
847-
848 QVector<QLayoutStruct> list(item_list.size());-
849 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
850 const QDockAreaLayoutItem &item = item_list.at(i);-
851 QLayoutStruct &ls = list[i];-
852 ((!(!(item.flags & QDockAreaLayoutItem::GapItem))) ? qt_assert("!(item.flags & QDockAreaLayoutItem::GapItem)",__FILE__,942) : qt_noop());-
853 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
854 ls.empty = true;-
855 }
never executed: end of block
else {
0
856 const int separatorSpace = item.hasFixedSize(o)
item.hasFixedSize(o)Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : *sep;
0
857 ls.empty = false;-
858 ls.pos = item.pos;-
859 ls.size = item.size + separatorSpace;-
860 ls.minimumSize = pick(o, item.minimumSize()) + separatorSpace;-
861 ls.maximumSize = pick(o, item.maximumSize()) + separatorSpace;-
862-
863 }
never executed: end of block
0
864 }-
865-
866-
867 delta = separatorMoveHelper(list, index, delta, 0 );-
868-
869 for (int i = 0; i < list.size()
i < list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
870 QDockAreaLayoutItem &item = item_list[i];-
871 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
872 continue;
never executed: continue;
0
873 QLayoutStruct &ls = list[i];-
874 const int separatorSpace = item.hasFixedSize(o)
item.hasFixedSize(o)Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : *sep;
0
875 item.size = ls.size - separatorSpace;-
876 item.pos = ls.pos;-
877 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
878 item.subinfo->rect = itemRect(i);-
879 item.subinfo->fitItems();-
880 }
never executed: end of block
0
881 }
never executed: end of block
0
882-
883 return
never executed: return delta;
delta;
never executed: return delta;
0
884}-
885-
886void QDockAreaLayoutInfo::unnest(int index)-
887{-
888 QDockAreaLayoutItem &item = item_list[index];-
889 if (item.subinfo == 0
item.subinfo == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
890 return;
never executed: return;
0
891 if (item.subinfo->item_list.count() > 1
item.subinfo->...st.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
892 return;
never executed: return;
0
893-
894 if (item.subinfo->item_list.count() == 0
item.subinfo->...t.count() == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
895 item_list.removeAt(index);-
896 }
never executed: end of block
else if (item.subinfo->item_list.count() == 1
item.subinfo->...t.count() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
897 QDockAreaLayoutItem &child = item.subinfo->item_list.first();-
898 if (child.widgetItem != 0
child.widgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
899 item.widgetItem = child.widgetItem;-
900 delete item.subinfo;-
901 item.subinfo = 0;-
902 }
never executed: end of block
else if (child.subinfo != 0
child.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
903 QDockAreaLayoutInfo *tmp = item.subinfo;-
904 item.subinfo = child.subinfo;-
905 child.subinfo = 0;-
906 tmp->item_list.clear();-
907 delete tmp;-
908 }
never executed: end of block
0
909 }
never executed: end of block
0
910}
never executed: end of block
0
911-
912void QDockAreaLayoutInfo::remove(const QList<int> &path)-
913{-
914 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,1004) : qt_noop());-
915-
916 if (path.count() > 1
path.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
917 const int index = path.first();-
918 QDockAreaLayoutItem &item = item_list[index];-
919 ((!(item.subinfo != 0)) ? qt_assert("item.subinfo != 0",__FILE__,1009) : qt_noop());-
920 item.subinfo->remove(path.mid(1));-
921 unnest(index);-
922 }
never executed: end of block
else {
0
923 int index = path.first();-
924 item_list.removeAt(index);-
925 }
never executed: end of block
0
926}-
927-
928QLayoutItem *QDockAreaLayoutInfo::plug(const QList<int> &path)-
929{-
930 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,1020) : qt_noop());-
931-
932 int index = path.first();-
933 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
934 index = -index - 1;
never executed: index = -index - 1;
0
935-
936 if (path.count() > 1
path.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
937 QDockAreaLayoutItem &item = item_list[index];-
938 ((!(item.subinfo != 0)) ? qt_assert("item.subinfo != 0",__FILE__,1028) : qt_noop());-
939 return
never executed: return item.subinfo->plug(path.mid(1));
item.subinfo->plug(path.mid(1));
never executed: return item.subinfo->plug(path.mid(1));
0
940 }-
941-
942 QDockAreaLayoutItem &item = item_list[index];-
943-
944 ((!(item.widgetItem != 0)) ? qt_assert("item.widgetItem != 0",__FILE__,1034) : qt_noop());-
945 ((!(item.flags & QDockAreaLayoutItem::GapItem)) ? qt_assert("item.flags & QDockAreaLayoutItem::GapItem",__FILE__,1035) : qt_noop());-
946 item.flags &= ~QDockAreaLayoutItem::GapItem;-
947-
948 QRect result;-
949-
950-
951 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
952 }
never executed: end of block
else
0
953-
954 {-
955 int prev = this->prev(index);-
956 int next = this->next(index);-
957-
958 if (prev != -1
prev != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)
!(item_list.at...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
959 item.pos += *sep;-
960 item.size -= *sep;-
961 }
never executed: end of block
0
962 if (next != -1
next != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem)
!(item_list.at...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
963 item.size -= *sep;
never executed: item.size -= *sep;
0
964-
965 QPoint pos;-
966 rpick(o, pos) = item.pos;-
967 rperp(o, pos) = perp(o, rect.topLeft());-
968 QSize s;-
969 rpick(o, s) = item.size;-
970 rperp(o, s) = perp(o, rect.size());-
971 result = QRect(pos, s);-
972 }
never executed: end of block
0
973-
974 return
never executed: return item.widgetItem;
item.widgetItem;
never executed: return item.widgetItem;
0
975}-
976-
977QLayoutItem *QDockAreaLayoutInfo::unplug(const QList<int> &path)-
978{-
979 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,1069) : qt_noop());-
980-
981 const int index = path.first();-
982 if (path.count() > 1
path.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
983 QDockAreaLayoutItem &item = item_list[index];-
984 ((!(item.subinfo != 0)) ? qt_assert("item.subinfo != 0",__FILE__,1074) : qt_noop());-
985 return
never executed: return item.subinfo->unplug(path.mid(1));
item.subinfo->unplug(path.mid(1));
never executed: return item.subinfo->unplug(path.mid(1));
0
986 }-
987-
988 QDockAreaLayoutItem &item = item_list[index];-
989 int prev = this->prev(index);-
990 int next = this->next(index);-
991-
992 ((!(!(item.flags & QDockAreaLayoutItem::GapItem))) ? qt_assert("!(item.flags & QDockAreaLayoutItem::GapItem)",__FILE__,1082) : qt_noop());-
993 item.flags |= QDockAreaLayoutItem::GapItem;-
994-
995-
996 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
997 }
never executed: end of block
else
0
998-
999 {-
1000 if (prev != -1
prev != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)
!(item_list.at...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1001 item.pos -= *sep;-
1002 item.size += *sep;-
1003 }
never executed: end of block
0
1004 if (next != -1
next != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem)
!(item_list.at...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1005 item.size += *sep;
never executed: item.size += *sep;
0
1006 }
never executed: end of block
0
1007-
1008 return
never executed: return item.widgetItem;
item.widgetItem;
never executed: return item.widgetItem;
0
1009}-
1010-
1011-
1012-
1013quintptr QDockAreaLayoutInfo::currentTabId() const-
1014{-
1015 if (!tabbed
!tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
|| tabBar == 0
tabBar == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1016 return
never executed: return 0;
0;
never executed: return 0;
0
1017-
1018 int index = tabBar->currentIndex();-
1019 if (index == -1
index == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1020 return
never executed: return 0;
0;
never executed: return 0;
0
1021-
1022 return
never executed: return qvariant_cast<quintptr>(tabBar->tabData(index));
qvariant_cast<quintptr>(tabBar->tabData(index));
never executed: return qvariant_cast<quintptr>(tabBar->tabData(index));
0
1023}-
1024-
1025void QDockAreaLayoutInfo::setCurrentTab(QWidget *widget)-
1026{-
1027 setCurrentTabId(reinterpret_cast<quintptr>(widget));-
1028}
never executed: end of block
0
1029-
1030void QDockAreaLayoutInfo::setCurrentTabId(quintptr id)-
1031{-
1032 if (!tabbed
!tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
|| tabBar == 0
tabBar == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1033 return;
never executed: return;
0
1034-
1035 for (int i = 0; i < tabBar->count()
i < tabBar->count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1036 if (qvariant_cast<quintptr>(tabBar->tabData(i)) == id
qvariant_cast<...Data(i)) == idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1037 tabBar->setCurrentIndex(i);-
1038 return;
never executed: return;
0
1039 }-
1040 }
never executed: end of block
0
1041}
never executed: end of block
0
1042-
1043-
1044-
1045static QRect dockedGeometry(QWidget *widget)-
1046{-
1047 int titleHeight = 0;-
1048-
1049 QDockWidgetLayout *layout-
1050 = qobject_cast<QDockWidgetLayout*>(widget->layout());-
1051 if(layout != 0
layout != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& layout->nativeWindowDeco()
layout->nativeWindowDeco()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1052 titleHeight = layout->titleHeight();
never executed: titleHeight = layout->titleHeight();
0
1053-
1054 QRect result = widget->geometry();-
1055 result.adjust(0, -titleHeight, 0, 0);-
1056 return
never executed: return result;
result;
never executed: return result;
0
1057}-
1058-
1059bool QDockAreaLayoutInfo::insertGap(const QList<int> &path, QLayoutItem *dockWidgetItem)-
1060{-
1061 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,1151) : qt_noop());-
1062-
1063 bool insert_tabbed = false;-
1064 int index = path.first();-
1065 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1066 insert_tabbed = true;-
1067 index = -index - 1;-
1068 }
never executed: end of block
0
1069-
1070-
1071-
1072 if (path.count() > 1
path.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1073 QDockAreaLayoutItem &item = item_list[index];-
1074-
1075 if (item.subinfo == 0
item.subinfo == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1076-
1077 || (item.subinfo->tabbed
item.subinfo->tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
&& !insert_tabbed
!insert_tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1078-
1079 ) {-
1080-
1081-
1082-
1083 QDockAreaLayoutInfo *subinfo = item.subinfo;-
1084 QLayoutItem *widgetItem = item.widgetItem;-
1085 QPlaceHolderItem *placeHolderItem = item.placeHolderItem;-
1086 QRect r = subinfo == 0
subinfo == 0Description
TRUEnever evaluated
FALSEnever evaluated
? widgetItem
widgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
? dockedGeometry(widgetItem->widget()) : placeHolderItem->topLevelRect : subinfo->rect;
0
1087-
1088 Qt::Orientation opposite = o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
? Qt::Vertical : Qt::Horizontal;
0
1089-
1090-
1091-
1092 QDockAreaLayoutInfo *new_info-
1093 = new QDockAreaLayoutInfo(sep, dockPos, opposite, tabBarShape, mainWindow);-
1094-
1095-
1096 item.subinfo = new_info;-
1097 item.widgetItem = 0;-
1098 item.placeHolderItem = 0;-
1099-
1100 QDockAreaLayoutItem new_item-
1101 = widgetItem == 0
widgetItem == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1102 ? QDockAreaLayoutItem(subinfo)-
1103 : widgetItem
widgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
? QDockAreaLayoutItem(widgetItem) : QDockAreaLayoutItem(placeHolderItem);
0
1104 new_item.size = pick(opposite, r.size());-
1105 new_item.pos = pick(opposite, r.topLeft());-
1106 new_info->item_list.append(new_item);-
1107-
1108 if (insert_tabbed
insert_tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1109 new_info->tabbed = true;-
1110 }
never executed: end of block
0
1111-
1112 }
never executed: end of block
0
1113-
1114 return
never executed: return item.subinfo->insertGap(path.mid(1), dockWidgetItem);
item.subinfo->insertGap(path.mid(1), dockWidgetItem);
never executed: return item.subinfo->insertGap(path.mid(1), dockWidgetItem);
0
1115 }-
1116-
1117-
1118 QDockAreaLayoutItem gap_item;-
1119 gap_item.flags |= QDockAreaLayoutItem::GapItem;-
1120 gap_item.widgetItem = dockWidgetItem;-
1121-
1122-
1123 if (!tabbed
!tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1124-
1125 {-
1126 int prev = this->prev(index);-
1127 int next = this->next(index - 1);-
1128-
1129 int space = 0;-
1130 if (isEmpty()
isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1131-
1132 switch (dockPos) {-
1133 case
never executed: case QInternal::LeftDock:
QInternal::LeftDock:
never executed: case QInternal::LeftDock:
0
1134 case
never executed: case QInternal::RightDock:
QInternal::RightDock:
never executed: case QInternal::RightDock:
0
1135 if (o == Qt::Vertical
o == Qt::VerticalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1136-
1137 space = pick(Qt::Vertical, rect.size());-
1138 }
never executed: end of block
else {
0
1139 space = pick(Qt::Horizontal, dockWidgetItem->widget()->size());-
1140 }
never executed: end of block
0
1141 break;
never executed: break;
0
1142 case
never executed: case QInternal::TopDock:
QInternal::TopDock:
never executed: case QInternal::TopDock:
0
1143 case
never executed: case QInternal::BottomDock:
QInternal::BottomDock:
never executed: case QInternal::BottomDock:
0
1144 default
never executed: default:
:
never executed: default:
0
1145 if (o == Qt::Horizontal
o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1146-
1147 space = pick(Qt::Horizontal, rect.size());-
1148 }
never executed: end of block
else {
0
1149 space = pick(Qt::Vertical, dockWidgetItem->widget()->size());-
1150 }
never executed: end of block
0
1151 break;
never executed: break;
0
1152 }-
1153 } else {-
1154 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1155 const QDockAreaLayoutItem &item = item_list.at(i);-
1156 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1157 continue;
never executed: continue;
0
1158 ((!(!(item.flags & QDockAreaLayoutItem::GapItem))) ? qt_assert("!(item.flags & QDockAreaLayoutItem::GapItem)",__FILE__,1248) : qt_noop());-
1159 space += item.size - pick(o, item.minimumSize());-
1160 }
never executed: end of block
0
1161 }
never executed: end of block
0
1162-
1163-
1164 int gap_size = 0;-
1165 int sep_size = 0;-
1166 if (isEmpty()
isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1167 gap_size = space;-
1168 sep_size = 0;-
1169 }
never executed: end of block
else {
0
1170 QRect r = dockedGeometry(dockWidgetItem->widget());-
1171 gap_size = pick(o, r.size());-
1172 if (prev != -1
prev != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)
!(item_list.at...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1173 sep_size += *sep;
never executed: sep_size += *sep;
0
1174 if (next != -1
next != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem)
!(item_list.at...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1175 sep_size += *sep;
never executed: sep_size += *sep;
0
1176 }
never executed: end of block
0
1177 if (gap_size + sep_size > space
gap_size + sep_size > spaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1178 gap_size = pick(o, gap_item.minimumSize());
never executed: gap_size = pick(o, gap_item.minimumSize());
0
1179 gap_item.size = gap_size + sep_size;-
1180 }
never executed: end of block
0
1181-
1182-
1183 item_list.insert(index, gap_item);-
1184-
1185-
1186-
1187 return
never executed: return true;
true;
never executed: return true;
0
1188}-
1189-
1190QDockAreaLayoutInfo *QDockAreaLayoutInfo::info(QWidget *widget)-
1191{-
1192 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1193 const QDockAreaLayoutItem &item = item_list.at(i);-
1194 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1195 continue;
never executed: continue;
0
1196-
1197-
1198 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
&& widget == tabBar
widget == tabBarDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1199 return
never executed: return this;
this;
never executed: return this;
0
1200-
1201-
1202 if (item.widgetItem != 0
item.widgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& item.widgetItem->widget() == widget
item.widgetIte...et() == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1203 return
never executed: return this;
this;
never executed: return this;
0
1204-
1205 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1206 if (QDockAreaLayoutInfo *result = item.subinfo->info(widget)
QDockAreaLayou...->info(widget)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1207 return
never executed: return result;
result;
never executed: return result;
0
1208 }
never executed: end of block
0
1209 }
never executed: end of block
0
1210-
1211 return
never executed: return 0;
0;
never executed: return 0;
0
1212}-
1213-
1214QDockAreaLayoutInfo *QDockAreaLayoutInfo::info(const QList<int> &path)-
1215{-
1216 int index = path.first();-
1217 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1218 index = -index - 1;
never executed: index = -index - 1;
0
1219 if (index >= item_list.count()
index >= item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1220 return
never executed: return this;
this;
never executed: return this;
0
1221 if (path.count() == 1
path.count() == 1Description
TRUEnever evaluated
FALSEnever evaluated
|| item_list[index].subinfo == 0
item_list[index].subinfo == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1222 return
never executed: return this;
this;
never executed: return this;
0
1223 return
never executed: return item_list[index].subinfo->info(path.mid(1));
item_list[index].subinfo->info(path.mid(1));
never executed: return item_list[index].subinfo->info(path.mid(1));
0
1224}-
1225-
1226QRect QDockAreaLayoutInfo::itemRect(int index) const-
1227{-
1228 const QDockAreaLayoutItem &item = item_list.at(index);-
1229-
1230 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1231 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
1232-
1233 QRect result;-
1234-
1235-
1236 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1237 if (tabId(item) == currentTabId()
tabId(item) == currentTabId()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1238 result = tabContentRect();
never executed: result = tabContentRect();
0
1239 }
never executed: end of block
else
0
1240-
1241 {-
1242 QPoint pos;-
1243 rpick(o, pos) = item.pos;-
1244 rperp(o, pos) = perp(o, rect.topLeft());-
1245 QSize s;-
1246 rpick(o, s) = item.size;-
1247 rperp(o, s) = perp(o, rect.size());-
1248 result = QRect(pos, s);-
1249 }
never executed: end of block
0
1250-
1251 return
never executed: return result;
result;
never executed: return result;
0
1252}-
1253-
1254QRect QDockAreaLayoutInfo::itemRect(const QList<int> &path) const-
1255{-
1256 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,1346) : qt_noop());-
1257-
1258 const int index = path.first();-
1259 if (path.count() > 1
path.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1260 const QDockAreaLayoutItem &item = item_list.at(index);-
1261 ((!(item.subinfo != 0)) ? qt_assert("item.subinfo != 0",__FILE__,1351) : qt_noop());-
1262 return
never executed: return item.subinfo->itemRect(path.mid(1));
item.subinfo->itemRect(path.mid(1));
never executed: return item.subinfo->itemRect(path.mid(1));
0
1263 }-
1264-
1265 return
never executed: return itemRect(index);
itemRect(index);
never executed: return itemRect(index);
0
1266}-
1267-
1268QRect QDockAreaLayoutInfo::separatorRect(int index) const-
1269{-
1270-
1271 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1272 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
1273-
1274-
1275 const QDockAreaLayoutItem &item = item_list.at(index);-
1276 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1277 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
1278-
1279 QPoint pos = rect.topLeft();-
1280 rpick(o, pos) = item.pos + item.size;-
1281 QSize s = rect.size();-
1282 rpick(o, s) = *sep;-
1283-
1284 return
never executed: return QRect(pos, s);
QRect(pos, s);
never executed: return QRect(pos, s);
0
1285}-
1286-
1287QRect QDockAreaLayoutInfo::separatorRect(const QList<int> &path) const-
1288{-
1289 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,1379) : qt_noop());-
1290-
1291 const int index = path.first();-
1292 if (path.count() > 1
path.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1293 const QDockAreaLayoutItem &item = item_list.at(index);-
1294 ((!(item.subinfo != 0)) ? qt_assert("item.subinfo != 0",__FILE__,1384) : qt_noop());-
1295 return
never executed: return item.subinfo->separatorRect(path.mid(1));
item.subinfo->separatorRect(path.mid(1));
never executed: return item.subinfo->separatorRect(path.mid(1));
0
1296 }-
1297 return
never executed: return separatorRect(index);
separatorRect(index);
never executed: return separatorRect(index);
0
1298}-
1299-
1300QList<int> QDockAreaLayoutInfo::findSeparator(const QPoint &_pos) const-
1301{-
1302-
1303 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1304 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
1305-
1306-
1307 int pos = pick(o, _pos);-
1308-
1309 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1310 const QDockAreaLayoutItem &item = item_list.at(i);-
1311 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(item.flags & ...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
item.flags & QDockAreaLayoutItem::GapItem)
(item.flags & ...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1312 continue;
never executed: continue;
0
1313-
1314 if (item.pos + item.size > pos
item.pos + item.size > posDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1315 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1316 QList<int> result = item.subinfo->findSeparator(_pos);-
1317 if (!result.isEmpty()
!result.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1318 result.prepend(i);-
1319 return
never executed: return result;
result;
never executed: return result;
0
1320 } else {-
1321 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
1322 }-
1323 }-
1324 }
never executed: end of block
0
1325-
1326 int next = this->next(i);-
1327 if (next == -1
next == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(item_list.at(...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
item_list.at(next).flags & QDockAreaLayoutItem::GapItem)
(item_list.at(...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1328 continue;
never executed: continue;
0
1329-
1330 QRect sepRect = separatorRect(i);-
1331 if (!sepRect.isNull()
!sepRect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
&& *
*sep == 1Description
TRUEnever evaluated
FALSEnever evaluated
sep == 1
*sep == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1332 sepRect.adjust(-2, -2, 2, 2);
never executed: sepRect.adjust(-2, -2, 2, 2);
0
1333-
1334 if (sepRect.contains(_pos)
sepRect.contains(_pos)Description
TRUEnever evaluated
FALSEnever evaluated
&& !item.hasFixedSize(o)
!item.hasFixedSize(o)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1335 return
never executed: return QList<int>() << i;
QList<int>() << i;
never executed: return QList<int>() << i;
0
1336 }-
1337-
1338 }
never executed: end of block
0
1339-
1340 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
1341}-
1342-
1343QList<int> QDockAreaLayoutInfo::indexOfPlaceHolder(const QString &objectName) const-
1344{-
1345 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1346 const QDockAreaLayoutItem &item = item_list.at(i);-
1347-
1348 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1349 QList<int> result = item.subinfo->indexOfPlaceHolder(objectName);-
1350 if (!result.isEmpty()
!result.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1351 result.prepend(i);-
1352 return
never executed: return result;
result;
never executed: return result;
0
1353 }-
1354 continue;
never executed: continue;
0
1355 }-
1356-
1357 if (item.placeHolderItem != 0
item.placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& item.placeHolderItem->objectName == objectName
item.placeHold... == objectNameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1358 QList<int> result;-
1359 result << i;-
1360 return
never executed: return result;
result;
never executed: return result;
0
1361 }-
1362 }
never executed: end of block
0
1363-
1364 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
1365}-
1366-
1367QList<int> QDockAreaLayoutInfo::indexOf(QWidget *widget) const-
1368{-
1369 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1370 const QDockAreaLayoutItem &item = item_list.at(i);-
1371-
1372 if (item.placeHolderItem != 0
item.placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1373 continue;
never executed: continue;
0
1374-
1375 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1376 QList<int> result = item.subinfo->indexOf(widget);-
1377 if (!result.isEmpty()
!result.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1378 result.prepend(i);-
1379 return
never executed: return result;
result;
never executed: return result;
0
1380 }-
1381 continue;
never executed: continue;
0
1382 }-
1383-
1384 if (!(item.flags & QDockAreaLayoutItem::GapItem)
!(item.flags &...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
&& item.widgetItem
item.widgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& item.widgetItem->widget() == widget
item.widgetIte...et() == widgetDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1385 QList<int> result;-
1386 result << i;-
1387 return
never executed: return result;
result;
never executed: return result;
0
1388 }-
1389 }
never executed: end of block
0
1390-
1391 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
1392}-
1393-
1394QMainWindowLayout *QDockAreaLayoutInfo::mainWindowLayout() const-
1395{-
1396 QMainWindowLayout *result = qt_mainwindow_layout(mainWindow);-
1397 ((!(result != 0)) ? qt_assert("result != 0",__FILE__,1487) : qt_noop());-
1398 return
never executed: return result;
result;
never executed: return result;
0
1399}-
1400-
1401bool QDockAreaLayoutInfo::hasFixedSize() const-
1402{-
1403 return
never executed: return perp(o, minimumSize()) == perp(o, maximumSize());
perp(o, minimumSize()) == perp(o, maximumSize());
never executed: return perp(o, minimumSize()) == perp(o, maximumSize());
0
1404}-
1405-
1406-
1407void QDockAreaLayoutInfo::apply(bool animate)-
1408{-
1409 QWidgetAnimator &widgetAnimator = mainWindowLayout()->widgetAnimator;-
1410-
1411-
1412 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1413 QRect tab_rect;-
1414 QSize tbh = tabBarSizeHint();-
1415-
1416 if (!tbh.isNull()
!tbh.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1417 switch (tabBarShape) {-
1418 case
never executed: case QTabBar::RoundedNorth:
QTabBar::RoundedNorth:
never executed: case QTabBar::RoundedNorth:
0
1419 case
never executed: case QTabBar::TriangularNorth:
QTabBar::TriangularNorth:
never executed: case QTabBar::TriangularNorth:
0
1420 tab_rect = QRect(rect.left(), rect.top(), rect.width(), tbh.height());-
1421 break;
never executed: break;
0
1422 case
never executed: case QTabBar::RoundedSouth:
QTabBar::RoundedSouth:
never executed: case QTabBar::RoundedSouth:
0
1423 case
never executed: case QTabBar::TriangularSouth:
QTabBar::TriangularSouth:
never executed: case QTabBar::TriangularSouth:
0
1424 tab_rect = QRect(rect.left(), rect.bottom() - tbh.height() + 1,-
1425 rect.width(), tbh.height());-
1426 break;
never executed: break;
0
1427 case
never executed: case QTabBar::RoundedEast:
QTabBar::RoundedEast:
never executed: case QTabBar::RoundedEast:
0
1428 case
never executed: case QTabBar::TriangularEast:
QTabBar::TriangularEast:
never executed: case QTabBar::TriangularEast:
0
1429 tab_rect = QRect(rect.right() - tbh.width() + 1, rect.top(),-
1430 tbh.width(), rect.height());-
1431 break;
never executed: break;
0
1432 case
never executed: case QTabBar::RoundedWest:
QTabBar::RoundedWest:
never executed: case QTabBar::RoundedWest:
0
1433 case
never executed: case QTabBar::TriangularWest:
QTabBar::TriangularWest:
never executed: case QTabBar::TriangularWest:
0
1434 tab_rect = QRect(rect.left(), rect.top(),-
1435 tbh.width(), rect.height());-
1436 break;
never executed: break;
0
1437 default
never executed: default:
:
never executed: default:
0
1438 break;
never executed: break;
0
1439 }-
1440 }-
1441-
1442 widgetAnimator.animate(tabBar, tab_rect, animate);-
1443 }
never executed: end of block
0
1444-
1445-
1446 for (int i = 0; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1447 QDockAreaLayoutItem &item = item_list[i];-
1448-
1449 if (item.flags & QDockAreaLayoutItem::GapItem
item.flags & Q...tItem::GapItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1450 continue;
never executed: continue;
0
1451-
1452 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1453 item.subinfo->apply(animate);-
1454 continue;
never executed: continue;
0
1455 }-
1456-
1457 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1458 continue;
never executed: continue;
0
1459-
1460 ((!(item.widgetItem)) ? qt_assert("item.widgetItem",__FILE__,1550) : qt_noop());-
1461 QRect r = itemRect(i);-
1462 QWidget *w = item.widgetItem->widget();-
1463-
1464 QRect geo = w->geometry();-
1465 widgetAnimator.animate(w, r, animate);-
1466 if (!w->isHidden()
!w->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
&& w->window()->isVisible()
w->window()->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1467 QDockWidget *dw = qobject_cast<QDockWidget*>(w);-
1468 if (!r.isValid()
!r.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& geo.right() >= 0
geo.right() >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& geo.bottom() >= 0
geo.bottom() >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1469 dw->lower();-
1470 dw->visibilityChanged(false);-
1471 }
never executed: end of block
else if (r.isValid()
r.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1472 && (geo.right() < 0
geo.right() < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| geo.bottom() < 0
geo.bottom() < 0Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
1473 dw->visibilityChanged(true);-
1474 }
never executed: end of block
0
1475 }
never executed: end of block
0
1476 }
never executed: end of block
0
1477-
1478 if (*
*sep == 1Description
TRUEnever evaluated
FALSEnever evaluated
sep == 1
*sep == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1479 updateSeparatorWidgets();
never executed: updateSeparatorWidgets();
0
1480-
1481}
never executed: end of block
0
1482-
1483static void paintSep(QPainter *p, QWidget *w, const QRect &r, Qt::Orientation o, bool mouse_over)-
1484{-
1485 QStyleOption opt(0);-
1486 opt.state = QStyle::State_None;-
1487 if (w->isEnabled()
w->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1488 opt.state |= QStyle::State_Enabled;
never executed: opt.state |= QStyle::State_Enabled;
0
1489 if (o != Qt::Horizontal
o != Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1490 opt.state |= QStyle::State_Horizontal;
never executed: opt.state |= QStyle::State_Horizontal;
0
1491 if (mouse_over
mouse_overDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1492 opt.state |= QStyle::State_MouseOver;
never executed: opt.state |= QStyle::State_MouseOver;
0
1493 opt.rect = r;-
1494 opt.palette = w->palette();-
1495-
1496 w->style()->drawPrimitive(QStyle::PE_IndicatorDockWidgetResizeHandle, &opt, p, w);-
1497}
never executed: end of block
0
1498-
1499QRegion QDockAreaLayoutInfo::separatorRegion() const-
1500{-
1501 QRegion result;-
1502-
1503 if (isEmpty()
isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1504 return
never executed: return result;
result;
never executed: return result;
0
1505-
1506 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1507 return
never executed: return result;
result;
never executed: return result;
0
1508-
1509-
1510 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1511 const QDockAreaLayoutItem &item = item_list.at(i);-
1512-
1513 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1514 continue;
never executed: continue;
0
1515-
1516 int next = this->next(i);-
1517-
1518 if (item.subinfo
item.subinfoDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1519 result |= item.subinfo->separatorRegion();
never executed: result |= item.subinfo->separatorRegion();
0
1520-
1521 if (next == -1
next == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1522 break;
never executed: break;
0
1523 result |= separatorRect(i);-
1524 }
never executed: end of block
0
1525-
1526 return
never executed: return result;
result;
never executed: return result;
0
1527}-
1528-
1529void QDockAreaLayoutInfo::paintSeparators(QPainter *p, QWidget *widget,-
1530 const QRegion &clip,-
1531 const QPoint &mouse) const-
1532{-
1533 if (isEmpty()
isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1534 return;
never executed: return;
0
1535-
1536 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1537 return;
never executed: return;
0
1538-
1539-
1540 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1541 const QDockAreaLayoutItem &item = item_list.at(i);-
1542-
1543 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1544 continue;
never executed: continue;
0
1545-
1546 int next = this->next(i);-
1547 if ((
(item.flags & ...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
item.flags & QDockAreaLayoutItem::GapItem)
(item.flags & ...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
0
1548 || (next != -1
next != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(item_list.at(...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
item_list.at(next).flags & QDockAreaLayoutItem::GapItem)
(item_list.at(...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1549 continue;
never executed: continue;
0
1550-
1551 if (item.subinfo
item.subinfoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1552 if (clip.contains(item.subinfo->rect)
clip.contains(...subinfo->rect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1553 item.subinfo->paintSeparators(p, widget, clip, mouse);
never executed: item.subinfo->paintSeparators(p, widget, clip, mouse);
0
1554 }
never executed: end of block
0
1555-
1556 if (next == -1
next == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1557 break;
never executed: break;
0
1558 QRect r = separatorRect(i);-
1559 if (clip.contains(r)
clip.contains(r)Description
TRUEnever evaluated
FALSEnever evaluated
&& !item.hasFixedSize(o)
!item.hasFixedSize(o)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1560 paintSep(p, widget, r, o, r.contains(mouse));
never executed: paintSep(p, widget, r, o, r.contains(mouse));
0
1561 }
never executed: end of block
0
1562}
never executed: end of block
0
1563-
1564int QDockAreaLayoutInfo::next(int index) const-
1565{-
1566 for (int i = index + 1; i < item_list.size()
i < item_list.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1567 if (!item_list.at(i).skip()
!item_list.at(i).skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1568 return
never executed: return i;
i;
never executed: return i;
0
1569 }
never executed: end of block
0
1570 return
never executed: return -1;
-1;
never executed: return -1;
0
1571}-
1572-
1573int QDockAreaLayoutInfo::prev(int index) const-
1574{-
1575 for (int i = index - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
1576 if (!item_list.at(i).skip()
!item_list.at(i).skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1577 return
never executed: return i;
i;
never executed: return i;
0
1578 }
never executed: end of block
0
1579 return
never executed: return -1;
-1;
never executed: return -1;
0
1580}-
1581-
1582void QDockAreaLayoutInfo::tab(int index, QLayoutItem *dockWidgetItem)-
1583{-
1584-
1585-
1586-
1587-
1588 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1589 item_list.append(QDockAreaLayoutItem(dockWidgetItem));-
1590 updateTabBar();-
1591 setCurrentTab(dockWidgetItem->widget());-
1592 }
never executed: end of block
else {
0
1593 QDockAreaLayoutInfo *new_info-
1594 = new QDockAreaLayoutInfo(sep, dockPos, o, tabBarShape, mainWindow);-
1595 item_list[index].subinfo = new_info;-
1596 new_info->item_list.append(QDockAreaLayoutItem(item_list.at(index).widgetItem));-
1597 item_list[index].widgetItem = 0;-
1598 new_info->item_list.append(QDockAreaLayoutItem(dockWidgetItem));-
1599 new_info->tabbed = true;-
1600 new_info->updateTabBar();-
1601 new_info->setCurrentTab(dockWidgetItem->widget());-
1602 }
never executed: end of block
0
1603-
1604}-
1605-
1606void QDockAreaLayoutInfo::split(int index, Qt::Orientation orientation,-
1607 QLayoutItem *dockWidgetItem)-
1608{-
1609 if (orientation == o
orientation == oDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1610 item_list.insert(index + 1, QDockAreaLayoutItem(dockWidgetItem));-
1611 }
never executed: end of block
else {
0
1612-
1613-
1614-
1615 QDockAreaLayoutInfo *new_info-
1616 = new QDockAreaLayoutInfo(sep, dockPos, orientation, tabBarShape, mainWindow);-
1617 item_list[index].subinfo = new_info;-
1618 new_info->item_list.append(QDockAreaLayoutItem(item_list.at(index).widgetItem));-
1619 item_list[index].widgetItem = 0;-
1620 new_info->item_list.append(QDockAreaLayoutItem(dockWidgetItem));-
1621 }
never executed: end of block
0
1622}-
1623-
1624QDockAreaLayoutItem &QDockAreaLayoutInfo::item(const QList<int> &path)-
1625{-
1626 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,1716) : qt_noop());-
1627 const int index = path.first();-
1628 if (path.count() > 1
path.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1629 const QDockAreaLayoutItem &item = item_list[index];-
1630 ((!(item.subinfo != 0)) ? qt_assert("item.subinfo != 0",__FILE__,1720) : qt_noop());-
1631 return
never executed: return item.subinfo->item(path.mid(1));
item.subinfo->item(path.mid(1));
never executed: return item.subinfo->item(path.mid(1));
0
1632 }-
1633 return
never executed: return item_list[index];
item_list[index];
never executed: return item_list[index];
0
1634}-
1635-
1636QLayoutItem *QDockAreaLayoutInfo::itemAt(int *x, int index) const-
1637{-
1638 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1639 const QDockAreaLayoutItem &item = item_list.at(i);-
1640 if (item.placeHolderItem != 0
item.placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1641 continue;
never executed: continue;
0
1642 if (item.subinfo
item.subinfoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1643 if (QLayoutItem *ret = item.subinfo->itemAt(x, index)
QLayoutItem *r...emAt(x, index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1644 return
never executed: return ret;
ret;
never executed: return ret;
0
1645 }
never executed: end of block
else if (item.widgetItem
item.widgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1646 if ((*
(*x)++ == indexDescription
TRUEnever evaluated
FALSEnever evaluated
x)++ == index
(*x)++ == indexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1647 return
never executed: return item.widgetItem;
item.widgetItem;
never executed: return item.widgetItem;
0
1648 }
never executed: end of block
0
1649 }
never executed: end of block
0
1650 return
never executed: return 0;
0;
never executed: return 0;
0
1651}-
1652-
1653QLayoutItem *QDockAreaLayoutInfo::takeAt(int *x, int index)-
1654{-
1655 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1656 QDockAreaLayoutItem &item = item_list[i];-
1657 if (item.placeHolderItem != 0
item.placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1658 continue;
never executed: continue;
0
1659 else if (item.subinfo
item.subinfoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1660 if (QLayoutItem *ret = item.subinfo->takeAt(x, index)
QLayoutItem *r...keAt(x, index)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1661 unnest(i);-
1662 return
never executed: return ret;
ret;
never executed: return ret;
0
1663 }-
1664 }
never executed: end of block
else if (item.widgetItem
item.widgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1665 if ((*
(*x)++ == indexDescription
TRUEnever evaluated
FALSEnever evaluated
x)++ == index
(*x)++ == indexDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1666 item.placeHolderItem = new QPlaceHolderItem(item.widgetItem->widget());-
1667 QLayoutItem *ret = item.widgetItem;-
1668 item.widgetItem = 0;-
1669 if (item.size != -1
item.size != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1670 item.flags |= QDockAreaLayoutItem::KeepSize;
never executed: item.flags |= QDockAreaLayoutItem::KeepSize;
0
1671 return
never executed: return ret;
ret;
never executed: return ret;
0
1672 }-
1673 }
never executed: end of block
0
1674 }
never executed: end of block
0
1675 return
never executed: return 0;
0;
never executed: return 0;
0
1676}-
1677-
1678void QDockAreaLayoutInfo::deleteAllLayoutItems()-
1679{-
1680 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1681 QDockAreaLayoutItem &item= item_list[i];-
1682 if (item.subinfo
item.subinfoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1683 item.subinfo->deleteAllLayoutItems();-
1684 }
never executed: end of block
else {
0
1685 delete item.widgetItem;-
1686 item.widgetItem = 0;-
1687 }
never executed: end of block
0
1688 }-
1689}
never executed: end of block
0
1690-
1691void QDockAreaLayoutInfo::saveState(QDataStream &stream) const-
1692{-
1693-
1694 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1695 stream << (uchar) TabMarker;-
1696-
1697-
1698 quintptr id = currentTabId();-
1699 int index = -1;-
1700 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1701 if (tabId(item_list.at(i)) == id
tabId(item_list.at(i)) == idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1702 index = i;-
1703 break;
never executed: break;
0
1704 }-
1705 }
never executed: end of block
0
1706 stream << index;-
1707 }
never executed: end of block
else
0
1708-
1709 {-
1710 stream << (uchar) SequenceMarker;-
1711 }
never executed: end of block
0
1712-
1713 stream << (uchar) o << item_list.count();-
1714-
1715 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1716 const QDockAreaLayoutItem &item = item_list.at(i);-
1717 if (item.widgetItem != 0
item.widgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1718 stream << (uchar) WidgetMarker;-
1719 QWidget *w = item.widgetItem->widget();-
1720 QString name = w->objectName();-
1721 if (__builtin_expect(!!(name.isEmpty()), false)
__builtin_expe...pty()), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1722 QMessageLogger(__FILE__, 1812, __PRETTY_FUNCTION__).warning("QMainWindow::saveState(): 'objectName' not set for QDockWidget %p '%ls;",-
1723 w, static_cast<const wchar_t*>(static_cast<const void*>(QString(w->windowTitle()).utf16())));-
1724 }
never executed: end of block
0
1725 stream << name;-
1726-
1727 uchar flags = 0;-
1728 if (!w->isHidden()
!w->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1729 flags |= StateFlagVisible;
never executed: flags |= StateFlagVisible;
0
1730 if (w->isWindow()
w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1731 flags |= StateFlagFloating;
never executed: flags |= StateFlagFloating;
0
1732 stream << flags;-
1733-
1734 if (w->isWindow()
w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1735 const QRect geometry = w->geometry();-
1736 stream << geometry.x() << geometry.y() << geometry.width() << geometry.height();-
1737 }
never executed: end of block
else {
0
1738 stream << item.pos << item.size << pick(o, item.minimumSize())-
1739 << pick(o, item.maximumSize());-
1740 }
never executed: end of block
0
1741 } else if (item.placeHolderItem != 0
item.placeHolderItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1742 stream << (uchar) WidgetMarker;-
1743 stream << item.placeHolderItem->objectName;-
1744 uchar flags = 0;-
1745 if (!item.placeHolderItem->hidden
!item.placeHolderItem->hiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1746 flags |= StateFlagVisible;
never executed: flags |= StateFlagVisible;
0
1747 if (item.placeHolderItem->window
item.placeHolderItem->windowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1748 flags |= StateFlagFloating;
never executed: flags |= StateFlagFloating;
0
1749 stream << flags;-
1750 if (item.placeHolderItem->window
item.placeHolderItem->windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1751 QRect r = item.placeHolderItem->topLevelRect;-
1752 stream << r.x() << r.y() << r.width() << r.height();-
1753 }
never executed: end of block
else {
0
1754 stream << item.pos << item.size << (int)0 << (int)0;-
1755 }
never executed: end of block
0
1756 } else if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1757 stream << (uchar) SequenceMarker << item.pos << item.size << pick(o, item.minimumSize()) << pick(o, item.maximumSize());-
1758 item.subinfo->saveState(stream);-
1759 }
never executed: end of block
0
1760 }
never executed: end of block
0
1761}
never executed: end of block
0
1762-
1763static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos)-
1764{-
1765 switch (pos) {-
1766 case
never executed: case QInternal::LeftDock:
QInternal::LeftDock:
never executed: case QInternal::LeftDock:
return
never executed: return Qt::LeftDockWidgetArea;
Qt::LeftDockWidgetArea;
never executed: return Qt::LeftDockWidgetArea;
0
1767 case
never executed: case QInternal::RightDock:
QInternal::RightDock:
never executed: case QInternal::RightDock:
return
never executed: return Qt::RightDockWidgetArea;
Qt::RightDockWidgetArea;
never executed: return Qt::RightDockWidgetArea;
0
1768 case
never executed: case QInternal::TopDock:
QInternal::TopDock:
never executed: case QInternal::TopDock:
return
never executed: return Qt::TopDockWidgetArea;
Qt::TopDockWidgetArea;
never executed: return Qt::TopDockWidgetArea;
0
1769 case
never executed: case QInternal::BottomDock:
QInternal::BottomDock:
never executed: case QInternal::BottomDock:
return
never executed: return Qt::BottomDockWidgetArea;
Qt::BottomDockWidgetArea;
never executed: return Qt::BottomDockWidgetArea;
0
1770 default
never executed: default:
:
never executed: default:
break;
never executed: break;
0
1771 }-
1772 return
never executed: return Qt::NoDockWidgetArea;
Qt::NoDockWidgetArea;
never executed: return Qt::NoDockWidgetArea;
0
1773}-
1774-
1775bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> &widgets, bool testing)-
1776{-
1777 uchar marker;-
1778 stream >> marker;-
1779 if (marker != TabMarker
marker != TabMarkerDescription
TRUEnever evaluated
FALSEnever evaluated
&& marker != SequenceMarker
marker != SequenceMarkerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1780 return
never executed: return false;
false;
never executed: return false;
0
1781-
1782-
1783 tabbed = marker == TabMarker;-
1784-
1785 int index = -1;-
1786 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1787 stream >> index;
never executed: stream >> index;
0
1788-
1789-
1790 uchar orientation;-
1791 stream >> orientation;-
1792 o = static_cast<Qt::Orientation>(orientation);-
1793-
1794 int cnt;-
1795 stream >> cnt;-
1796-
1797 for (int i = 0; i < cnt
i < cntDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1798 uchar nextMarker;-
1799 stream >> nextMarker;-
1800 if (nextMarker == WidgetMarker
nextMarker == WidgetMarkerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1801 QString name;-
1802 uchar flags;-
1803 stream >> name >> flags;-
1804 if (name.isEmpty()
name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1805 int dummy;-
1806 stream >> dummy >> dummy >> dummy >> dummy;-
1807 continue;
never executed: continue;
0
1808 }-
1809-
1810 QDockWidget *widget = 0;-
1811 for (int j = 0; j < widgets.count()
j < widgets.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++j) {
0
1812 if (widgets.at(j)->objectName() == name
widgets.at(j)-...Name() == nameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1813 widget = widgets.takeAt(j);-
1814 break;
never executed: break;
0
1815 }-
1816 }
never executed: end of block
0
1817-
1818 if (widget == 0
widget == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1819 QPlaceHolderItem *placeHolder = new QPlaceHolderItem;-
1820 QDockAreaLayoutItem item(placeHolder);-
1821-
1822 placeHolder->objectName = name;-
1823 placeHolder->window = flags & StateFlagFloating;-
1824 placeHolder->hidden = !(flags & StateFlagVisible);-
1825 if (placeHolder->window
placeHolder->windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1826 int x, y, w, h;-
1827 stream >> x >> y >> w >> h;-
1828 placeHolder->topLevelRect = QRect(x, y, w, h);-
1829 }
never executed: end of block
else {
0
1830 int dummy;-
1831 stream >> item.pos >> item.size >> dummy >> dummy;-
1832 }
never executed: end of block
0
1833 if (item.size != -1
item.size != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1834 item.flags |= QDockAreaLayoutItem::KeepSize;
never executed: item.flags |= QDockAreaLayoutItem::KeepSize;
0
1835 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1836 item_list.append(item);
never executed: item_list.append(item);
0
1837 }
never executed: end of block
else {
0
1838 QDockAreaLayoutItem item(new QDockWidgetItem(widget));-
1839 if (flags & StateFlagFloating
flags & StateFlagFloatingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1840 bool drawer = false;-
1841-
1842-
1843-
1844-
1845-
1846-
1847 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1848 widget->hide();-
1849 if (!drawer
!drawerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1850 widget->setFloating(true);
never executed: widget->setFloating(true);
0
1851 }
never executed: end of block
0
1852-
1853 int x, y, w, h;-
1854 stream >> x >> y >> w >> h;-
1855 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1856 widget->setGeometry(QDockAreaLayout::constrainedRect(QRect(x, y, w, h), widget));
never executed: widget->setGeometry(QDockAreaLayout::constrainedRect(QRect(x, y, w, h), widget));
0
1857-
1858 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1859 widget->setVisible(flags & StateFlagVisible);-
1860 item_list.append(item);-
1861 }
never executed: end of block
0
1862 }
never executed: end of block
else {
0
1863 int dummy;-
1864 stream >> item.pos >> item.size >> dummy >> dummy;-
1865 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1866 item_list.append(item);-
1867 widget->setFloating(false);-
1868 widget->setVisible(flags & StateFlagVisible);-
1869 widget->dockLocationChanged(toDockWidgetArea(dockPos));-
1870 }
never executed: end of block
0
1871 }
never executed: end of block
0
1872 if (testing
testingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1873-
1874 delete item.widgetItem;-
1875 }
never executed: end of block
0
1876 }
never executed: end of block
0
1877 } else if (nextMarker == SequenceMarker
nextMarker == SequenceMarkerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1878 int dummy;-
1879-
1880-
1881-
1882 QDockAreaLayoutItem item(new QDockAreaLayoutInfo(sep, dockPos, o,-
1883 tabBarShape, mainWindow));-
1884 stream >> item.pos >> item.size >> dummy >> dummy;-
1885-
1886 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1887 item_list.append(item);
never executed: item_list.append(item);
0
1888-
1889-
1890 QDockAreaLayoutItem &lastItem = testing
testingDescription
TRUEnever evaluated
FALSEnever evaluated
? item : item_list.last();
0
1891-
1892 if (!lastItem.subinfo->restoreState(stream, widgets, testing)
!lastItem.subi...gets, testing)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1893 return
never executed: return false;
false;
never executed: return false;
0
1894-
1895 }
never executed: end of block
else {
0
1896 return
never executed: return false;
false;
never executed: return false;
0
1897 }-
1898 }-
1899-
1900-
1901 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
&& tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
&& index >= 0
index >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& index < item_list.count()
index < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1902 updateTabBar();-
1903 setCurrentTabId(tabId(item_list.at(index)));-
1904 }
never executed: end of block
0
1905 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
&& *
*sep == 1Description
TRUEnever evaluated
FALSEnever evaluated
sep == 1
*sep == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1906 updateSeparatorWidgets();
never executed: updateSeparatorWidgets();
0
1907-
1908-
1909 return
never executed: return true;
true;
never executed: return true;
0
1910}-
1911-
1912-
1913void QDockAreaLayoutInfo::updateSeparatorWidgets() const-
1914{-
1915 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1916 separatorWidgets.clear();-
1917 return;
never executed: return;
0
1918 }-
1919-
1920 int j = 0;-
1921 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1922 const QDockAreaLayoutItem &item = item_list.at(i);-
1923-
1924 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1925 continue;
never executed: continue;
0
1926-
1927 int next = this->next(i);-
1928 if ((
(item.flags & ...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
item.flags & QDockAreaLayoutItem::GapItem)
(item.flags & ...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
0
1929 || (next != -1
next != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(item_list.at(...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
item_list.at(next).flags & QDockAreaLayoutItem::GapItem)
(item_list.at(...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1930 continue;
never executed: continue;
0
1931-
1932 if (item.subinfo
item.subinfoDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1933 item.subinfo->updateSeparatorWidgets();-
1934 }
never executed: end of block
0
1935-
1936 if (next == -1
next == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1937 break;
never executed: break;
0
1938-
1939 QWidget *sepWidget;-
1940 if (j < separatorWidgets.size()
j < separatorWidgets.size()Description
TRUEnever evaluated
FALSEnever evaluated
&& separatorWidgets.at(j)
separatorWidgets.at(j)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1941 sepWidget = separatorWidgets.at(j);-
1942 }
never executed: end of block
else {
0
1943 sepWidget = mainWindowLayout()->getSeparatorWidget();-
1944 separatorWidgets.append(sepWidget);-
1945 }
never executed: end of block
0
1946 j++;-
1947-
1948-
1949 sepWidget->raise();-
1950-
1951 QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2);-
1952 sepWidget->setGeometry(sepRect);-
1953 sepWidget->setMask( QRegion(separatorRect(i).translated( - sepRect.topLeft())));-
1954 sepWidget->show();-
1955 }
never executed: end of block
0
1956-
1957 for (int k = j; k < separatorWidgets.size()
k < separatorWidgets.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++k) {
0
1958 separatorWidgets[k]->hide();-
1959 }
never executed: end of block
0
1960 separatorWidgets.resize(j);-
1961 ((!(separatorWidgets.size() == j)) ? qt_assert("separatorWidgets.size() == j",__FILE__,2059) : qt_noop());-
1962}
never executed: end of block
0
1963void QDockAreaLayoutInfo::reparentWidgets(QWidget *parent)-
1964{-
1965 if (tabBar
tabBarDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1966 tabBar->setParent(parent);
never executed: tabBar->setParent(parent);
0
1967-
1968 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1969 const QDockAreaLayoutItem &item = item_list.at(i);-
1970 if (item.flags & QDockAreaLayoutItem::GapItem
item.flags & Q...tItem::GapItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1971 continue;
never executed: continue;
0
1972 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1973 continue;
never executed: continue;
0
1974 if (item.subinfo
item.subinfoDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1975 item.subinfo->reparentWidgets(parent);
never executed: item.subinfo->reparentWidgets(parent);
0
1976 if (item.widgetItem
item.widgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1977 QWidget *w = item.widgetItem->widget();-
1978 if (w->parent() != parent
w->parent() != parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1979 bool hidden = w->isHidden();-
1980 w->setParent(parent);-
1981 if (!hidden
!hiddenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1982 w->show();
never executed: w->show();
0
1983 }
never executed: end of block
0
1984 }
never executed: end of block
0
1985 }
never executed: end of block
0
1986}
never executed: end of block
0
1987-
1988-
1989bool QDockAreaLayoutInfo::updateTabBar() const-
1990{-
1991 if (!tabbed
!tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1992 return
never executed: return false;
false;
never executed: return false;
0
1993-
1994 QDockAreaLayoutInfo *that = const_cast<QDockAreaLayoutInfo*>(this);-
1995-
1996 if (that->tabBar == 0
that->tabBar == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1997 that->tabBar = mainWindowLayout()->getTabBar();-
1998 that->tabBar->setShape(static_cast<QTabBar::Shape>(tabBarShape));-
1999 that->tabBar->setDrawBase(true);-
2000 }
never executed: end of block
0
2001-
2002 const QSignalBlocker blocker(tabBar);-
2003 bool gap = false;-
2004-
2005 const quintptr oldCurrentId = currentTabId();-
2006-
2007 int tab_idx = 0;-
2008 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2009 const QDockAreaLayoutItem &item = item_list.at(i);-
2010 if (item.skip()
item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2011 continue;
never executed: continue;
0
2012 if (item.flags & QDockAreaLayoutItem::GapItem
item.flags & Q...tItem::GapItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2013 gap = true;-
2014 continue;
never executed: continue;
0
2015 }-
2016 if (item.widgetItem == 0
item.widgetItem == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2017 continue;
never executed: continue;
0
2018-
2019 QDockWidget *dw = qobject_cast<QDockWidget*>(item.widgetItem->widget());-
2020 QString title = dw->d_func()->fixedWindowTitle;-
2021 quintptr id = tabId(item);-
2022 if (tab_idx == tabBar->count()
tab_idx == tabBar->count()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2023 tabBar->insertTab(tab_idx, title);-
2024-
2025 tabBar->setTabToolTip(tab_idx, title);-
2026-
2027 tabBar->setTabData(tab_idx, id);-
2028 }
never executed: end of block
else if (qvariant_cast<quintptr>(tabBar->tabData(tab_idx)) != id
qvariant_cast<...ab_idx)) != idDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2029 if (tab_idx + 1 < tabBar->count()
tab_idx + 1 < tabBar->count()Description
TRUEnever evaluated
FALSEnever evaluated
0
2030 && qvariant_cast<quintptr>(tabBar->tabData(tab_idx + 1)) == id
qvariant_cast<...dx + 1)) == idDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2031 tabBar->removeTab(tab_idx);
never executed: tabBar->removeTab(tab_idx);
0
2032 else {-
2033 tabBar->insertTab(tab_idx, title);-
2034-
2035 tabBar->setTabToolTip(tab_idx, title);-
2036-
2037 tabBar->setTabData(tab_idx, id);-
2038 }
never executed: end of block
0
2039 }-
2040-
2041 if (title != tabBar->tabText(tab_idx)
title != tabBa...bText(tab_idx)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2042 tabBar->setTabText(tab_idx, title);-
2043-
2044 tabBar->setTabToolTip(tab_idx, title);-
2045-
2046 }
never executed: end of block
0
2047-
2048 ++tab_idx;-
2049 }
never executed: end of block
0
2050-
2051 while (tab_idx < tabBar->count()
tab_idx < tabBar->count()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2052 tabBar->removeTab(tab_idx);-
2053 }
never executed: end of block
0
2054-
2055 if (oldCurrentId > 0
oldCurrentId > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& currentTabId() != oldCurrentId
currentTabId() != oldCurrentIdDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2056 that->setCurrentTabId(oldCurrentId);
never executed: that->setCurrentTabId(oldCurrentId);
0
2057-
2058 if (QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(tabBar->parent())
QDockWidgetGro...Bar->parent())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2059 dwgw->adjustFlags();
never executed: dwgw->adjustFlags();
0
2060-
2061-
2062 return
never executed: return ( (gap ? 1 : 0) + tabBar->count()) > 1;
( (gap ? 1 : 0) + tabBar->count()) > 1;
never executed: return ( (gap ? 1 : 0) + tabBar->count()) > 1;
0
2063}-
2064-
2065void QDockAreaLayoutInfo::setTabBarShape(int shape)-
2066{-
2067 if (shape == tabBarShape
shape == tabBarShapeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2068 return;
never executed: return;
0
2069 tabBarShape = shape;-
2070 if (tabBar != 0
tabBar != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2071 tabBar->setShape(static_cast<QTabBar::Shape>(shape));
never executed: tabBar->setShape(static_cast<QTabBar::Shape>(shape));
0
2072-
2073 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2074 QDockAreaLayoutItem &item = item_list[i];-
2075 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2076 item.subinfo->setTabBarShape(shape);
never executed: item.subinfo->setTabBarShape(shape);
0
2077 }
never executed: end of block
0
2078}
never executed: end of block
0
2079-
2080QSize QDockAreaLayoutInfo::tabBarMinimumSize() const-
2081{-
2082 if (!updateTabBar()
!updateTabBar()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2083 return
never executed: return QSize(0, 0);
QSize(0, 0);
never executed: return QSize(0, 0);
0
2084-
2085 return
never executed: return tabBar->minimumSizeHint();
tabBar->minimumSizeHint();
never executed: return tabBar->minimumSizeHint();
0
2086}-
2087-
2088QSize QDockAreaLayoutInfo::tabBarSizeHint() const-
2089{-
2090 if (!updateTabBar()
!updateTabBar()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2091 return
never executed: return QSize(0, 0);
QSize(0, 0);
never executed: return QSize(0, 0);
0
2092-
2093 return
never executed: return tabBar->sizeHint();
tabBar->sizeHint();
never executed: return tabBar->sizeHint();
0
2094}-
2095-
2096QSet<QTabBar*> QDockAreaLayoutInfo::usedTabBars() const-
2097{-
2098 QSet<QTabBar*> result;-
2099-
2100 if (tabbed
tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2101 updateTabBar();-
2102 result.insert(tabBar);-
2103 }
never executed: end of block
0
2104-
2105 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2106 const QDockAreaLayoutItem &item = item_list.at(i);-
2107 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2108 result += item.subinfo->usedTabBars();
never executed: result += item.subinfo->usedTabBars();
0
2109 }
never executed: end of block
0
2110-
2111 return
never executed: return result;
result;
never executed: return result;
0
2112}-
2113-
2114-
2115-
2116QSet<QWidget*> QDockAreaLayoutInfo::usedSeparatorWidgets() const-
2117{-
2118 QSet<QWidget*> result;-
2119 const int numSeparatorWidgets = separatorWidgets.count();-
2120 result.reserve(numSeparatorWidgets);-
2121-
2122 for (int i = 0; i < numSeparatorWidgets
i < numSeparatorWidgetsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2123 result << separatorWidgets.at(i);
never executed: result << separatorWidgets.at(i);
0
2124-
2125 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2126 const QDockAreaLayoutItem &item = item_list.at(i);-
2127 if (item.subinfo != 0
item.subinfo != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2128 result += item.subinfo->usedSeparatorWidgets();
never executed: result += item.subinfo->usedSeparatorWidgets();
0
2129 }
never executed: end of block
0
2130-
2131 return
never executed: return result;
result;
never executed: return result;
0
2132}-
2133-
2134QRect QDockAreaLayoutInfo::tabContentRect() const-
2135{-
2136 if (!tabbed
!tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2137 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
2138-
2139 QRect result = rect;-
2140 QSize tbh = tabBarSizeHint();-
2141-
2142 if (!tbh.isNull()
!tbh.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2143 switch (tabBarShape) {-
2144 case
never executed: case QTabBar::RoundedNorth:
QTabBar::RoundedNorth:
never executed: case QTabBar::RoundedNorth:
0
2145 case
never executed: case QTabBar::TriangularNorth:
QTabBar::TriangularNorth:
never executed: case QTabBar::TriangularNorth:
0
2146 result.adjust(0, tbh.height(), 0, 0);-
2147 break;
never executed: break;
0
2148 case
never executed: case QTabBar::RoundedSouth:
QTabBar::RoundedSouth:
never executed: case QTabBar::RoundedSouth:
0
2149 case
never executed: case QTabBar::TriangularSouth:
QTabBar::TriangularSouth:
never executed: case QTabBar::TriangularSouth:
0
2150 result.adjust(0, 0, 0, -tbh.height());-
2151 break;
never executed: break;
0
2152 case
never executed: case QTabBar::RoundedEast:
QTabBar::RoundedEast:
never executed: case QTabBar::RoundedEast:
0
2153 case
never executed: case QTabBar::TriangularEast:
QTabBar::TriangularEast:
never executed: case QTabBar::TriangularEast:
0
2154 result.adjust(0, 0, -tbh.width(), 0);-
2155 break;
never executed: break;
0
2156 case
never executed: case QTabBar::RoundedWest:
QTabBar::RoundedWest:
never executed: case QTabBar::RoundedWest:
0
2157 case
never executed: case QTabBar::TriangularWest:
QTabBar::TriangularWest:
never executed: case QTabBar::TriangularWest:
0
2158 result.adjust(tbh.width(), 0, 0, 0);-
2159 break;
never executed: break;
0
2160 default
never executed: default:
:
never executed: default:
0
2161 break;
never executed: break;
0
2162 }-
2163 }-
2164-
2165 return
never executed: return result;
result;
never executed: return result;
0
2166}-
2167-
2168int QDockAreaLayoutInfo::tabIndexToListIndex(int tabIndex) const-
2169{-
2170 ((!(tabbed && tabBar)) ? qt_assert("tabbed && tabBar",__FILE__,2276) : qt_noop());-
2171 quintptr data = qvariant_cast<quintptr>(tabBar->tabData(tabIndex));-
2172 for (int i = 0; i < item_list.count()
i < item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2173 if (tabId(item_list.at(i)) == data
tabId(item_list.at(i)) == dataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2174 return
never executed: return i;
i;
never executed: return i;
0
2175 }
never executed: end of block
0
2176 return
never executed: return -1;
-1;
never executed: return -1;
0
2177}-
2178-
2179void QDockAreaLayoutInfo::moveTab(int from, int to)-
2180{-
2181 item_list.move(tabIndexToListIndex(from), tabIndexToListIndex(to));-
2182}
never executed: end of block
0
2183-
2184-
2185-
2186-
2187-
2188-
2189QDockAreaLayout::QDockAreaLayout(QMainWindow *win) : fallbackToSizeHints(true)-
2190{-
2191 mainWindow = win;-
2192 sep = win->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, win);-
2193-
2194 const int tabShape = QTabBar::RoundedSouth;-
2195-
2196-
2197-
2198 docks[QInternal::LeftDock]-
2199 = QDockAreaLayoutInfo(&sep, QInternal::LeftDock, Qt::Vertical, tabShape, win);-
2200 docks[QInternal::RightDock]-
2201 = QDockAreaLayoutInfo(&sep, QInternal::RightDock, Qt::Vertical, tabShape, win);-
2202 docks[QInternal::TopDock]-
2203 = QDockAreaLayoutInfo(&sep, QInternal::TopDock, Qt::Horizontal, tabShape, win);-
2204 docks[QInternal::BottomDock]-
2205 = QDockAreaLayoutInfo(&sep, QInternal::BottomDock, Qt::Horizontal, tabShape, win);-
2206 centralWidgetItem = 0;-
2207-
2208-
2209 corners[Qt::TopLeftCorner] = Qt::TopDockWidgetArea;-
2210 corners[Qt::TopRightCorner] = Qt::TopDockWidgetArea;-
2211 corners[Qt::BottomLeftCorner] = Qt::BottomDockWidgetArea;-
2212 corners[Qt::BottomRightCorner] = Qt::BottomDockWidgetArea;-
2213}
never executed: end of block
0
2214-
2215bool QDockAreaLayout::isValid() const-
2216{-
2217 return
never executed: return rect.isValid();
rect.isValid();
never executed: return rect.isValid();
0
2218}-
2219-
2220void QDockAreaLayout::saveState(QDataStream &stream) const-
2221{-
2222 stream << (uchar) DockWidgetStateMarker;-
2223 int cnt = 0;-
2224 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2225 if (!docks[i].item_list.isEmpty()
!docks[i].item_list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2226 ++
never executed: ++cnt;
cnt;
never executed: ++cnt;
0
2227 }
never executed: end of block
0
2228 stream << cnt;-
2229 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2230 if (docks[i].item_list.isEmpty()
docks[i].item_list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2231 continue;
never executed: continue;
0
2232 stream << i << docks[i].rect.size();-
2233 docks[i].saveState(stream);-
2234 }
never executed: end of block
0
2235-
2236 stream << centralWidgetRect.size();-
2237-
2238 for (int i = 0; i < 4
i < 4Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2239 stream << static_cast<int>(corners[i]);
never executed: stream << static_cast<int>(corners[i]);
0
2240}
never executed: end of block
0
2241-
2242bool QDockAreaLayout::restoreState(QDataStream &stream, const QList<QDockWidget*> &_dockwidgets, bool testing)-
2243{-
2244 QList<QDockWidget*> dockwidgets = _dockwidgets;-
2245-
2246 int cnt;-
2247 stream >> cnt;-
2248 for (int i = 0; i < cnt
i < cntDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2249 int pos;-
2250 stream >> pos;-
2251 QSize size;-
2252 stream >> size;-
2253 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2254 docks[pos].rect = QRect(QPoint(0, 0), size);-
2255 }
never executed: end of block
0
2256 if (!docks[pos].restoreState(stream, dockwidgets, testing)
!docks[pos].re...gets, testing)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2257 stream.setStatus(QDataStream::ReadCorruptData);-
2258 return
never executed: return false;
false;
never executed: return false;
0
2259 }-
2260 }
never executed: end of block
0
2261-
2262 QSize size;-
2263 stream >> size;-
2264 centralWidgetRect = QRect(QPoint(0, 0), size);-
2265-
2266 bool ok = stream.status() == QDataStream::Ok;-
2267-
2268 if (ok
okDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2269 int cornerData[4];-
2270 for (int i = 0; i < 4
i < 4Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2271 stream >> cornerData[i];
never executed: stream >> cornerData[i];
0
2272 if (stream.status() == QDataStream::Ok
stream.status(...DataStream::OkDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2273 for (int i = 0; i < 4
i < 4Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2274 corners[i] = static_cast<Qt::DockWidgetArea>(cornerData[i]);
never executed: corners[i] = static_cast<Qt::DockWidgetArea>(cornerData[i]);
0
2275 }
never executed: end of block
0
2276-
2277 if (!testing
!testingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2278 fallbackToSizeHints = false;
never executed: fallbackToSizeHints = false;
0
2279 }
never executed: end of block
0
2280-
2281 return
never executed: return ok;
ok;
never executed: return ok;
0
2282}-
2283-
2284QList<int> QDockAreaLayout::indexOfPlaceHolder(const QString &objectName) const-
2285{-
2286 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2287 QList<int> result = docks[i].indexOfPlaceHolder(objectName);-
2288 if (!result.isEmpty()
!result.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2289 result.prepend(i);-
2290 return
never executed: return result;
result;
never executed: return result;
0
2291 }-
2292 }
never executed: end of block
0
2293 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
2294}-
2295-
2296QList<int> QDockAreaLayout::indexOf(QWidget *dockWidget) const-
2297{-
2298 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2299 QList<int> result = docks[i].indexOf(dockWidget);-
2300 if (!result.isEmpty()
!result.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2301 result.prepend(i);-
2302 return
never executed: return result;
result;
never executed: return result;
0
2303 }-
2304 }
never executed: end of block
0
2305 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
2306}-
2307-
2308QList<int> QDockAreaLayout::gapIndex(const QPoint &pos) const-
2309{-
2310 QMainWindow::DockOptions opts = mainWindow->dockOptions();-
2311 bool nestingEnabled = opts & QMainWindow::AllowNestedDocks;-
2312 QDockAreaLayoutInfo::TabMode tabMode = QDockAreaLayoutInfo::NoTabs;-
2313-
2314 if (opts & QMainWindow::AllowTabbedDocks
opts & QMainWi...lowTabbedDocksDescription
TRUEnever evaluated
FALSEnever evaluated
0
2315 || opts & QMainWindow::VerticalTabs
opts & QMainWi...::VerticalTabsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2316 tabMode = QDockAreaLayoutInfo::AllowTabs;
never executed: tabMode = QDockAreaLayoutInfo::AllowTabs;
0
2317 if (opts & QMainWindow::ForceTabbedDocks
opts & QMainWi...rceTabbedDocksDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2318 tabMode = QDockAreaLayoutInfo::ForceTabs;
never executed: tabMode = QDockAreaLayoutInfo::ForceTabs;
0
2319-
2320 if (tabMode == QDockAreaLayoutInfo::ForceTabs
tabMode == QDo...nfo::ForceTabsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2321 nestingEnabled = false;
never executed: nestingEnabled = false;
0
2322-
2323-
2324-
2325 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2326 const QDockAreaLayoutInfo &info = docks[i];-
2327-
2328 if (!info.isEmpty()
!info.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& info.rect.contains(pos)
info.rect.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2329 QList<int> result-
2330 = docks[i].gapIndex(pos, nestingEnabled, tabMode);-
2331 if (!result.isEmpty()
!result.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2332 result.prepend(i);
never executed: result.prepend(i);
0
2333 return
never executed: return result;
result;
never executed: return result;
0
2334 }-
2335 }
never executed: end of block
0
2336-
2337 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2338 const QDockAreaLayoutInfo &info = docks[i];-
2339-
2340 if (info.isEmpty()
info.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2341 QRect r;-
2342 switch (i) {-
2343 case
never executed: case QInternal::LeftDock:
QInternal::LeftDock:
never executed: case QInternal::LeftDock:
0
2344 r = QRect(rect.left(), rect.top(), EmptyDropAreaSize, rect.height());-
2345 break;
never executed: break;
0
2346 case
never executed: case QInternal::RightDock:
QInternal::RightDock:
never executed: case QInternal::RightDock:
0
2347 r = QRect(rect.right() - EmptyDropAreaSize, rect.top(),-
2348 EmptyDropAreaSize, rect.height());-
2349 break;
never executed: break;
0
2350 case
never executed: case QInternal::TopDock:
QInternal::TopDock:
never executed: case QInternal::TopDock:
0
2351 r = QRect(rect.left(), rect.top(), rect.width(), EmptyDropAreaSize);-
2352 break;
never executed: break;
0
2353 case
never executed: case QInternal::BottomDock:
QInternal::BottomDock:
never executed: case QInternal::BottomDock:
0
2354 r = QRect(rect.left(), rect.bottom() - EmptyDropAreaSize,-
2355 rect.width(), EmptyDropAreaSize);-
2356 break;
never executed: break;
0
2357 }-
2358 if (r.contains(pos)
r.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2359 if (opts & QMainWindow::ForceTabbedDocks
opts & QMainWi...rceTabbedDocksDescription
TRUEnever evaluated
FALSEnever evaluated
&& !info.item_list.isEmpty()
!info.item_list.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2360-
2361-
2362 return
never executed: return QList<int>() << i << -1 << 0;
QList<int>() << i << -1 << 0;
never executed: return QList<int>() << i << -1 << 0;
0
2363 } else {-
2364 return
never executed: return QList<int>() << i << 0;
QList<int>() << i << 0;
never executed: return QList<int>() << i << 0;
0
2365 }-
2366 }-
2367 }
never executed: end of block
0
2368 }
never executed: end of block
0
2369-
2370 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
2371}-
2372-
2373QList<int> QDockAreaLayout::findSeparator(const QPoint &pos) const-
2374{-
2375 QList<int> result;-
2376 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2377 const QDockAreaLayoutInfo &info = docks[i];-
2378 if (info.isEmpty()
info.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2379 continue;
never executed: continue;
0
2380 QRect rect = separatorRect(i);-
2381 if (!rect.isNull()
!rect.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
&& sep == 1
sep == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2382 rect.adjust(-2, -2, 2, 2);
never executed: rect.adjust(-2, -2, 2, 2);
0
2383 if (rect.contains(pos)
rect.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
&& !info.hasFixedSize()
!info.hasFixedSize()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2384 result << i;-
2385 break;
never executed: break;
0
2386 } else if (info.rect.contains(pos)
info.rect.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2387 result = docks[i].findSeparator(pos);-
2388 if (!result.isEmpty()
!result.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2389 result.prepend(i);-
2390 break;
never executed: break;
0
2391 }-
2392 }
never executed: end of block
0
2393 }
never executed: end of block
0
2394-
2395 return
never executed: return result;
result;
never executed: return result;
0
2396}-
2397-
2398QDockAreaLayoutInfo *QDockAreaLayout::info(QWidget *widget)-
2399{-
2400 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2401 if (QDockAreaLayoutInfo *result = docks[i].info(widget)
QDockAreaLayou...].info(widget)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2402 return
never executed: return result;
result;
never executed: return result;
0
2403 }
never executed: end of block
0
2404-
2405 return
never executed: return 0;
0;
never executed: return 0;
0
2406}-
2407-
2408QDockAreaLayoutInfo *QDockAreaLayout::info(const QList<int> &path)-
2409{-
2410 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,2516) : qt_noop());-
2411 const int index = path.first();-
2412 ((!(index >= 0 && index < QInternal::DockCount)) ? qt_assert("index >= 0 && index < QInternal::DockCount",__FILE__,2518) : qt_noop());-
2413-
2414 if (path.count() == 1
path.count() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2415 return
never executed: return &docks[index];
&docks[index];
never executed: return &docks[index];
0
2416-
2417 return
never executed: return docks[index].info(path.mid(1));
docks[index].info(path.mid(1));
never executed: return docks[index].info(path.mid(1));
0
2418}-
2419-
2420const QDockAreaLayoutInfo *QDockAreaLayout::info(const QList<int> &path) const-
2421{-
2422 return
never executed: return const_cast<QDockAreaLayout*>(this)->info(path);
const_cast<QDockAreaLayout*>(this)->info(path);
never executed: return const_cast<QDockAreaLayout*>(this)->info(path);
0
2423}-
2424-
2425QDockAreaLayoutItem &QDockAreaLayout::item(const QList<int> &path)-
2426{-
2427 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,2533) : qt_noop());-
2428 const int index = path.first();-
2429 ((!(index >= 0 && index < QInternal::DockCount)) ? qt_assert("index >= 0 && index < QInternal::DockCount",__FILE__,2535) : qt_noop());-
2430 return
never executed: return docks[index].item(path.mid(1));
docks[index].item(path.mid(1));
never executed: return docks[index].item(path.mid(1));
0
2431}-
2432-
2433QRect QDockAreaLayout::itemRect(const QList<int> &path) const-
2434{-
2435 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,2541) : qt_noop());-
2436 const int index = path.first();-
2437 ((!(index >= 0 && index < QInternal::DockCount)) ? qt_assert("index >= 0 && index < QInternal::DockCount",__FILE__,2543) : qt_noop());-
2438 return
never executed: return docks[index].itemRect(path.mid(1));
docks[index].itemRect(path.mid(1));
never executed: return docks[index].itemRect(path.mid(1));
0
2439}-
2440-
2441QRect QDockAreaLayout::separatorRect(int index) const-
2442{-
2443 const QDockAreaLayoutInfo &dock = docks[index];-
2444 if (dock.isEmpty()
dock.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2445 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
2446 QRect r = dock.rect;-
2447 switch (index) {-
2448 case
never executed: case QInternal::LeftDock:
QInternal::LeftDock:
never executed: case QInternal::LeftDock:
0
2449 return
never executed: return QRect(r.right() + 1, r.top(), sep, r.height());
QRect(r.right() + 1, r.top(), sep, r.height());
never executed: return QRect(r.right() + 1, r.top(), sep, r.height());
0
2450 case
never executed: case QInternal::RightDock:
QInternal::RightDock:
never executed: case QInternal::RightDock:
0
2451 return
never executed: return QRect(r.left() - sep, r.top(), sep, r.height());
QRect(r.left() - sep, r.top(), sep, r.height());
never executed: return QRect(r.left() - sep, r.top(), sep, r.height());
0
2452 case
never executed: case QInternal::TopDock:
QInternal::TopDock:
never executed: case QInternal::TopDock:
0
2453 return
never executed: return QRect(r.left(), r.bottom() + 1, r.width(), sep);
QRect(r.left(), r.bottom() + 1, r.width(), sep);
never executed: return QRect(r.left(), r.bottom() + 1, r.width(), sep);
0
2454 case
never executed: case QInternal::BottomDock:
QInternal::BottomDock:
never executed: case QInternal::BottomDock:
0
2455 return
never executed: return QRect(r.left(), r.top() - sep, r.width(), sep);
QRect(r.left(), r.top() - sep, r.width(), sep);
never executed: return QRect(r.left(), r.top() - sep, r.width(), sep);
0
2456 default
never executed: default:
:
never executed: default:
0
2457 break;
never executed: break;
0
2458 }-
2459 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
2460}-
2461-
2462QRect QDockAreaLayout::separatorRect(const QList<int> &path) const-
2463{-
2464 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,2570) : qt_noop());-
2465-
2466 const int index = path.first();-
2467 ((!(index >= 0 && index < QInternal::DockCount)) ? qt_assert("index >= 0 && index < QInternal::DockCount",__FILE__,2573) : qt_noop());-
2468-
2469 if (path.count() == 1
path.count() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2470 return
never executed: return separatorRect(index);
separatorRect(index);
never executed: return separatorRect(index);
0
2471 else-
2472 return
never executed: return docks[index].separatorRect(path.mid(1));
docks[index].separatorRect(path.mid(1));
never executed: return docks[index].separatorRect(path.mid(1));
0
2473}-
2474-
2475bool QDockAreaLayout::insertGap(const QList<int> &path, QLayoutItem *dockWidgetItem)-
2476{-
2477 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,2583) : qt_noop());-
2478 const int index = path.first();-
2479 ((!(index >= 0 && index < QInternal::DockCount)) ? qt_assert("index >= 0 && index < QInternal::DockCount",__FILE__,2585) : qt_noop());-
2480 return
never executed: return docks[index].insertGap(path.mid(1), dockWidgetItem);
docks[index].insertGap(path.mid(1), dockWidgetItem);
never executed: return docks[index].insertGap(path.mid(1), dockWidgetItem);
0
2481}-
2482-
2483QLayoutItem *QDockAreaLayout::plug(const QList<int> &path)-
2484{-
2485 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,2591) : qt_noop());-
2486 const int index = path.first();-
2487 ((!(index >= 0 && index < QInternal::DockCount)) ? qt_assert("index >= 0 && index < QInternal::DockCount",__FILE__,2593) : qt_noop());-
2488 return
never executed: return docks[index].plug(path.mid(1));
docks[index].plug(path.mid(1));
never executed: return docks[index].plug(path.mid(1));
0
2489}-
2490-
2491QLayoutItem *QDockAreaLayout::unplug(const QList<int> &path)-
2492{-
2493 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,2599) : qt_noop());-
2494 const int index = path.first();-
2495 ((!(index >= 0 && index < QInternal::DockCount)) ? qt_assert("index >= 0 && index < QInternal::DockCount",__FILE__,2601) : qt_noop());-
2496 return
never executed: return docks[index].unplug(path.mid(1));
docks[index].unplug(path.mid(1));
never executed: return docks[index].unplug(path.mid(1));
0
2497}-
2498-
2499void QDockAreaLayout::remove(const QList<int> &path)-
2500{-
2501 ((!(!path.isEmpty())) ? qt_assert("!path.isEmpty()",__FILE__,2607) : qt_noop());-
2502 const int index = path.first();-
2503 ((!(index >= 0 && index < QInternal::DockCount)) ? qt_assert("index >= 0 && index < QInternal::DockCount",__FILE__,2609) : qt_noop());-
2504 docks[index].remove(path.mid(1));-
2505}
never executed: end of block
0
2506-
2507void QDockAreaLayout::removePlaceHolder(const QString &name)-
2508{-
2509 QList<int> index = indexOfPlaceHolder(name);-
2510 if (!index.isEmpty()
!index.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2511 remove(index);
never executed: remove(index);
0
2512 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(mainWindow->findChildren<QDockWidgetGroupWindow *>( QString(), Qt::FindDirectChildrenOnly))>::type> _container_((mainWindow->findChildren<QDockWidgetGroupWindow *>( QString(), Qt::FindDirectChildrenOnly))); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QDockWidgetGroupWindow *dwgw = *_container_.i; _container_.control; _container_.control = 0)-
2513 {-
2514 index = dwgw->layoutInfo()->indexOfPlaceHolder(name);-
2515 if (!index.isEmpty()
!index.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2516 dwgw->layoutInfo()->remove(index);-
2517 dwgw->destroyOrHideIfEmpty();-
2518 }
never executed: end of block
0
2519 }
never executed: end of block
0
2520}
never executed: end of block
0
2521-
2522static inline int qMax(int i1, int i2, int i3) { return
never executed: return qMax(i1, qMax(i2, i3));
qMax(i1, qMax(i2, i3));
never executed: return qMax(i1, qMax(i2, i3));
}
0
2523-
2524void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,-
2525 QVector<QLayoutStruct> *_hor_struct_list)-
2526{-
2527 QSize center_hint(0, 0);-
2528 QSize center_min(0, 0);-
2529 QSize center_max(0, 0);-
2530 const bool have_central = centralWidgetItem != 0
centralWidgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& !centralWidgetItem->isEmpty()
!centralWidgetItem->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2531 if (have_central
have_centralDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2532 center_hint = centralWidgetRect.size();-
2533 if (!center_hint.isValid()
!center_hint.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2534 center_hint = centralWidgetItem->sizeHint();
never executed: center_hint = centralWidgetItem->sizeHint();
0
2535 center_min = centralWidgetItem->minimumSize();-
2536 center_max = centralWidgetItem->maximumSize();-
2537 }
never executed: end of block
0
2538-
2539 QRect center_rect = rect;-
2540 if (!docks[QInternal::LeftDock].isEmpty()
!docks[QIntern...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2541 center_rect.setLeft(rect.left() + docks[QInternal::LeftDock].rect.width() + sep);
never executed: center_rect.setLeft(rect.left() + docks[QInternal::LeftDock].rect.width() + sep);
0
2542 if (!docks[QInternal::TopDock].isEmpty()
!docks[QIntern...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2543 center_rect.setTop(rect.top() + docks[QInternal::TopDock].rect.height() + sep);
never executed: center_rect.setTop(rect.top() + docks[QInternal::TopDock].rect.height() + sep);
0
2544 if (!docks[QInternal::RightDock].isEmpty()
!docks[QIntern...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2545 center_rect.setRight(rect.right() - docks[QInternal::RightDock].rect.width() - sep);
never executed: center_rect.setRight(rect.right() - docks[QInternal::RightDock].rect.width() - sep);
0
2546 if (!docks[QInternal::BottomDock].isEmpty()
!docks[QIntern...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2547 center_rect.setBottom(rect.bottom() - docks[QInternal::BottomDock].rect.height() - sep);
never executed: center_rect.setBottom(rect.bottom() - docks[QInternal::BottomDock].rect.height() - sep);
0
2548-
2549 QSize left_hint = docks[QInternal::LeftDock].size();-
2550 if (left_hint.isNull()
left_hint.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
|| fallbackToSizeHints
fallbackToSizeHintsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2551 left_hint = docks[QInternal::LeftDock].sizeHint();
never executed: left_hint = docks[QInternal::LeftDock].sizeHint();
0
2552 QSize left_min = docks[QInternal::LeftDock].minimumSize();-
2553 QSize left_max = docks[QInternal::LeftDock].maximumSize();-
2554 left_hint = left_hint.boundedTo(left_max).expandedTo(left_min);-
2555-
2556 QSize right_hint = docks[QInternal::RightDock].size();-
2557 if (right_hint.isNull()
right_hint.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
|| fallbackToSizeHints
fallbackToSizeHintsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2558 right_hint = docks[QInternal::RightDock].sizeHint();
never executed: right_hint = docks[QInternal::RightDock].sizeHint();
0
2559 QSize right_min = docks[QInternal::RightDock].minimumSize();-
2560 QSize right_max = docks[QInternal::RightDock].maximumSize();-
2561 right_hint = right_hint.boundedTo(right_max).expandedTo(right_min);-
2562-
2563 QSize top_hint = docks[QInternal::TopDock].size();-
2564 if (top_hint.isNull()
top_hint.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
|| fallbackToSizeHints
fallbackToSizeHintsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2565 top_hint = docks[QInternal::TopDock].sizeHint();
never executed: top_hint = docks[QInternal::TopDock].sizeHint();
0
2566 QSize top_min = docks[QInternal::TopDock].minimumSize();-
2567 QSize top_max = docks[QInternal::TopDock].maximumSize();-
2568 top_hint = top_hint.boundedTo(top_max).expandedTo(top_min);-
2569-
2570 QSize bottom_hint = docks[QInternal::BottomDock].size();-
2571 if (bottom_hint.isNull()
bottom_hint.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
|| fallbackToSizeHints
fallbackToSizeHintsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2572 bottom_hint = docks[QInternal::BottomDock].sizeHint();
never executed: bottom_hint = docks[QInternal::BottomDock].sizeHint();
0
2573 QSize bottom_min = docks[QInternal::BottomDock].minimumSize();-
2574 QSize bottom_max = docks[QInternal::BottomDock].maximumSize();-
2575 bottom_hint = bottom_hint.boundedTo(bottom_max).expandedTo(bottom_min);-
2576-
2577 if (_ver_struct_list != 0
_ver_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2578 QVector<QLayoutStruct> &ver_struct_list = *_ver_struct_list;-
2579 ver_struct_list.resize(3);-
2580-
2581-
2582 ver_struct_list[0].init();-
2583 ver_struct_list[0].stretch = 0;-
2584 ver_struct_list[0].sizeHint = top_hint.height();-
2585 ver_struct_list[0].minimumSize = top_min.height();-
2586 ver_struct_list[0].maximumSize = top_max.height();-
2587 ver_struct_list[0].expansive = false;-
2588 ver_struct_list[0].empty = docks[QInternal::TopDock].isEmpty();-
2589 ver_struct_list[0].pos = docks[QInternal::TopDock].rect.top();-
2590 ver_struct_list[0].size = docks[QInternal::TopDock].rect.height();-
2591-
2592-
2593 ver_struct_list[1].init();-
2594 ver_struct_list[1].stretch = center_hint.height();-
2595-
2596 bool tl_significant = corners[Qt::TopLeftCorner] == Qt::TopDockWidgetArea
corners[Qt::To...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
2597 || docks[QInternal::TopDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2598 bool bl_significant = corners[Qt::BottomLeftCorner] == Qt::BottomDockWidgetArea
corners[Qt::Bo...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
2599 || docks[QInternal::BottomDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2600 bool tr_significant = corners[Qt::TopRightCorner] == Qt::TopDockWidgetArea
corners[Qt::To...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
2601 || docks[QInternal::TopDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2602 bool br_significant = corners[Qt::BottomRightCorner] == Qt::BottomDockWidgetArea
corners[Qt::Bo...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
2603 || docks[QInternal::BottomDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2604-
2605 int left = (tl_significant
tl_significantDescription
TRUEnever evaluated
FALSEnever evaluated
&& bl_significant
bl_significantDescription
TRUEnever evaluated
FALSEnever evaluated
) ? left_hint.height() : 0;
0
2606 int right = (tr_significant
tr_significantDescription
TRUEnever evaluated
FALSEnever evaluated
&& br_significant
br_significantDescription
TRUEnever evaluated
FALSEnever evaluated
) ? right_hint.height() : 0;
0
2607 ver_struct_list[1].sizeHint = qMax(left, center_hint.height(), right);-
2608-
2609 left = (tl_significant
tl_significantDescription
TRUEnever evaluated
FALSEnever evaluated
&& bl_significant
bl_significantDescription
TRUEnever evaluated
FALSEnever evaluated
) ? left_min.height() : 0;
0
2610 right = (tr_significant
tr_significantDescription
TRUEnever evaluated
FALSEnever evaluated
&& br_significant
br_significantDescription
TRUEnever evaluated
FALSEnever evaluated
) ? right_min.height() : 0;
0
2611 ver_struct_list[1].minimumSize = qMax(left, center_min.height(), right);-
2612 ver_struct_list[1].maximumSize = center_max.height();-
2613 ver_struct_list[1].expansive = have_central;-
2614 ver_struct_list[1].empty = docks[QInternal::LeftDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
2615 && !have_central
!have_centralDescription
TRUEnever evaluated
FALSEnever evaluated
0
2616 && docks[QInternal::RightDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2617 ver_struct_list[1].pos = center_rect.top();-
2618 ver_struct_list[1].size = center_rect.height();-
2619-
2620-
2621 ver_struct_list[2].init();-
2622 ver_struct_list[2].stretch = 0;-
2623 ver_struct_list[2].sizeHint = bottom_hint.height();-
2624 ver_struct_list[2].minimumSize = bottom_min.height();-
2625 ver_struct_list[2].maximumSize = bottom_max.height();-
2626 ver_struct_list[2].expansive = false;-
2627 ver_struct_list[2].empty = docks[QInternal::BottomDock].isEmpty();-
2628 ver_struct_list[2].pos = docks[QInternal::BottomDock].rect.top();-
2629 ver_struct_list[2].size = docks[QInternal::BottomDock].rect.height();-
2630-
2631 for (int i = 0; i < 3
i < 3Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2632 ver_struct_list[i].sizeHint-
2633 = qMax(ver_struct_list[i].sizeHint, ver_struct_list[i].minimumSize);-
2634 }
never executed: end of block
0
2635 if (have_central
have_centralDescription
TRUEnever evaluated
FALSEnever evaluated
&& ver_struct_list[0].empty
ver_struct_list[0].emptyDescription
TRUEnever evaluated
FALSEnever evaluated
&& ver_struct_list[2].empty
ver_struct_list[2].emptyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2636 ver_struct_list[1].maximumSize = ((1<<24)-1);
never executed: ver_struct_list[1].maximumSize = ((1<<24)-1);
0
2637 }
never executed: end of block
0
2638-
2639 if (_hor_struct_list != 0
_hor_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2640 QVector<QLayoutStruct> &hor_struct_list = *_hor_struct_list;-
2641 hor_struct_list.resize(3);-
2642-
2643-
2644 hor_struct_list[0].init();-
2645 hor_struct_list[0].stretch = 0;-
2646 hor_struct_list[0].sizeHint = left_hint.width();-
2647 hor_struct_list[0].minimumSize = left_min.width();-
2648 hor_struct_list[0].maximumSize = left_max.width();-
2649 hor_struct_list[0].expansive = false;-
2650 hor_struct_list[0].empty = docks[QInternal::LeftDock].isEmpty();-
2651 hor_struct_list[0].pos = docks[QInternal::LeftDock].rect.left();-
2652 hor_struct_list[0].size = docks[QInternal::LeftDock].rect.width();-
2653-
2654-
2655 hor_struct_list[1].init();-
2656 hor_struct_list[1].stretch = center_hint.width();-
2657-
2658 bool tl_significant = corners[Qt::TopLeftCorner] == Qt::LeftDockWidgetArea
corners[Qt::To...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
2659 || docks[QInternal::LeftDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2660 bool tr_significant = corners[Qt::TopRightCorner] == Qt::RightDockWidgetArea
corners[Qt::To...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
2661 || docks[QInternal::RightDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2662 bool bl_significant = corners[Qt::BottomLeftCorner] == Qt::LeftDockWidgetArea
corners[Qt::Bo...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
2663 || docks[QInternal::LeftDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2664 bool br_significant = corners[Qt::BottomRightCorner] == Qt::RightDockWidgetArea
corners[Qt::Bo...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
0
2665 || docks[QInternal::RightDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
2666-
2667 int top = (tl_significant
tl_significantDescription
TRUEnever evaluated
FALSEnever evaluated
&& tr_significant
tr_significantDescription
TRUEnever evaluated
FALSEnever evaluated
) ? top_hint.width() : 0;
0
2668 int bottom = (bl_significant
bl_significantDescription
TRUEnever evaluated
FALSEnever evaluated
&& br_significant
br_significantDescription
TRUEnever evaluated
FALSEnever evaluated
) ? bottom_hint.width() : 0;
0
2669 hor_struct_list[1].sizeHint = qMax(top, center_hint.width(), bottom);-
2670-
2671 top = (tl_significant
tl_significantDescription
TRUEnever evaluated
FALSEnever evaluated
&& tr_significant
tr_significantDescription
TRUEnever evaluated
FALSEnever evaluated
) ? top_min.width() : 0;
0
2672 bottom = (bl_significant
bl_significantDescription
TRUEnever evaluated
FALSEnever evaluated
&& br_significant
br_significantDescription
TRUEnever evaluated
FALSEnever evaluated
) ? bottom_min.width() : 0;
0
2673 hor_struct_list[1].minimumSize = qMax(top, center_min.width(), bottom);-
2674-
2675 hor_struct_list[1].maximumSize = center_max.width();-
2676 hor_struct_list[1].expansive = have_central;-
2677 hor_struct_list[1].empty = !have_central;-
2678 hor_struct_list[1].pos = center_rect.left();-
2679 hor_struct_list[1].size = center_rect.width();-
2680-
2681-
2682 hor_struct_list[2].init();-
2683 hor_struct_list[2].stretch = 0;-
2684 hor_struct_list[2].sizeHint = right_hint.width();-
2685 hor_struct_list[2].minimumSize = right_min.width();-
2686 hor_struct_list[2].maximumSize = right_max.width();-
2687 hor_struct_list[2].expansive = false;-
2688 hor_struct_list[2].empty = docks[QInternal::RightDock].isEmpty();-
2689 hor_struct_list[2].pos = docks[QInternal::RightDock].rect.left();-
2690 hor_struct_list[2].size = docks[QInternal::RightDock].rect.width();-
2691-
2692 for (int i = 0; i < 3
i < 3Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
2693 hor_struct_list[i].sizeHint-
2694 = qMax(hor_struct_list[i].sizeHint, hor_struct_list[i].minimumSize);-
2695 }
never executed: end of block
0
2696 if (have_central
have_centralDescription
TRUEnever evaluated
FALSEnever evaluated
&& hor_struct_list[0].empty
hor_struct_list[0].emptyDescription
TRUEnever evaluated
FALSEnever evaluated
&& hor_struct_list[2].empty
hor_struct_list[2].emptyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2697 hor_struct_list[1].maximumSize = ((1<<24)-1);
never executed: hor_struct_list[1].maximumSize = ((1<<24)-1);
0
2698-
2699 }
never executed: end of block
0
2700}
never executed: end of block
0
2701-
2702void QDockAreaLayout::setGrid(QVector<QLayoutStruct> *ver_struct_list,-
2703 QVector<QLayoutStruct> *hor_struct_list)-
2704{-
2705-
2706-
2707-
2708 if (!docks[QInternal::TopDock].isEmpty()
!docks[QIntern...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2709 QRect r = docks[QInternal::TopDock].rect;-
2710 if (hor_struct_list != 0
hor_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2711 r.setLeft(corners[Qt::TopLeftCorner] == Qt::TopDockWidgetArea-
2712 || docks[QInternal::LeftDock].isEmpty()-
2713 ? rect.left() : hor_struct_list->at(1).pos);-
2714 r.setRight(corners[Qt::TopRightCorner] == Qt::TopDockWidgetArea-
2715 || docks[QInternal::RightDock].isEmpty()-
2716 ? rect.right() : hor_struct_list->at(2).pos - sep - 1);-
2717 }
never executed: end of block
0
2718 if (ver_struct_list != 0
ver_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2719 r.setTop(rect.top());-
2720 r.setBottom(ver_struct_list->at(1).pos - sep - 1);-
2721 }
never executed: end of block
0
2722 docks[QInternal::TopDock].rect = r;-
2723 docks[QInternal::TopDock].fitItems();-
2724 }
never executed: end of block
0
2725-
2726-
2727-
2728 if (!docks[QInternal::BottomDock].isEmpty()
!docks[QIntern...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2729 QRect r = docks[QInternal::BottomDock].rect;-
2730 if (hor_struct_list != 0
hor_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2731 r.setLeft(corners[Qt::BottomLeftCorner] == Qt::BottomDockWidgetArea-
2732 || docks[QInternal::LeftDock].isEmpty()-
2733 ? rect.left() : hor_struct_list->at(1).pos);-
2734 r.setRight(corners[Qt::BottomRightCorner] == Qt::BottomDockWidgetArea-
2735 || docks[QInternal::RightDock].isEmpty()-
2736 ? rect.right() : hor_struct_list->at(2).pos - sep - 1);-
2737 }
never executed: end of block
0
2738 if (ver_struct_list != 0
ver_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2739 r.setTop(ver_struct_list->at(2).pos);-
2740 r.setBottom(rect.bottom());-
2741 }
never executed: end of block
0
2742 docks[QInternal::BottomDock].rect = r;-
2743 docks[QInternal::BottomDock].fitItems();-
2744 }
never executed: end of block
0
2745-
2746-
2747-
2748 if (!docks[QInternal::LeftDock].isEmpty()
!docks[QIntern...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2749 QRect r = docks[QInternal::LeftDock].rect;-
2750 if (hor_struct_list != 0
hor_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2751 r.setLeft(rect.left());-
2752 r.setRight(hor_struct_list->at(1).pos - sep - 1);-
2753 }
never executed: end of block
0
2754 if (ver_struct_list != 0
ver_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2755 r.setTop(corners[Qt::TopLeftCorner] == Qt::LeftDockWidgetArea-
2756 || docks[QInternal::TopDock].isEmpty()-
2757 ? rect.top() : ver_struct_list->at(1).pos);-
2758 r.setBottom(corners[Qt::BottomLeftCorner] == Qt::LeftDockWidgetArea-
2759 || docks[QInternal::BottomDock].isEmpty()-
2760 ? rect.bottom() : ver_struct_list->at(2).pos - sep - 1);-
2761 }
never executed: end of block
0
2762 docks[QInternal::LeftDock].rect = r;-
2763 docks[QInternal::LeftDock].fitItems();-
2764 }
never executed: end of block
0
2765-
2766-
2767-
2768 if (!docks[QInternal::RightDock].isEmpty()
!docks[QIntern...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2769 QRect r = docks[QInternal::RightDock].rect;-
2770 if (hor_struct_list != 0
hor_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2771 r.setLeft(hor_struct_list->at(2).pos);-
2772 r.setRight(rect.right());-
2773 }
never executed: end of block
0
2774 if (ver_struct_list != 0
ver_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2775 r.setTop(corners[Qt::TopRightCorner] == Qt::RightDockWidgetArea-
2776 || docks[QInternal::TopDock].isEmpty()-
2777 ? rect.top() : ver_struct_list->at(1).pos);-
2778 r.setBottom(corners[Qt::BottomRightCorner] == Qt::RightDockWidgetArea-
2779 || docks[QInternal::BottomDock].isEmpty()-
2780 ? rect.bottom() : ver_struct_list->at(2).pos - sep - 1);-
2781 }
never executed: end of block
0
2782 docks[QInternal::RightDock].rect = r;-
2783 docks[QInternal::RightDock].fitItems();-
2784 }
never executed: end of block
0
2785-
2786-
2787-
2788 if (hor_struct_list != 0
hor_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2789 centralWidgetRect.setLeft(hor_struct_list->at(1).pos);-
2790 centralWidgetRect.setWidth(hor_struct_list->at(1).size);-
2791 }
never executed: end of block
0
2792 if (ver_struct_list != 0
ver_struct_list != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2793 centralWidgetRect.setTop(ver_struct_list->at(1).pos);-
2794 centralWidgetRect.setHeight(ver_struct_list->at(1).size);-
2795 }
never executed: end of block
0
2796}
never executed: end of block
0
2797-
2798void QDockAreaLayout::fitLayout()-
2799{-
2800 QVector<QLayoutStruct> ver_struct_list(3);-
2801 QVector<QLayoutStruct> hor_struct_list(3);-
2802 getGrid(&ver_struct_list, &hor_struct_list);-
2803-
2804 qGeomCalc(ver_struct_list, 0, 3, rect.top(), rect.height(), sep);-
2805 qGeomCalc(hor_struct_list, 0, 3, rect.left(), rect.width(), sep);-
2806-
2807 setGrid(&ver_struct_list, &hor_struct_list);-
2808}
never executed: end of block
0
2809-
2810void QDockAreaLayout::clear()-
2811{-
2812 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
2813 docks[i].clear();
never executed: docks[i].clear();
0
2814-
2815 rect = QRect();-
2816 centralWidgetRect = QRect();-
2817}
never executed: end of block
0
2818-
2819QSize QDockAreaLayout::sizeHint() const-
2820{-
2821 int left_sep = 0;-
2822 int right_sep = 0;-
2823 int top_sep = 0;-
2824 int bottom_sep = 0;-
2825-
2826 if (centralWidgetItem != 0
centralWidgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2827 left_sep = docks[QInternal::LeftDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep;
0
2828 right_sep = docks[QInternal::RightDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep;
0
2829 top_sep = docks[QInternal::TopDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep;
0
2830 bottom_sep = docks[QInternal::BottomDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep;
0
2831 }
never executed: end of block
0
2832-
2833 QSize left = docks[QInternal::LeftDock].sizeHint() + QSize(left_sep, 0);-
2834 QSize right = docks[QInternal::RightDock].sizeHint() + QSize(right_sep, 0);-
2835 QSize top = docks[QInternal::TopDock].sizeHint() + QSize(0, top_sep);-
2836 QSize bottom = docks[QInternal::BottomDock].sizeHint() + QSize(0, bottom_sep);-
2837 QSize center = centralWidgetItem == 0
centralWidgetItem == 0Description
TRUEnever evaluated
FALSEnever evaluated
? QSize(0, 0) : centralWidgetItem->sizeHint();
0
2838-
2839 int row1 = top.width();-
2840 int row2 = left.width() + center.width() + right.width();-
2841 int row3 = bottom.width();-
2842 int col1 = left.height();-
2843 int col2 = top.height() + center.height() + bottom.height();-
2844 int col3 = right.height();-
2845-
2846 if (corners[Qt::TopLeftCorner] == Qt::LeftDockWidgetArea
corners[Qt::To...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2847 row1 += left.width();
never executed: row1 += left.width();
0
2848 else-
2849 col1 += top.height();
never executed: col1 += top.height();
0
2850-
2851 if (corners[Qt::TopRightCorner] == Qt::RightDockWidgetArea
corners[Qt::To...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2852 row1 += right.width();
never executed: row1 += right.width();
0
2853 else-
2854 col3 += top.height();
never executed: col3 += top.height();
0
2855-
2856 if (corners[Qt::BottomLeftCorner] == Qt::LeftDockWidgetArea
corners[Qt::Bo...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2857 row3 += left.width();
never executed: row3 += left.width();
0
2858 else-
2859 col1 += bottom.height();
never executed: col1 += bottom.height();
0
2860-
2861 if (corners[Qt::BottomRightCorner] == Qt::RightDockWidgetArea
corners[Qt::Bo...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2862 row3 += right.width();
never executed: row3 += right.width();
0
2863 else-
2864 col3 += bottom.height();
never executed: col3 += bottom.height();
0
2865-
2866 return
never executed: return QSize(qMax(row1, row2, row3), qMax(col1, col2, col3));
QSize(qMax(row1, row2, row3), qMax(col1, col2, col3));
never executed: return QSize(qMax(row1, row2, row3), qMax(col1, col2, col3));
0
2867}-
2868-
2869QSize QDockAreaLayout::minimumSize() const-
2870{-
2871 int left_sep = 0;-
2872 int right_sep = 0;-
2873 int top_sep = 0;-
2874 int bottom_sep = 0;-
2875-
2876 if (centralWidgetItem != 0
centralWidgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2877 left_sep = docks[QInternal::LeftDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep;
0
2878 right_sep = docks[QInternal::RightDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep;
0
2879 top_sep = docks[QInternal::TopDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep;
0
2880 bottom_sep = docks[QInternal::BottomDock].isEmpty()
docks[QInterna...ock].isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? 0 : sep;
0
2881 }
never executed: end of block
0
2882-
2883 QSize left = docks[QInternal::LeftDock].minimumSize() + QSize(left_sep, 0);-
2884 QSize right = docks[QInternal::RightDock].minimumSize() + QSize(right_sep, 0);-
2885 QSize top = docks[QInternal::TopDock].minimumSize() + QSize(0, top_sep);-
2886 QSize bottom = docks[QInternal::BottomDock].minimumSize() + QSize(0, bottom_sep);-
2887 QSize center = centralWidgetItem == 0
centralWidgetItem == 0Description
TRUEnever evaluated
FALSEnever evaluated
? QSize(0, 0) : centralWidgetItem->minimumSize();
0
2888-
2889 int row1 = top.width();-
2890 int row2 = left.width() + center.width() + right.width();-
2891 int row3 = bottom.width();-
2892 int col1 = left.height();-
2893 int col2 = top.height() + center.height() + bottom.height();-
2894 int col3 = right.height();-
2895-
2896 if (corners[Qt::TopLeftCorner] == Qt::LeftDockWidgetArea
corners[Qt::To...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2897 row1 += left.width();
never executed: row1 += left.width();
0
2898 else-
2899 col1 += top.height();
never executed: col1 += top.height();
0
2900-
2901 if (corners[Qt::TopRightCorner] == Qt::RightDockWidgetArea
corners[Qt::To...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2902 row1 += right.width();
never executed: row1 += right.width();
0
2903 else-
2904 col3 += top.height();
never executed: col3 += top.height();
0
2905-
2906 if (corners[Qt::BottomLeftCorner] == Qt::LeftDockWidgetArea
corners[Qt::Bo...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2907 row3 += left.width();
never executed: row3 += left.width();
0
2908 else-
2909 col1 += bottom.height();
never executed: col1 += bottom.height();
0
2910-
2911 if (corners[Qt::BottomRightCorner] == Qt::RightDockWidgetArea
corners[Qt::Bo...DockWidgetAreaDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2912 row3 += right.width();
never executed: row3 += right.width();
0
2913 else-
2914 col3 += bottom.height();
never executed: col3 += bottom.height();
0
2915-
2916 return
never executed: return QSize(qMax(row1, row2, row3), qMax(col1, col2, col3));
QSize(qMax(row1, row2, row3), qMax(col1, col2, col3));
never executed: return QSize(qMax(row1, row2, row3), qMax(col1, col2, col3));
0
2917}-
2918-
2919-
2920-
2921-
2922-
2923-
2924-
2925QRect QDockAreaLayout::constrainedRect(QRect rect, QWidget* widget)-
2926{-
2927 QRect desktop;-
2928 QDesktopWidget *desktopW = QApplication::desktop();-
2929 if (desktopW->isVirtualDesktop()
desktopW->isVirtualDesktop()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2930 desktop = desktopW->screenGeometry(rect.topLeft());
never executed: desktop = desktopW->screenGeometry(rect.topLeft());
0
2931 else-
2932 desktop = desktopW->screenGeometry(widget);
never executed: desktop = desktopW->screenGeometry(widget);
0
2933-
2934 if (desktop.isValid()
desktop.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2935 rect.setWidth(qMin(rect.width(), desktop.width()));-
2936 rect.setHeight(qMin(rect.height(), desktop.height()));-
2937 rect.moveLeft(qMax(rect.left(), desktop.left()));-
2938 rect.moveTop(qMax(rect.top(), desktop.top()));-
2939 rect.moveRight(qMin(rect.right(), desktop.right()));-
2940 rect.moveBottom(qMin(rect.bottom(), desktop.bottom()));-
2941 }
never executed: end of block
0
2942-
2943 return
never executed: return rect;
rect;
never executed: return rect;
0
2944}-
2945-
2946bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget)-
2947{-
2948 QDockAreaLayoutItem *item = 0;-
2949 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(mainWindow->findChildren<QDockWidgetGroupWindow *>( QString(), Qt::FindDirectChildrenOnly))>::type> _container_((mainWindow->findChildren<QDockWidgetGroupWindow *>( QString(), Qt::FindDirectChildrenOnly))); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QDockWidgetGroupWindow *dwgw = *_container_.i; _container_.control; _container_.control = 0)-
2950 {-
2951 QList<int> index = dwgw->layoutInfo()->indexOfPlaceHolder(dockWidget->objectName());-
2952 if (!index.isEmpty()
!index.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2953 dockWidget->setParent(dwgw);-
2954 item = const_cast<QDockAreaLayoutItem *>(&dwgw->layoutInfo()->item(index));-
2955 break;
never executed: break;
0
2956 }-
2957 }
never executed: end of block
0
2958 if (!item
!itemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2959 QList<int> index = indexOfPlaceHolder(dockWidget->objectName());-
2960 if (index.isEmpty()
index.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2961 return
never executed: return false;
false;
never executed: return false;
0
2962 item = const_cast<QDockAreaLayoutItem *>(&this->item(index));-
2963 }
never executed: end of block
0
2964-
2965 QPlaceHolderItem *placeHolder = item->placeHolderItem;-
2966 ((!(placeHolder != 0)) ? qt_assert("placeHolder != 0",__FILE__,3072) : qt_noop());-
2967-
2968 item->widgetItem = new QDockWidgetItem(dockWidget);-
2969-
2970 if (placeHolder->window
placeHolder->windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2971 const QRect r = constrainedRect(placeHolder->topLevelRect, dockWidget);-
2972 dockWidget->d_func()->setWindowState(true, true, r);-
2973 }
never executed: end of block
0
2974 dockWidget->setVisible(!placeHolder->hidden);-
2975-
2976-
2977-
2978-
2979-
2980 item->placeHolderItem = 0;-
2981 delete placeHolder;-
2982-
2983 return
never executed: return true;
true;
never executed: return true;
0
2984}-
2985-
2986void QDockAreaLayout::addDockWidget(QInternal::DockPosition pos, QDockWidget *dockWidget,-
2987 Qt::Orientation orientation)-
2988{-
2989 QLayoutItem *dockWidgetItem = new QDockWidgetItem(dockWidget);-
2990 QDockAreaLayoutInfo &info = docks[pos];-
2991 if (orientation == info.o
orientation == info.oDescription
TRUEnever evaluated
FALSEnever evaluated
|| info.item_list.count() <= 1
info.item_list.count() <= 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2992-
2993-
2994 info.o = orientation;-
2995-
2996 QDockAreaLayoutItem new_item(dockWidgetItem);-
2997 info.item_list.append(new_item);-
2998-
2999 if (info.tabbed
info.tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
&& !new_item.skip()
!new_item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3000 info.updateTabBar();-
3001 info.setCurrentTabId(tabId(new_item));-
3002 }
never executed: end of block
0
3003-
3004 }
never executed: end of block
else {
0
3005-
3006 int tbshape = info.tabBarShape;-
3007-
3008-
3009-
3010 QDockAreaLayoutInfo new_info(&sep, pos, orientation, tbshape, mainWindow);-
3011 new_info.item_list.append(QDockAreaLayoutItem(new QDockAreaLayoutInfo(info)));-
3012 new_info.item_list.append(QDockAreaLayoutItem(dockWidgetItem));-
3013 info = new_info;-
3014 }
never executed: end of block
0
3015-
3016 removePlaceHolder(dockWidget->objectName());-
3017}
never executed: end of block
0
3018-
3019void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second)-
3020{-
3021 const QList<int> path = indexOf(first);-
3022 if (path.isEmpty()
path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3023 return;
never executed: return;
0
3024-
3025 QDockAreaLayoutInfo *info = this->info(path);-
3026 ((!(info != 0)) ? qt_assert("info != 0",__FILE__,3132) : qt_noop());-
3027 info->tab(path.last(), new QDockWidgetItem(second));-
3028-
3029 removePlaceHolder(second->objectName());-
3030}
never executed: end of block
0
3031-
3032void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks,-
3033 const QList<int> &sizes, Qt::Orientation o)-
3034{-
3035 if (__builtin_expect(!!(docks.count() != sizes.count()), false)
__builtin_expe...unt()), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3036 QMessageLogger(__FILE__, 3142, __PRETTY_FUNCTION__).warning("QMainWidget::resizeDocks: size of the lists are not the same");-
3037 return;
never executed: return;
0
3038 }-
3039 int count = docks.count();-
3040 fallbackToSizeHints = false;-
3041 for (int i = 0; i < count
i < countDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3042 QList<int> path = indexOf(docks[i]);-
3043 if (__builtin_expect(!!(path.isEmpty()), false)
__builtin_expe...pty()), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3044 QMessageLogger(__FILE__, 3150, __PRETTY_FUNCTION__).warning("QMainWidget::resizeDocks: one QDockWidget is not part of the layout");-
3045 continue;
never executed: continue;
0
3046 }-
3047 int size = sizes[i];-
3048 if (__builtin_expect(!!(size <= 0), false)
__builtin_expe... <= 0), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3049 QMessageLogger(__FILE__, 3155, __PRETTY_FUNCTION__).warning("QMainWidget::resizeDocks: all sizes need to be larger than 0");-
3050 size = 1;-
3051 }
never executed: end of block
0
3052-
3053 while (path.size() > 1
path.size() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3054 QDockAreaLayoutInfo *info = this->info(path);-
3055 if (!info->tabbed
!info->tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
&& info->o == o
info->o == oDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3056 info->item_list[path.constLast()].size = size;-
3057 int totalSize = 0;-
3058 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(info->item_list)>::type> _container_((info->item_list)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QDockAreaLayoutItem &item = *_container_.i; _container_.control; _container_.control = 0) {-
3059 if (!item.skip()
!item.skip()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3060 if (totalSize != 0
totalSize != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3061 totalSize += sep;
never executed: totalSize += sep;
0
3062 totalSize += item.size == -1
item.size == -1Description
TRUEnever evaluated
FALSEnever evaluated
? pick(o, item.sizeHint()) : item.size;
0
3063 }
never executed: end of block
0
3064 }
never executed: end of block
0
3065 size = totalSize;-
3066 }
never executed: end of block
0
3067 path.removeLast();-
3068 }
never executed: end of block
0
3069-
3070 const int dockNum = path.constFirst();-
3071 ((!(dockNum < QInternal::DockCount)) ? qt_assert("dockNum < QInternal::DockCount",__FILE__,3177) : qt_noop());-
3072 QRect &r = this->docks[dockNum].rect;-
3073 QSize s = r.size();-
3074 rpick(o, s) = size;-
3075 r.setSize(s);-
3076 }
never executed: end of block
0
3077}
never executed: end of block
0
3078-
3079void QDockAreaLayout::splitDockWidget(QDockWidget *after,-
3080 QDockWidget *dockWidget,-
3081 Qt::Orientation orientation)-
3082{-
3083 const QList<int> path = indexOf(after);-
3084 if (path.isEmpty()
path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3085 return;
never executed: return;
0
3086-
3087 QDockAreaLayoutInfo *info = this->info(path);-
3088 ((!(info != 0)) ? qt_assert("info != 0",__FILE__,3194) : qt_noop());-
3089 info->split(path.last(), orientation, new QDockWidgetItem(dockWidget));-
3090-
3091 removePlaceHolder(dockWidget->objectName());-
3092}
never executed: end of block
0
3093-
3094void QDockAreaLayout::apply(bool animate)-
3095{-
3096 QWidgetAnimator &widgetAnimator = qt_mainwindow_layout(mainWindow)->widgetAnimator;-
3097-
3098 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
3099 docks[i].apply(animate);
never executed: docks[i].apply(animate);
0
3100 if (centralWidgetItem != 0
centralWidgetItem != 0Description
TRUEnever evaluated
FALSEnever evaluated
&& !centralWidgetItem->isEmpty()
!centralWidgetItem->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3101 widgetAnimator.animate(centralWidgetItem->widget(), centralWidgetRect,-
3102 animate);-
3103 }
never executed: end of block
0
3104-
3105 if (sep == 1
sep == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3106 updateSeparatorWidgets();
never executed: updateSeparatorWidgets();
0
3107-
3108}
never executed: end of block
0
3109-
3110void QDockAreaLayout::paintSeparators(QPainter *p, QWidget *widget,-
3111 const QRegion &clip,-
3112 const QPoint &mouse) const-
3113{-
3114 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3115 const QDockAreaLayoutInfo &dock = docks[i];-
3116 if (dock.isEmpty()
dock.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3117 continue;
never executed: continue;
0
3118 QRect r = separatorRect(i);-
3119 if (clip.contains(r)
clip.contains(r)Description
TRUEnever evaluated
FALSEnever evaluated
&& !dock.hasFixedSize()
!dock.hasFixedSize()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3120 Qt::Orientation opposite = dock.o == Qt::Horizontal
dock.o == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
0
3121 ? Qt::Vertical : Qt::Horizontal;-
3122 paintSep(p, widget, r, opposite, r.contains(mouse));-
3123 }
never executed: end of block
0
3124 if (clip.contains(dock.rect)
clip.contains(dock.rect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3125 dock.paintSeparators(p, widget, clip, mouse);
never executed: dock.paintSeparators(p, widget, clip, mouse);
0
3126 }
never executed: end of block
0
3127}
never executed: end of block
0
3128-
3129QRegion QDockAreaLayout::separatorRegion() const-
3130{-
3131 QRegion result;-
3132-
3133 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3134 const QDockAreaLayoutInfo &dock = docks[i];-
3135 if (dock.isEmpty()
dock.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3136 continue;
never executed: continue;
0
3137 result |= separatorRect(i);-
3138 result |= dock.separatorRegion();-
3139 }
never executed: end of block
0
3140-
3141 return
never executed: return result;
result;
never executed: return result;
0
3142}-
3143-
3144int QDockAreaLayout::separatorMove(const QList<int> &separator, const QPoint &origin,-
3145 const QPoint &dest)-
3146{-
3147 int delta = 0;-
3148 int index = separator.last();-
3149-
3150 if (separator.count() > 1
separator.count() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3151 QDockAreaLayoutInfo *info = this->info(separator);-
3152 delta = pick(info->o, dest - origin);-
3153 if (delta != 0
delta != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3154 delta = info->separatorMove(index, delta);
never executed: delta = info->separatorMove(index, delta);
0
3155 info->apply(false);-
3156 return
never executed: return delta;
delta;
never executed: return delta;
0
3157 }-
3158-
3159 QVector<QLayoutStruct> list;-
3160-
3161 if (index == QInternal::LeftDock
index == QInternal::LeftDockDescription
TRUEnever evaluated
FALSEnever evaluated
|| index == QInternal::RightDock
index == QInternal::RightDockDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3162 getGrid(0, &list);
never executed: getGrid(0, &list);
0
3163 else-
3164 getGrid(&list, 0);
never executed: getGrid(&list, 0);
0
3165-
3166 int sep_index = index == QInternal::LeftDock
index == QInternal::LeftDockDescription
TRUEnever evaluated
FALSEnever evaluated
|| index == QInternal::TopDock
index == QInternal::TopDockDescription
TRUEnever evaluated
FALSEnever evaluated
0
3167 ? 0 : 1;-
3168 Qt::Orientation o = index == QInternal::LeftDock
index == QInternal::LeftDockDescription
TRUEnever evaluated
FALSEnever evaluated
|| index == QInternal::RightDock
index == QInternal::RightDockDescription
TRUEnever evaluated
FALSEnever evaluated
0
3169 ? Qt::Horizontal-
3170 : Qt::Vertical;-
3171-
3172 delta = pick(o, dest - origin);-
3173 delta = separatorMoveHelper(list, sep_index, delta, sep);-
3174-
3175 if (index == QInternal::LeftDock
index == QInternal::LeftDockDescription
TRUEnever evaluated
FALSEnever evaluated
|| index == QInternal::RightDock
index == QInternal::RightDockDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3176 setGrid(0, &list);
never executed: setGrid(0, &list);
0
3177 else-
3178 setGrid(&list, 0);
never executed: setGrid(&list, 0);
0
3179-
3180 apply(false);-
3181-
3182 return
never executed: return delta;
delta;
never executed: return delta;
0
3183}-
3184-
3185-
3186-
3187-
3188void QDockAreaLayout::updateSeparatorWidgets() const-
3189{-
3190 int j = 0;-
3191-
3192 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3193 const QDockAreaLayoutInfo &dock = docks[i];-
3194 if (dock.isEmpty()
dock.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3195 continue;
never executed: continue;
0
3196-
3197 QWidget *sepWidget;-
3198 if (j < separatorWidgets.size()
j < separatorWidgets.size()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3199 sepWidget = separatorWidgets.at(j);-
3200 }
never executed: end of block
else {
0
3201 sepWidget = qt_mainwindow_layout(mainWindow)->getSeparatorWidget();-
3202 separatorWidgets.append(sepWidget);-
3203 }
never executed: end of block
0
3204 j++;-
3205-
3206-
3207 sepWidget->raise();-
3208-
3209 QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2);-
3210 sepWidget->setGeometry(sepRect);-
3211 sepWidget->setMask( QRegion(separatorRect(i).translated( - sepRect.topLeft())));-
3212 sepWidget->show();-
3213 }
never executed: end of block
0
3214 for (int i = j; i < separatorWidgets.size()
i < separatorWidgets.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
3215 separatorWidgets.at(i)->hide();
never executed: separatorWidgets.at(i)->hide();
0
3216-
3217 separatorWidgets.resize(j);-
3218}
never executed: end of block
0
3219-
3220-
3221QLayoutItem *QDockAreaLayout::itemAt(int *x, int index) const-
3222{-
3223 ((!(x != 0)) ? qt_assert("x != 0",__FILE__,3329) : qt_noop());-
3224-
3225 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3226 const QDockAreaLayoutInfo &dock = docks[i];-
3227 if (QLayoutItem *ret = dock.itemAt(x, index)
QLayoutItem *r...emAt(x, index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3228 return
never executed: return ret;
ret;
never executed: return ret;
0
3229 }
never executed: end of block
0
3230-
3231 if (centralWidgetItem
centralWidgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& (*
(*x)++ == indexDescription
TRUEnever evaluated
FALSEnever evaluated
x)++ == index
(*x)++ == indexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
3232 return
never executed: return centralWidgetItem;
centralWidgetItem;
never executed: return centralWidgetItem;
0
3233-
3234 return
never executed: return 0;
0;
never executed: return 0;
0
3235}-
3236-
3237QLayoutItem *QDockAreaLayout::takeAt(int *x, int index)-
3238{-
3239 ((!(x != 0)) ? qt_assert("x != 0",__FILE__,3345) : qt_noop());-
3240-
3241 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3242 QDockAreaLayoutInfo &dock = docks[i];-
3243 if (QLayoutItem *ret = dock.takeAt(x, index)
QLayoutItem *r...keAt(x, index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3244 return
never executed: return ret;
ret;
never executed: return ret;
0
3245 }
never executed: end of block
0
3246-
3247 if (centralWidgetItem
centralWidgetItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& (*
(*x)++ == indexDescription
TRUEnever evaluated
FALSEnever evaluated
x)++ == index
(*x)++ == indexDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3248 QLayoutItem *ret = centralWidgetItem;-
3249 centralWidgetItem = 0;-
3250 return
never executed: return ret;
ret;
never executed: return ret;
0
3251 }-
3252-
3253 return
never executed: return 0;
0;
never executed: return 0;
0
3254}-
3255-
3256void QDockAreaLayout::deleteAllLayoutItems()-
3257{-
3258 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
3259 docks[i].deleteAllLayoutItems();
never executed: docks[i].deleteAllLayoutItems();
0
3260}
never executed: end of block
0
3261-
3262-
3263QSet<QTabBar*> QDockAreaLayout::usedTabBars() const-
3264{-
3265 QSet<QTabBar*> result;-
3266 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3267 const QDockAreaLayoutInfo &dock = docks[i];-
3268 result += dock.usedTabBars();-
3269 }
never executed: end of block
0
3270 return
never executed: return result;
result;
never executed: return result;
0
3271}-
3272-
3273-
3274QSet<QWidget*> QDockAreaLayout::usedSeparatorWidgets() const-
3275{-
3276 QSet<QWidget*> result;-
3277 const int numSeparators = separatorWidgets.count();-
3278 result.reserve(numSeparators);-
3279 for (int i = 0; i < numSeparators
i < numSeparatorsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
3280 result << separatorWidgets.at(i);
never executed: result << separatorWidgets.at(i);
0
3281 for (int i = 0; i < QInternal::DockCount
i < QInternal::DockCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
3282 const QDockAreaLayoutInfo &dock = docks[i];-
3283 result += dock.usedSeparatorWidgets();-
3284 }
never executed: end of block
0
3285 return
never executed: return result;
result;
never executed: return result;
0
3286}-
3287-
3288-
3289QRect QDockAreaLayout::gapRect(const QList<int> &path) const-
3290{-
3291 const QDockAreaLayoutInfo *info = this->info(path);-
3292 if (info == 0
info == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3293 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
3294 const QList<QDockAreaLayoutItem> &item_list = info->item_list;-
3295 Qt::Orientation o = info->o;-
3296 int index = path.last();-
3297 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| index >= item_list.count()
index >= item_list.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3298 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
3299 const QDockAreaLayoutItem &item = item_list.at(index);-
3300 if (!(item.flags & QDockAreaLayoutItem::GapItem)
!(item.flags &...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3301 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
3302-
3303 QRect result;-
3304-
3305-
3306 if (info->tabbed
info->tabbedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
3307 result = info->tabContentRect();-
3308 }
never executed: end of block
else
0
3309-
3310 {-
3311 int pos = item.pos;-
3312 int size = item.size;-
3313-
3314 int prev = info->prev(index);-
3315 int next = info->next(index);-
3316-
3317 if (prev != -1
prev != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !(item_list.at(prev).flags & QDockAreaLayoutItem::GapItem)
!(item_list.at...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
3318 pos += sep;-
3319 size -= sep;-
3320 }
never executed: end of block
0
3321 if (next != -1
next != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& !(item_list.at(next).flags & QDockAreaLayoutItem::GapItem)
!(item_list.at...Item::GapItem)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3322 size -= sep;
never executed: size -= sep;
0
3323-
3324 QPoint p;-
3325 rpick(o, p) = pos;-
3326 rperp(o, p) = perp(o, info->rect.topLeft());-
3327 QSize s;-
3328 rpick(o, s) = size;-
3329 rperp(o, s) = perp(o, info->rect.size());-
3330-
3331 result = QRect(p, s);-
3332 }
never executed: end of block
0
3333-
3334 return
never executed: return result;
result;
never executed: return result;
0
3335}-
3336-
3337void QDockAreaLayout::keepSize(QDockWidget *w)-
3338{-
3339 QList<int> path = indexOf(w);-
3340 if (path.isEmpty()
path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3341 return;
never executed: return;
0
3342 QDockAreaLayoutItem &item = this->item(path);-
3343 if (item.size != -1
item.size != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3344 item.flags |= QDockAreaLayoutItem::KeepSize;
never executed: item.flags |= QDockAreaLayoutItem::KeepSize;
0
3345}
never executed: end of block
0
3346-
3347void QDockAreaLayout::styleChangedEvent()-
3348{-
3349 sep = mainWindow->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, mainWindow);-
3350 if (isValid()
isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
3351 fitLayout();
never executed: fitLayout();
0
3352}
never executed: end of block
0
3353-
3354-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9