| Line | Source Code | Coverage |
|---|
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | using namespace QMdi; | - |
| 11 | | - |
| 12 | | - |
| 13 | static bool sanityCheck(const QMdiSubWindow * const child, const char *where) | - |
| 14 | { | - |
| 15 | if (!child) { partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:1280 |
| 0-1280 |
| 16 | const char error[] = "null pointer"; | - |
| 17 | qt_noop(); | - |
| 18 | QMessageLogger("widgets/qmdiarea.cpp", 191, __PRETTY_FUNCTION__).warning("%s:%s", where, error); | - |
| 19 | return false; never executed: return false; | 0 |
| 20 | } | - |
| 21 | return true; executed: return true;Execution Count:1280 | 1280 |
| 22 | } | - |
| 23 | | - |
| 24 | static bool sanityCheck(const QList<QWidget *> &widgets, const int index, const char *where) | - |
| 25 | { | - |
| 26 | if (index < 0 || index >= widgets.size()) { partially evaluated: index < 0| no Evaluation Count:0 | yes Evaluation Count:36 |
partially evaluated: index >= widgets.size()| no Evaluation Count:0 | yes Evaluation Count:36 |
| 0-36 |
| 27 | const char error[] = "index out of range"; | - |
| 28 | qt_noop(); | - |
| 29 | QMessageLogger("widgets/qmdiarea.cpp", 202, __PRETTY_FUNCTION__).warning("%s:%s", where, error); | - |
| 30 | return false; never executed: return false; | 0 |
| 31 | } | - |
| 32 | if (!widgets.at(index)) { partially evaluated: !widgets.at(index)| no Evaluation Count:0 | yes Evaluation Count:36 |
| 0-36 |
| 33 | const char error[] = "null pointer"; | - |
| 34 | qt_noop(); | - |
| 35 | QMessageLogger("widgets/qmdiarea.cpp", 208, __PRETTY_FUNCTION__).warning("%s:%s", where, error); | - |
| 36 | return false; never executed: return false; | 0 |
| 37 | } | - |
| 38 | return true; executed: return true;Execution Count:36 | 36 |
| 39 | } | - |
| 40 | | - |
| 41 | static void setIndex(int *index, int candidate, int min, int max, bool isIncreasing) | - |
| 42 | { | - |
| 43 | if (!index) partially evaluated: !index| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 44 | return; | 0 |
| 45 | | - |
| 46 | if (isIncreasing) { partially evaluated: isIncreasing| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 47 | if (candidate > max) evaluated: candidate > max| yes Evaluation Count:2 | yes Evaluation Count:4 |
| 2-4 |
| 48 | *index = min; executed: *index = min;Execution Count:2 | 2 |
| 49 | else | - |
| 50 | *index = qMax(candidate, min); executed: *index = qMax(candidate, min);Execution Count:4 | 4 |
| 51 | } else { | - |
| 52 | if (candidate < min) never evaluated: candidate < min | 0 |
| 53 | *index = max; never executed: *index = max; | 0 |
| 54 | else | - |
| 55 | *index = qMin(candidate, max); never executed: *index = qMin(candidate, max); | 0 |
| 56 | } | - |
| 57 | qt_noop(); | - |
| 58 | } executed: }Execution Count:6 | 6 |
| 59 | | - |
| 60 | static inline bool useScrollBar(const QRect &childrenRect, const QSize &maxViewportSize, | - |
| 61 | Qt::Orientation orientation) | - |
| 62 | { | - |
| 63 | if (orientation == Qt::Horizontal) evaluated: orientation == Qt::Horizontal| yes Evaluation Count:129 | yes Evaluation Count:86 |
| 86-129 |
| 64 | return childrenRect.width() > maxViewportSize.width() | 129 |
| 65 | || childrenRect.left() < 0 | 129 |
| 66 | || childrenRect.right() >= maxViewportSize.width(); executed: return childrenRect.width() > maxViewportSize.width() || childrenRect.left() < 0 || childrenRect.right() >= maxViewportSize.width();Execution Count:129 | 129 |
| 67 | else | - |
| 68 | return childrenRect.height() > maxViewportSize.height() | 86 |
| 69 | || childrenRect.top() < 0 | 86 |
| 70 | || childrenRect.bottom() >= maxViewportSize.height(); executed: return childrenRect.height() > maxViewportSize.height() || childrenRect.top() < 0 || childrenRect.bottom() >= maxViewportSize.height();Execution Count:86 | 86 |
| 71 | } | - |
| 72 | | - |
| 73 | | - |
| 74 | static inline QMdiArea *mdiAreaParent(QWidget *widget) | - |
| 75 | { | - |
| 76 | if (!widget) | 0 |
| 77 | return 0; never executed: return 0; | 0 |
| 78 | | - |
| 79 | QWidget *parent = widget->parentWidget(); | - |
| 80 | while (parent) { | 0 |
| 81 | if (QMdiArea *area = qobject_cast<QMdiArea *>(parent)) never evaluated: QMdiArea *area = qobject_cast<QMdiArea *>(parent) | 0 |
| 82 | return area; never executed: return area; | 0 |
| 83 | parent = parent->parentWidget(); | - |
| 84 | } | 0 |
| 85 | return 0; never executed: return 0; | 0 |
| 86 | } | - |
| 87 | | - |
| 88 | | - |
| 89 | static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position) | - |
| 90 | { | - |
| 91 | const bool rounded = (shape == QTabWidget::Rounded); | - |
| 92 | if (position == QTabWidget::North) never evaluated: position == QTabWidget::North | 0 |
| 93 | return rounded ? QTabBar::RoundedNorth : QTabBar::TriangularNorth; never executed: return rounded ? QTabBar::RoundedNorth : QTabBar::TriangularNorth; | 0 |
| 94 | if (position == QTabWidget::South) never evaluated: position == QTabWidget::South | 0 |
| 95 | return rounded ? QTabBar::RoundedSouth : QTabBar::TriangularSouth; never executed: return rounded ? QTabBar::RoundedSouth : QTabBar::TriangularSouth; | 0 |
| 96 | if (position == QTabWidget::East) never evaluated: position == QTabWidget::East | 0 |
| 97 | return rounded ? QTabBar::RoundedEast : QTabBar::TriangularEast; never executed: return rounded ? QTabBar::RoundedEast : QTabBar::TriangularEast; | 0 |
| 98 | if (position == QTabWidget::West) never evaluated: position == QTabWidget::West | 0 |
| 99 | return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest; never executed: return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest; | 0 |
| 100 | return QTabBar::RoundedNorth; never executed: return QTabBar::RoundedNorth; | 0 |
| 101 | } | - |
| 102 | | - |
| 103 | | - |
| 104 | static inline QString tabTextFor(QMdiSubWindow *subWindow) | - |
| 105 | { | - |
| 106 | if (!subWindow) never evaluated: !subWindow | 0 |
| 107 | return QString(); never executed: return QString(); | 0 |
| 108 | | - |
| 109 | QString title = subWindow->windowTitle(); | - |
| 110 | if (subWindow->isWindowModified()) { never evaluated: subWindow->isWindowModified() | 0 |
| 111 | title.replace(QLatin1String("[*]"), QLatin1String("*")); | - |
| 112 | } else { | 0 |
| 113 | extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); | - |
| 114 | title = qt_setWindowTitle_helperHelper(title, subWindow); | - |
| 115 | } | 0 |
| 116 | | - |
| 117 | return title.isEmpty() ? QMdiArea::tr("(Untitled)") : title; never executed: return title.isEmpty() ? QMdiArea::tr("(Untitled)") : title; | 0 |
| 118 | } | - |
| 119 | | - |
| 120 | | - |
| 121 | | - |
| 122 | | - |
| 123 | void RegularTiler::rearrange(QList<QWidget *> &widgets, const QRect &domain) const | - |
| 124 | { | - |
| 125 | if (widgets.isEmpty()) never evaluated: widgets.isEmpty() | 0 |
| 126 | return; | 0 |
| 127 | | - |
| 128 | const int n = widgets.size(); | - |
| 129 | const int ncols = qMax(qCeil(qSqrt(qreal(n))), 1); | - |
| 130 | const int nrows = qMax((n % ncols) ? (n / ncols + 1) : (n / ncols), 1); | - |
| 131 | const int nspecial = (n % ncols) ? (ncols - n % ncols) : 0; never evaluated: (n % ncols) | 0 |
| 132 | const int dx = domain.width() / ncols; | - |
| 133 | const int dy = domain.height() / nrows; | - |
| 134 | | - |
| 135 | int i = 0; | - |
| 136 | for (int row = 0; row < nrows; ++row) { never evaluated: row < nrows | 0 |
| 137 | const int y1 = int(row * (dy + 1)); | - |
| 138 | for (int col = 0; col < ncols; ++col) { never evaluated: col < ncols | 0 |
| 139 | if (row == 1 && col < nspecial) never evaluated: row == 1 never evaluated: col < nspecial | 0 |
| 140 | continue; never executed: continue; | 0 |
| 141 | const int x1 = int(col * (dx + 1)); | - |
| 142 | int x2 = int(x1 + dx); | - |
| 143 | int y2 = int(y1 + dy); | - |
| 144 | if (row == 0 && col < nspecial) { never evaluated: row == 0 never evaluated: col < nspecial | 0 |
| 145 | y2 *= 2; | - |
| 146 | if (nrows != 2) never evaluated: nrows != 2 | 0 |
| 147 | y2 += 1; | 0 |
| 148 | else | - |
| 149 | y2 = domain.bottom(); never executed: y2 = domain.bottom(); | 0 |
| 150 | } | - |
| 151 | if (col == ncols - 1 && x2 != domain.right()) never evaluated: col == ncols - 1 never evaluated: x2 != domain.right() | 0 |
| 152 | x2 = domain.right(); never executed: x2 = domain.right(); | 0 |
| 153 | if (row == nrows - 1 && y2 != domain.bottom()) never evaluated: row == nrows - 1 never evaluated: y2 != domain.bottom() | 0 |
| 154 | y2 = domain.bottom(); never executed: y2 = domain.bottom(); | 0 |
| 155 | if (!sanityCheck(widgets, i, "RegularTiler")) never evaluated: !sanityCheck(widgets, i, "RegularTiler") | 0 |
| 156 | continue; never executed: continue; | 0 |
| 157 | QWidget *widget = widgets.at(i++); | - |
| 158 | QRect newGeometry = QRect(QPoint(x1, y1), QPoint(x2, y2)); | - |
| 159 | widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); | - |
| 160 | } | 0 |
| 161 | } | 0 |
| 162 | } | 0 |
| 163 | | - |
| 164 | | - |
| 165 | | - |
| 166 | | - |
| 167 | void SimpleCascader::rearrange(QList<QWidget *> &widgets, const QRect &domain) const | - |
| 168 | { | - |
| 169 | if (widgets.isEmpty()) never evaluated: widgets.isEmpty() | 0 |
| 170 | return; | 0 |
| 171 | | - |
| 172 | | - |
| 173 | const int topOffset = 0; | - |
| 174 | const int bottomOffset = 50; | - |
| 175 | const int leftOffset = 0; | - |
| 176 | const int rightOffset = 100; | - |
| 177 | const int dx = 10; | - |
| 178 | | - |
| 179 | QStyleOptionTitleBar options; | - |
| 180 | options.initFrom(widgets.at(0)); | - |
| 181 | int titleBarHeight = widgets.at(0)->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, widgets.at(0)); | - |
| 182 | | - |
| 183 | | - |
| 184 | | - |
| 185 | | - |
| 186 | | - |
| 187 | const QFontMetrics fontMetrics = QFontMetrics(QApplication::font("QMdiSubWindowTitleBar")); | - |
| 188 | const int dy = qMax(titleBarHeight - (titleBarHeight - fontMetrics.height()) / 2, 1); | - |
| 189 | | - |
| 190 | const int n = widgets.size(); | - |
| 191 | const int nrows = qMax((domain.height() - (topOffset + bottomOffset)) / dy, 1); | - |
| 192 | const int ncols = qMax(n / nrows + ((n % nrows) ? 1 : 0), 1); | - |
| 193 | const int dcol = (domain.width() - (leftOffset + rightOffset)) / ncols; | - |
| 194 | | - |
| 195 | int i = 0; | - |
| 196 | for (int row = 0; row < nrows; ++row) { never evaluated: row < nrows | 0 |
| 197 | for (int col = 0; col < ncols; ++col) { never evaluated: col < ncols | 0 |
| 198 | const int x = leftOffset + row * dx + col * dcol; | - |
| 199 | const int y = topOffset + row * dy; | - |
| 200 | if (!sanityCheck(widgets, i, "SimpleCascader")) never evaluated: !sanityCheck(widgets, i, "SimpleCascader") | 0 |
| 201 | continue; never executed: continue; | 0 |
| 202 | QWidget *widget = widgets.at(i++); | - |
| 203 | QRect newGeometry = QRect(QPoint(x, y), widget->sizeHint()); | - |
| 204 | widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); | - |
| 205 | if (i == n) | 0 |
| 206 | return; | 0 |
| 207 | } | 0 |
| 208 | } | 0 |
| 209 | } | 0 |
| 210 | | - |
| 211 | | - |
| 212 | | - |
| 213 | | - |
| 214 | void IconTiler::rearrange(QList<QWidget *> &widgets, const QRect &domain) const | - |
| 215 | { | - |
| 216 | if (widgets.isEmpty() || !sanityCheck(widgets, 0, "IconTiler")) evaluated: widgets.isEmpty()| yes Evaluation Count:80 | yes Evaluation Count:18 |
partially evaluated: !sanityCheck(widgets, 0, "IconTiler")| no Evaluation Count:0 | yes Evaluation Count:18 |
| 0-80 |
| 217 | return; executed: return;Execution Count:80 | 80 |
| 218 | | - |
| 219 | const int n = widgets.size(); | - |
| 220 | const int width = widgets.at(0)->width(); | - |
| 221 | const int height = widgets.at(0)->height(); | - |
| 222 | const int ncols = qMax(domain.width() / width, 1); | - |
| 223 | const int nrows = n / ncols + ((n % ncols) ? 1 : 0); evaluated: (n % ncols)| yes Evaluation Count:13 | yes Evaluation Count:5 |
| 5-13 |
| 224 | | - |
| 225 | int i = 0; | - |
| 226 | for (int row = 0; row < nrows; ++row) { partially evaluated: row < nrows| yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
| 227 | for (int col = 0; col < ncols; ++col) { partially evaluated: col < ncols| yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
| 228 | const int x = col * width; | - |
| 229 | const int y = domain.height() - height - row * height; | - |
| 230 | if (!sanityCheck(widgets, i, "IconTiler")) partially evaluated: !sanityCheck(widgets, i, "IconTiler")| no Evaluation Count:0 | yes Evaluation Count:18 |
| 0-18 |
| 231 | continue; never executed: continue; | 0 |
| 232 | QWidget *widget = widgets.at(i++); | - |
| 233 | QPoint newPos(x, y); | - |
| 234 | QRect newGeometry = QRect(newPos.x(), newPos.y(), widget->width(), widget->height()); | - |
| 235 | widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); | - |
| 236 | if (i == n) partially evaluated: i == n| yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
| 237 | return; executed: return;Execution Count:18 | 18 |
| 238 | } | 0 |
| 239 | } | 0 |
| 240 | } | 0 |
| 241 | | - |
| 242 | | - |
| 243 | | - |
| 244 | | - |
| 245 | | - |
| 246 | int MinOverlapPlacer::accumulatedOverlap(const QRect &source, const QList<QRect> &rects) | - |
| 247 | { | - |
| 248 | int accOverlap = 0; | - |
| 249 | for (QForeachContainer<__typeof__(rects)> _container_(rects); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QRect &rect = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 250 | QRect intersection = source.intersected(rect); | - |
| 251 | accOverlap += intersection.width() * intersection.height(); | - |
| 252 | } executed: }Execution Count:264 | 264 |
| 253 | return accOverlap; executed: return accOverlap;Execution Count:400 | 400 |
| 254 | } | - |
| 255 | | - |
| 256 | | - |
| 257 | | - |
| 258 | | - |
| 259 | | - |
| 260 | | - |
| 261 | | - |
| 262 | QRect MinOverlapPlacer::findMinOverlapRect(const QList<QRect> &source, const QList<QRect> &rects) | - |
| 263 | { | - |
| 264 | int minAccOverlap = -1; | - |
| 265 | QRect minAccOverlapRect; | - |
| 266 | for (QForeachContainer<__typeof__(source)> _container_(source); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QRect &srcRect = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 267 | const int accOverlap = accumulatedOverlap(srcRect, rects); | - |
| 268 | if (accOverlap < minAccOverlap || minAccOverlap == -1) { evaluated: accOverlap < minAccOverlap| yes Evaluation Count:16 | yes Evaluation Count:384 |
evaluated: minAccOverlap == -1| yes Evaluation Count:87 | yes Evaluation Count:297 |
| 16-384 |
| 269 | minAccOverlap = accOverlap; | - |
| 270 | minAccOverlapRect = srcRect; | - |
| 271 | } executed: }Execution Count:103 | 103 |
| 272 | } executed: }Execution Count:400 | 400 |
| 273 | return minAccOverlapRect; executed: return minAccOverlapRect;Execution Count:87 | 87 |
| 274 | } | - |
| 275 | | - |
| 276 | | - |
| 277 | | - |
| 278 | | - |
| 279 | | - |
| 280 | void MinOverlapPlacer::getCandidatePlacements(const QSize &size, const QList<QRect> &rects, | - |
| 281 | const QRect &domain,QList<QRect> &candidates) | - |
| 282 | { | - |
| 283 | QSet<int> xset; | - |
| 284 | QSet<int> yset; | - |
| 285 | xset << domain.left() << domain.right() - size.width() + 1; | - |
| 286 | yset << domain.top(); | - |
| 287 | if (domain.bottom() - size.height() + 1 >= 0) evaluated: domain.bottom() - size.height() + 1 >= 0| yes Evaluation Count:85 | yes Evaluation Count:2 |
| 2-85 |
| 288 | yset << domain.bottom() - size.height() + 1; executed: yset << domain.bottom() - size.height() + 1;Execution Count:85 | 85 |
| 289 | for (QForeachContainer<__typeof__(rects)> _container_(rects); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QRect &rect = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 290 | xset << rect.right() + 1; | - |
| 291 | yset << rect.bottom() + 1; | - |
| 292 | } executed: }Execution Count:32 | 32 |
| 293 | | - |
| 294 | QList<int> xlist = xset.values(); | - |
| 295 | qSort(xlist.begin(), xlist.end()); | - |
| 296 | QList<int> ylist = yset.values(); | - |
| 297 | qSort(ylist.begin(), ylist.end()); | - |
| 298 | | - |
| 299 | for (QForeachContainer<__typeof__(ylist)> _container_(ylist); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (int y = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
| 300 | for (QForeachContainer<__typeof__(xlist)> _container_(xlist); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (int x = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
| 301 | candidates << QRect(QPoint(x, y), size); executed: candidates << QRect(QPoint(x, y), size);Execution Count:477 | 477 |
| 302 | } executed: }Execution Count:87 | 87 |
| 303 | | - |
| 304 | | - |
| 305 | | - |
| 306 | | - |
| 307 | | - |
| 308 | | - |
| 309 | void MinOverlapPlacer::findNonInsiders(const QRect &domain, QList<QRect> &source, | - |
| 310 | QList<QRect> &result) | - |
| 311 | { | - |
| 312 | QMutableListIterator<QRect> it(source); | - |
| 313 | while (it.hasNext()) { evaluated: it.hasNext()| yes Evaluation Count:477 | yes Evaluation Count:87 |
| 87-477 |
| 314 | const QRect srcRect = it.next(); | - |
| 315 | if (!domain.contains(srcRect)) { evaluated: !domain.contains(srcRect)| yes Evaluation Count:81 | yes Evaluation Count:396 |
| 81-396 |
| 316 | result << srcRect; | - |
| 317 | it.remove(); | - |
| 318 | } executed: }Execution Count:81 | 81 |
| 319 | } executed: }Execution Count:477 | 477 |
| 320 | } executed: }Execution Count:87 | 87 |
| 321 | | - |
| 322 | | - |
| 323 | | - |
| 324 | | - |
| 325 | | - |
| 326 | | - |
| 327 | void MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const QList<QRect> &source, | - |
| 328 | QList<QRect> &result) | - |
| 329 | { | - |
| 330 | int maxOverlap = -1; | - |
| 331 | for (QForeachContainer<__typeof__(source)> _container_(source); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QRect &srcRect = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 332 | QRect intersection = domain.intersected(srcRect); | - |
| 333 | const int overlap = intersection.width() * intersection.height(); | - |
| 334 | if (overlap >= maxOverlap || maxOverlap == -1) { evaluated: overlap >= maxOverlap| yes Evaluation Count:4 | yes Evaluation Count:4 |
partially evaluated: maxOverlap == -1| no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
| 335 | if (overlap > maxOverlap) { evaluated: overlap > maxOverlap| yes Evaluation Count:2 | yes Evaluation Count:2 |
| 2 |
| 336 | maxOverlap = overlap; | - |
| 337 | result.clear(); | - |
| 338 | } executed: }Execution Count:2 | 2 |
| 339 | result << srcRect; | - |
| 340 | } executed: }Execution Count:4 | 4 |
| 341 | } executed: }Execution Count:8 | 8 |
| 342 | } executed: }Execution Count:2 | 2 |
| 343 | | - |
| 344 | | - |
| 345 | | - |
| 346 | | - |
| 347 | | - |
| 348 | | - |
| 349 | | - |
| 350 | QPoint MinOverlapPlacer::findBestPlacement(const QRect &domain, const QList<QRect> &rects, | - |
| 351 | QList<QRect> &source) | - |
| 352 | { | - |
| 353 | QList<QRect> nonInsiders; | - |
| 354 | findNonInsiders(domain, source, nonInsiders); | - |
| 355 | | - |
| 356 | if (!source.empty()) evaluated: !source.empty()| yes Evaluation Count:85 | yes Evaluation Count:2 |
| 2-85 |
| 357 | return findMinOverlapRect(source, rects).topLeft(); executed: return findMinOverlapRect(source, rects).topLeft();Execution Count:85 | 85 |
| 358 | | - |
| 359 | QList<QRect> maxOverlappers; | - |
| 360 | findMaxOverlappers(domain, nonInsiders, maxOverlappers); | - |
| 361 | return findMinOverlapRect(maxOverlappers, rects).topLeft(); executed: return findMinOverlapRect(maxOverlappers, rects).topLeft();Execution Count:2 | 2 |
| 362 | } | - |
| 363 | QPoint MinOverlapPlacer::place(const QSize &size, const QList<QRect> &rects, | - |
| 364 | const QRect &domain) const | - |
| 365 | { | - |
| 366 | if (size.isEmpty() || !domain.isValid()) partially evaluated: size.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:87 |
partially evaluated: !domain.isValid()| no Evaluation Count:0 | yes Evaluation Count:87 |
| 0-87 |
| 367 | return QPoint(); never executed: return QPoint(); | 0 |
| 368 | for (QForeachContainer<__typeof__(rects)> _container_(rects); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (const QRect &rect = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 369 | if (!rect.isValid()) partially evaluated: !rect.isValid()| no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
| 370 | return QPoint(); never executed: return QPoint(); | 0 |
| 371 | } executed: }Execution Count:32 | 32 |
| 372 | | - |
| 373 | QList<QRect> candidates; | - |
| 374 | getCandidatePlacements(size, rects, domain, candidates); | - |
| 375 | return findBestPlacement(domain, rects, candidates); executed: return findBestPlacement(domain, rects, candidates);Execution Count:87 | 87 |
| 376 | } | - |
| 377 | | - |
| 378 | | - |
| 379 | class QMdiAreaTabBar : public QTabBar | - |
| 380 | { | - |
| 381 | public: | - |
| 382 | QMdiAreaTabBar(QWidget *parent) : QTabBar(parent) {} | 0 |
| 383 | | - |
| 384 | protected: | - |
| 385 | void mousePressEvent(QMouseEvent *event); | - |
| 386 | | - |
| 387 | void contextMenuEvent(QContextMenuEvent *event); | - |
| 388 | | - |
| 389 | | - |
| 390 | private: | - |
| 391 | QMdiSubWindow *subWindowFromIndex(int index) const; | - |
| 392 | }; | - |
| 393 | | - |
| 394 | | - |
| 395 | | - |
| 396 | | - |
| 397 | void QMdiAreaTabBar::mousePressEvent(QMouseEvent *event) | - |
| 398 | { | - |
| 399 | if (event->button() != Qt::MidButton) { never evaluated: event->button() != Qt::MidButton | 0 |
| 400 | QTabBar::mousePressEvent(event); | - |
| 401 | return; | 0 |
| 402 | } | - |
| 403 | | - |
| 404 | QMdiSubWindow *subWindow = subWindowFromIndex(tabAt(event->pos())); | - |
| 405 | if (!subWindow) { never evaluated: !subWindow | 0 |
| 406 | event->ignore(); | - |
| 407 | return; | 0 |
| 408 | } | - |
| 409 | | - |
| 410 | subWindow->close(); | - |
| 411 | } | 0 |
| 412 | | - |
| 413 | | - |
| 414 | | - |
| 415 | | - |
| 416 | | - |
| 417 | void QMdiAreaTabBar::contextMenuEvent(QContextMenuEvent *event) | - |
| 418 | { | - |
| 419 | QPointer<QMdiSubWindow> subWindow = subWindowFromIndex(tabAt(event->pos())); | - |
| 420 | if (!subWindow || subWindow->isHidden()) { never evaluated: !subWindow never evaluated: subWindow->isHidden() | 0 |
| 421 | event->ignore(); | - |
| 422 | return; | 0 |
| 423 | } | - |
| 424 | | - |
| 425 | | - |
| 426 | QMdiSubWindowPrivate *subWindowPrivate = subWindow->d_func(); | - |
| 427 | if (!subWindowPrivate->systemMenu) { never evaluated: !subWindowPrivate->systemMenu | 0 |
| 428 | event->ignore(); | - |
| 429 | return; | 0 |
| 430 | } | - |
| 431 | | - |
| 432 | QMdiSubWindow *currentSubWindow = subWindowFromIndex(currentIndex()); | - |
| 433 | qt_noop(); | - |
| 434 | | - |
| 435 | | - |
| 436 | | - |
| 437 | if (currentSubWindow->isMaximized()) { never evaluated: currentSubWindow->isMaximized() | 0 |
| 438 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::MoveAction, false); | - |
| 439 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::ResizeAction, false); | - |
| 440 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::MinimizeAction, false); | - |
| 441 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::MaximizeAction, false); | - |
| 442 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::RestoreAction, false); | - |
| 443 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::StayOnTopAction, false); | - |
| 444 | } | 0 |
| 445 | | - |
| 446 | | - |
| 447 | subWindowPrivate->systemMenu->exec(event->globalPos()); | - |
| 448 | if (!subWindow) never evaluated: !subWindow | 0 |
| 449 | return; | 0 |
| 450 | | - |
| 451 | | - |
| 452 | subWindowPrivate->updateActions(); | - |
| 453 | | - |
| 454 | } | 0 |
| 455 | | - |
| 456 | | - |
| 457 | | - |
| 458 | | - |
| 459 | | - |
| 460 | QMdiSubWindow *QMdiAreaTabBar::subWindowFromIndex(int index) const | - |
| 461 | { | - |
| 462 | if (index < 0 || index >= count()) never evaluated: index < 0 never evaluated: index >= count() | 0 |
| 463 | return 0; never executed: return 0; | 0 |
| 464 | | - |
| 465 | QMdiArea *mdiArea = qobject_cast<QMdiArea *>(parentWidget()); | - |
| 466 | qt_noop(); | - |
| 467 | | - |
| 468 | const QList<QMdiSubWindow *> subWindows = mdiArea->subWindowList(); | - |
| 469 | qt_noop(); | - |
| 470 | | - |
| 471 | QMdiSubWindow *subWindow = mdiArea->subWindowList().at(index); | - |
| 472 | qt_noop(); | - |
| 473 | | - |
| 474 | return subWindow; never executed: return subWindow; | 0 |
| 475 | } | - |
| 476 | | - |
| 477 | | - |
| 478 | | - |
| 479 | | - |
| 480 | | - |
| 481 | QMdiAreaPrivate::QMdiAreaPrivate() | - |
| 482 | : cascader(0), | - |
| 483 | regularTiler(0), | - |
| 484 | iconTiler(0), | - |
| 485 | placer(0), | - |
| 486 | | - |
| 487 | rubberBand(0), | - |
| 488 | | - |
| 489 | | - |
| 490 | tabBar(0), | - |
| 491 | | - |
| 492 | activationOrder(QMdiArea::CreationOrder), | - |
| 493 | viewMode(QMdiArea::SubWindowView), | - |
| 494 | | - |
| 495 | documentMode(false), | - |
| 496 | tabsClosable(false), | - |
| 497 | tabsMovable(false), | - |
| 498 | | - |
| 499 | | - |
| 500 | tabShape(QTabWidget::Rounded), | - |
| 501 | tabPosition(QTabWidget::North), | - |
| 502 | | - |
| 503 | ignoreGeometryChange(false), | - |
| 504 | ignoreWindowStateChange(false), | - |
| 505 | isActivated(false), | - |
| 506 | isSubWindowsTiled(false), | - |
| 507 | showActiveWindowMaximized(false), | - |
| 508 | tileCalledFromResizeEvent(false), | - |
| 509 | updatesDisabledByUs(false), | - |
| 510 | inViewModeChange(false), | - |
| 511 | indexToNextWindow(-1), | - |
| 512 | indexToPreviousWindow(-1), | - |
| 513 | indexToHighlighted(-1), | - |
| 514 | indexToLastActiveTab(-1), | - |
| 515 | resizeTimerId(-1), | - |
| 516 | tabToPreviousTimerId(-1) | - |
| 517 | { | - |
| 518 | } executed: }Execution Count:80 | 80 |
| 519 | | - |
| 520 | | - |
| 521 | | - |
| 522 | | - |
| 523 | void QMdiAreaPrivate::_q_deactivateAllWindows(QMdiSubWindow *aboutToActivate) | - |
| 524 | { | - |
| 525 | if (ignoreWindowStateChange) partially evaluated: ignoreWindowStateChange| no Evaluation Count:0 | yes Evaluation Count:138 |
| 0-138 |
| 526 | return; | 0 |
| 527 | | - |
| 528 | QMdiArea * const q = q_func(); | - |
| 529 | if (!aboutToActivate) partially evaluated: !aboutToActivate| yes Evaluation Count:138 | no Evaluation Count:0 |
| 0-138 |
| 530 | aboutToBecomeActive = qobject_cast<QMdiSubWindow *>(q->sender()); executed: aboutToBecomeActive = qobject_cast<QMdiSubWindow *>(q->sender());Execution Count:138 | 138 |
| 531 | else | - |
| 532 | aboutToBecomeActive = aboutToActivate; never executed: aboutToBecomeActive = aboutToActivate; | 0 |
| 533 | qt_noop(); | - |
| 534 | | - |
| 535 | for (QForeachContainer<__typeof__(childWindows)> _container_(childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 536 | if (!sanityCheck(child, "QMdiArea::deactivateAllWindows") || aboutToBecomeActive == child) partially evaluated: !sanityCheck(child, "QMdiArea::deactivateAllWindows")| no Evaluation Count:0 | yes Evaluation Count:283 |
evaluated: aboutToBecomeActive == child| yes Evaluation Count:138 | yes Evaluation Count:145 |
| 0-283 |
| 537 | continue; executed: continue;Execution Count:138 | 138 |
| 538 | | - |
| 539 | ignoreWindowStateChange = true; | - |
| 540 | if(!(options & QMdiArea::DontMaximizeSubWindowOnActivation) && !showActiveWindowMaximized) evaluated: !(options & QMdiArea::DontMaximizeSubWindowOnActivation)| yes Evaluation Count:133 | yes Evaluation Count:12 |
evaluated: !showActiveWindowMaximized| yes Evaluation Count:117 | yes Evaluation Count:16 |
| 12-133 |
| 541 | showActiveWindowMaximized = child->isMaximized() && child->isVisible(); evaluated: child->isMaximized()| yes Evaluation Count:21 | yes Evaluation Count:96 |
evaluated: child->isVisible()| yes Evaluation Count:16 | yes Evaluation Count:5 |
executed: showActiveWindowMaximized = child->isMaximized() && child->isVisible();Execution Count:117 | 5-117 |
| 542 | if (showActiveWindowMaximized && child->isMaximized()) { evaluated: showActiveWindowMaximized| yes Evaluation Count:32 | yes Evaluation Count:113 |
evaluated: child->isMaximized()| yes Evaluation Count:16 | yes Evaluation Count:16 |
| 16-113 |
| 543 | if (q->updatesEnabled()) { evaluated: q->updatesEnabled()| yes Evaluation Count:11 | yes Evaluation Count:5 |
| 5-11 |
| 544 | updatesDisabledByUs = true; | - |
| 545 | q->setUpdatesEnabled(false); | - |
| 546 | } executed: }Execution Count:11 | 11 |
| 547 | child->showNormal(); | - |
| 548 | } executed: }Execution Count:16 | 16 |
| 549 | if (child->isMinimized() && !child->isShaded() && !windowStaysOnTop(child)) evaluated: child->isMinimized()| yes Evaluation Count:4 | yes Evaluation Count:141 |
partially evaluated: !child->isShaded()| yes Evaluation Count:4 | no Evaluation Count:0 |
partially evaluated: !windowStaysOnTop(child)| yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-141 |
| 550 | child->lower(); executed: child->lower();Execution Count:4 | 4 |
| 551 | ignoreWindowStateChange = false; | - |
| 552 | child->d_func()->setActive(false); | - |
| 553 | } executed: }Execution Count:145 | 145 |
| 554 | } executed: }Execution Count:138 | 138 |
| 555 | | - |
| 556 | | - |
| 557 | | - |
| 558 | | - |
| 559 | void QMdiAreaPrivate::_q_processWindowStateChanged(Qt::WindowStates oldState, | - |
| 560 | Qt::WindowStates newState) | - |
| 561 | { | - |
| 562 | if (ignoreWindowStateChange) evaluated: ignoreWindowStateChange| yes Evaluation Count:16 | yes Evaluation Count:343 |
| 16-343 |
| 563 | return; executed: return;Execution Count:16 | 16 |
| 564 | | - |
| 565 | QMdiArea * const q = q_func(); | - |
| 566 | QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(q->sender()); | - |
| 567 | if (!child) partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:343 |
| 0-343 |
| 568 | return; | 0 |
| 569 | | - |
| 570 | | - |
| 571 | if (!(oldState & Qt::WindowActive) && (newState & Qt::WindowActive)) evaluated: !(oldState & Qt::WindowActive)| yes Evaluation Count:155 | yes Evaluation Count:188 |
evaluated: (newState & Qt::WindowActive)| yes Evaluation Count:151 | yes Evaluation Count:4 |
| 4-188 |
| 572 | emitWindowActivated(child); executed: emitWindowActivated(child);Execution Count:151 | 151 |
| 573 | | - |
| 574 | else if ((oldState & Qt::WindowActive) && !(newState & Qt::WindowActive)) evaluated: (oldState & Qt::WindowActive)| yes Evaluation Count:188 | yes Evaluation Count:4 |
evaluated: !(newState & Qt::WindowActive)| yes Evaluation Count:91 | yes Evaluation Count:97 |
| 4-188 |
| 575 | resetActiveWindow(child); executed: resetActiveWindow(child);Execution Count:91 | 91 |
| 576 | | - |
| 577 | | - |
| 578 | if (!(oldState & Qt::WindowMinimized) && (newState & Qt::WindowMinimized)) { evaluated: !(oldState & Qt::WindowMinimized)| yes Evaluation Count:316 | yes Evaluation Count:27 |
evaluated: (newState & Qt::WindowMinimized)| yes Evaluation Count:16 | yes Evaluation Count:300 |
| 16-316 |
| 579 | isSubWindowsTiled = false; | - |
| 580 | arrangeMinimizedSubWindows(); | - |
| 581 | | - |
| 582 | } else if (!(oldState & Qt::WindowMaximized) && (newState & Qt::WindowMaximized)) { evaluated: !(oldState & Qt::WindowMaximized)| yes Evaluation Count:242 | yes Evaluation Count:85 |
evaluated: (newState & Qt::WindowMaximized)| yes Evaluation Count:58 | yes Evaluation Count:184 |
executed: }Execution Count:16 | 16-242 |
| 583 | internalRaise(child); | - |
| 584 | | - |
| 585 | } else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized))) { evaluated: !(newState & (Qt::WindowMaximized | Qt::WindowMinimized))| yes Evaluation Count:200 | yes Evaluation Count:69 |
executed: }Execution Count:58 | 58-200 |
| 586 | internalRaise(child); | - |
| 587 | if (oldState & Qt::WindowMinimized) evaluated: oldState & Qt::WindowMinimized| yes Evaluation Count:16 | yes Evaluation Count:184 |
| 16-184 |
| 588 | arrangeMinimizedSubWindows(); executed: arrangeMinimizedSubWindows();Execution Count:16 | 16 |
| 589 | } executed: }Execution Count:200 | 200 |
| 590 | } | - |
| 591 | | - |
| 592 | void QMdiAreaPrivate::_q_currentTabChanged(int index) | - |
| 593 | { | - |
| 594 | | - |
| 595 | | - |
| 596 | | - |
| 597 | if (!tabBar || index < 0) never evaluated: index < 0 | 0 |
| 598 | return; | 0 |
| 599 | | - |
| 600 | | - |
| 601 | if (indexToLastActiveTab >= 0 && indexToLastActiveTab < tabBar->count() never evaluated: indexToLastActiveTab >= 0 never evaluated: indexToLastActiveTab < tabBar->count() | 0 |
| 602 | && indexToLastActiveTab < childWindows.count()) { never evaluated: indexToLastActiveTab < childWindows.count() | 0 |
| 603 | QMdiSubWindow *lastActive = childWindows.at(indexToLastActiveTab); | - |
| 604 | if (lastActive && lastActive->isHidden()) never evaluated: lastActive never evaluated: lastActive->isHidden() | 0 |
| 605 | tabBar->setTabEnabled(indexToLastActiveTab, false); never executed: tabBar->setTabEnabled(indexToLastActiveTab, false); | 0 |
| 606 | } | 0 |
| 607 | | - |
| 608 | indexToLastActiveTab = index; | - |
| 609 | qt_noop(); | - |
| 610 | QMdiSubWindow *subWindow = childWindows.at(index); | - |
| 611 | qt_noop(); | - |
| 612 | activateWindow(subWindow); | - |
| 613 | | - |
| 614 | } | 0 |
| 615 | | - |
| 616 | void QMdiAreaPrivate::_q_closeTab(int index) | - |
| 617 | { | - |
| 618 | | - |
| 619 | | - |
| 620 | | - |
| 621 | QMdiSubWindow *subWindow = childWindows.at(index); | - |
| 622 | qt_noop(); | - |
| 623 | subWindow->close(); | - |
| 624 | | - |
| 625 | } | 0 |
| 626 | | - |
| 627 | void QMdiAreaPrivate::_q_moveTab(int from, int to) | - |
| 628 | { | - |
| 629 | | - |
| 630 | | - |
| 631 | | - |
| 632 | | - |
| 633 | childWindows.move(from, to); | - |
| 634 | | - |
| 635 | } | 0 |
| 636 | | - |
| 637 | | - |
| 638 | | - |
| 639 | | - |
| 640 | void QMdiAreaPrivate::appendChild(QMdiSubWindow *child) | - |
| 641 | { | - |
| 642 | QMdiArea * const q = q_func(); | - |
| 643 | qt_noop(); | - |
| 644 | | - |
| 645 | if (child->parent() != viewport) partially evaluated: child->parent() != viewport| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 646 | child->setParent(viewport, child->windowFlags()); never executed: child->setParent(viewport, child->windowFlags()); | 0 |
| 647 | childWindows.append(QPointer<QMdiSubWindow>(child)); | - |
| 648 | | - |
| 649 | if (!child->testAttribute(Qt::WA_Resized) && q->isVisible()) { evaluated: !child->testAttribute(Qt::WA_Resized)| yes Evaluation Count:100 | yes Evaluation Count:1 |
evaluated: q->isVisible()| yes Evaluation Count:36 | yes Evaluation Count:64 |
| 1-100 |
| 650 | QSize newSize(child->sizeHint().boundedTo(viewport->size())); | - |
| 651 | child->resize(newSize.expandedTo(qSmartMinSize(child))); | - |
| 652 | } executed: }Execution Count:36 | 36 |
| 653 | | - |
| 654 | if (!placer) evaluated: !placer| yes Evaluation Count:76 | yes Evaluation Count:25 |
| 25-76 |
| 655 | placer = new MinOverlapPlacer; executed: placer = new MinOverlapPlacer;Execution Count:76 | 76 |
| 656 | place(placer, child); | - |
| 657 | | - |
| 658 | if (hbarpolicy != Qt::ScrollBarAlwaysOff) partially evaluated: hbarpolicy != Qt::ScrollBarAlwaysOff| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 659 | child->setOption(QMdiSubWindow::AllowOutsideAreaHorizontally, true); never executed: child->setOption(QMdiSubWindow::AllowOutsideAreaHorizontally, true); | 0 |
| 660 | else | - |
| 661 | child->setOption(QMdiSubWindow::AllowOutsideAreaHorizontally, false); executed: child->setOption(QMdiSubWindow::AllowOutsideAreaHorizontally, false);Execution Count:101 | 101 |
| 662 | | - |
| 663 | if (vbarpolicy != Qt::ScrollBarAlwaysOff) partially evaluated: vbarpolicy != Qt::ScrollBarAlwaysOff| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 664 | child->setOption(QMdiSubWindow::AllowOutsideAreaVertically, true); never executed: child->setOption(QMdiSubWindow::AllowOutsideAreaVertically, true); | 0 |
| 665 | else | - |
| 666 | child->setOption(QMdiSubWindow::AllowOutsideAreaVertically, false); executed: child->setOption(QMdiSubWindow::AllowOutsideAreaVertically, false);Execution Count:101 | 101 |
| 667 | | - |
| 668 | internalRaise(child); | - |
| 669 | indicesToActivatedChildren.prepend(childWindows.size() - 1); | - |
| 670 | qt_noop(); | - |
| 671 | | - |
| 672 | | - |
| 673 | if (tabBar) { partially evaluated: tabBar| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 674 | tabBar->addTab(child->windowIcon(), tabTextFor(child)); | - |
| 675 | updateTabBarGeometry(); | - |
| 676 | if (childWindows.count() == 1 && !(options & QMdiArea::DontMaximizeSubWindowOnActivation)) never evaluated: childWindows.count() == 1 never evaluated: !(options & QMdiArea::DontMaximizeSubWindowOnActivation) | 0 |
| 677 | showActiveWindowMaximized = true; never executed: showActiveWindowMaximized = true; | 0 |
| 678 | } | 0 |
| 679 | | - |
| 680 | | - |
| 681 | if (!(child->windowFlags() & Qt::SubWindow)) partially evaluated: !(child->windowFlags() & Qt::SubWindow)| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 682 | child->setWindowFlags(Qt::SubWindow); never executed: child->setWindowFlags(Qt::SubWindow); | 0 |
| 683 | child->installEventFilter(q); | - |
| 684 | | - |
| 685 | QObject::connect(child, "2""aboutToActivate()", q, "1""_q_deactivateAllWindows()"); | - |
| 686 | QObject::connect(child, "2""windowStateChanged(Qt::WindowStates,Qt::WindowStates)", | - |
| 687 | q, "1""_q_processWindowStateChanged(Qt::WindowStates,Qt::WindowStates)"); | - |
| 688 | } executed: }Execution Count:101 | 101 |
| 689 | | - |
| 690 | | - |
| 691 | | - |
| 692 | | - |
| 693 | void QMdiAreaPrivate::place(Placer *placer, QMdiSubWindow *child) | - |
| 694 | { | - |
| 695 | if (!placer || !child) partially evaluated: !placer| no Evaluation Count:0 | yes Evaluation Count:152 |
partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:152 |
| 0-152 |
| 696 | return; | 0 |
| 697 | | - |
| 698 | QMdiArea * const q = q_func(); | - |
| 699 | if (!q->isVisible()) { evaluated: !q->isVisible()| yes Evaluation Count:65 | yes Evaluation Count:87 |
| 65-87 |
| 700 | | - |
| 701 | | - |
| 702 | | - |
| 703 | pendingPlacements.append(child); | - |
| 704 | return; executed: return;Execution Count:65 | 65 |
| 705 | } | - |
| 706 | | - |
| 707 | QList<QRect> rects; | - |
| 708 | QRect parentRect = q->rect(); | - |
| 709 | for (QForeachContainer<__typeof__(childWindows)> _container_(childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *window = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 710 | if (!sanityCheck(window, "QMdiArea::place") || window == child || !window->isVisibleTo(q) partially evaluated: !sanityCheck(window, "QMdiArea::place")| no Evaluation Count:0 | yes Evaluation Count:125 |
evaluated: window == child| yes Evaluation Count:87 | yes Evaluation Count:38 |
partially evaluated: !window->isVisibleTo(q)| no Evaluation Count:0 | yes Evaluation Count:38 |
| 0-125 |
| 711 | || !window->testAttribute(Qt::WA_Moved)) { evaluated: !window->testAttribute(Qt::WA_Moved)| yes Evaluation Count:6 | yes Evaluation Count:32 |
| 6-32 |
| 712 | continue; executed: continue;Execution Count:93 | 93 |
| 713 | } | - |
| 714 | QRect occupiedGeometry; | - |
| 715 | if (window->isMaximized()) { evaluated: window->isMaximized()| yes Evaluation Count:4 | yes Evaluation Count:28 |
| 4-28 |
| 716 | occupiedGeometry = QRect(window->d_func()->oldGeometry.topLeft(), | - |
| 717 | window->d_func()->restoreSize); | - |
| 718 | } else { executed: }Execution Count:4 | 4 |
| 719 | occupiedGeometry = window->geometry(); | - |
| 720 | } executed: }Execution Count:28 | 28 |
| 721 | rects.append(QStyle::visualRect(child->layoutDirection(), parentRect, occupiedGeometry)); | - |
| 722 | } executed: }Execution Count:32 | 32 |
| 723 | QPoint newPos = placer->place(child->size(), rects, parentRect); | - |
| 724 | QRect newGeometry = QRect(newPos.x(), newPos.y(), child->width(), child->height()); | - |
| 725 | child->setGeometry(QStyle::visualRect(child->layoutDirection(), parentRect, newGeometry)); | - |
| 726 | } executed: }Execution Count:87 | 87 |
| 727 | | - |
| 728 | | - |
| 729 | | - |
| 730 | | - |
| 731 | void QMdiAreaPrivate::rearrange(Rearranger *rearranger) | - |
| 732 | { | - |
| 733 | if (!rearranger) partially evaluated: !rearranger| no Evaluation Count:0 | yes Evaluation Count:99 |
| 0-99 |
| 734 | return; | 0 |
| 735 | | - |
| 736 | QMdiArea * const q = q_func(); | - |
| 737 | if (!q->isVisible()) { evaluated: !q->isVisible()| yes Evaluation Count:1 | yes Evaluation Count:98 |
| 1-98 |
| 738 | | - |
| 739 | int index = pendingRearrangements.indexOf(rearranger); | - |
| 740 | if (index != -1) partially evaluated: index != -1| no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
| 741 | pendingRearrangements.move(index, pendingRearrangements.size() - 1); never executed: pendingRearrangements.move(index, pendingRearrangements.size() - 1); | 0 |
| 742 | else | - |
| 743 | pendingRearrangements.append(rearranger); executed: pendingRearrangements.append(rearranger);Execution Count:1 | 1 |
| 744 | return; executed: return;Execution Count:1 | 1 |
| 745 | } | - |
| 746 | | - |
| 747 | QList<QWidget *> widgets; | - |
| 748 | const bool reverseList = rearranger->type() == Rearranger::RegularTiler; | - |
| 749 | const QList<QMdiSubWindow *> subWindows = subWindowList(activationOrder, reverseList); | - |
| 750 | QSize minSubWindowSize; | - |
| 751 | for (QForeachContainer<__typeof__(subWindows)> _container_(subWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 752 | if (!sanityCheck(child, "QMdiArea::rearrange") || !child->isVisible()) partially evaluated: !sanityCheck(child, "QMdiArea::rearrange")| no Evaluation Count:0 | yes Evaluation Count:126 |
evaluated: !child->isVisible()| yes Evaluation Count:51 | yes Evaluation Count:75 |
| 0-126 |
| 753 | continue; executed: continue;Execution Count:51 | 51 |
| 754 | if (rearranger->type() == Rearranger::IconTiler) { partially evaluated: rearranger->type() == Rearranger::IconTiler| yes Evaluation Count:75 | no Evaluation Count:0 |
| 0-75 |
| 755 | if (child->isMinimized() && !child->isShaded() && !(child->windowFlags() & Qt::FramelessWindowHint)) evaluated: child->isMinimized()| yes Evaluation Count:18 | yes Evaluation Count:57 |
partially evaluated: !child->isShaded()| yes Evaluation Count:18 | no Evaluation Count:0 |
partially evaluated: !(child->windowFlags() & Qt::FramelessWindowHint)| yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-57 |
| 756 | widgets.append(child); executed: widgets.append(child);Execution Count:18 | 18 |
| 757 | } else { executed: }Execution Count:75 | 75 |
| 758 | if (child->isMinimized() && !child->isShaded()) never evaluated: child->isMinimized() never evaluated: !child->isShaded() | 0 |
| 759 | continue; never executed: continue; | 0 |
| 760 | if (child->isMaximized() || child->isShaded()) never evaluated: child->isMaximized() never evaluated: child->isShaded() | 0 |
| 761 | child->showNormal(); never executed: child->showNormal(); | 0 |
| 762 | minSubWindowSize = minSubWindowSize.expandedTo(child->minimumSize()) | - |
| 763 | .expandedTo(child->d_func()->internalMinimumSize); | - |
| 764 | widgets.append(child); | - |
| 765 | } | 0 |
| 766 | } | - |
| 767 | | - |
| 768 | if (active && rearranger->type() == Rearranger::RegularTiler) { evaluated: active| yes Evaluation Count:40 | yes Evaluation Count:58 |
partially evaluated: rearranger->type() == Rearranger::RegularTiler| no Evaluation Count:0 | yes Evaluation Count:40 |
| 0-58 |
| 769 | | - |
| 770 | | - |
| 771 | int indexToActive = widgets.indexOf((QWidget *)active); | - |
| 772 | if (indexToActive > 0) never evaluated: indexToActive > 0 | 0 |
| 773 | widgets.move(indexToActive, 0); never executed: widgets.move(indexToActive, 0); | 0 |
| 774 | } | 0 |
| 775 | | - |
| 776 | QRect domain = viewport->rect(); | - |
| 777 | if (rearranger->type() == Rearranger::RegularTiler && !widgets.isEmpty()) partially evaluated: rearranger->type() == Rearranger::RegularTiler| no Evaluation Count:0 | yes Evaluation Count:98 |
never evaluated: !widgets.isEmpty() | 0-98 |
| 778 | domain = resizeToMinimumTileSize(minSubWindowSize, widgets.count()); never executed: domain = resizeToMinimumTileSize(minSubWindowSize, widgets.count()); | 0 |
| 779 | | - |
| 780 | rearranger->rearrange(widgets, domain); | - |
| 781 | | - |
| 782 | if (rearranger->type() == Rearranger::RegularTiler && !widgets.isEmpty()) { partially evaluated: rearranger->type() == Rearranger::RegularTiler| no Evaluation Count:0 | yes Evaluation Count:98 |
never evaluated: !widgets.isEmpty() | 0-98 |
| 783 | isSubWindowsTiled = true; | - |
| 784 | updateScrollBars(); | - |
| 785 | } else if (rearranger->type() == Rearranger::SimpleCascader) { partially evaluated: rearranger->type() == Rearranger::SimpleCascader| no Evaluation Count:0 | yes Evaluation Count:98 |
| 0-98 |
| 786 | isSubWindowsTiled = false; | - |
| 787 | } | 0 |
| 788 | } | - |
| 789 | | - |
| 790 | | - |
| 791 | | - |
| 792 | | - |
| 793 | | - |
| 794 | | - |
| 795 | void QMdiAreaPrivate::arrangeMinimizedSubWindows() | - |
| 796 | { | - |
| 797 | if (!iconTiler) evaluated: !iconTiler| yes Evaluation Count:62 | yes Evaluation Count:37 |
| 37-62 |
| 798 | iconTiler = new IconTiler; executed: iconTiler = new IconTiler;Execution Count:62 | 62 |
| 799 | rearrange(iconTiler); | - |
| 800 | } executed: }Execution Count:99 | 99 |
| 801 | | - |
| 802 | | - |
| 803 | | - |
| 804 | | - |
| 805 | void QMdiAreaPrivate::activateWindow(QMdiSubWindow *child) | - |
| 806 | { | - |
| 807 | if (childWindows.isEmpty()) { partially evaluated: childWindows.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:19 |
| 0-19 |
| 808 | qt_noop(); | - |
| 809 | qt_noop(); | - |
| 810 | return; | 0 |
| 811 | } | - |
| 812 | | - |
| 813 | if (!child) { evaluated: !child| yes Evaluation Count:6 | yes Evaluation Count:13 |
| 6-13 |
| 814 | if (active) { partially evaluated: active| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 815 | qt_noop(); | - |
| 816 | active->d_func()->setActive(false); | - |
| 817 | resetActiveWindow(); | - |
| 818 | } executed: }Execution Count:6 | 6 |
| 819 | return; executed: return;Execution Count:6 | 6 |
| 820 | } | - |
| 821 | | - |
| 822 | if (child->isHidden() || child == active) partially evaluated: child->isHidden()| no Evaluation Count:0 | yes Evaluation Count:13 |
evaluated: child == active| yes Evaluation Count:3 | yes Evaluation Count:10 |
| 0-13 |
| 823 | return; executed: return;Execution Count:3 | 3 |
| 824 | child->d_func()->setActive(true); | - |
| 825 | } executed: }Execution Count:10 | 10 |
| 826 | | - |
| 827 | | - |
| 828 | | - |
| 829 | | - |
| 830 | void QMdiAreaPrivate::activateCurrentWindow() | - |
| 831 | { | - |
| 832 | QMdiSubWindow *current = q_func()->currentSubWindow(); | - |
| 833 | if (current && !isExplicitlyDeactivated(current)) { evaluated: current| yes Evaluation Count:69 | yes Evaluation Count:69 |
partially evaluated: !isExplicitlyDeactivated(current)| yes Evaluation Count:69 | no Evaluation Count:0 |
| 0-69 |
| 834 | current->d_func()->activationEnabled = true; | - |
| 835 | current->d_func()->setActive(true, false); | - |
| 836 | } executed: }Execution Count:69 | 69 |
| 837 | } executed: }Execution Count:138 | 138 |
| 838 | | - |
| 839 | void QMdiAreaPrivate::activateHighlightedWindow() | - |
| 840 | { | - |
| 841 | if (indexToHighlighted < 0) never evaluated: indexToHighlighted < 0 | 0 |
| 842 | return; | 0 |
| 843 | | - |
| 844 | qt_noop(); | - |
| 845 | if (tabToPreviousTimerId != -1) never evaluated: tabToPreviousTimerId != -1 | 0 |
| 846 | activateWindow(nextVisibleSubWindow(-1, QMdiArea::ActivationHistoryOrder)); never executed: activateWindow(nextVisibleSubWindow(-1, QMdiArea::ActivationHistoryOrder)); | 0 |
| 847 | else | - |
| 848 | activateWindow(childWindows.at(indexToHighlighted)); never executed: activateWindow(childWindows.at(indexToHighlighted)); | 0 |
| 849 | | - |
| 850 | hideRubberBand(); | - |
| 851 | | - |
| 852 | } | 0 |
| 853 | | - |
| 854 | | - |
| 855 | | - |
| 856 | | - |
| 857 | void QMdiAreaPrivate::emitWindowActivated(QMdiSubWindow *activeWindow) | - |
| 858 | { | - |
| 859 | QMdiArea * const q = q_func(); | - |
| 860 | qt_noop(); | - |
| 861 | if (activeWindow == active) evaluated: activeWindow == active| yes Evaluation Count:13 | yes Evaluation Count:138 |
| 13-138 |
| 862 | return; executed: return;Execution Count:13 | 13 |
| 863 | qt_noop(); | - |
| 864 | | - |
| 865 | if (!aboutToBecomeActive) partially evaluated: !aboutToBecomeActive| no Evaluation Count:0 | yes Evaluation Count:138 |
| 0-138 |
| 866 | _q_deactivateAllWindows(activeWindow); never executed: _q_deactivateAllWindows(activeWindow); | 0 |
| 867 | qt_noop(); | - |
| 868 | | - |
| 869 | | - |
| 870 | | - |
| 871 | if (showActiveWindowMaximized) { evaluated: showActiveWindowMaximized| yes Evaluation Count:16 | yes Evaluation Count:122 |
| 16-122 |
| 872 | if (!activeWindow->isMaximized()) partially evaluated: !activeWindow->isMaximized()| yes Evaluation Count:16 | no Evaluation Count:0 |
| 0-16 |
| 873 | activeWindow->showMaximized(); executed: activeWindow->showMaximized();Execution Count:16 | 16 |
| 874 | showActiveWindowMaximized = false; | - |
| 875 | } executed: }Execution Count:16 | 16 |
| 876 | | - |
| 877 | | - |
| 878 | const int indexToActiveWindow = childWindows.indexOf(activeWindow); | - |
| 879 | qt_noop(); | - |
| 880 | const int index = indicesToActivatedChildren.indexOf(indexToActiveWindow); | - |
| 881 | qt_noop(); | - |
| 882 | indicesToActivatedChildren.move(index, 0); | - |
| 883 | internalRaise(activeWindow); | - |
| 884 | | - |
| 885 | if (updatesDisabledByUs) { evaluated: updatesDisabledByUs| yes Evaluation Count:11 | yes Evaluation Count:127 |
| 11-127 |
| 886 | q->setUpdatesEnabled(true); | - |
| 887 | updatesDisabledByUs = false; | - |
| 888 | } executed: }Execution Count:11 | 11 |
| 889 | | - |
| 890 | qt_noop(); | - |
| 891 | active = activeWindow; | - |
| 892 | aboutToBecomeActive = 0; | - |
| 893 | qt_noop(); | - |
| 894 | | - |
| 895 | | - |
| 896 | if (tabBar && tabBar->currentIndex() != indexToActiveWindow) partially evaluated: tabBar| no Evaluation Count:0 | yes Evaluation Count:138 |
never evaluated: tabBar->currentIndex() != indexToActiveWindow | 0-138 |
| 897 | tabBar->setCurrentIndex(indexToActiveWindow); never executed: tabBar->setCurrentIndex(indexToActiveWindow); | 0 |
| 898 | | - |
| 899 | | - |
| 900 | if (active->isMaximized() && scrollBarsEnabled()) evaluated: active->isMaximized()| yes Evaluation Count:42 | yes Evaluation Count:96 |
partially evaluated: scrollBarsEnabled()| no Evaluation Count:0 | yes Evaluation Count:42 |
| 0-96 |
| 901 | updateScrollBars(); never executed: updateScrollBars(); | 0 |
| 902 | | - |
| 903 | q->subWindowActivated(active); | - |
| 904 | } executed: }Execution Count:138 | 138 |
| 905 | | - |
| 906 | | - |
| 907 | | - |
| 908 | | - |
| 909 | void QMdiAreaPrivate::resetActiveWindow(QMdiSubWindow *deactivatedWindow) | - |
| 910 | { | - |
| 911 | QMdiArea * const q = q_func(); | - |
| 912 | if (deactivatedWindow) { evaluated: deactivatedWindow| yes Evaluation Count:91 | yes Evaluation Count:17 |
| 17-91 |
| 913 | if (deactivatedWindow != active) partially evaluated: deactivatedWindow != active| no Evaluation Count:0 | yes Evaluation Count:91 |
| 0-91 |
| 914 | return; | 0 |
| 915 | active = 0; | - |
| 916 | if ((aboutToBecomeActive || isActivated || lastWindowAboutToBeDestroyed()) evaluated: aboutToBecomeActive| yes Evaluation Count:40 | yes Evaluation Count:51 |
evaluated: isActivated| yes Evaluation Count:17 | yes Evaluation Count:34 |
evaluated: lastWindowAboutToBeDestroyed()| yes Evaluation Count:1 | yes Evaluation Count:33 |
| 1-51 |
| 917 | && !isExplicitlyDeactivated(deactivatedWindow) && !q->window()->isMinimized()) { partially evaluated: !isExplicitlyDeactivated(deactivatedWindow)| yes Evaluation Count:58 | no Evaluation Count:0 |
partially evaluated: !q->window()->isMinimized()| yes Evaluation Count:58 | no Evaluation Count:0 |
| 0-58 |
| 918 | return; executed: return;Execution Count:58 | 58 |
| 919 | } | - |
| 920 | q->subWindowActivated(0); | - |
| 921 | return; executed: return;Execution Count:33 | 33 |
| 922 | } | - |
| 923 | | - |
| 924 | if (aboutToBecomeActive) partially evaluated: aboutToBecomeActive| no Evaluation Count:0 | yes Evaluation Count:17 |
| 0-17 |
| 925 | return; | 0 |
| 926 | | - |
| 927 | active = 0; | - |
| 928 | q->subWindowActivated(0); | - |
| 929 | } executed: }Execution Count:17 | 17 |
| 930 | | - |
| 931 | | - |
| 932 | | - |
| 933 | | - |
| 934 | void QMdiAreaPrivate::updateActiveWindow(int removedIndex, bool activeRemoved) | - |
| 935 | { | - |
| 936 | qt_noop(); | - |
| 937 | | - |
| 938 | | - |
| 939 | if (tabBar && removedIndex >= 0) { partially evaluated: tabBar| no Evaluation Count:0 | yes Evaluation Count:11 |
never evaluated: removedIndex >= 0 | 0-11 |
| 940 | tabBar->blockSignals(true); | - |
| 941 | tabBar->removeTab(removedIndex); | - |
| 942 | updateTabBarGeometry(); | - |
| 943 | tabBar->blockSignals(false); | - |
| 944 | } | 0 |
| 945 | | - |
| 946 | | - |
| 947 | if (childWindows.isEmpty()) { partially evaluated: childWindows.isEmpty()| yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
| 948 | showActiveWindowMaximized = false; | - |
| 949 | resetActiveWindow(); | - |
| 950 | return; executed: return;Execution Count:11 | 11 |
| 951 | } | - |
| 952 | | - |
| 953 | if (indexToHighlighted >= 0) { never evaluated: indexToHighlighted >= 0 | 0 |
| 954 | | - |
| 955 | | - |
| 956 | if (indexToHighlighted == removedIndex) never evaluated: indexToHighlighted == removedIndex | 0 |
| 957 | hideRubberBand(); never executed: hideRubberBand(); | 0 |
| 958 | else | - |
| 959 | | - |
| 960 | | - |
| 961 | if (indexToHighlighted > removedIndex) never evaluated: indexToHighlighted > removedIndex | 0 |
| 962 | --indexToHighlighted; never executed: --indexToHighlighted; | 0 |
| 963 | } | - |
| 964 | | - |
| 965 | | - |
| 966 | for (int i = 0; i < indicesToActivatedChildren.size(); ++i) { never evaluated: i < indicesToActivatedChildren.size() | 0 |
| 967 | int *index = &indicesToActivatedChildren[i]; | - |
| 968 | if (*index > removedIndex) never evaluated: *index > removedIndex | 0 |
| 969 | --*index; never executed: --*index; | 0 |
| 970 | } | 0 |
| 971 | | - |
| 972 | if (!activeRemoved) never evaluated: !activeRemoved | 0 |
| 973 | return; | 0 |
| 974 | | - |
| 975 | | - |
| 976 | QMdiSubWindow *next = nextVisibleSubWindow(0, activationOrder, removedIndex); | - |
| 977 | if (next) | 0 |
| 978 | activateWindow(next); never executed: activateWindow(next); | 0 |
| 979 | } | 0 |
| 980 | | - |
| 981 | | - |
| 982 | | - |
| 983 | | - |
| 984 | void QMdiAreaPrivate::updateScrollBars() | - |
| 985 | { | - |
| 986 | if (ignoreGeometryChange || !scrollBarsEnabled()) partially evaluated: ignoreGeometryChange| no Evaluation Count:0 | yes Evaluation Count:2012 |
evaluated: !scrollBarsEnabled()| yes Evaluation Count:1926 | yes Evaluation Count:86 |
| 0-2012 |
| 987 | return; executed: return;Execution Count:1926 | 1926 |
| 988 | | - |
| 989 | QMdiArea * const q = q_func(); | - |
| 990 | QSize maxSize = q->maximumViewportSize(); | - |
| 991 | QSize hbarExtent = hbar->sizeHint(); | - |
| 992 | QSize vbarExtent = vbar->sizeHint(); | - |
| 993 | | - |
| 994 | if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q)) { partially evaluated: q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q)| no Evaluation Count:0 | yes Evaluation Count:86 |
| 0-86 |
| 995 | const int doubleFrameWidth = frameWidth * 2; | - |
| 996 | if (hbarpolicy == Qt::ScrollBarAlwaysOn) never evaluated: hbarpolicy == Qt::ScrollBarAlwaysOn | 0 |
| 997 | maxSize.rheight() -= doubleFrameWidth; never executed: maxSize.rheight() -= doubleFrameWidth; | 0 |
| 998 | if (vbarpolicy == Qt::ScrollBarAlwaysOn) never evaluated: vbarpolicy == Qt::ScrollBarAlwaysOn | 0 |
| 999 | maxSize.rwidth() -= doubleFrameWidth; never executed: maxSize.rwidth() -= doubleFrameWidth; | 0 |
| 1000 | hbarExtent.rheight() += doubleFrameWidth; | - |
| 1001 | vbarExtent.rwidth() += doubleFrameWidth; | - |
| 1002 | } | 0 |
| 1003 | | - |
| 1004 | const QRect childrenRect = active && active->isMaximized() evaluated: active| yes Evaluation Count:73 | yes Evaluation Count:13 |
evaluated: active->isMaximized()| yes Evaluation Count:15 | yes Evaluation Count:58 |
| 13-73 |
| 1005 | ? active->geometry() : viewport->childrenRect(); | - |
| 1006 | bool useHorizontalScrollBar = useScrollBar(childrenRect, maxSize, Qt::Horizontal); | - |
| 1007 | bool useVerticalScrollBar = useScrollBar(childrenRect, maxSize, Qt::Vertical); | - |
| 1008 | | - |
| 1009 | if (useHorizontalScrollBar && !useVerticalScrollBar) { partially evaluated: useHorizontalScrollBar| no Evaluation Count:0 | yes Evaluation Count:86 |
never evaluated: !useVerticalScrollBar | 0-86 |
| 1010 | const QSize max = maxSize - QSize(0, hbarExtent.height()); | - |
| 1011 | useVerticalScrollBar = useScrollBar(childrenRect, max, Qt::Vertical); | - |
| 1012 | } | 0 |
| 1013 | | - |
| 1014 | if (useVerticalScrollBar && !useHorizontalScrollBar) { evaluated: useVerticalScrollBar| yes Evaluation Count:43 | yes Evaluation Count:43 |
partially evaluated: !useHorizontalScrollBar| yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
| 1015 | const QSize max = maxSize - QSize(vbarExtent.width(), 0); | - |
| 1016 | useHorizontalScrollBar = useScrollBar(childrenRect, max, Qt::Horizontal); | - |
| 1017 | } executed: }Execution Count:43 | 43 |
| 1018 | | - |
| 1019 | if (useHorizontalScrollBar && hbarpolicy != Qt::ScrollBarAlwaysOn) evaluated: useHorizontalScrollBar| yes Evaluation Count:43 | yes Evaluation Count:43 |
partially evaluated: hbarpolicy != Qt::ScrollBarAlwaysOn| yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
| 1020 | maxSize.rheight() -= hbarExtent.height(); executed: maxSize.rheight() -= hbarExtent.height();Execution Count:43 | 43 |
| 1021 | if (useVerticalScrollBar && vbarpolicy != Qt::ScrollBarAlwaysOn) evaluated: useVerticalScrollBar| yes Evaluation Count:43 | yes Evaluation Count:43 |
partially evaluated: vbarpolicy != Qt::ScrollBarAlwaysOn| yes Evaluation Count:43 | no Evaluation Count:0 |
| 0-43 |
| 1022 | maxSize.rwidth() -= vbarExtent.width(); executed: maxSize.rwidth() -= vbarExtent.width();Execution Count:43 | 43 |
| 1023 | | - |
| 1024 | QRect viewportRect(QPoint(0, 0), maxSize); | - |
| 1025 | const int startX = q->isLeftToRight() ? childrenRect.left() : viewportRect.right() partially evaluated: q->isLeftToRight()| yes Evaluation Count:86 | no Evaluation Count:0 |
| 0-86 |
| 1026 | - childrenRect.right(); | - |
| 1027 | | - |
| 1028 | | - |
| 1029 | if (isSubWindowsTiled && hbar->value() != 0) partially evaluated: isSubWindowsTiled| no Evaluation Count:0 | yes Evaluation Count:86 |
never evaluated: hbar->value() != 0 | 0-86 |
| 1030 | hbar->setValue(0); never executed: hbar->setValue(0); | 0 |
| 1031 | const int xOffset = startX + hbar->value(); | - |
| 1032 | hbar->setRange(qMin(0, xOffset), | - |
| 1033 | qMax(0, xOffset + childrenRect.width() - viewportRect.width())); | - |
| 1034 | hbar->setPageStep(childrenRect.width()); | - |
| 1035 | hbar->setSingleStep(childrenRect.width() / 20); | - |
| 1036 | | - |
| 1037 | | - |
| 1038 | if (isSubWindowsTiled && vbar->value() != 0) partially evaluated: isSubWindowsTiled| no Evaluation Count:0 | yes Evaluation Count:86 |
never evaluated: vbar->value() != 0 | 0-86 |
| 1039 | vbar->setValue(0); never executed: vbar->setValue(0); | 0 |
| 1040 | const int yOffset = childrenRect.top() + vbar->value(); | - |
| 1041 | vbar->setRange(qMin(0, yOffset), | - |
| 1042 | qMax(0, yOffset + childrenRect.height() - viewportRect.height())); | - |
| 1043 | vbar->setPageStep(childrenRect.height()); | - |
| 1044 | vbar->setSingleStep(childrenRect.height() / 20); | - |
| 1045 | } executed: }Execution Count:86 | 86 |
| 1046 | | - |
| 1047 | | - |
| 1048 | | - |
| 1049 | | - |
| 1050 | void QMdiAreaPrivate::internalRaise(QMdiSubWindow *mdiChild) const | - |
| 1051 | { | - |
| 1052 | if (!sanityCheck(mdiChild, "QMdiArea::internalRaise") || childWindows.size() < 2) partially evaluated: !sanityCheck(mdiChild, "QMdiArea::internalRaise")| no Evaluation Count:0 | yes Evaluation Count:497 |
evaluated: childWindows.size() < 2| yes Evaluation Count:319 | yes Evaluation Count:178 |
| 0-497 |
| 1053 | return; executed: return;Execution Count:319 | 319 |
| 1054 | | - |
| 1055 | QMdiSubWindow *stackUnderChild = 0; | - |
| 1056 | if (!windowStaysOnTop(mdiChild)) { partially evaluated: !windowStaysOnTop(mdiChild)| yes Evaluation Count:178 | no Evaluation Count:0 |
| 0-178 |
| 1057 | for (QForeachContainer<__typeof__(viewport->children())> _container_(viewport->children()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QObject *object = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1058 | QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(object); | - |
| 1059 | if (!child || !childWindows.contains(child)) partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:791 |
evaluated: !childWindows.contains(child)| yes Evaluation Count:52 | yes Evaluation Count:739 |
| 0-791 |
| 1060 | continue; executed: continue;Execution Count:52 | 52 |
| 1061 | if (!child->isHidden() && windowStaysOnTop(child)) { evaluated: !child->isHidden()| yes Evaluation Count:726 | yes Evaluation Count:13 |
partially evaluated: windowStaysOnTop(child)| no Evaluation Count:0 | yes Evaluation Count:726 |
| 0-726 |
| 1062 | if (stackUnderChild) never evaluated: stackUnderChild | 0 |
| 1063 | child->stackUnder(stackUnderChild); never executed: child->stackUnder(stackUnderChild); | 0 |
| 1064 | else | - |
| 1065 | child->raise(); never executed: child->raise(); | 0 |
| 1066 | stackUnderChild = child; | - |
| 1067 | } | 0 |
| 1068 | } executed: }Execution Count:739 | 739 |
| 1069 | } executed: }Execution Count:178 | 178 |
| 1070 | | - |
| 1071 | if (stackUnderChild) partially evaluated: stackUnderChild| no Evaluation Count:0 | yes Evaluation Count:178 |
| 0-178 |
| 1072 | mdiChild->stackUnder(stackUnderChild); never executed: mdiChild->stackUnder(stackUnderChild); | 0 |
| 1073 | else | - |
| 1074 | mdiChild->raise(); executed: mdiChild->raise();Execution Count:178 | 178 |
| 1075 | } | - |
| 1076 | | - |
| 1077 | QRect QMdiAreaPrivate::resizeToMinimumTileSize(const QSize &minSubWindowSize, int subWindowCount) | - |
| 1078 | { | - |
| 1079 | QMdiArea * const q = q_func(); | - |
| 1080 | if (!minSubWindowSize.isValid() || subWindowCount <= 0) never evaluated: !minSubWindowSize.isValid() never evaluated: subWindowCount <= 0 | 0 |
| 1081 | return viewport->rect(); never executed: return viewport->rect(); | 0 |
| 1082 | | - |
| 1083 | | - |
| 1084 | const int columns = qMax(qCeil(qSqrt(qreal(subWindowCount))), 1); | - |
| 1085 | const int rows = qMax((subWindowCount % columns) ? (subWindowCount / columns + 1) | - |
| 1086 | : (subWindowCount / columns), 1); | - |
| 1087 | const int minWidth = minSubWindowSize.width() * columns; | - |
| 1088 | const int minHeight = minSubWindowSize.height() * rows; | - |
| 1089 | | - |
| 1090 | | - |
| 1091 | | - |
| 1092 | if (!tileCalledFromResizeEvent) { never evaluated: !tileCalledFromResizeEvent | 0 |
| 1093 | QWidget *topLevel = q; | - |
| 1094 | | - |
| 1095 | while (topLevel && !topLevel->isWindow() && topLevel->windowType() != Qt::SubWindow) never evaluated: topLevel never evaluated: !topLevel->isWindow() never evaluated: topLevel->windowType() != Qt::SubWindow | 0 |
| 1096 | topLevel = topLevel->parentWidget(); never executed: topLevel = topLevel->parentWidget(); | 0 |
| 1097 | | - |
| 1098 | int minAreaWidth = minWidth + left + right + 2; | - |
| 1099 | int minAreaHeight = minHeight + top + bottom + 2; | - |
| 1100 | if (hbar->isVisible()) never evaluated: hbar->isVisible() | 0 |
| 1101 | minAreaHeight += hbar->height(); never executed: minAreaHeight += hbar->height(); | 0 |
| 1102 | if (vbar->isVisible()) never evaluated: vbar->isVisible() | 0 |
| 1103 | minAreaWidth += vbar->width(); never executed: minAreaWidth += vbar->width(); | 0 |
| 1104 | if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q)) { never evaluated: q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q) | 0 |
| 1105 | const int frame = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, q); | - |
| 1106 | minAreaWidth += 2 * frame; | - |
| 1107 | minAreaHeight += 2 * frame; | - |
| 1108 | } | 0 |
| 1109 | const QSize diff = QSize(minAreaWidth, minAreaHeight).expandedTo(q->size()) - q->size(); | - |
| 1110 | topLevel->resize(topLevel->size() + diff); | - |
| 1111 | } | 0 |
| 1112 | | - |
| 1113 | QRect domain = viewport->rect(); | - |
| 1114 | | - |
| 1115 | | - |
| 1116 | if (domain.width() < minWidth) { never evaluated: domain.width() < minWidth | 0 |
| 1117 | domain.setWidth(minWidth); | - |
| 1118 | if (hbarpolicy == Qt::ScrollBarAlwaysOff) never evaluated: hbarpolicy == Qt::ScrollBarAlwaysOff | 0 |
| 1119 | q->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); never executed: q->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); | 0 |
| 1120 | else | - |
| 1121 | hbar->setValue(0); never executed: hbar->setValue(0); | 0 |
| 1122 | } | - |
| 1123 | | - |
| 1124 | if (domain.height() < minHeight) { never evaluated: domain.height() < minHeight | 0 |
| 1125 | domain.setHeight(minHeight); | - |
| 1126 | if (vbarpolicy == Qt::ScrollBarAlwaysOff) never evaluated: vbarpolicy == Qt::ScrollBarAlwaysOff | 0 |
| 1127 | q->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); never executed: q->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); | 0 |
| 1128 | else | - |
| 1129 | vbar->setValue(0); never executed: vbar->setValue(0); | 0 |
| 1130 | } | - |
| 1131 | return domain; never executed: return domain; | 0 |
| 1132 | } | - |
| 1133 | | - |
| 1134 | | - |
| 1135 | | - |
| 1136 | | - |
| 1137 | bool QMdiAreaPrivate::scrollBarsEnabled() const | - |
| 1138 | { | - |
| 1139 | return hbarpolicy != Qt::ScrollBarAlwaysOff || vbarpolicy != Qt::ScrollBarAlwaysOff; executed: return hbarpolicy != Qt::ScrollBarAlwaysOff || vbarpolicy != Qt::ScrollBarAlwaysOff;Execution Count:2110 | 2110 |
| 1140 | } | - |
| 1141 | | - |
| 1142 | | - |
| 1143 | | - |
| 1144 | | - |
| 1145 | bool QMdiAreaPrivate::lastWindowAboutToBeDestroyed() const | - |
| 1146 | { | - |
| 1147 | if (childWindows.count() != 1) evaluated: childWindows.count() != 1| yes Evaluation Count:5 | yes Evaluation Count:29 |
| 5-29 |
| 1148 | return false; executed: return false;Execution Count:5 | 5 |
| 1149 | | - |
| 1150 | QMdiSubWindow *last = childWindows.at(0); | - |
| 1151 | if (!last) partially evaluated: !last| no Evaluation Count:0 | yes Evaluation Count:29 |
| 0-29 |
| 1152 | return true; never executed: return true; | 0 |
| 1153 | | - |
| 1154 | if (!last->testAttribute(Qt::WA_DeleteOnClose)) evaluated: !last->testAttribute(Qt::WA_DeleteOnClose)| yes Evaluation Count:23 | yes Evaluation Count:6 |
| 6-23 |
| 1155 | return false; executed: return false;Execution Count:23 | 23 |
| 1156 | | - |
| 1157 | return last->d_func()->data.is_closing; executed: return last->d_func()->data.is_closing;Execution Count:6 | 6 |
| 1158 | } | - |
| 1159 | | - |
| 1160 | | - |
| 1161 | | - |
| 1162 | | - |
| 1163 | void QMdiAreaPrivate::setChildActivationEnabled(bool enable, bool onlyNextActivationEvent) const | - |
| 1164 | { | - |
| 1165 | for (QForeachContainer<__typeof__(childWindows)> _container_(childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *subWindow = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1166 | if (!subWindow || !subWindow->isVisible()) partially evaluated: !subWindow| no Evaluation Count:0 | yes Evaluation Count:234 |
evaluated: !subWindow->isVisible()| yes Evaluation Count:60 | yes Evaluation Count:174 |
| 0-234 |
| 1167 | continue; executed: continue;Execution Count:60 | 60 |
| 1168 | if (onlyNextActivationEvent) evaluated: onlyNextActivationEvent| yes Evaluation Count:84 | yes Evaluation Count:90 |
| 84-90 |
| 1169 | subWindow->d_func()->ignoreNextActivationEvent = !enable; executed: subWindow->d_func()->ignoreNextActivationEvent = !enable;Execution Count:84 | 84 |
| 1170 | else | - |
| 1171 | subWindow->d_func()->activationEnabled = enable; executed: subWindow->d_func()->activationEnabled = enable;Execution Count:90 | 90 |
| 1172 | } | - |
| 1173 | } executed: }Execution Count:249 | 249 |
| 1174 | | - |
| 1175 | | - |
| 1176 | | - |
| 1177 | | - |
| 1178 | | - |
| 1179 | void QMdiAreaPrivate::scrollBarPolicyChanged(Qt::Orientation orientation, Qt::ScrollBarPolicy policy) | - |
| 1180 | { | - |
| 1181 | if (childWindows.isEmpty()) evaluated: childWindows.isEmpty()| yes Evaluation Count:160 | yes Evaluation Count:2 |
| 2-160 |
| 1182 | return; executed: return;Execution Count:160 | 160 |
| 1183 | | - |
| 1184 | const QMdiSubWindow::SubWindowOption option = orientation == Qt::Horizontal ? evaluated: orientation == Qt::Horizontal| yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
| 1185 | QMdiSubWindow::AllowOutsideAreaHorizontally : QMdiSubWindow::AllowOutsideAreaVertically; | - |
| 1186 | const bool enable = policy != Qt::ScrollBarAlwaysOff; | - |
| 1187 | for (QForeachContainer<__typeof__(childWindows)> _container_(childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1188 | if (!sanityCheck(child, "QMdiArea::scrollBarPolicyChanged")) partially evaluated: !sanityCheck(child, "QMdiArea::scrollBarPolicyChanged")| no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
| 1189 | continue; never executed: continue; | 0 |
| 1190 | child->setOption(option, enable); | - |
| 1191 | } executed: }Execution Count:8 | 8 |
| 1192 | updateScrollBars(); | - |
| 1193 | } executed: }Execution Count:2 | 2 |
| 1194 | | - |
| 1195 | QList<QMdiSubWindow*> | - |
| 1196 | QMdiAreaPrivate::subWindowList(QMdiArea::WindowOrder order, bool reversed) const | - |
| 1197 | { | - |
| 1198 | QList<QMdiSubWindow *> list; | - |
| 1199 | if (childWindows.isEmpty()) evaluated: childWindows.isEmpty()| yes Evaluation Count:11 | yes Evaluation Count:101 |
| 11-101 |
| 1200 | return list; executed: return list;Execution Count:11 | 11 |
| 1201 | | - |
| 1202 | if (order == QMdiArea::CreationOrder) { partially evaluated: order == QMdiArea::CreationOrder| yes Evaluation Count:101 | no Evaluation Count:0 |
| 0-101 |
| 1203 | for (QForeachContainer<__typeof__(childWindows)> _container_(childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1204 | if (!child) partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:184 |
| 0-184 |
| 1205 | continue; never executed: continue; | 0 |
| 1206 | if (!reversed) partially evaluated: !reversed| yes Evaluation Count:184 | no Evaluation Count:0 |
| 0-184 |
| 1207 | list.append(child); executed: list.append(child);Execution Count:184 | 184 |
| 1208 | else | - |
| 1209 | list.prepend(child); never executed: list.prepend(child); | 0 |
| 1210 | } | - |
| 1211 | } else if (order == QMdiArea::StackingOrder) { executed: }Execution Count:101 never evaluated: order == QMdiArea::StackingOrder | 0-101 |
| 1212 | for (QForeachContainer<__typeof__(viewport->children())> _container_(viewport->children()); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QObject *object = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1213 | QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(object); | - |
| 1214 | if (!child || !childWindows.contains(child)) never evaluated: !childWindows.contains(child) | 0 |
| 1215 | continue; never executed: continue; | 0 |
| 1216 | if (!reversed) never evaluated: !reversed | 0 |
| 1217 | list.append(child); never executed: list.append(child); | 0 |
| 1218 | else | - |
| 1219 | list.prepend(child); never executed: list.prepend(child); | 0 |
| 1220 | } | - |
| 1221 | } else { | 0 |
| 1222 | qt_noop(); | - |
| 1223 | for (int i = indicesToActivatedChildren.count() - 1; i >= 0; --i) { | 0 |
| 1224 | QMdiSubWindow *child = childWindows.at(indicesToActivatedChildren.at(i)); | - |
| 1225 | if (!child) | 0 |
| 1226 | continue; never executed: continue; | 0 |
| 1227 | if (!reversed) never evaluated: !reversed | 0 |
| 1228 | list.append(child); never executed: list.append(child); | 0 |
| 1229 | else | - |
| 1230 | list.prepend(child); never executed: list.prepend(child); | 0 |
| 1231 | } | - |
| 1232 | } | 0 |
| 1233 | return list; executed: return list;Execution Count:101 | 101 |
| 1234 | } | - |
| 1235 | | - |
| 1236 | | - |
| 1237 | | - |
| 1238 | | - |
| 1239 | void QMdiAreaPrivate::disconnectSubWindow(QObject *subWindow) | - |
| 1240 | { | - |
| 1241 | if (!subWindow) partially evaluated: !subWindow| no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
| 1242 | return; | 0 |
| 1243 | | - |
| 1244 | QMdiArea * const q = q_func(); | - |
| 1245 | QObject::disconnect(subWindow, 0, q, 0); | - |
| 1246 | subWindow->removeEventFilter(q); | - |
| 1247 | } executed: }Execution Count:11 | 11 |
| 1248 | | - |
| 1249 | | - |
| 1250 | | - |
| 1251 | | - |
| 1252 | QMdiSubWindow *QMdiAreaPrivate::nextVisibleSubWindow(int increaseFactor, QMdiArea::WindowOrder order, | - |
| 1253 | int removedIndex, int fromIndex) const | - |
| 1254 | { | - |
| 1255 | if (childWindows.isEmpty()) partially evaluated: childWindows.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 1256 | return 0; never executed: return 0; | 0 |
| 1257 | | - |
| 1258 | const QMdiArea * const q = q_func(); | - |
| 1259 | const QList<QMdiSubWindow *> subWindows = q->subWindowList(order); | - |
| 1260 | QMdiSubWindow *current = 0; | - |
| 1261 | | - |
| 1262 | if (removedIndex < 0) { partially evaluated: removedIndex < 0| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 1263 | if (fromIndex >= 0 && fromIndex < subWindows.size()) partially evaluated: fromIndex >= 0| no Evaluation Count:0 | yes Evaluation Count:6 |
never evaluated: fromIndex < subWindows.size() | 0-6 |
| 1264 | current = childWindows.at(fromIndex); never executed: current = childWindows.at(fromIndex); | 0 |
| 1265 | else | - |
| 1266 | current = q->currentSubWindow(); executed: current = q->currentSubWindow();Execution Count:6 | 6 |
| 1267 | } | - |
| 1268 | | - |
| 1269 | | - |
| 1270 | | - |
| 1271 | if (!current) { partially evaluated: !current| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 1272 | if (removedIndex >= 0 && order == QMdiArea::CreationOrder) { never evaluated: removedIndex >= 0 never evaluated: order == QMdiArea::CreationOrder | 0 |
| 1273 | int candidateIndex = -1; | - |
| 1274 | setIndex(&candidateIndex, removedIndex, 0, subWindows.size() - 1, true); | - |
| 1275 | current = childWindows.at(candidateIndex); | - |
| 1276 | } else { | 0 |
| 1277 | current = subWindows.back(); | - |
| 1278 | } | 0 |
| 1279 | } | - |
| 1280 | qt_noop(); | - |
| 1281 | | - |
| 1282 | | - |
| 1283 | const int indexToCurrent = subWindows.indexOf(current); | - |
| 1284 | const bool increasing = increaseFactor > 0 ? true : false; partially evaluated: increaseFactor > 0| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 1285 | | - |
| 1286 | | - |
| 1287 | int index = -1; | - |
| 1288 | setIndex(&index, indexToCurrent + increaseFactor, 0, subWindows.size() - 1, increasing); | - |
| 1289 | qt_noop(); | - |
| 1290 | | - |
| 1291 | | - |
| 1292 | while (subWindows.at(index)->isHidden()) { partially evaluated: subWindows.at(index)->isHidden()| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 1293 | setIndex(&index, index + increaseFactor, 0, subWindows.size() - 1, increasing); | - |
| 1294 | if (index == indexToCurrent) never evaluated: index == indexToCurrent | 0 |
| 1295 | break; | 0 |
| 1296 | } | 0 |
| 1297 | | - |
| 1298 | if (!subWindows.at(index)->isHidden()) partially evaluated: !subWindows.at(index)->isHidden()| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 1299 | return subWindows.at(index); executed: return subWindows.at(index);Execution Count:6 | 6 |
| 1300 | return 0; never executed: return 0; | 0 |
| 1301 | } | - |
| 1302 | | - |
| 1303 | | - |
| 1304 | | - |
| 1305 | | - |
| 1306 | void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor) | - |
| 1307 | { | - |
| 1308 | if (childWindows.size() == 1) never evaluated: childWindows.size() == 1 | 0 |
| 1309 | return; | 0 |
| 1310 | | - |
| 1311 | QMdiArea * const q = q_func(); | - |
| 1312 | | - |
| 1313 | if (indexToHighlighted < 0) { never evaluated: indexToHighlighted < 0 | 0 |
| 1314 | QMdiSubWindow *current = q->currentSubWindow(); | - |
| 1315 | if (!current) never evaluated: !current | 0 |
| 1316 | return; | 0 |
| 1317 | indexToHighlighted = childWindows.indexOf(current); | - |
| 1318 | } | 0 |
| 1319 | | - |
| 1320 | qt_noop(); | - |
| 1321 | qt_noop(); | - |
| 1322 | | - |
| 1323 | QMdiSubWindow *highlight = nextVisibleSubWindow(increaseFactor, activationOrder, -1, indexToHighlighted); | - |
| 1324 | if (!highlight) never evaluated: !highlight | 0 |
| 1325 | return; | 0 |
| 1326 | | - |
| 1327 | | - |
| 1328 | if (!rubberBand) { never evaluated: !rubberBand | 0 |
| 1329 | rubberBand = new QRubberBand(QRubberBand::Rectangle, viewport); | - |
| 1330 | | - |
| 1331 | rubberBand->setObjectName(QLatin1String("qt_rubberband")); | - |
| 1332 | rubberBand->setWindowFlags(rubberBand->windowFlags() | Qt::WindowStaysOnTopHint); | - |
| 1333 | } | 0 |
| 1334 | | - |
| 1335 | | - |
| 1336 | | - |
| 1337 | | - |
| 1338 | if (tabToPreviousTimerId == -1) never evaluated: tabToPreviousTimerId == -1 | 0 |
| 1339 | showRubberBandFor(highlight); never executed: showRubberBandFor(highlight); | 0 |
| 1340 | | - |
| 1341 | | - |
| 1342 | indexToHighlighted = childWindows.indexOf(highlight); | - |
| 1343 | qt_noop(); | - |
| 1344 | } | 0 |
| 1345 | | - |
| 1346 | | - |
| 1347 | | - |
| 1348 | | - |
| 1349 | | - |
| 1350 | void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) | - |
| 1351 | { | - |
| 1352 | QMdiArea * const q = q_func(); | - |
| 1353 | if (viewMode == mode || inViewModeChange) never evaluated: viewMode == mode never evaluated: inViewModeChange | 0 |
| 1354 | return; | 0 |
| 1355 | | - |
| 1356 | | - |
| 1357 | inViewModeChange = true; | - |
| 1358 | | - |
| 1359 | | - |
| 1360 | if (mode == QMdiArea::TabbedView) { never evaluated: mode == QMdiArea::TabbedView | 0 |
| 1361 | qt_noop(); | - |
| 1362 | tabBar = new QMdiAreaTabBar(q); | - |
| 1363 | tabBar->setDocumentMode(documentMode); | - |
| 1364 | tabBar->setTabsClosable(tabsClosable); | - |
| 1365 | tabBar->setMovable(tabsMovable); | - |
| 1366 | | - |
| 1367 | tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); | - |
| 1368 | | - |
| 1369 | | - |
| 1370 | isSubWindowsTiled = false; | - |
| 1371 | | - |
| 1372 | for (QForeachContainer<__typeof__(childWindows)> _container_(childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *subWindow = *_container_.i;; __extension__ ({--_container_.brk; break;})) | - |
| 1373 | tabBar->addTab(subWindow->windowIcon(), tabTextFor(subWindow)); never executed: tabBar->addTab(subWindow->windowIcon(), tabTextFor(subWindow)); | 0 |
| 1374 | | - |
| 1375 | QMdiSubWindow *current = q->currentSubWindow(); | - |
| 1376 | if (current) { | 0 |
| 1377 | tabBar->setCurrentIndex(childWindows.indexOf(current)); | - |
| 1378 | | - |
| 1379 | if (current->isMaximized()) never evaluated: current->isMaximized() | 0 |
| 1380 | current->showNormal(); never executed: current->showNormal(); | 0 |
| 1381 | | - |
| 1382 | viewMode = mode; | - |
| 1383 | | - |
| 1384 | | - |
| 1385 | if (!q->testOption(QMdiArea::DontMaximizeSubWindowOnActivation)) { never evaluated: !q->testOption(QMdiArea::DontMaximizeSubWindowOnActivation) | 0 |
| 1386 | current->showMaximized(); | - |
| 1387 | } | 0 |
| 1388 | } else { | 0 |
| 1389 | viewMode = mode; | - |
| 1390 | } | 0 |
| 1391 | | - |
| 1392 | if (q->isVisible()) never evaluated: q->isVisible() | 0 |
| 1393 | tabBar->show(); never executed: tabBar->show(); | 0 |
| 1394 | updateTabBarGeometry(); | - |
| 1395 | | - |
| 1396 | QObject::connect(tabBar, "2""currentChanged(int)", q, "1""_q_currentTabChanged(int)"); | - |
| 1397 | QObject::connect(tabBar, "2""tabCloseRequested(int)", q, "1""_q_closeTab(int)"); | - |
| 1398 | QObject::connect(tabBar, "2""tabMoved(int,int)", q, "1""_q_moveTab(int,int)"); | - |
| 1399 | } else | 0 |
| 1400 | | - |
| 1401 | { | - |
| 1402 | | - |
| 1403 | delete tabBar; | - |
| 1404 | tabBar = 0; | - |
| 1405 | | - |
| 1406 | | - |
| 1407 | viewMode = mode; | - |
| 1408 | q->setViewportMargins(0, 0, 0, 0); | - |
| 1409 | indexToLastActiveTab = -1; | - |
| 1410 | | - |
| 1411 | QMdiSubWindow *current = q->currentSubWindow(); | - |
| 1412 | if (current && current->isMaximized()) never evaluated: current->isMaximized() | 0 |
| 1413 | current->showNormal(); never executed: current->showNormal(); | 0 |
| 1414 | } | 0 |
| 1415 | | - |
| 1416 | qt_noop(); | - |
| 1417 | inViewModeChange = false; | - |
| 1418 | } | 0 |
| 1419 | | - |
| 1420 | | - |
| 1421 | | - |
| 1422 | | - |
| 1423 | | - |
| 1424 | void QMdiAreaPrivate::updateTabBarGeometry() | - |
| 1425 | { | - |
| 1426 | if (!tabBar) partially evaluated: !tabBar| yes Evaluation Count:97 | no Evaluation Count:0 |
| 0-97 |
| 1427 | return; executed: return;Execution Count:97 | 97 |
| 1428 | | - |
| 1429 | QMdiArea * const q = q_func(); | - |
| 1430 | | - |
| 1431 | qt_noop(); | - |
| 1432 | | - |
| 1433 | const QSize tabBarSizeHint = tabBar->sizeHint(); | - |
| 1434 | | - |
| 1435 | int areaHeight = q->height(); | - |
| 1436 | if (hbar && hbar->isVisible()) never evaluated: hbar->isVisible() | 0 |
| 1437 | areaHeight -= hbar->height(); never executed: areaHeight -= hbar->height(); | 0 |
| 1438 | | - |
| 1439 | int areaWidth = q->width(); | - |
| 1440 | if (vbar && vbar->isVisible()) never evaluated: vbar->isVisible() | 0 |
| 1441 | areaWidth -= vbar->width(); never executed: areaWidth -= vbar->width(); | 0 |
| 1442 | | - |
| 1443 | QRect tabBarRect; | - |
| 1444 | | - |
| 1445 | switch (tabPosition) { | - |
| 1446 | case QTabWidget::North: | - |
| 1447 | q->setViewportMargins(0, tabBarSizeHint.height(), 0, 0); | - |
| 1448 | tabBarRect = QRect(0, 0, areaWidth, tabBarSizeHint.height()); | - |
| 1449 | break; | 0 |
| 1450 | case QTabWidget::South: | - |
| 1451 | q->setViewportMargins(0, 0, 0, tabBarSizeHint.height()); | - |
| 1452 | tabBarRect = QRect(0, areaHeight - tabBarSizeHint.height(), areaWidth, tabBarSizeHint.height()); | - |
| 1453 | break; | 0 |
| 1454 | case QTabWidget::East: | - |
| 1455 | if (q->layoutDirection() == Qt::LeftToRight) never evaluated: q->layoutDirection() == Qt::LeftToRight | 0 |
| 1456 | q->setViewportMargins(0, 0, tabBarSizeHint.width(), 0); never executed: q->setViewportMargins(0, 0, tabBarSizeHint.width(), 0); | 0 |
| 1457 | else | - |
| 1458 | q->setViewportMargins(tabBarSizeHint.width(), 0, 0, 0); never executed: q->setViewportMargins(tabBarSizeHint.width(), 0, 0, 0); | 0 |
| 1459 | tabBarRect = QRect(areaWidth - tabBarSizeHint.width(), 0, tabBarSizeHint.width(), areaHeight); | - |
| 1460 | break; | 0 |
| 1461 | case QTabWidget::West: | - |
| 1462 | if (q->layoutDirection() == Qt::LeftToRight) never evaluated: q->layoutDirection() == Qt::LeftToRight | 0 |
| 1463 | q->setViewportMargins(tabBarSizeHint.width(), 0, 0, 0); never executed: q->setViewportMargins(tabBarSizeHint.width(), 0, 0, 0); | 0 |
| 1464 | else | - |
| 1465 | q->setViewportMargins(0, 0, tabBarSizeHint.width(), 0); never executed: q->setViewportMargins(0, 0, tabBarSizeHint.width(), 0); | 0 |
| 1466 | tabBarRect = QRect(0, 0, tabBarSizeHint.width(), areaHeight); | - |
| 1467 | break; | 0 |
| 1468 | default: | - |
| 1469 | break; | 0 |
| 1470 | } | - |
| 1471 | | - |
| 1472 | | - |
| 1473 | tabBar->setGeometry(QStyle::visualRect(q->layoutDirection(), q->contentsRect(), tabBarRect)); | - |
| 1474 | } | 0 |
| 1475 | | - |
| 1476 | | - |
| 1477 | | - |
| 1478 | | - |
| 1479 | void QMdiAreaPrivate::refreshTabBar() | - |
| 1480 | { | - |
| 1481 | if (!tabBar) | 0 |
| 1482 | return; | 0 |
| 1483 | | - |
| 1484 | tabBar->setDocumentMode(documentMode); | - |
| 1485 | tabBar->setTabsClosable(tabsClosable); | - |
| 1486 | tabBar->setMovable(tabsMovable); | - |
| 1487 | | - |
| 1488 | tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); | - |
| 1489 | | - |
| 1490 | updateTabBarGeometry(); | - |
| 1491 | } | 0 |
| 1492 | | - |
| 1493 | | - |
| 1494 | | - |
| 1495 | | - |
| 1496 | | - |
| 1497 | | - |
| 1498 | QMdiArea::QMdiArea(QWidget *parent) | - |
| 1499 | : QAbstractScrollArea(*new QMdiAreaPrivate, parent) | - |
| 1500 | { | - |
| 1501 | setBackground(palette().brush(QPalette::Dark)); | - |
| 1502 | setFrameStyle(QFrame::NoFrame); | - |
| 1503 | setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | - |
| 1504 | setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | - |
| 1505 | setViewport(0); | - |
| 1506 | setFocusPolicy(Qt::NoFocus); | - |
| 1507 | QApplication::instance()->installEventFilter(this); | - |
| 1508 | } executed: }Execution Count:80 | 80 |
| 1509 | | - |
| 1510 | | - |
| 1511 | | - |
| 1512 | | - |
| 1513 | QMdiArea::~QMdiArea() | - |
| 1514 | { | - |
| 1515 | QMdiAreaPrivate * const d = d_func(); | - |
| 1516 | delete d->cascader; | - |
| 1517 | d->cascader = 0; | - |
| 1518 | | - |
| 1519 | delete d->regularTiler; | - |
| 1520 | d->regularTiler = 0; | - |
| 1521 | | - |
| 1522 | delete d->iconTiler; | - |
| 1523 | d->iconTiler = 0; | - |
| 1524 | | - |
| 1525 | delete d->placer; | - |
| 1526 | d->placer = 0; | - |
| 1527 | } executed: }Execution Count:77 | 77 |
| 1528 | | - |
| 1529 | | - |
| 1530 | | - |
| 1531 | | - |
| 1532 | QSize QMdiArea::sizeHint() const | - |
| 1533 | { | - |
| 1534 | | - |
| 1535 | | - |
| 1536 | int nestedCount = 0; | - |
| 1537 | QWidget *widget = this->parentWidget(); | - |
| 1538 | while (widget) { evaluated: widget| yes Evaluation Count:208 | yes Evaluation Count:141 |
| 141-208 |
| 1539 | if (qobject_cast<QMdiArea *>(widget)) evaluated: qobject_cast<QMdiArea *>(widget)| yes Evaluation Count:32 | yes Evaluation Count:176 |
| 32-176 |
| 1540 | ++nestedCount; executed: ++nestedCount;Execution Count:32 | 32 |
| 1541 | widget = widget->parentWidget(); | - |
| 1542 | } executed: }Execution Count:208 | 208 |
| 1543 | const int scaleFactor = 3 * (nestedCount + 1); | - |
| 1544 | | - |
| 1545 | QSize desktopSize = QApplication::desktop()->size(); | - |
| 1546 | QSize size(desktopSize.width() * 2 / scaleFactor, desktopSize.height() * 2 / scaleFactor); | - |
| 1547 | for (QForeachContainer<__typeof__(d_func()->childWindows)> _container_(d_func()->childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1548 | if (!sanityCheck(child, "QMdiArea::sizeHint")) partially evaluated: !sanityCheck(child, "QMdiArea::sizeHint")| no Evaluation Count:0 | yes Evaluation Count:76 |
| 0-76 |
| 1549 | continue; never executed: continue; | 0 |
| 1550 | size = size.expandedTo(child->sizeHint()); | - |
| 1551 | } executed: }Execution Count:76 | 76 |
| 1552 | return size.expandedTo(QApplication::globalStrut()); executed: return size.expandedTo(QApplication::globalStrut());Execution Count:141 | 141 |
| 1553 | } | - |
| 1554 | | - |
| 1555 | | - |
| 1556 | | - |
| 1557 | | - |
| 1558 | QSize QMdiArea::minimumSizeHint() const | - |
| 1559 | { | - |
| 1560 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1561 | QSize size(style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, this), | - |
| 1562 | style()->pixelMetric(QStyle::PM_TitleBarHeight, 0, this)); | - |
| 1563 | size = size.expandedTo(QAbstractScrollArea::minimumSizeHint()); | - |
| 1564 | if (!d->scrollBarsEnabled()) { evaluated: !d->scrollBarsEnabled()| yes Evaluation Count:55 | yes Evaluation Count:1 |
| 1-55 |
| 1565 | for (QForeachContainer<__typeof__(d->childWindows)> _container_(d->childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1566 | if (!sanityCheck(child, "QMdiArea::sizeHint")) partially evaluated: !sanityCheck(child, "QMdiArea::sizeHint")| no Evaluation Count:0 | yes Evaluation Count:18 |
| 0-18 |
| 1567 | continue; never executed: continue; | 0 |
| 1568 | size = size.expandedTo(child->minimumSizeHint()); | - |
| 1569 | } executed: }Execution Count:18 | 18 |
| 1570 | } executed: }Execution Count:55 | 55 |
| 1571 | return size.expandedTo(QApplication::globalStrut()); executed: return size.expandedTo(QApplication::globalStrut());Execution Count:56 | 56 |
| 1572 | } | - |
| 1573 | QMdiSubWindow *QMdiArea::currentSubWindow() const | - |
| 1574 | { | - |
| 1575 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1576 | if (d->childWindows.isEmpty()) evaluated: d->childWindows.isEmpty()| yes Evaluation Count:66 | yes Evaluation Count:78 |
| 66-78 |
| 1577 | return 0; executed: return 0;Execution Count:66 | 66 |
| 1578 | | - |
| 1579 | if (d->active) evaluated: d->active| yes Evaluation Count:75 | yes Evaluation Count:3 |
| 3-75 |
| 1580 | return d->active; executed: return d->active;Execution Count:75 | 75 |
| 1581 | | - |
| 1582 | if (d->isActivated && !window()->isMinimized()) partially evaluated: d->isActivated| yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: !window()->isMinimized()| yes Evaluation Count:3 | no Evaluation Count:0 |
| 0-3 |
| 1583 | return 0; executed: return 0;Execution Count:3 | 3 |
| 1584 | | - |
| 1585 | qt_noop(); | - |
| 1586 | int index = d->indicesToActivatedChildren.at(0); | - |
| 1587 | qt_noop(); | - |
| 1588 | QMdiSubWindow *current = d->childWindows.at(index); | - |
| 1589 | qt_noop(); | - |
| 1590 | return current; never executed: return current; | 0 |
| 1591 | } | - |
| 1592 | QMdiSubWindow *QMdiArea::activeSubWindow() const | - |
| 1593 | { | - |
| 1594 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1595 | return d->active; executed: return d->active;Execution Count:9 | 9 |
| 1596 | } | - |
| 1597 | | - |
| 1598 | | - |
| 1599 | | - |
| 1600 | | - |
| 1601 | | - |
| 1602 | | - |
| 1603 | | - |
| 1604 | void QMdiArea::setActiveSubWindow(QMdiSubWindow *window) | - |
| 1605 | { | - |
| 1606 | QMdiAreaPrivate * const d = d_func(); | - |
| 1607 | if (!window) { evaluated: !window| yes Evaluation Count:6 | yes Evaluation Count:7 |
| 6-7 |
| 1608 | d->activateWindow(0); | - |
| 1609 | return; executed: return;Execution Count:6 | 6 |
| 1610 | } | - |
| 1611 | | - |
| 1612 | if (d->childWindows.isEmpty()) { partially evaluated: d->childWindows.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
| 1613 | QMessageLogger("widgets/qmdiarea.cpp", 1817, __PRETTY_FUNCTION__).warning("QMdiArea::setActiveSubWindow: workspace is empty"); | - |
| 1614 | return; | 0 |
| 1615 | } | - |
| 1616 | | - |
| 1617 | if (d->childWindows.indexOf(window) == -1) { partially evaluated: d->childWindows.indexOf(window) == -1| no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
| 1618 | QMessageLogger("widgets/qmdiarea.cpp", 1822, __PRETTY_FUNCTION__).warning("QMdiArea::setActiveSubWindow: window is not inside workspace"); | - |
| 1619 | return; | 0 |
| 1620 | } | - |
| 1621 | | - |
| 1622 | d->activateWindow(window); | - |
| 1623 | } executed: }Execution Count:7 | 7 |
| 1624 | | - |
| 1625 | | - |
| 1626 | | - |
| 1627 | | - |
| 1628 | | - |
| 1629 | | - |
| 1630 | void QMdiArea::closeActiveSubWindow() | - |
| 1631 | { | - |
| 1632 | QMdiAreaPrivate * const d = d_func(); | - |
| 1633 | if (d->active) never evaluated: d->active | 0 |
| 1634 | d->active->close(); never executed: d->active->close(); | 0 |
| 1635 | } | 0 |
| 1636 | QList<QMdiSubWindow *> QMdiArea::subWindowList(WindowOrder order) const | - |
| 1637 | { | - |
| 1638 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1639 | return d->subWindowList(order, false); executed: return d->subWindowList(order, false);Execution Count:14 | 14 |
| 1640 | } | - |
| 1641 | void QMdiArea::closeAllSubWindows() | - |
| 1642 | { | - |
| 1643 | QMdiAreaPrivate * const d = d_func(); | - |
| 1644 | if (d->childWindows.isEmpty()) never evaluated: d->childWindows.isEmpty() | 0 |
| 1645 | return; | 0 |
| 1646 | | - |
| 1647 | d->isSubWindowsTiled = false; | - |
| 1648 | for (QForeachContainer<__typeof__(d->childWindows)> _container_(d->childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1649 | if (!sanityCheck(child, "QMdiArea::closeAllSubWindows")) never evaluated: !sanityCheck(child, "QMdiArea::closeAllSubWindows") | 0 |
| 1650 | continue; never executed: continue; | 0 |
| 1651 | child->close(); | - |
| 1652 | } | 0 |
| 1653 | | - |
| 1654 | d->updateScrollBars(); | - |
| 1655 | } | 0 |
| 1656 | void QMdiArea::activateNextSubWindow() | - |
| 1657 | { | - |
| 1658 | QMdiAreaPrivate * const d = d_func(); | - |
| 1659 | if (d->childWindows.isEmpty()) partially evaluated: d->childWindows.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 1660 | return; | 0 |
| 1661 | | - |
| 1662 | QMdiSubWindow *next = d->nextVisibleSubWindow(1, d->activationOrder); | - |
| 1663 | if (next) partially evaluated: next| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 1664 | d->activateWindow(next); executed: d->activateWindow(next);Execution Count:6 | 6 |
| 1665 | } executed: }Execution Count:6 | 6 |
| 1666 | void QMdiArea::activatePreviousSubWindow() | - |
| 1667 | { | - |
| 1668 | QMdiAreaPrivate * const d = d_func(); | - |
| 1669 | if (d->childWindows.isEmpty()) never evaluated: d->childWindows.isEmpty() | 0 |
| 1670 | return; | 0 |
| 1671 | | - |
| 1672 | QMdiSubWindow *previous = d->nextVisibleSubWindow(-1, d->activationOrder); | - |
| 1673 | if (previous) never evaluated: previous | 0 |
| 1674 | d->activateWindow(previous); never executed: d->activateWindow(previous); | 0 |
| 1675 | } | 0 |
| 1676 | QMdiSubWindow *QMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags windowFlags) | - |
| 1677 | { | - |
| 1678 | if (!widget) { partially evaluated: !widget| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 1679 | QMessageLogger("widgets/qmdiarea.cpp", 1946, __PRETTY_FUNCTION__).warning("QMdiArea::addSubWindow: null pointer to widget"); | - |
| 1680 | return 0; never executed: return 0; | 0 |
| 1681 | } | - |
| 1682 | | - |
| 1683 | QMdiAreaPrivate * const d = d_func(); | - |
| 1684 | | - |
| 1685 | QWidget *childFocus = widget->focusWidget(); | - |
| 1686 | QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(widget); | - |
| 1687 | | - |
| 1688 | | - |
| 1689 | if (child) { evaluated: child| yes Evaluation Count:19 | yes Evaluation Count:82 |
| 19-82 |
| 1690 | if (d->childWindows.indexOf(child) != -1) { partially evaluated: d->childWindows.indexOf(child) != -1| no Evaluation Count:0 | yes Evaluation Count:19 |
| 0-19 |
| 1691 | QMessageLogger("widgets/qmdiarea.cpp", 1958, __PRETTY_FUNCTION__).warning("QMdiArea::addSubWindow: window is already added"); | - |
| 1692 | return child; never executed: return child; | 0 |
| 1693 | } | - |
| 1694 | child->setParent(viewport(), windowFlags ? windowFlags : child->windowFlags()); | - |
| 1695 | | - |
| 1696 | } else { executed: }Execution Count:19 | 19 |
| 1697 | child = new QMdiSubWindow(viewport(), windowFlags); | - |
| 1698 | child->setAttribute(Qt::WA_DeleteOnClose); | - |
| 1699 | child->setWidget(widget); | - |
| 1700 | qt_noop(); | - |
| 1701 | } executed: }Execution Count:82 | 82 |
| 1702 | | - |
| 1703 | if (childFocus) partially evaluated: childFocus| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 1704 | childFocus->setFocus(); never executed: childFocus->setFocus(); | 0 |
| 1705 | d->appendChild(child); | - |
| 1706 | return child; executed: return child;Execution Count:101 | 101 |
| 1707 | } | - |
| 1708 | void QMdiArea::removeSubWindow(QWidget *widget) | - |
| 1709 | { | - |
| 1710 | if (!widget) { | 0 |
| 1711 | QMessageLogger("widgets/qmdiarea.cpp", 1989, __PRETTY_FUNCTION__).warning("QMdiArea::removeSubWindow: null pointer to widget"); | - |
| 1712 | return; | 0 |
| 1713 | } | - |
| 1714 | | - |
| 1715 | QMdiAreaPrivate * const d = d_func(); | - |
| 1716 | if (d->childWindows.isEmpty()) never evaluated: d->childWindows.isEmpty() | 0 |
| 1717 | return; | 0 |
| 1718 | | - |
| 1719 | if (QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(widget)) { never evaluated: QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(widget) | 0 |
| 1720 | int index = d->childWindows.indexOf(child); | - |
| 1721 | if (index == -1) { never evaluated: index == -1 | 0 |
| 1722 | QMessageLogger("widgets/qmdiarea.cpp", 2000, __PRETTY_FUNCTION__).warning("QMdiArea::removeSubWindow: window is not inside workspace"); | - |
| 1723 | return; | 0 |
| 1724 | } | - |
| 1725 | d->disconnectSubWindow(child); | - |
| 1726 | d->childWindows.removeAll(child); | - |
| 1727 | d->indicesToActivatedChildren.removeAll(index); | - |
| 1728 | d->updateActiveWindow(index, d->active == child); | - |
| 1729 | child->setParent(0); | - |
| 1730 | return; | 0 |
| 1731 | } | - |
| 1732 | | - |
| 1733 | bool found = false; | - |
| 1734 | for (QForeachContainer<__typeof__(d->childWindows)> _container_(d->childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1735 | if (!sanityCheck(child, "QMdiArea::removeSubWindow")) never evaluated: !sanityCheck(child, "QMdiArea::removeSubWindow") | 0 |
| 1736 | continue; never executed: continue; | 0 |
| 1737 | if (child->widget() == widget) { never evaluated: child->widget() == widget | 0 |
| 1738 | child->setWidget(0); | - |
| 1739 | qt_noop(); | - |
| 1740 | found = true; | - |
| 1741 | break; | 0 |
| 1742 | } | - |
| 1743 | } | 0 |
| 1744 | | - |
| 1745 | if (!found) | 0 |
| 1746 | QMessageLogger("widgets/qmdiarea.cpp", 2024, __PRETTY_FUNCTION__).warning("QMdiArea::removeSubWindow: widget is not child of any window inside QMdiArea"); never executed: QMessageLogger("widgets/qmdiarea.cpp", 2024, __PRETTY_FUNCTION__).warning("QMdiArea::removeSubWindow: widget is not child of any window inside QMdiArea"); | 0 |
| 1747 | } | 0 |
| 1748 | QBrush QMdiArea::background() const | - |
| 1749 | { | - |
| 1750 | return d_func()->background; never executed: return d_func()->background; | 0 |
| 1751 | } | - |
| 1752 | | - |
| 1753 | void QMdiArea::setBackground(const QBrush &brush) | - |
| 1754 | { | - |
| 1755 | QMdiAreaPrivate * const d = d_func(); | - |
| 1756 | if (d->background != brush) { partially evaluated: d->background != brush| yes Evaluation Count:80 | no Evaluation Count:0 |
| 0-80 |
| 1757 | d->background = brush; | - |
| 1758 | d->viewport->setAttribute(Qt::WA_OpaquePaintEvent, brush.isOpaque()); | - |
| 1759 | update(); | - |
| 1760 | } executed: }Execution Count:80 | 80 |
| 1761 | } executed: }Execution Count:80 | 80 |
| 1762 | QMdiArea::WindowOrder QMdiArea::activationOrder() const | - |
| 1763 | { | - |
| 1764 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1765 | return d->activationOrder; never executed: return d->activationOrder; | 0 |
| 1766 | } | - |
| 1767 | | - |
| 1768 | void QMdiArea::setActivationOrder(WindowOrder order) | - |
| 1769 | { | - |
| 1770 | QMdiAreaPrivate * const d = d_func(); | - |
| 1771 | if (order != d->activationOrder) never evaluated: order != d->activationOrder | 0 |
| 1772 | d->activationOrder = order; never executed: d->activationOrder = order; | 0 |
| 1773 | } | 0 |
| 1774 | | - |
| 1775 | | - |
| 1776 | | - |
| 1777 | | - |
| 1778 | | - |
| 1779 | | - |
| 1780 | | - |
| 1781 | void QMdiArea::setOption(AreaOption option, bool on) | - |
| 1782 | { | - |
| 1783 | QMdiAreaPrivate * const d = d_func(); | - |
| 1784 | if (on && !(d->options & option)) partially evaluated: on| yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: !(d->options & option)| yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
| 1785 | d->options |= option; executed: d->options |= option;Execution Count:1 | 1 |
| 1786 | else if (!on && (d->options & option)) never evaluated: (d->options & option) | 0 |
| 1787 | d->options &= ~option; never executed: d->options &= ~option; | 0 |
| 1788 | } | - |
| 1789 | | - |
| 1790 | | - |
| 1791 | | - |
| 1792 | | - |
| 1793 | | - |
| 1794 | | - |
| 1795 | bool QMdiArea::testOption(AreaOption option) const | - |
| 1796 | { | - |
| 1797 | return d_func()->options & option; executed: return d_func()->options & option;Execution Count:11 | 11 |
| 1798 | } | - |
| 1799 | QMdiArea::ViewMode QMdiArea::viewMode() const | - |
| 1800 | { | - |
| 1801 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1802 | return d->viewMode; executed: return d->viewMode;Execution Count:5513 | 5513 |
| 1803 | } | - |
| 1804 | | - |
| 1805 | void QMdiArea::setViewMode(ViewMode mode) | - |
| 1806 | { | - |
| 1807 | QMdiAreaPrivate * const d = d_func(); | - |
| 1808 | d->setViewMode(mode); | - |
| 1809 | } | 0 |
| 1810 | bool QMdiArea::documentMode() const | - |
| 1811 | { | - |
| 1812 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1813 | return d->documentMode; never executed: return d->documentMode; | 0 |
| 1814 | } | - |
| 1815 | | - |
| 1816 | void QMdiArea::setDocumentMode(bool enabled) | - |
| 1817 | { | - |
| 1818 | QMdiAreaPrivate * const d = d_func(); | - |
| 1819 | if (d->documentMode == enabled) never evaluated: d->documentMode == enabled | 0 |
| 1820 | return; | 0 |
| 1821 | | - |
| 1822 | d->documentMode = enabled; | - |
| 1823 | d->refreshTabBar(); | - |
| 1824 | } | 0 |
| 1825 | bool QMdiArea::tabsClosable() const | - |
| 1826 | { | - |
| 1827 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1828 | return d->tabsClosable; never executed: return d->tabsClosable; | 0 |
| 1829 | } | - |
| 1830 | | - |
| 1831 | void QMdiArea::setTabsClosable(bool closable) | - |
| 1832 | { | - |
| 1833 | QMdiAreaPrivate * const d = d_func(); | - |
| 1834 | if (d->tabsClosable == closable) never evaluated: d->tabsClosable == closable | 0 |
| 1835 | return; | 0 |
| 1836 | | - |
| 1837 | d->tabsClosable = closable; | - |
| 1838 | d->refreshTabBar(); | - |
| 1839 | } | 0 |
| 1840 | bool QMdiArea::tabsMovable() const | - |
| 1841 | { | - |
| 1842 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1843 | return d->tabsMovable; never executed: return d->tabsMovable; | 0 |
| 1844 | } | - |
| 1845 | | - |
| 1846 | void QMdiArea::setTabsMovable(bool movable) | - |
| 1847 | { | - |
| 1848 | QMdiAreaPrivate * const d = d_func(); | - |
| 1849 | if (d->tabsMovable == movable) never evaluated: d->tabsMovable == movable | 0 |
| 1850 | return; | 0 |
| 1851 | | - |
| 1852 | d->tabsMovable = movable; | - |
| 1853 | d->refreshTabBar(); | - |
| 1854 | } | 0 |
| 1855 | QTabWidget::TabShape QMdiArea::tabShape() const | - |
| 1856 | { | - |
| 1857 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1858 | return d->tabShape; never executed: return d->tabShape; | 0 |
| 1859 | } | - |
| 1860 | | - |
| 1861 | void QMdiArea::setTabShape(QTabWidget::TabShape shape) | - |
| 1862 | { | - |
| 1863 | QMdiAreaPrivate * const d = d_func(); | - |
| 1864 | if (d->tabShape == shape) never evaluated: d->tabShape == shape | 0 |
| 1865 | return; | 0 |
| 1866 | | - |
| 1867 | d->tabShape = shape; | - |
| 1868 | d->refreshTabBar(); | - |
| 1869 | } | 0 |
| 1870 | QTabWidget::TabPosition QMdiArea::tabPosition() const | - |
| 1871 | { | - |
| 1872 | const QMdiAreaPrivate * const d = d_func(); | - |
| 1873 | return d->tabPosition; never executed: return d->tabPosition; | 0 |
| 1874 | } | - |
| 1875 | | - |
| 1876 | void QMdiArea::setTabPosition(QTabWidget::TabPosition position) | - |
| 1877 | { | - |
| 1878 | QMdiAreaPrivate * const d = d_func(); | - |
| 1879 | if (d->tabPosition == position) never evaluated: d->tabPosition == position | 0 |
| 1880 | return; | 0 |
| 1881 | | - |
| 1882 | d->tabPosition = position; | - |
| 1883 | d->refreshTabBar(); | - |
| 1884 | } | 0 |
| 1885 | | - |
| 1886 | | - |
| 1887 | | - |
| 1888 | | - |
| 1889 | | - |
| 1890 | void QMdiArea::childEvent(QChildEvent *childEvent) | - |
| 1891 | { | - |
| 1892 | QMdiAreaPrivate * const d = d_func(); | - |
| 1893 | if (childEvent->type() == QEvent::ChildPolished) { evaluated: childEvent->type() == QEvent::ChildPolished| yes Evaluation Count:231 | yes Evaluation Count:300 |
| 231-300 |
| 1894 | if (QMdiSubWindow *mdiChild = qobject_cast<QMdiSubWindow *>(childEvent->child())) { partially evaluated: QMdiSubWindow *mdiChild = qobject_cast<QMdiSubWindow *>(childEvent->child())| no Evaluation Count:0 | yes Evaluation Count:231 |
| 0-231 |
| 1895 | if (d->childWindows.indexOf(mdiChild) == -1) never evaluated: d->childWindows.indexOf(mdiChild) == -1 | 0 |
| 1896 | d->appendChild(mdiChild); never executed: d->appendChild(mdiChild); | 0 |
| 1897 | } | 0 |
| 1898 | } executed: }Execution Count:231 | 231 |
| 1899 | } executed: }Execution Count:531 | 531 |
| 1900 | | - |
| 1901 | | - |
| 1902 | | - |
| 1903 | | - |
| 1904 | void QMdiArea::resizeEvent(QResizeEvent *resizeEvent) | - |
| 1905 | { | - |
| 1906 | QMdiAreaPrivate * const d = d_func(); | - |
| 1907 | if (d->childWindows.isEmpty()) { evaluated: d->childWindows.isEmpty()| yes Evaluation Count:57 | yes Evaluation Count:95 |
| 57-95 |
| 1908 | resizeEvent->ignore(); | - |
| 1909 | return; executed: return;Execution Count:57 | 57 |
| 1910 | } | - |
| 1911 | | - |
| 1912 | | - |
| 1913 | d->updateTabBarGeometry(); | - |
| 1914 | | - |
| 1915 | | - |
| 1916 | | - |
| 1917 | | - |
| 1918 | | - |
| 1919 | if (d->isSubWindowsTiled) { partially evaluated: d->isSubWindowsTiled| no Evaluation Count:0 | yes Evaluation Count:95 |
| 0-95 |
| 1920 | d->tileCalledFromResizeEvent = true; | - |
| 1921 | tileSubWindows(); | - |
| 1922 | d->tileCalledFromResizeEvent = false; | - |
| 1923 | d->isSubWindowsTiled = true; | - |
| 1924 | d->startResizeTimer(); | - |
| 1925 | | - |
| 1926 | return; | 0 |
| 1927 | } | - |
| 1928 | | - |
| 1929 | | - |
| 1930 | bool hasMaximizedSubWindow = false; | - |
| 1931 | for (QForeachContainer<__typeof__(d->childWindows)> _container_(d->childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1932 | if (sanityCheck(child, "QMdiArea::resizeEvent") && child->isMaximized() partially evaluated: sanityCheck(child, "QMdiArea::resizeEvent")| yes Evaluation Count:146 | no Evaluation Count:0 |
evaluated: child->isMaximized()| yes Evaluation Count:45 | yes Evaluation Count:101 |
| 0-146 |
| 1933 | && child->size() != resizeEvent->size()) { partially evaluated: child->size() != resizeEvent->size()| yes Evaluation Count:45 | no Evaluation Count:0 |
| 0-45 |
| 1934 | child->resize(resizeEvent->size()); | - |
| 1935 | if (!hasMaximizedSubWindow) evaluated: !hasMaximizedSubWindow| yes Evaluation Count:41 | yes Evaluation Count:4 |
| 4-41 |
| 1936 | hasMaximizedSubWindow = true; executed: hasMaximizedSubWindow = true;Execution Count:41 | 41 |
| 1937 | } executed: }Execution Count:45 | 45 |
| 1938 | } executed: }Execution Count:146 | 146 |
| 1939 | | - |
| 1940 | d->updateScrollBars(); | - |
| 1941 | | - |
| 1942 | | - |
| 1943 | | - |
| 1944 | | - |
| 1945 | if (hasMaximizedSubWindow) evaluated: hasMaximizedSubWindow| yes Evaluation Count:41 | yes Evaluation Count:54 |
| 41-54 |
| 1946 | d->startResizeTimer(); executed: d->startResizeTimer();Execution Count:41 | 41 |
| 1947 | else | - |
| 1948 | d->arrangeMinimizedSubWindows(); executed: d->arrangeMinimizedSubWindows();Execution Count:54 | 54 |
| 1949 | } | - |
| 1950 | | - |
| 1951 | | - |
| 1952 | | - |
| 1953 | | - |
| 1954 | void QMdiArea::timerEvent(QTimerEvent *timerEvent) | - |
| 1955 | { | - |
| 1956 | QMdiAreaPrivate * const d = d_func(); | - |
| 1957 | if (timerEvent->timerId() == d->resizeTimerId) { partially evaluated: timerEvent->timerId() == d->resizeTimerId| yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
| 1958 | killTimer(d->resizeTimerId); | - |
| 1959 | d->resizeTimerId = -1; | - |
| 1960 | d->arrangeMinimizedSubWindows(); | - |
| 1961 | } else if (timerEvent->timerId() == d->tabToPreviousTimerId) { executed: }Execution Count:2 never evaluated: timerEvent->timerId() == d->tabToPreviousTimerId | 0-2 |
| 1962 | killTimer(d->tabToPreviousTimerId); | - |
| 1963 | d->tabToPreviousTimerId = -1; | - |
| 1964 | if (d->indexToHighlighted < 0) never evaluated: d->indexToHighlighted < 0 | 0 |
| 1965 | return; | 0 |
| 1966 | | - |
| 1967 | | - |
| 1968 | qt_noop(); | - |
| 1969 | qt_noop(); | - |
| 1970 | d->showRubberBandFor(d->childWindows.at(d->indexToHighlighted)); | - |
| 1971 | | - |
| 1972 | } | 0 |
| 1973 | } | - |
| 1974 | | - |
| 1975 | | - |
| 1976 | | - |
| 1977 | | - |
| 1978 | void QMdiArea::showEvent(QShowEvent *showEvent) | - |
| 1979 | { | - |
| 1980 | QMdiAreaPrivate * const d = d_func(); | - |
| 1981 | if (!d->pendingRearrangements.isEmpty()) { partially evaluated: !d->pendingRearrangements.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:116 |
| 0-116 |
| 1982 | bool skipPlacement = false; | - |
| 1983 | for (QForeachContainer<__typeof__(d->pendingRearrangements)> _container_(d->pendingRearrangements); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (Rearranger *rearranger = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1984 | | - |
| 1985 | | - |
| 1986 | if (rearranger->type() != Rearranger::IconTiler && !skipPlacement) never evaluated: rearranger->type() != Rearranger::IconTiler never evaluated: !skipPlacement | 0 |
| 1987 | skipPlacement = true; never executed: skipPlacement = true; | 0 |
| 1988 | d->rearrange(rearranger); | - |
| 1989 | } | 0 |
| 1990 | d->pendingRearrangements.clear(); | - |
| 1991 | | - |
| 1992 | if (skipPlacement && !d->pendingPlacements.isEmpty()) never evaluated: skipPlacement never evaluated: !d->pendingPlacements.isEmpty() | 0 |
| 1993 | d->pendingPlacements.clear(); never executed: d->pendingPlacements.clear(); | 0 |
| 1994 | } | 0 |
| 1995 | | - |
| 1996 | if (!d->pendingPlacements.isEmpty()) { evaluated: !d->pendingPlacements.isEmpty()| yes Evaluation Count:51 | yes Evaluation Count:65 |
| 51-65 |
| 1997 | for (QForeachContainer<__typeof__(d->pendingPlacements)> _container_(d->pendingPlacements); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *window = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 1998 | if (!window) partially evaluated: !window| no Evaluation Count:0 | yes Evaluation Count:60 |
| 0-60 |
| 1999 | continue; never executed: continue; | 0 |
| 2000 | if (!window->testAttribute(Qt::WA_Resized)) { evaluated: !window->testAttribute(Qt::WA_Resized)| yes Evaluation Count:49 | yes Evaluation Count:11 |
| 11-49 |
| 2001 | QSize newSize(window->sizeHint().boundedTo(viewport()->size())); | - |
| 2002 | window->resize(newSize.expandedTo(qSmartMinSize(window))); | - |
| 2003 | } executed: }Execution Count:49 | 49 |
| 2004 | if (!window->testAttribute(Qt::WA_Moved) && !window->isMinimized() evaluated: !window->testAttribute(Qt::WA_Moved)| yes Evaluation Count:51 | yes Evaluation Count:9 |
partially evaluated: !window->isMinimized()| yes Evaluation Count:51 | no Evaluation Count:0 |
| 0-51 |
| 2005 | && !window->isMaximized()) { partially evaluated: !window->isMaximized()| yes Evaluation Count:51 | no Evaluation Count:0 |
| 0-51 |
| 2006 | d->place(d->placer, window); | - |
| 2007 | } executed: }Execution Count:51 | 51 |
| 2008 | } executed: }Execution Count:60 | 60 |
| 2009 | d->pendingPlacements.clear(); | - |
| 2010 | } executed: }Execution Count:51 | 51 |
| 2011 | | - |
| 2012 | d->setChildActivationEnabled(true); | - |
| 2013 | d->activateCurrentWindow(); | - |
| 2014 | | - |
| 2015 | QAbstractScrollArea::showEvent(showEvent); | - |
| 2016 | } executed: }Execution Count:116 | 116 |
| 2017 | | - |
| 2018 | | - |
| 2019 | | - |
| 2020 | | - |
| 2021 | bool QMdiArea::viewportEvent(QEvent *event) | - |
| 2022 | { | - |
| 2023 | QMdiAreaPrivate * const d = d_func(); | - |
| 2024 | switch (event->type()) { | - |
| 2025 | case QEvent::ChildRemoved: { | - |
| 2026 | d->isSubWindowsTiled = false; | - |
| 2027 | QObject *removedChild = static_cast<QChildEvent *>(event)->child(); | - |
| 2028 | for (int i = 0; i < d->childWindows.size(); ++i) { evaluated: i < d->childWindows.size()| yes Evaluation Count:11 | yes Evaluation Count:1 |
| 1-11 |
| 2029 | QObject *child = d->childWindows.at(i); | - |
| 2030 | if (!child || child == removedChild || !child->parent() partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:11 |
partially evaluated: child == removedChild| yes Evaluation Count:11 | no Evaluation Count:0 |
never evaluated: !child->parent() | 0-11 |
| 2031 | || child->parent() != viewport()) { never evaluated: child->parent() != viewport() | 0 |
| 2032 | if (!testOption(DontMaximizeSubWindowOnActivation)) { partially evaluated: !testOption(DontMaximizeSubWindowOnActivation)| yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
| 2033 | | - |
| 2034 | | - |
| 2035 | QWidget *mdiChild = qobject_cast<QWidget *>(removedChild); | - |
| 2036 | if (mdiChild && mdiChild->isMaximized()) partially evaluated: mdiChild| yes Evaluation Count:11 | no Evaluation Count:0 |
evaluated: mdiChild->isMaximized()| yes Evaluation Count:1 | yes Evaluation Count:10 |
| 0-11 |
| 2037 | d->showActiveWindowMaximized = true; executed: d->showActiveWindowMaximized = true;Execution Count:1 | 1 |
| 2038 | } executed: }Execution Count:11 | 11 |
| 2039 | d->disconnectSubWindow(child); | - |
| 2040 | const bool activeRemoved = i == d->indicesToActivatedChildren.at(0); | - |
| 2041 | d->childWindows.removeAt(i); | - |
| 2042 | d->indicesToActivatedChildren.removeAll(i); | - |
| 2043 | d->updateActiveWindow(i, activeRemoved); | - |
| 2044 | d->arrangeMinimizedSubWindows(); | - |
| 2045 | break; executed: break;Execution Count:11 | 11 |
| 2046 | } | - |
| 2047 | } | 0 |
| 2048 | d->updateScrollBars(); | - |
| 2049 | break; executed: break;Execution Count:12 | 12 |
| 2050 | } | - |
| 2051 | case QEvent::Destroy: | - |
| 2052 | d->isSubWindowsTiled = false; | - |
| 2053 | d->resetActiveWindow(); | - |
| 2054 | d->childWindows.clear(); | - |
| 2055 | QMessageLogger("widgets/qmdiarea.cpp", 2420, __PRETTY_FUNCTION__).warning("QMdiArea: Deleting the view port is undefined, use setViewport instead."); | - |
| 2056 | break; | 0 |
| 2057 | default: | - |
| 2058 | break; executed: break;Execution Count:1258 | 1258 |
| 2059 | } | - |
| 2060 | return QAbstractScrollArea::viewportEvent(event); executed: return QAbstractScrollArea::viewportEvent(event);Execution Count:1270 | 1270 |
| 2061 | } | - |
| 2062 | | - |
| 2063 | | - |
| 2064 | | - |
| 2065 | | - |
| 2066 | void QMdiArea::scrollContentsBy(int dx, int dy) | - |
| 2067 | { | - |
| 2068 | QMdiAreaPrivate * const d = d_func(); | - |
| 2069 | const bool wasSubWindowsTiled = d->isSubWindowsTiled; | - |
| 2070 | d->ignoreGeometryChange = true; | - |
| 2071 | viewport()->scroll(isLeftToRight() ? dx : -dx, dy); | - |
| 2072 | d->arrangeMinimizedSubWindows(); | - |
| 2073 | d->ignoreGeometryChange = false; | - |
| 2074 | if (wasSubWindowsTiled) never evaluated: wasSubWindowsTiled | 0 |
| 2075 | d->isSubWindowsTiled = true; never executed: d->isSubWindowsTiled = true; | 0 |
| 2076 | } | 0 |
| 2077 | | - |
| 2078 | | - |
| 2079 | | - |
| 2080 | | - |
| 2081 | | - |
| 2082 | | - |
| 2083 | void QMdiArea::tileSubWindows() | - |
| 2084 | { | - |
| 2085 | QMdiAreaPrivate * const d = d_func(); | - |
| 2086 | if (!d->regularTiler) never evaluated: !d->regularTiler | 0 |
| 2087 | d->regularTiler = new RegularTiler; never executed: d->regularTiler = new RegularTiler; | 0 |
| 2088 | d->rearrange(d->regularTiler); | - |
| 2089 | } | 0 |
| 2090 | | - |
| 2091 | | - |
| 2092 | | - |
| 2093 | | - |
| 2094 | | - |
| 2095 | | - |
| 2096 | void QMdiArea::cascadeSubWindows() | - |
| 2097 | { | - |
| 2098 | QMdiAreaPrivate * const d = d_func(); | - |
| 2099 | if (!d->cascader) never evaluated: !d->cascader | 0 |
| 2100 | d->cascader = new SimpleCascader; never executed: d->cascader = new SimpleCascader; | 0 |
| 2101 | d->rearrange(d->cascader); | - |
| 2102 | } | 0 |
| 2103 | | - |
| 2104 | | - |
| 2105 | | - |
| 2106 | | - |
| 2107 | bool QMdiArea::event(QEvent *event) | - |
| 2108 | { | - |
| 2109 | QMdiAreaPrivate * const d = d_func(); | - |
| 2110 | switch (event->type()) { | - |
| 2111 | | - |
| 2112 | | - |
| 2113 | | - |
| 2114 | | - |
| 2115 | | - |
| 2116 | | - |
| 2117 | | - |
| 2118 | case QEvent::WindowActivate: { | - |
| 2119 | d->isActivated = true; | - |
| 2120 | if (d->childWindows.isEmpty()) evaluated: d->childWindows.isEmpty()| yes Evaluation Count:22 | yes Evaluation Count:49 |
| 22-49 |
| 2121 | break; executed: break;Execution Count:22 | 22 |
| 2122 | if (!d->active) partially evaluated: !d->active| no Evaluation Count:0 | yes Evaluation Count:49 |
| 0-49 |
| 2123 | d->activateCurrentWindow(); never executed: d->activateCurrentWindow(); | 0 |
| 2124 | d->setChildActivationEnabled(false, true); | - |
| 2125 | break; executed: break;Execution Count:49 | 49 |
| 2126 | } | - |
| 2127 | case QEvent::WindowDeactivate: | - |
| 2128 | d->isActivated = false; | - |
| 2129 | d->setChildActivationEnabled(false, true); | - |
| 2130 | break; executed: break;Execution Count:26 | 26 |
| 2131 | case QEvent::StyleChange: | - |
| 2132 | | - |
| 2133 | | - |
| 2134 | | - |
| 2135 | if (d->isSubWindowsTiled) { never evaluated: d->isSubWindowsTiled | 0 |
| 2136 | tileSubWindows(); | - |
| 2137 | d->isSubWindowsTiled = true; | - |
| 2138 | } | 0 |
| 2139 | break; | 0 |
| 2140 | case QEvent::WindowIconChange: | - |
| 2141 | for (QForeachContainer<__typeof__(d->childWindows)> _container_(d->childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *window = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 2142 | if (sanityCheck(window, "QMdiArea::WindowIconChange")) never evaluated: sanityCheck(window, "QMdiArea::WindowIconChange") | 0 |
| 2143 | QApplication::sendEvent(window, event); never executed: QApplication::sendEvent(window, event); | 0 |
| 2144 | } | 0 |
| 2145 | break; | 0 |
| 2146 | case QEvent::Hide: | - |
| 2147 | d->setActive(d->active, false, false); | - |
| 2148 | d->setChildActivationEnabled(false); | - |
| 2149 | break; executed: break;Execution Count:58 | 58 |
| 2150 | | - |
| 2151 | case QEvent::LayoutDirectionChange: | - |
| 2152 | d->updateTabBarGeometry(); | - |
| 2153 | break; executed: break;Execution Count:2 | 2 |
| 2154 | | - |
| 2155 | default: | - |
| 2156 | break; executed: break;Execution Count:2134 | 2134 |
| 2157 | } | - |
| 2158 | return QAbstractScrollArea::event(event); executed: return QAbstractScrollArea::event(event);Execution Count:2291 | 2291 |
| 2159 | } | - |
| 2160 | | - |
| 2161 | | - |
| 2162 | | - |
| 2163 | | - |
| 2164 | bool QMdiArea::eventFilter(QObject *object, QEvent *event) | - |
| 2165 | { | - |
| 2166 | if (!object) partially evaluated: !object| no Evaluation Count:0 | yes Evaluation Count:71070 |
| 0-71070 |
| 2167 | return QAbstractScrollArea::eventFilter(object, event); never executed: return QAbstractScrollArea::eventFilter(object, event); | 0 |
| 2168 | | - |
| 2169 | QMdiAreaPrivate * const d = d_func(); | - |
| 2170 | | - |
| 2171 | if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { evaluated: event->type() == QEvent::KeyPress| yes Evaluation Count:8 | yes Evaluation Count:71062 |
partially evaluated: event->type() == QEvent::KeyRelease| no Evaluation Count:0 | yes Evaluation Count:71062 |
| 0-71062 |
| 2172 | | - |
| 2173 | QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); | - |
| 2174 | | - |
| 2175 | | - |
| 2176 | | - |
| 2177 | | - |
| 2178 | if (!(keyEvent->modifiers() & Qt::ControlModifier) && keyEvent->key() != Qt::Key_Control) partially evaluated: !(keyEvent->modifiers() & Qt::ControlModifier)| yes Evaluation Count:8 | no Evaluation Count:0 |
partially evaluated: keyEvent->key() != Qt::Key_Control| yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
| 2179 | | - |
| 2180 | return QAbstractScrollArea::eventFilter(object, event); executed: return QAbstractScrollArea::eventFilter(object, event);Execution Count:8 | 8 |
| 2181 | | - |
| 2182 | | - |
| 2183 | QMdiArea *area = mdiAreaParent(static_cast<QWidget *>(object)); | - |
| 2184 | if (!area) | 0 |
| 2185 | return QAbstractScrollArea::eventFilter(object, event); never executed: return QAbstractScrollArea::eventFilter(object, event); | 0 |
| 2186 | | - |
| 2187 | const bool keyPress = (event->type() == QEvent::KeyPress) ? true : false; never evaluated: (event->type() == QEvent::KeyPress) | 0 |
| 2188 | | - |
| 2189 | | - |
| 2190 | | - |
| 2191 | | - |
| 2192 | | - |
| 2193 | switch (keyEvent->key()) { | - |
| 2194 | | - |
| 2195 | | - |
| 2196 | | - |
| 2197 | case Qt::Key_Control: | - |
| 2198 | | - |
| 2199 | if (keyPress) never evaluated: keyPress | 0 |
| 2200 | area->d_func()->startTabToPreviousTimer(); never executed: area->d_func()->startTabToPreviousTimer(); | 0 |
| 2201 | else | - |
| 2202 | area->d_func()->activateHighlightedWindow(); never executed: area->d_func()->activateHighlightedWindow(); | 0 |
| 2203 | break; | 0 |
| 2204 | case Qt::Key_Tab: | - |
| 2205 | case Qt::Key_Backtab: | - |
| 2206 | if (keyPress) never evaluated: keyPress | 0 |
| 2207 | area->d_func()->highlightNextSubWindow(keyEvent->key() == Qt::Key_Tab ? 1 : -1); never executed: area->d_func()->highlightNextSubWindow(keyEvent->key() == Qt::Key_Tab ? 1 : -1); | 0 |
| 2208 | return true; never executed: return true; | 0 |
| 2209 | | - |
| 2210 | case Qt::Key_Escape: | - |
| 2211 | area->d_func()->hideRubberBand(); | - |
| 2212 | break; | 0 |
| 2213 | | - |
| 2214 | default: | - |
| 2215 | break; | 0 |
| 2216 | } | - |
| 2217 | return QAbstractScrollArea::eventFilter(object, event); never executed: return QAbstractScrollArea::eventFilter(object, event); | 0 |
| 2218 | } | - |
| 2219 | | - |
| 2220 | QMdiSubWindow *subWindow = qobject_cast<QMdiSubWindow *>(object); | - |
| 2221 | | - |
| 2222 | if (!subWindow) { evaluated: !subWindow| yes Evaluation Count:49121 | yes Evaluation Count:21941 |
| 21941-49121 |
| 2223 | | - |
| 2224 | if (event->type() == QEvent::ApplicationActivate && !d->active evaluated: event->type() == QEvent::ApplicationActivate| yes Evaluation Count:72 | yes Evaluation Count:49049 |
evaluated: !d->active| yes Evaluation Count:22 | yes Evaluation Count:50 |
| 22-49049 |
| 2225 | && isVisible() && !window()->isMinimized()) { partially evaluated: isVisible()| yes Evaluation Count:22 | no Evaluation Count:0 |
partially evaluated: !window()->isMinimized()| yes Evaluation Count:22 | no Evaluation Count:0 |
| 0-22 |
| 2226 | d->activateCurrentWindow(); | - |
| 2227 | } else if (event->type() == QEvent::ApplicationDeactivate && d->active) { executed: }Execution Count:22 partially evaluated: event->type() == QEvent::ApplicationDeactivate| no Evaluation Count:0 | yes Evaluation Count:49099 |
never evaluated: d->active | 0-49099 |
| 2228 | d->setActive(d->active, false, false); | - |
| 2229 | } | 0 |
| 2230 | return QAbstractScrollArea::eventFilter(object, event); executed: return QAbstractScrollArea::eventFilter(object, event);Execution Count:49121 | 49121 |
| 2231 | } | - |
| 2232 | | - |
| 2233 | | - |
| 2234 | switch (event->type()) { | - |
| 2235 | case QEvent::Move: | - |
| 2236 | case QEvent::Resize: | - |
| 2237 | if (d->tileCalledFromResizeEvent) partially evaluated: d->tileCalledFromResizeEvent| no Evaluation Count:0 | yes Evaluation Count:1903 |
| 0-1903 |
| 2238 | break; | 0 |
| 2239 | d->updateScrollBars(); | - |
| 2240 | if (!subWindow->isMinimized()) evaluated: !subWindow->isMinimized()| yes Evaluation Count:1808 | yes Evaluation Count:95 |
| 95-1808 |
| 2241 | d->isSubWindowsTiled = false; executed: d->isSubWindowsTiled = false;Execution Count:1808 | 1808 |
| 2242 | break; executed: break;Execution Count:1903 | 1903 |
| 2243 | case QEvent::Show: | - |
| 2244 | | - |
| 2245 | if (d->tabBar) { partially evaluated: d->tabBar| no Evaluation Count:0 | yes Evaluation Count:791 |
| 0-791 |
| 2246 | const int tabIndex = d->childWindows.indexOf(subWindow); | - |
| 2247 | if (!d->tabBar->isTabEnabled(tabIndex)) never evaluated: !d->tabBar->isTabEnabled(tabIndex) | 0 |
| 2248 | d->tabBar->setTabEnabled(tabIndex, true); never executed: d->tabBar->setTabEnabled(tabIndex, true); | 0 |
| 2249 | } | 0 |
| 2250 | | - |
| 2251 | | - |
| 2252 | case QEvent::Hide: code before this statement executed: case QEvent::Hide:Execution Count:791 | 791 |
| 2253 | d->isSubWindowsTiled = false; | - |
| 2254 | break; executed: break;Execution Count:1509 | 1509 |
| 2255 | | - |
| 2256 | case QEvent::Close: | - |
| 2257 | if (d->childWindows.indexOf(subWindow) == d->indexToHighlighted) partially evaluated: d->childWindows.indexOf(subWindow) == d->indexToHighlighted| no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
| 2258 | d->hideRubberBand(); never executed: d->hideRubberBand(); | 0 |
| 2259 | break; executed: break;Execution Count:8 | 8 |
| 2260 | | - |
| 2261 | | - |
| 2262 | case QEvent::WindowTitleChange: | - |
| 2263 | case QEvent::ModifiedChange: | - |
| 2264 | if (d->tabBar) partially evaluated: d->tabBar| no Evaluation Count:0 | yes Evaluation Count:85 |
| 0-85 |
| 2265 | d->tabBar->setTabText(d->childWindows.indexOf(subWindow), tabTextFor(subWindow)); never executed: d->tabBar->setTabText(d->childWindows.indexOf(subWindow), tabTextFor(subWindow)); | 0 |
| 2266 | break; executed: break;Execution Count:85 | 85 |
| 2267 | case QEvent::WindowIconChange: | - |
| 2268 | if (d->tabBar) never evaluated: d->tabBar | 0 |
| 2269 | d->tabBar->setTabIcon(d->childWindows.indexOf(subWindow), subWindow->windowIcon()); never executed: d->tabBar->setTabIcon(d->childWindows.indexOf(subWindow), subWindow->windowIcon()); | 0 |
| 2270 | break; | 0 |
| 2271 | | - |
| 2272 | default: | - |
| 2273 | break; executed: break;Execution Count:18436 | 18436 |
| 2274 | } | - |
| 2275 | return QAbstractScrollArea::eventFilter(object, event); executed: return QAbstractScrollArea::eventFilter(object, event);Execution Count:21941 | 21941 |
| 2276 | } | - |
| 2277 | | - |
| 2278 | | - |
| 2279 | | - |
| 2280 | | - |
| 2281 | void QMdiArea::paintEvent(QPaintEvent *paintEvent) | - |
| 2282 | { | - |
| 2283 | QMdiAreaPrivate * const d = d_func(); | - |
| 2284 | QPainter painter(d->viewport); | - |
| 2285 | const QVector<QRect> &exposedRects = paintEvent->region().rects(); | - |
| 2286 | for (int i = 0; i < exposedRects.size(); ++i) evaluated: i < exposedRects.size()| yes Evaluation Count:128 | yes Evaluation Count:81 |
| 81-128 |
| 2287 | painter.fillRect(exposedRects.at(i), d->background); executed: painter.fillRect(exposedRects.at(i), d->background);Execution Count:128 | 128 |
| 2288 | } executed: }Execution Count:81 | 81 |
| 2289 | void QMdiArea::setupViewport(QWidget *viewport) | - |
| 2290 | { | - |
| 2291 | QMdiAreaPrivate * const d = d_func(); | - |
| 2292 | if (viewport) partially evaluated: viewport| yes Evaluation Count:81 | no Evaluation Count:0 |
| 0-81 |
| 2293 | viewport->setAttribute(Qt::WA_OpaquePaintEvent, d->background.isOpaque()); executed: viewport->setAttribute(Qt::WA_OpaquePaintEvent, d->background.isOpaque());Execution Count:81 | 81 |
| 2294 | for (QForeachContainer<__typeof__(d->childWindows)> _container_(d->childWindows); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QMdiSubWindow *child = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
| 2295 | if (!sanityCheck(child, "QMdiArea::setupViewport")) partially evaluated: !sanityCheck(child, "QMdiArea::setupViewport")| no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
| 2296 | continue; never executed: continue; | 0 |
| 2297 | child->setParent(viewport, child->windowFlags()); | - |
| 2298 | } executed: }Execution Count:1 | 1 |
| 2299 | } executed: }Execution Count:81 | 81 |
| 2300 | | - |
| 2301 | | - |
| 2302 | | - |
| 2303 | | - |
| | |