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