| Line | Source Code | Coverage |
|---|
| 1 | /**************************************************************************** | - |
| 2 | ** | - |
| 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). | - |
| 4 | ** Contact: http://www.qt-project.org/legal | - |
| 5 | ** | - |
| 6 | ** This file is part of the QtGui module of the Qt Toolkit. | - |
| 7 | ** | - |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
| 9 | ** Commercial License Usage | - |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
| 11 | ** accordance with the commercial license agreement provided with the | - |
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - |
| 13 | ** a written agreement between you and Digia. For licensing terms and | - |
| 14 | ** conditions see http://qt.digia.com/licensing. For further information | - |
| 15 | ** use the contact form at http://qt.digia.com/contact-us. | - |
| 16 | ** | - |
| 17 | ** GNU Lesser General Public License Usage | - |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
| 19 | ** General Public License version 2.1 as published by the Free Software | - |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the | - |
| 21 | ** packaging of this file. Please review the following information to | - |
| 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements | - |
| 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - |
| 24 | ** | - |
| 25 | ** In addition, as a special exception, Digia gives you certain additional | - |
| 26 | ** rights. These rights are described in the Digia Qt LGPL Exception | - |
| 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - |
| 28 | ** | - |
| 29 | ** GNU General Public License Usage | - |
| 30 | ** Alternatively, this file may be used under the terms of the GNU | - |
| 31 | ** General Public License version 3.0 as published by the Free Software | - |
| 32 | ** Foundation and appearing in the file LICENSE.GPL included in the | - |
| 33 | ** packaging of this file. Please review the following information to | - |
| 34 | ** ensure the GNU General Public License version 3.0 requirements will be | - |
| 35 | ** met: http://www.gnu.org/copyleft/gpl.html. | - |
| 36 | ** | - |
| 37 | ** | - |
| 38 | ** $QT_END_LICENSE$ | - |
| 39 | ** | - |
| 40 | ****************************************************************************/ | - |
| 41 | | - |
| 42 | /*! | - |
| 43 | \class QMdiArea | - |
| 44 | \brief The QMdiArea widget provides an area in which MDI windows are displayed. | - |
| 45 | \since 4.3 | - |
| 46 | \ingroup mainwindow-classes | - |
| 47 | \inmodule QtWidgets | - |
| 48 | | - |
| 49 | QMdiArea functions, essentially, like a window manager for MDI | - |
| 50 | windows. For instance, it draws the windows it manages on itself | - |
| 51 | and arranges them in a cascading or tile pattern. QMdiArea is | - |
| 52 | commonly used as the center widget in a QMainWindow to create MDI | - |
| 53 | applications, but can also be placed in any layout. The following | - |
| 54 | code adds an area to a main window: | - |
| 55 | | - |
| 56 | \snippet mdiareasnippets.cpp 0 | - |
| 57 | | - |
| 58 | Unlike the window managers for top-level windows, all window flags | - |
| 59 | (Qt::WindowFlags) are supported by QMdiArea as long as the flags | - |
| 60 | are supported by the current widget style. If a specific flag is | - |
| 61 | not supported by the style (e.g., the | - |
| 62 | \l{Qt::}{WindowShadeButtonHint}), you can still shade the window | - |
| 63 | with showShaded(). | - |
| 64 | | - |
| 65 | Subwindows in QMdiArea are instances of QMdiSubWindow. They | - |
| 66 | are added to an MDI area with addSubWindow(). It is common to pass | - |
| 67 | a QWidget, which is set as the internal widget, to this function, | - |
| 68 | but it is also possible to pass a QMdiSubWindow directly.The class | - |
| 69 | inherits QWidget, and you can use the same API as with a normal | - |
| 70 | top-level window when programming. QMdiSubWindow also has behavior | - |
| 71 | that is specific to MDI windows. See the QMdiSubWindow class | - |
| 72 | description for more details. | - |
| 73 | | - |
| 74 | A subwindow becomes active when it gets the keyboard focus, or | - |
| 75 | when setFocus() is called. The user activates a window by moving | - |
| 76 | focus in the usual ways. The MDI area emits the | - |
| 77 | subWindowActivated() signal when the active window changes, and | - |
| 78 | the activeSubWindow() function returns the active subwindow. | - |
| 79 | | - |
| 80 | The convenience function subWindowList() returns a list of all | - |
| 81 | subwindows. This information could be used in a popup menu | - |
| 82 | containing a list of windows, for example. | - |
| 83 | | - |
| 84 | The subwindows are sorted by the current | - |
| 85 | \l{QMdiArea::}{WindowOrder}. This is used for the subWindowList() | - |
| 86 | and for activateNextSubWindow() and activatePreviousSubWindow(). | - |
| 87 | Also, it is used when cascading or tiling the windows with | - |
| 88 | cascadeSubWindows() and tileSubWindows(). | - |
| 89 | | - |
| 90 | QMdiArea provides two built-in layout strategies for | - |
| 91 | subwindows: cascadeSubWindows() and tileSubWindows(). Both are | - |
| 92 | slots and are easily connected to menu entries. | - |
| 93 | | - |
| 94 | \table | - |
| 95 | \row \li \inlineimage mdi-cascade.png | - |
| 96 | \li \inlineimage mdi-tile.png | - |
| 97 | \endtable | - |
| 98 | | - |
| 99 | \note The default scroll bar property for QMdiArea is Qt::ScrollBarAlwaysOff. | - |
| 100 | | - |
| 101 | \sa QMdiSubWindow | - |
| 102 | */ | - |
| 103 | | - |
| 104 | /*! | - |
| 105 | \fn QMdiArea::subWindowActivated(QMdiSubWindow *window) | - |
| 106 | | - |
| 107 | QMdiArea emits this signal after \a window has been activated. When \a | - |
| 108 | window is 0, QMdiArea has just deactivated its last active window, and | - |
| 109 | there are no active windows on the workspace. | - |
| 110 | | - |
| 111 | \sa QMdiArea::activeSubWindow() | - |
| 112 | */ | - |
| 113 | | - |
| 114 | /*! | - |
| 115 | \enum QMdiArea::AreaOption | - |
| 116 | | - |
| 117 | This enum describes options that customize the behavior of the | - |
| 118 | QMdiArea. | - |
| 119 | | - |
| 120 | \value DontMaximizeSubWindowOnActivation When the active subwindow | - |
| 121 | is maximized, the default behavior is to maximize the next | - |
| 122 | subwindow that is activated. Set this option if you do not want | - |
| 123 | this behavior. | - |
| 124 | */ | - |
| 125 | | - |
| 126 | /*! | - |
| 127 | \enum QMdiArea::WindowOrder | - |
| 128 | | - |
| 129 | Specifies the criteria to use for ordering the list of child windows | - |
| 130 | returned by subWindowList(). The functions cascadeSubWindows() and | - |
| 131 | tileSubWindows() follow this order when arranging the windows. | - |
| 132 | | - |
| 133 | \value CreationOrder The windows are returned in the order of | - |
| 134 | their creation. | - |
| 135 | | - |
| 136 | \value StackingOrder The windows are returned in the order in | - |
| 137 | which they are stacked, with the top-most window being last in | - |
| 138 | the list. | - |
| 139 | | - |
| 140 | \value ActivationHistoryOrder The windows are returned in the order in | - |
| 141 | which they were activated. | - |
| 142 | | - |
| 143 | \sa subWindowList() | - |
| 144 | */ | - |
| 145 | | - |
| 146 | /*! | - |
| 147 | \enum QMdiArea::ViewMode | - |
| 148 | \since 4.4 | - |
| 149 | | - |
| 150 | This enum describes the view mode of the area; i.e. how sub-windows | - |
| 151 | will be displayed. | - |
| 152 | | - |
| 153 | \value SubWindowView Display sub-windows with window frames (default). | - |
| 154 | \value TabbedView Display sub-windows with tabs in a tab bar. | - |
| 155 | | - |
| 156 | \sa setViewMode() | - |
| 157 | */ | - |
| 158 | | - |
| 159 | #include "qmdiarea_p.h" | - |
| 160 | | - |
| 161 | #ifndef QT_NO_MDIAREA | - |
| 162 | | - |
| 163 | #include <QApplication> | - |
| 164 | #include <QStyle> | - |
| 165 | #if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) | - |
| 166 | #include <private/qmacstyle_mac_p.h> | - |
| 167 | #endif | - |
| 168 | #include <QChildEvent> | - |
| 169 | #include <QResizeEvent> | - |
| 170 | #include <QScrollBar> | - |
| 171 | #include <QtAlgorithms> | - |
| 172 | #include <QMutableListIterator> | - |
| 173 | #include <QPainter> | - |
| 174 | #include <QFontMetrics> | - |
| 175 | #include <QStyleOption> | - |
| 176 | #include <QDesktopWidget> | - |
| 177 | #include <QDebug> | - |
| 178 | #include <qmath.h> | - |
| 179 | #include <private/qlayoutengine_p.h> | - |
| 180 | | - |
| 181 | QT_BEGIN_NAMESPACE | - |
| 182 | | - |
| 183 | using namespace QMdi; | - |
| 184 | | - |
| 185 | // Asserts in debug mode, gives warning otherwise. | - |
| 186 | static bool sanityCheck(const QMdiSubWindow * const child, const char *where) | - |
| 187 | { | - |
| 188 | if (!child) { partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:1280 |
| 0-1280 |
| 189 | const char error[] = "null pointer"; never executed (the execution status of this line is deduced): const char error[] = "null pointer"; | - |
| 190 | Q_ASSERT_X(false, where, error); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 191 | qWarning("%s:%s", where, error); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 191, __PRETTY_FUNCTION__).warning("%s:%s", where, error); | - |
| 192 | return false; never executed: return false; | 0 |
| 193 | } | - |
| 194 | return true; executed: return true;Execution Count:1280 | 1280 |
| 195 | } | - |
| 196 | | - |
| 197 | static bool sanityCheck(const QList<QWidget *> &widgets, const int index, const char *where) | - |
| 198 | { | - |
| 199 | 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 |
| 200 | const char error[] = "index out of range"; never executed (the execution status of this line is deduced): const char error[] = "index out of range"; | - |
| 201 | Q_ASSERT_X(false, where, error); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 202 | qWarning("%s:%s", where, error); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 202, __PRETTY_FUNCTION__).warning("%s:%s", where, error); | - |
| 203 | return false; never executed: return false; | 0 |
| 204 | } | - |
| 205 | if (!widgets.at(index)) { partially evaluated: !widgets.at(index)| no Evaluation Count:0 | yes Evaluation Count:36 |
| 0-36 |
| 206 | const char error[] = "null pointer"; never executed (the execution status of this line is deduced): const char error[] = "null pointer"; | - |
| 207 | Q_ASSERT_X(false, where, error); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 208 | qWarning("%s:%s", where, error); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 208, __PRETTY_FUNCTION__).warning("%s:%s", where, error); | - |
| 209 | return false; never executed: return false; | 0 |
| 210 | } | - |
| 211 | return true; executed: return true;Execution Count:36 | 36 |
| 212 | } | - |
| 213 | | - |
| 214 | static void setIndex(int *index, int candidate, int min, int max, bool isIncreasing) | - |
| 215 | { | - |
| 216 | if (!index) partially evaluated: !index| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 217 | return; | 0 |
| 218 | | - |
| 219 | if (isIncreasing) { partially evaluated: isIncreasing| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 220 | if (candidate > max) evaluated: candidate > max| yes Evaluation Count:2 | yes Evaluation Count:4 |
| 2-4 |
| 221 | *index = min; executed: *index = min;Execution Count:2 | 2 |
| 222 | else | - |
| 223 | *index = qMax(candidate, min); executed: *index = qMax(candidate, min);Execution Count:4 | 4 |
| 224 | } else { | - |
| 225 | if (candidate < min) never evaluated: candidate < min | 0 |
| 226 | *index = max; never executed: *index = max; | 0 |
| 227 | else | - |
| 228 | *index = qMin(candidate, max); never executed: *index = qMin(candidate, max); | 0 |
| 229 | } | - |
| 230 | Q_ASSERT(*index >= min && *index <= max); executed (the execution status of this line is deduced): qt_noop(); | - |
| 231 | } executed: }Execution Count:6 | 6 |
| 232 | | - |
| 233 | static inline bool useScrollBar(const QRect &childrenRect, const QSize &maxViewportSize, | - |
| 234 | Qt::Orientation orientation) | - |
| 235 | { | - |
| 236 | if (orientation == Qt::Horizontal) evaluated: orientation == Qt::Horizontal| yes Evaluation Count:129 | yes Evaluation Count:86 |
| 86-129 |
| 237 | return childrenRect.width() > maxViewportSize.width() executed: return childrenRect.width() > maxViewportSize.width() || childrenRect.left() < 0 || childrenRect.right() >= maxViewportSize.width();Execution Count:129 | 129 |
| 238 | || childrenRect.left() < 0 executed: return childrenRect.width() > maxViewportSize.width() || childrenRect.left() < 0 || childrenRect.right() >= maxViewportSize.width();Execution Count:129 | 129 |
| 239 | || childrenRect.right() >= maxViewportSize.width(); executed: return childrenRect.width() > maxViewportSize.width() || childrenRect.left() < 0 || childrenRect.right() >= maxViewportSize.width();Execution Count:129 | 129 |
| 240 | else | - |
| 241 | return childrenRect.height() > maxViewportSize.height() executed: return childrenRect.height() > maxViewportSize.height() || childrenRect.top() < 0 || childrenRect.bottom() >= maxViewportSize.height();Execution Count:86 | 86 |
| 242 | || childrenRect.top() < 0 executed: return childrenRect.height() > maxViewportSize.height() || childrenRect.top() < 0 || childrenRect.bottom() >= maxViewportSize.height();Execution Count:86 | 86 |
| 243 | || childrenRect.bottom() >= maxViewportSize.height(); executed: return childrenRect.height() > maxViewportSize.height() || childrenRect.top() < 0 || childrenRect.bottom() >= maxViewportSize.height();Execution Count:86 | 86 |
| 244 | } | - |
| 245 | | - |
| 246 | // Returns the closest mdi area containing the widget (if any). | - |
| 247 | static inline QMdiArea *mdiAreaParent(QWidget *widget) | - |
| 248 | { | - |
| 249 | if (!widget) | 0 |
| 250 | return 0; never executed: return 0; | 0 |
| 251 | | - |
| 252 | QWidget *parent = widget->parentWidget(); never executed (the execution status of this line is deduced): QWidget *parent = widget->parentWidget(); | - |
| 253 | while (parent) { | 0 |
| 254 | if (QMdiArea *area = qobject_cast<QMdiArea *>(parent)) never evaluated: QMdiArea *area = qobject_cast<QMdiArea *>(parent) | 0 |
| 255 | return area; never executed: return area; | 0 |
| 256 | parent = parent->parentWidget(); never executed (the execution status of this line is deduced): parent = parent->parentWidget(); | - |
| 257 | } | 0 |
| 258 | return 0; never executed: return 0; | 0 |
| 259 | } | - |
| 260 | | - |
| 261 | #ifndef QT_NO_TABWIDGET | - |
| 262 | static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position) | - |
| 263 | { | - |
| 264 | const bool rounded = (shape == QTabWidget::Rounded); never executed (the execution status of this line is deduced): const bool rounded = (shape == QTabWidget::Rounded); | - |
| 265 | if (position == QTabWidget::North) never evaluated: position == QTabWidget::North | 0 |
| 266 | return rounded ? QTabBar::RoundedNorth : QTabBar::TriangularNorth; never executed: return rounded ? QTabBar::RoundedNorth : QTabBar::TriangularNorth; | 0 |
| 267 | if (position == QTabWidget::South) never evaluated: position == QTabWidget::South | 0 |
| 268 | return rounded ? QTabBar::RoundedSouth : QTabBar::TriangularSouth; never executed: return rounded ? QTabBar::RoundedSouth : QTabBar::TriangularSouth; | 0 |
| 269 | if (position == QTabWidget::East) never evaluated: position == QTabWidget::East | 0 |
| 270 | return rounded ? QTabBar::RoundedEast : QTabBar::TriangularEast; never executed: return rounded ? QTabBar::RoundedEast : QTabBar::TriangularEast; | 0 |
| 271 | if (position == QTabWidget::West) never evaluated: position == QTabWidget::West | 0 |
| 272 | return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest; never executed: return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest; | 0 |
| 273 | return QTabBar::RoundedNorth; never executed: return QTabBar::RoundedNorth; | 0 |
| 274 | } | - |
| 275 | #endif // QT_NO_TABWIDGET | - |
| 276 | | - |
| 277 | static inline QString tabTextFor(QMdiSubWindow *subWindow) | - |
| 278 | { | - |
| 279 | if (!subWindow) never evaluated: !subWindow | 0 |
| 280 | return QString(); never executed: return QString(); | 0 |
| 281 | | - |
| 282 | QString title = subWindow->windowTitle(); never executed (the execution status of this line is deduced): QString title = subWindow->windowTitle(); | - |
| 283 | if (subWindow->isWindowModified()) { never evaluated: subWindow->isWindowModified() | 0 |
| 284 | title.replace(QLatin1String("[*]"), QLatin1String("*")); never executed (the execution status of this line is deduced): title.replace(QLatin1String("[*]"), QLatin1String("*")); | - |
| 285 | } else { | 0 |
| 286 | extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); never executed (the execution status of this line is deduced): extern QString qt_setWindowTitle_helperHelper(const QString&, const QWidget*); | - |
| 287 | title = qt_setWindowTitle_helperHelper(title, subWindow); never executed (the execution status of this line is deduced): title = qt_setWindowTitle_helperHelper(title, subWindow); | - |
| 288 | } | 0 |
| 289 | | - |
| 290 | return title.isEmpty() ? QMdiArea::tr("(Untitled)") : title; never executed: return title.isEmpty() ? QMdiArea::tr("(Untitled)") : title; | 0 |
| 291 | } | - |
| 292 | | - |
| 293 | /*! | - |
| 294 | \internal | - |
| 295 | */ | - |
| 296 | void RegularTiler::rearrange(QList<QWidget *> &widgets, const QRect &domain) const | - |
| 297 | { | - |
| 298 | if (widgets.isEmpty()) never evaluated: widgets.isEmpty() | 0 |
| 299 | return; | 0 |
| 300 | | - |
| 301 | const int n = widgets.size(); never executed (the execution status of this line is deduced): const int n = widgets.size(); | - |
| 302 | const int ncols = qMax(qCeil(qSqrt(qreal(n))), 1); never executed (the execution status of this line is deduced): const int ncols = qMax(qCeil(qSqrt(qreal(n))), 1); | - |
| 303 | const int nrows = qMax((n % ncols) ? (n / ncols + 1) : (n / ncols), 1); never executed (the execution status of this line is deduced): const int nrows = qMax((n % ncols) ? (n / ncols + 1) : (n / ncols), 1); | - |
| 304 | const int nspecial = (n % ncols) ? (ncols - n % ncols) : 0; never evaluated: (n % ncols) | 0 |
| 305 | const int dx = domain.width() / ncols; never executed (the execution status of this line is deduced): const int dx = domain.width() / ncols; | - |
| 306 | const int dy = domain.height() / nrows; never executed (the execution status of this line is deduced): const int dy = domain.height() / nrows; | - |
| 307 | | - |
| 308 | int i = 0; never executed (the execution status of this line is deduced): int i = 0; | - |
| 309 | for (int row = 0; row < nrows; ++row) { never evaluated: row < nrows | 0 |
| 310 | const int y1 = int(row * (dy + 1)); never executed (the execution status of this line is deduced): const int y1 = int(row * (dy + 1)); | - |
| 311 | for (int col = 0; col < ncols; ++col) { never evaluated: col < ncols | 0 |
| 312 | if (row == 1 && col < nspecial) never evaluated: row == 1 never evaluated: col < nspecial | 0 |
| 313 | continue; never executed: continue; | 0 |
| 314 | const int x1 = int(col * (dx + 1)); never executed (the execution status of this line is deduced): const int x1 = int(col * (dx + 1)); | - |
| 315 | int x2 = int(x1 + dx); never executed (the execution status of this line is deduced): int x2 = int(x1 + dx); | - |
| 316 | int y2 = int(y1 + dy); never executed (the execution status of this line is deduced): int y2 = int(y1 + dy); | - |
| 317 | if (row == 0 && col < nspecial) { never evaluated: row == 0 never evaluated: col < nspecial | 0 |
| 318 | y2 *= 2; never executed (the execution status of this line is deduced): y2 *= 2; | - |
| 319 | if (nrows != 2) never evaluated: nrows != 2 | 0 |
| 320 | y2 += 1; | 0 |
| 321 | else | - |
| 322 | y2 = domain.bottom(); never executed: y2 = domain.bottom(); | 0 |
| 323 | } | - |
| 324 | if (col == ncols - 1 && x2 != domain.right()) never evaluated: col == ncols - 1 never evaluated: x2 != domain.right() | 0 |
| 325 | x2 = domain.right(); never executed: x2 = domain.right(); | 0 |
| 326 | if (row == nrows - 1 && y2 != domain.bottom()) never evaluated: row == nrows - 1 never evaluated: y2 != domain.bottom() | 0 |
| 327 | y2 = domain.bottom(); never executed: y2 = domain.bottom(); | 0 |
| 328 | if (!sanityCheck(widgets, i, "RegularTiler")) never evaluated: !sanityCheck(widgets, i, "RegularTiler") | 0 |
| 329 | continue; never executed: continue; | 0 |
| 330 | QWidget *widget = widgets.at(i++); never executed (the execution status of this line is deduced): QWidget *widget = widgets.at(i++); | - |
| 331 | QRect newGeometry = QRect(QPoint(x1, y1), QPoint(x2, y2)); never executed (the execution status of this line is deduced): QRect newGeometry = QRect(QPoint(x1, y1), QPoint(x2, y2)); | - |
| 332 | widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); never executed (the execution status of this line is deduced): widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); | - |
| 333 | } | 0 |
| 334 | } | 0 |
| 335 | } | 0 |
| 336 | | - |
| 337 | /*! | - |
| 338 | \internal | - |
| 339 | */ | - |
| 340 | void SimpleCascader::rearrange(QList<QWidget *> &widgets, const QRect &domain) const | - |
| 341 | { | - |
| 342 | if (widgets.isEmpty()) never evaluated: widgets.isEmpty() | 0 |
| 343 | return; | 0 |
| 344 | | - |
| 345 | // Tunables: | - |
| 346 | const int topOffset = 0; never executed (the execution status of this line is deduced): const int topOffset = 0; | - |
| 347 | const int bottomOffset = 50; never executed (the execution status of this line is deduced): const int bottomOffset = 50; | - |
| 348 | const int leftOffset = 0; never executed (the execution status of this line is deduced): const int leftOffset = 0; | - |
| 349 | const int rightOffset = 100; never executed (the execution status of this line is deduced): const int rightOffset = 100; | - |
| 350 | const int dx = 10; never executed (the execution status of this line is deduced): const int dx = 10; | - |
| 351 | | - |
| 352 | QStyleOptionTitleBar options; never executed (the execution status of this line is deduced): QStyleOptionTitleBar options; | - |
| 353 | options.initFrom(widgets.at(0)); never executed (the execution status of this line is deduced): options.initFrom(widgets.at(0)); | - |
| 354 | int titleBarHeight = widgets.at(0)->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, widgets.at(0)); never executed (the execution status of this line is deduced): int titleBarHeight = widgets.at(0)->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, widgets.at(0)); | - |
| 355 | #if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) | - |
| 356 | // ### Remove this after the mac style has been fixed | - |
| 357 | if (qobject_cast<QMacStyle *>(widgets.at(0)->style())) | - |
| 358 | titleBarHeight -= 4; | - |
| 359 | #endif | - |
| 360 | const QFontMetrics fontMetrics = QFontMetrics(QApplication::font("QMdiSubWindowTitleBar")); never executed (the execution status of this line is deduced): const QFontMetrics fontMetrics = QFontMetrics(QApplication::font("QMdiSubWindowTitleBar")); | - |
| 361 | const int dy = qMax(titleBarHeight - (titleBarHeight - fontMetrics.height()) / 2, 1); never executed (the execution status of this line is deduced): const int dy = qMax(titleBarHeight - (titleBarHeight - fontMetrics.height()) / 2, 1); | - |
| 362 | | - |
| 363 | const int n = widgets.size(); never executed (the execution status of this line is deduced): const int n = widgets.size(); | - |
| 364 | const int nrows = qMax((domain.height() - (topOffset + bottomOffset)) / dy, 1); never executed (the execution status of this line is deduced): const int nrows = qMax((domain.height() - (topOffset + bottomOffset)) / dy, 1); | - |
| 365 | const int ncols = qMax(n / nrows + ((n % nrows) ? 1 : 0), 1); never executed (the execution status of this line is deduced): const int ncols = qMax(n / nrows + ((n % nrows) ? 1 : 0), 1); | - |
| 366 | const int dcol = (domain.width() - (leftOffset + rightOffset)) / ncols; never executed (the execution status of this line is deduced): const int dcol = (domain.width() - (leftOffset + rightOffset)) / ncols; | - |
| 367 | | - |
| 368 | int i = 0; never executed (the execution status of this line is deduced): int i = 0; | - |
| 369 | for (int row = 0; row < nrows; ++row) { never evaluated: row < nrows | 0 |
| 370 | for (int col = 0; col < ncols; ++col) { never evaluated: col < ncols | 0 |
| 371 | const int x = leftOffset + row * dx + col * dcol; never executed (the execution status of this line is deduced): const int x = leftOffset + row * dx + col * dcol; | - |
| 372 | const int y = topOffset + row * dy; never executed (the execution status of this line is deduced): const int y = topOffset + row * dy; | - |
| 373 | if (!sanityCheck(widgets, i, "SimpleCascader")) never evaluated: !sanityCheck(widgets, i, "SimpleCascader") | 0 |
| 374 | continue; never executed: continue; | 0 |
| 375 | QWidget *widget = widgets.at(i++); never executed (the execution status of this line is deduced): QWidget *widget = widgets.at(i++); | - |
| 376 | QRect newGeometry = QRect(QPoint(x, y), widget->sizeHint()); never executed (the execution status of this line is deduced): QRect newGeometry = QRect(QPoint(x, y), widget->sizeHint()); | - |
| 377 | widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); never executed (the execution status of this line is deduced): widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); | - |
| 378 | if (i == n) | 0 |
| 379 | return; | 0 |
| 380 | } | 0 |
| 381 | } | 0 |
| 382 | } | 0 |
| 383 | | - |
| 384 | /*! | - |
| 385 | \internal | - |
| 386 | */ | - |
| 387 | void IconTiler::rearrange(QList<QWidget *> &widgets, const QRect &domain) const | - |
| 388 | { | - |
| 389 | 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 |
| 390 | return; executed: return;Execution Count:80 | 80 |
| 391 | | - |
| 392 | const int n = widgets.size(); executed (the execution status of this line is deduced): const int n = widgets.size(); | - |
| 393 | const int width = widgets.at(0)->width(); executed (the execution status of this line is deduced): const int width = widgets.at(0)->width(); | - |
| 394 | const int height = widgets.at(0)->height(); executed (the execution status of this line is deduced): const int height = widgets.at(0)->height(); | - |
| 395 | const int ncols = qMax(domain.width() / width, 1); executed (the execution status of this line is deduced): const int ncols = qMax(domain.width() / width, 1); | - |
| 396 | const int nrows = n / ncols + ((n % ncols) ? 1 : 0); evaluated: (n % ncols)| yes Evaluation Count:13 | yes Evaluation Count:5 |
| 5-13 |
| 397 | | - |
| 398 | int i = 0; executed (the execution status of this line is deduced): int i = 0; | - |
| 399 | for (int row = 0; row < nrows; ++row) { partially evaluated: row < nrows| yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
| 400 | for (int col = 0; col < ncols; ++col) { partially evaluated: col < ncols| yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
| 401 | const int x = col * width; executed (the execution status of this line is deduced): const int x = col * width; | - |
| 402 | const int y = domain.height() - height - row * height; executed (the execution status of this line is deduced): const int y = domain.height() - height - row * height; | - |
| 403 | if (!sanityCheck(widgets, i, "IconTiler")) partially evaluated: !sanityCheck(widgets, i, "IconTiler")| no Evaluation Count:0 | yes Evaluation Count:18 |
| 0-18 |
| 404 | continue; never executed: continue; | 0 |
| 405 | QWidget *widget = widgets.at(i++); executed (the execution status of this line is deduced): QWidget *widget = widgets.at(i++); | - |
| 406 | QPoint newPos(x, y); executed (the execution status of this line is deduced): QPoint newPos(x, y); | - |
| 407 | QRect newGeometry = QRect(newPos.x(), newPos.y(), widget->width(), widget->height()); executed (the execution status of this line is deduced): QRect newGeometry = QRect(newPos.x(), newPos.y(), widget->width(), widget->height()); | - |
| 408 | widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); executed (the execution status of this line is deduced): widget->setGeometry(QStyle::visualRect(widget->layoutDirection(), domain, newGeometry)); | - |
| 409 | if (i == n) partially evaluated: i == n| yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
| 410 | return; executed: return;Execution Count:18 | 18 |
| 411 | } | 0 |
| 412 | } | 0 |
| 413 | } | 0 |
| 414 | | - |
| 415 | /*! | - |
| 416 | \internal | - |
| 417 | Calculates the accumulated overlap (intersection area) between 'source' and 'rects'. | - |
| 418 | */ | - |
| 419 | int MinOverlapPlacer::accumulatedOverlap(const QRect &source, const QList<QRect> &rects) | - |
| 420 | { | - |
| 421 | int accOverlap = 0; executed (the execution status of this line is deduced): int accOverlap = 0; | - |
| 422 | foreach (const QRect &rect, rects) { executed (the execution status of this line is deduced): 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;})) { | - |
| 423 | QRect intersection = source.intersected(rect); executed (the execution status of this line is deduced): QRect intersection = source.intersected(rect); | - |
| 424 | accOverlap += intersection.width() * intersection.height(); executed (the execution status of this line is deduced): accOverlap += intersection.width() * intersection.height(); | - |
| 425 | } executed: }Execution Count:264 | 264 |
| 426 | return accOverlap; executed: return accOverlap;Execution Count:400 | 400 |
| 427 | } | - |
| 428 | | - |
| 429 | | - |
| 430 | /*! | - |
| 431 | \internal | - |
| 432 | Finds among 'source' the rectangle with the minimum accumulated overlap with the | - |
| 433 | rectangles in 'rects'. | - |
| 434 | */ | - |
| 435 | QRect MinOverlapPlacer::findMinOverlapRect(const QList<QRect> &source, const QList<QRect> &rects) | - |
| 436 | { | - |
| 437 | int minAccOverlap = -1; executed (the execution status of this line is deduced): int minAccOverlap = -1; | - |
| 438 | QRect minAccOverlapRect; executed (the execution status of this line is deduced): QRect minAccOverlapRect; | - |
| 439 | foreach (const QRect &srcRect, source) { executed (the execution status of this line is deduced): 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;})) { | - |
| 440 | const int accOverlap = accumulatedOverlap(srcRect, rects); executed (the execution status of this line is deduced): const int accOverlap = accumulatedOverlap(srcRect, rects); | - |
| 441 | 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 |
| 442 | minAccOverlap = accOverlap; executed (the execution status of this line is deduced): minAccOverlap = accOverlap; | - |
| 443 | minAccOverlapRect = srcRect; executed (the execution status of this line is deduced): minAccOverlapRect = srcRect; | - |
| 444 | } executed: }Execution Count:103 | 103 |
| 445 | } executed: }Execution Count:400 | 400 |
| 446 | return minAccOverlapRect; executed: return minAccOverlapRect;Execution Count:87 | 87 |
| 447 | } | - |
| 448 | | - |
| 449 | /*! | - |
| 450 | \internal | - |
| 451 | Gets candidates for the final placement. | - |
| 452 | */ | - |
| 453 | void MinOverlapPlacer::getCandidatePlacements(const QSize &size, const QList<QRect> &rects, | - |
| 454 | const QRect &domain,QList<QRect> &candidates) | - |
| 455 | { | - |
| 456 | QSet<int> xset; executed (the execution status of this line is deduced): QSet<int> xset; | - |
| 457 | QSet<int> yset; executed (the execution status of this line is deduced): QSet<int> yset; | - |
| 458 | xset << domain.left() << domain.right() - size.width() + 1; executed (the execution status of this line is deduced): xset << domain.left() << domain.right() - size.width() + 1; | - |
| 459 | yset << domain.top(); executed (the execution status of this line is deduced): yset << domain.top(); | - |
| 460 | if (domain.bottom() - size.height() + 1 >= 0) evaluated: domain.bottom() - size.height() + 1 >= 0| yes Evaluation Count:85 | yes Evaluation Count:2 |
| 2-85 |
| 461 | yset << domain.bottom() - size.height() + 1; executed: yset << domain.bottom() - size.height() + 1;Execution Count:85 | 85 |
| 462 | foreach (const QRect &rect, rects) { executed (the execution status of this line is deduced): 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;})) { | - |
| 463 | xset << rect.right() + 1; executed (the execution status of this line is deduced): xset << rect.right() + 1; | - |
| 464 | yset << rect.bottom() + 1; executed (the execution status of this line is deduced): yset << rect.bottom() + 1; | - |
| 465 | } executed: }Execution Count:32 | 32 |
| 466 | | - |
| 467 | QList<int> xlist = xset.values(); executed (the execution status of this line is deduced): QList<int> xlist = xset.values(); | - |
| 468 | qSort(xlist.begin(), xlist.end()); executed (the execution status of this line is deduced): qSort(xlist.begin(), xlist.end()); | - |
| 469 | QList<int> ylist = yset.values(); executed (the execution status of this line is deduced): QList<int> ylist = yset.values(); | - |
| 470 | qSort(ylist.begin(), ylist.end()); executed (the execution status of this line is deduced): qSort(ylist.begin(), ylist.end()); | - |
| 471 | | - |
| 472 | foreach (int y, ylist) executed (the execution status of this line is deduced): 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;})) | - |
| 473 | foreach (int x, xlist) executed (the execution status of this line is deduced): 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;})) | - |
| 474 | candidates << QRect(QPoint(x, y), size); executed: candidates << QRect(QPoint(x, y), size);Execution Count:477 | 477 |
| 475 | } executed: }Execution Count:87 | 87 |
| 476 | | - |
| 477 | /*! | - |
| 478 | \internal | - |
| 479 | Finds all rectangles in 'source' not completely inside 'domain'. The result is stored | - |
| 480 | in 'result' and also removed from 'source'. | - |
| 481 | */ | - |
| 482 | void MinOverlapPlacer::findNonInsiders(const QRect &domain, QList<QRect> &source, | - |
| 483 | QList<QRect> &result) | - |
| 484 | { | - |
| 485 | QMutableListIterator<QRect> it(source); executed (the execution status of this line is deduced): QMutableListIterator<QRect> it(source); | - |
| 486 | while (it.hasNext()) { evaluated: it.hasNext()| yes Evaluation Count:477 | yes Evaluation Count:87 |
| 87-477 |
| 487 | const QRect srcRect = it.next(); executed (the execution status of this line is deduced): const QRect srcRect = it.next(); | - |
| 488 | if (!domain.contains(srcRect)) { evaluated: !domain.contains(srcRect)| yes Evaluation Count:81 | yes Evaluation Count:396 |
| 81-396 |
| 489 | result << srcRect; executed (the execution status of this line is deduced): result << srcRect; | - |
| 490 | it.remove(); executed (the execution status of this line is deduced): it.remove(); | - |
| 491 | } executed: }Execution Count:81 | 81 |
| 492 | } executed: }Execution Count:477 | 477 |
| 493 | } executed: }Execution Count:87 | 87 |
| 494 | | - |
| 495 | /*! | - |
| 496 | \internal | - |
| 497 | Finds all rectangles in 'source' that overlaps 'domain' by the maximum overlap area | - |
| 498 | between 'domain' and any rectangle in 'source'. The result is stored in 'result'. | - |
| 499 | */ | - |
| 500 | void MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const QList<QRect> &source, | - |
| 501 | QList<QRect> &result) | - |
| 502 | { | - |
| 503 | int maxOverlap = -1; executed (the execution status of this line is deduced): int maxOverlap = -1; | - |
| 504 | foreach (const QRect &srcRect, source) { executed (the execution status of this line is deduced): 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;})) { | - |
| 505 | QRect intersection = domain.intersected(srcRect); executed (the execution status of this line is deduced): QRect intersection = domain.intersected(srcRect); | - |
| 506 | const int overlap = intersection.width() * intersection.height(); executed (the execution status of this line is deduced): const int overlap = intersection.width() * intersection.height(); | - |
| 507 | 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 |
| 508 | if (overlap > maxOverlap) { evaluated: overlap > maxOverlap| yes Evaluation Count:2 | yes Evaluation Count:2 |
| 2 |
| 509 | maxOverlap = overlap; executed (the execution status of this line is deduced): maxOverlap = overlap; | - |
| 510 | result.clear(); executed (the execution status of this line is deduced): result.clear(); | - |
| 511 | } executed: }Execution Count:2 | 2 |
| 512 | result << srcRect; executed (the execution status of this line is deduced): result << srcRect; | - |
| 513 | } executed: }Execution Count:4 | 4 |
| 514 | } executed: }Execution Count:8 | 8 |
| 515 | } executed: }Execution Count:2 | 2 |
| 516 | | - |
| 517 | /*! | - |
| 518 | \internal | - |
| 519 | Finds among the rectangles in 'source' the best placement. Here, 'best' means the | - |
| 520 | placement that overlaps the rectangles in 'rects' as little as possible while at the | - |
| 521 | same time being as much as possible inside 'domain'. | - |
| 522 | */ | - |
| 523 | QPoint MinOverlapPlacer::findBestPlacement(const QRect &domain, const QList<QRect> &rects, | - |
| 524 | QList<QRect> &source) | - |
| 525 | { | - |
| 526 | QList<QRect> nonInsiders; executed (the execution status of this line is deduced): QList<QRect> nonInsiders; | - |
| 527 | findNonInsiders(domain, source, nonInsiders); executed (the execution status of this line is deduced): findNonInsiders(domain, source, nonInsiders); | - |
| 528 | | - |
| 529 | if (!source.empty()) evaluated: !source.empty()| yes Evaluation Count:85 | yes Evaluation Count:2 |
| 2-85 |
| 530 | return findMinOverlapRect(source, rects).topLeft(); executed: return findMinOverlapRect(source, rects).topLeft();Execution Count:85 | 85 |
| 531 | | - |
| 532 | QList<QRect> maxOverlappers; executed (the execution status of this line is deduced): QList<QRect> maxOverlappers; | - |
| 533 | findMaxOverlappers(domain, nonInsiders, maxOverlappers); executed (the execution status of this line is deduced): findMaxOverlappers(domain, nonInsiders, maxOverlappers); | - |
| 534 | return findMinOverlapRect(maxOverlappers, rects).topLeft(); executed: return findMinOverlapRect(maxOverlappers, rects).topLeft();Execution Count:2 | 2 |
| 535 | } | - |
| 536 | | - |
| 537 | | - |
| 538 | /*! | - |
| 539 | \internal | - |
| 540 | Places the rectangle defined by 'size' relative to 'rects' and 'domain' so that it | - |
| 541 | overlaps 'rects' as little as possible and 'domain' as much as possible. | - |
| 542 | Returns the position of the resulting rectangle. | - |
| 543 | */ | - |
| 544 | QPoint MinOverlapPlacer::place(const QSize &size, const QList<QRect> &rects, | - |
| 545 | const QRect &domain) const | - |
| 546 | { | - |
| 547 | 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 |
| 548 | return QPoint(); never executed: return QPoint(); | 0 |
| 549 | foreach (const QRect &rect, rects) { executed (the execution status of this line is deduced): 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;})) { | - |
| 550 | if (!rect.isValid()) partially evaluated: !rect.isValid()| no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
| 551 | return QPoint(); never executed: return QPoint(); | 0 |
| 552 | } executed: }Execution Count:32 | 32 |
| 553 | | - |
| 554 | QList<QRect> candidates; executed (the execution status of this line is deduced): QList<QRect> candidates; | - |
| 555 | getCandidatePlacements(size, rects, domain, candidates); executed (the execution status of this line is deduced): getCandidatePlacements(size, rects, domain, candidates); | - |
| 556 | return findBestPlacement(domain, rects, candidates); executed: return findBestPlacement(domain, rects, candidates);Execution Count:87 | 87 |
| 557 | } | - |
| 558 | | - |
| 559 | #ifndef QT_NO_TABBAR | - |
| 560 | class QMdiAreaTabBar : public QTabBar | - |
| 561 | { | - |
| 562 | public: | - |
| 563 | QMdiAreaTabBar(QWidget *parent) : QTabBar(parent) {} | 0 |
| 564 | | - |
| 565 | protected: | - |
| 566 | void mousePressEvent(QMouseEvent *event); | - |
| 567 | #ifndef QT_NO_CONTEXTMENU | - |
| 568 | void contextMenuEvent(QContextMenuEvent *event); | - |
| 569 | #endif | - |
| 570 | | - |
| 571 | private: | - |
| 572 | QMdiSubWindow *subWindowFromIndex(int index) const; | - |
| 573 | }; | - |
| 574 | | - |
| 575 | /*! | - |
| 576 | \internal | - |
| 577 | */ | - |
| 578 | void QMdiAreaTabBar::mousePressEvent(QMouseEvent *event) | - |
| 579 | { | - |
| 580 | if (event->button() != Qt::MidButton) { never evaluated: event->button() != Qt::MidButton | 0 |
| 581 | QTabBar::mousePressEvent(event); never executed (the execution status of this line is deduced): QTabBar::mousePressEvent(event); | - |
| 582 | return; | 0 |
| 583 | } | - |
| 584 | | - |
| 585 | QMdiSubWindow *subWindow = subWindowFromIndex(tabAt(event->pos())); never executed (the execution status of this line is deduced): QMdiSubWindow *subWindow = subWindowFromIndex(tabAt(event->pos())); | - |
| 586 | if (!subWindow) { never evaluated: !subWindow | 0 |
| 587 | event->ignore(); never executed (the execution status of this line is deduced): event->ignore(); | - |
| 588 | return; | 0 |
| 589 | } | - |
| 590 | | - |
| 591 | subWindow->close(); never executed (the execution status of this line is deduced): subWindow->close(); | - |
| 592 | } | 0 |
| 593 | | - |
| 594 | #ifndef QT_NO_CONTEXTMENU | - |
| 595 | /*! | - |
| 596 | \internal | - |
| 597 | */ | - |
| 598 | void QMdiAreaTabBar::contextMenuEvent(QContextMenuEvent *event) | - |
| 599 | { | - |
| 600 | QPointer<QMdiSubWindow> subWindow = subWindowFromIndex(tabAt(event->pos())); never executed (the execution status of this line is deduced): QPointer<QMdiSubWindow> subWindow = subWindowFromIndex(tabAt(event->pos())); | - |
| 601 | if (!subWindow || subWindow->isHidden()) { never evaluated: !subWindow never evaluated: subWindow->isHidden() | 0 |
| 602 | event->ignore(); never executed (the execution status of this line is deduced): event->ignore(); | - |
| 603 | return; | 0 |
| 604 | } | - |
| 605 | | - |
| 606 | #ifndef QT_NO_MENU | - |
| 607 | QMdiSubWindowPrivate *subWindowPrivate = subWindow->d_func(); never executed (the execution status of this line is deduced): QMdiSubWindowPrivate *subWindowPrivate = subWindow->d_func(); | - |
| 608 | if (!subWindowPrivate->systemMenu) { never evaluated: !subWindowPrivate->systemMenu | 0 |
| 609 | event->ignore(); never executed (the execution status of this line is deduced): event->ignore(); | - |
| 610 | return; | 0 |
| 611 | } | - |
| 612 | | - |
| 613 | QMdiSubWindow *currentSubWindow = subWindowFromIndex(currentIndex()); never executed (the execution status of this line is deduced): QMdiSubWindow *currentSubWindow = subWindowFromIndex(currentIndex()); | - |
| 614 | Q_ASSERT(currentSubWindow); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 615 | | - |
| 616 | // We don't want these actions to show up in the system menu when the | - |
| 617 | // current sub-window is maximized, i.e. covers the entire viewport. | - |
| 618 | if (currentSubWindow->isMaximized()) { never evaluated: currentSubWindow->isMaximized() | 0 |
| 619 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::MoveAction, false); never executed (the execution status of this line is deduced): subWindowPrivate->setVisible(QMdiSubWindowPrivate::MoveAction, false); | - |
| 620 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::ResizeAction, false); never executed (the execution status of this line is deduced): subWindowPrivate->setVisible(QMdiSubWindowPrivate::ResizeAction, false); | - |
| 621 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::MinimizeAction, false); never executed (the execution status of this line is deduced): subWindowPrivate->setVisible(QMdiSubWindowPrivate::MinimizeAction, false); | - |
| 622 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::MaximizeAction, false); never executed (the execution status of this line is deduced): subWindowPrivate->setVisible(QMdiSubWindowPrivate::MaximizeAction, false); | - |
| 623 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::RestoreAction, false); never executed (the execution status of this line is deduced): subWindowPrivate->setVisible(QMdiSubWindowPrivate::RestoreAction, false); | - |
| 624 | subWindowPrivate->setVisible(QMdiSubWindowPrivate::StayOnTopAction, false); never executed (the execution status of this line is deduced): subWindowPrivate->setVisible(QMdiSubWindowPrivate::StayOnTopAction, false); | - |
| 625 | } | 0 |
| 626 | | - |
| 627 | // Show system menu. | - |
| 628 | subWindowPrivate->systemMenu->exec(event->globalPos()); never executed (the execution status of this line is deduced): subWindowPrivate->systemMenu->exec(event->globalPos()); | - |
| 629 | if (!subWindow) never evaluated: !subWindow | 0 |
| 630 | return; | 0 |
| 631 | | - |
| 632 | // Restore action visibility. | - |
| 633 | subWindowPrivate->updateActions(); never executed (the execution status of this line is deduced): subWindowPrivate->updateActions(); | - |
| 634 | #endif // QT_NO_MENU | - |
| 635 | } | 0 |
| 636 | #endif // QT_NO_CONTEXTMENU | - |
| 637 | | - |
| 638 | /*! | - |
| 639 | \internal | - |
| 640 | */ | - |
| 641 | QMdiSubWindow *QMdiAreaTabBar::subWindowFromIndex(int index) const | - |
| 642 | { | - |
| 643 | if (index < 0 || index >= count()) never evaluated: index < 0 never evaluated: index >= count() | 0 |
| 644 | return 0; never executed: return 0; | 0 |
| 645 | | - |
| 646 | QMdiArea *mdiArea = qobject_cast<QMdiArea *>(parentWidget()); never executed (the execution status of this line is deduced): QMdiArea *mdiArea = qobject_cast<QMdiArea *>(parentWidget()); | - |
| 647 | Q_ASSERT(mdiArea); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 648 | | - |
| 649 | const QList<QMdiSubWindow *> subWindows = mdiArea->subWindowList(); never executed (the execution status of this line is deduced): const QList<QMdiSubWindow *> subWindows = mdiArea->subWindowList(); | - |
| 650 | Q_ASSERT(index < subWindows.size()); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 651 | | - |
| 652 | QMdiSubWindow *subWindow = mdiArea->subWindowList().at(index); never executed (the execution status of this line is deduced): QMdiSubWindow *subWindow = mdiArea->subWindowList().at(index); | - |
| 653 | Q_ASSERT(subWindow); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 654 | | - |
| 655 | return subWindow; never executed: return subWindow; | 0 |
| 656 | } | - |
| 657 | #endif // QT_NO_TABBAR | - |
| 658 | | - |
| 659 | /*! | - |
| 660 | \internal | - |
| 661 | */ | - |
| 662 | QMdiAreaPrivate::QMdiAreaPrivate() | - |
| 663 | : cascader(0), | - |
| 664 | regularTiler(0), | - |
| 665 | iconTiler(0), | - |
| 666 | placer(0), | - |
| 667 | #ifndef QT_NO_RUBBERBAND | - |
| 668 | rubberBand(0), | - |
| 669 | #endif | - |
| 670 | #ifndef QT_NO_TABBAR | - |
| 671 | tabBar(0), | - |
| 672 | #endif | - |
| 673 | activationOrder(QMdiArea::CreationOrder), | - |
| 674 | viewMode(QMdiArea::SubWindowView), | - |
| 675 | #ifndef QT_NO_TABBAR | - |
| 676 | documentMode(false), | - |
| 677 | tabsClosable(false), | - |
| 678 | tabsMovable(false), | - |
| 679 | #endif | - |
| 680 | #ifndef QT_NO_TABWIDGET | - |
| 681 | tabShape(QTabWidget::Rounded), | - |
| 682 | tabPosition(QTabWidget::North), | - |
| 683 | #endif | - |
| 684 | ignoreGeometryChange(false), | - |
| 685 | ignoreWindowStateChange(false), | - |
| 686 | isActivated(false), | - |
| 687 | isSubWindowsTiled(false), | - |
| 688 | showActiveWindowMaximized(false), | - |
| 689 | tileCalledFromResizeEvent(false), | - |
| 690 | updatesDisabledByUs(false), | - |
| 691 | inViewModeChange(false), | - |
| 692 | indexToNextWindow(-1), | - |
| 693 | indexToPreviousWindow(-1), | - |
| 694 | indexToHighlighted(-1), | - |
| 695 | indexToLastActiveTab(-1), | - |
| 696 | resizeTimerId(-1), | - |
| 697 | tabToPreviousTimerId(-1) | - |
| 698 | { | - |
| 699 | } executed: }Execution Count:80 | 80 |
| 700 | | - |
| 701 | /*! | - |
| 702 | \internal | - |
| 703 | */ | - |
| 704 | void QMdiAreaPrivate::_q_deactivateAllWindows(QMdiSubWindow *aboutToActivate) | - |
| 705 | { | - |
| 706 | if (ignoreWindowStateChange) partially evaluated: ignoreWindowStateChange| no Evaluation Count:0 | yes Evaluation Count:138 |
| 0-138 |
| 707 | return; | 0 |
| 708 | | - |
| 709 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 710 | if (!aboutToActivate) partially evaluated: !aboutToActivate| yes Evaluation Count:138 | no Evaluation Count:0 |
| 0-138 |
| 711 | aboutToBecomeActive = qobject_cast<QMdiSubWindow *>(q->sender()); executed: aboutToBecomeActive = qobject_cast<QMdiSubWindow *>(q->sender());Execution Count:138 | 138 |
| 712 | else | - |
| 713 | aboutToBecomeActive = aboutToActivate; never executed: aboutToBecomeActive = aboutToActivate; | 0 |
| 714 | Q_ASSERT(aboutToBecomeActive); executed (the execution status of this line is deduced): qt_noop(); | - |
| 715 | | - |
| 716 | foreach (QMdiSubWindow *child, childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 717 | 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 |
| 718 | continue; executed: continue;Execution Count:138 | 138 |
| 719 | // We don't want to handle signals caused by child->showNormal(). | - |
| 720 | ignoreWindowStateChange = true; executed (the execution status of this line is deduced): ignoreWindowStateChange = true; | - |
| 721 | 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 |
| 722 | showActiveWindowMaximized = child->isMaximized() && child->isVisible(); executed: showActiveWindowMaximized = child->isMaximized() && child->isVisible();Execution Count:117 evaluated: child->isMaximized()| yes Evaluation Count:21 | yes Evaluation Count:96 |
evaluated: child->isVisible()| yes Evaluation Count:16 | yes Evaluation Count:5 |
| 5-117 |
| 723 | 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 |
| 724 | if (q->updatesEnabled()) { evaluated: q->updatesEnabled()| yes Evaluation Count:11 | yes Evaluation Count:5 |
| 5-11 |
| 725 | updatesDisabledByUs = true; executed (the execution status of this line is deduced): updatesDisabledByUs = true; | - |
| 726 | q->setUpdatesEnabled(false); executed (the execution status of this line is deduced): q->setUpdatesEnabled(false); | - |
| 727 | } executed: }Execution Count:11 | 11 |
| 728 | child->showNormal(); executed (the execution status of this line is deduced): child->showNormal(); | - |
| 729 | } executed: }Execution Count:16 | 16 |
| 730 | 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 |
| 731 | child->lower(); executed: child->lower();Execution Count:4 | 4 |
| 732 | ignoreWindowStateChange = false; executed (the execution status of this line is deduced): ignoreWindowStateChange = false; | - |
| 733 | child->d_func()->setActive(false); executed (the execution status of this line is deduced): child->d_func()->setActive(false); | - |
| 734 | } executed: }Execution Count:145 | 145 |
| 735 | } executed: }Execution Count:138 | 138 |
| 736 | | - |
| 737 | /*! | - |
| 738 | \internal | - |
| 739 | */ | - |
| 740 | void QMdiAreaPrivate::_q_processWindowStateChanged(Qt::WindowStates oldState, | - |
| 741 | Qt::WindowStates newState) | - |
| 742 | { | - |
| 743 | if (ignoreWindowStateChange) evaluated: ignoreWindowStateChange| yes Evaluation Count:16 | yes Evaluation Count:343 |
| 16-343 |
| 744 | return; executed: return;Execution Count:16 | 16 |
| 745 | | - |
| 746 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 747 | QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(q->sender()); executed (the execution status of this line is deduced): QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(q->sender()); | - |
| 748 | if (!child) partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:343 |
| 0-343 |
| 749 | return; | 0 |
| 750 | | - |
| 751 | // windowActivated | - |
| 752 | 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 |
| 753 | emitWindowActivated(child); executed: emitWindowActivated(child);Execution Count:151 | 151 |
| 754 | // windowDeactivated | - |
| 755 | 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 |
| 756 | resetActiveWindow(child); executed: resetActiveWindow(child);Execution Count:91 | 91 |
| 757 | | - |
| 758 | // windowMinimized | - |
| 759 | 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 |
| 760 | isSubWindowsTiled = false; executed (the execution status of this line is deduced): isSubWindowsTiled = false; | - |
| 761 | arrangeMinimizedSubWindows(); executed (the execution status of this line is deduced): arrangeMinimizedSubWindows(); | - |
| 762 | // windowMaximized | - |
| 763 | } else if (!(oldState & Qt::WindowMaximized) && (newState & Qt::WindowMaximized)) { executed: }Execution Count:16 evaluated: !(oldState & Qt::WindowMaximized)| yes Evaluation Count:242 | yes Evaluation Count:85 |
evaluated: (newState & Qt::WindowMaximized)| yes Evaluation Count:58 | yes Evaluation Count:184 |
| 16-242 |
| 764 | internalRaise(child); executed (the execution status of this line is deduced): internalRaise(child); | - |
| 765 | // windowRestored | - |
| 766 | } else if (!(newState & (Qt::WindowMaximized | Qt::WindowMinimized))) { executed: }Execution Count:58 evaluated: !(newState & (Qt::WindowMaximized | Qt::WindowMinimized))| yes Evaluation Count:200 | yes Evaluation Count:69 |
| 58-200 |
| 767 | internalRaise(child); executed (the execution status of this line is deduced): internalRaise(child); | - |
| 768 | if (oldState & Qt::WindowMinimized) evaluated: oldState & Qt::WindowMinimized| yes Evaluation Count:16 | yes Evaluation Count:184 |
| 16-184 |
| 769 | arrangeMinimizedSubWindows(); executed: arrangeMinimizedSubWindows();Execution Count:16 | 16 |
| 770 | } executed: }Execution Count:200 | 200 |
| 771 | } | - |
| 772 | | - |
| 773 | void QMdiAreaPrivate::_q_currentTabChanged(int index) | - |
| 774 | { | - |
| 775 | #ifdef QT_NO_TABBAR | - |
| 776 | Q_UNUSED(index); | - |
| 777 | #else | - |
| 778 | if (!tabBar || index < 0) never evaluated: !tabBar never evaluated: index < 0 | 0 |
| 779 | return; | 0 |
| 780 | | - |
| 781 | // If the previous active sub-window was hidden, disable the tab. | - |
| 782 | if (indexToLastActiveTab >= 0 && indexToLastActiveTab < tabBar->count() never evaluated: indexToLastActiveTab >= 0 never evaluated: indexToLastActiveTab < tabBar->count() | 0 |
| 783 | && indexToLastActiveTab < childWindows.count()) { never evaluated: indexToLastActiveTab < childWindows.count() | 0 |
| 784 | QMdiSubWindow *lastActive = childWindows.at(indexToLastActiveTab); never executed (the execution status of this line is deduced): QMdiSubWindow *lastActive = childWindows.at(indexToLastActiveTab); | - |
| 785 | if (lastActive && lastActive->isHidden()) never evaluated: lastActive never evaluated: lastActive->isHidden() | 0 |
| 786 | tabBar->setTabEnabled(indexToLastActiveTab, false); never executed: tabBar->setTabEnabled(indexToLastActiveTab, false); | 0 |
| 787 | } | 0 |
| 788 | | - |
| 789 | indexToLastActiveTab = index; never executed (the execution status of this line is deduced): indexToLastActiveTab = index; | - |
| 790 | Q_ASSERT(childWindows.size() > index); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 791 | QMdiSubWindow *subWindow = childWindows.at(index); never executed (the execution status of this line is deduced): QMdiSubWindow *subWindow = childWindows.at(index); | - |
| 792 | Q_ASSERT(subWindow); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 793 | activateWindow(subWindow); never executed (the execution status of this line is deduced): activateWindow(subWindow); | - |
| 794 | #endif // QT_NO_TABBAR | - |
| 795 | } | 0 |
| 796 | | - |
| 797 | void QMdiAreaPrivate::_q_closeTab(int index) | - |
| 798 | { | - |
| 799 | #ifdef QT_NO_TABBAR | - |
| 800 | Q_UNUSED(index); | - |
| 801 | #else | - |
| 802 | QMdiSubWindow *subWindow = childWindows.at(index); never executed (the execution status of this line is deduced): QMdiSubWindow *subWindow = childWindows.at(index); | - |
| 803 | Q_ASSERT(subWindow); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 804 | subWindow->close(); never executed (the execution status of this line is deduced): subWindow->close(); | - |
| 805 | #endif // QT_NO_TABBAR | - |
| 806 | } | 0 |
| 807 | | - |
| 808 | void QMdiAreaPrivate::_q_moveTab(int from, int to) | - |
| 809 | { | - |
| 810 | #ifdef QT_NO_TABBAR | - |
| 811 | Q_UNUSED(from); | - |
| 812 | Q_UNUSED(to); | - |
| 813 | #else | - |
| 814 | childWindows.move(from, to); never executed (the execution status of this line is deduced): childWindows.move(from, to); | - |
| 815 | #endif // QT_NO_TABBAR | - |
| 816 | } | 0 |
| 817 | | - |
| 818 | /*! | - |
| 819 | \internal | - |
| 820 | */ | - |
| 821 | void QMdiAreaPrivate::appendChild(QMdiSubWindow *child) | - |
| 822 | { | - |
| 823 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 824 | Q_ASSERT(child && childWindows.indexOf(child) == -1); executed (the execution status of this line is deduced): qt_noop(); | - |
| 825 | | - |
| 826 | if (child->parent() != viewport) partially evaluated: child->parent() != viewport| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 827 | child->setParent(viewport, child->windowFlags()); never executed: child->setParent(viewport, child->windowFlags()); | 0 |
| 828 | childWindows.append(QPointer<QMdiSubWindow>(child)); executed (the execution status of this line is deduced): childWindows.append(QPointer<QMdiSubWindow>(child)); | - |
| 829 | | - |
| 830 | 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 |
| 831 | QSize newSize(child->sizeHint().boundedTo(viewport->size())); executed (the execution status of this line is deduced): QSize newSize(child->sizeHint().boundedTo(viewport->size())); | - |
| 832 | child->resize(newSize.expandedTo(qSmartMinSize(child))); executed (the execution status of this line is deduced): child->resize(newSize.expandedTo(qSmartMinSize(child))); | - |
| 833 | } executed: }Execution Count:36 | 36 |
| 834 | | - |
| 835 | if (!placer) evaluated: !placer| yes Evaluation Count:76 | yes Evaluation Count:25 |
| 25-76 |
| 836 | placer = new MinOverlapPlacer; executed: placer = new MinOverlapPlacer;Execution Count:76 | 76 |
| 837 | place(placer, child); executed (the execution status of this line is deduced): place(placer, child); | - |
| 838 | | - |
| 839 | if (hbarpolicy != Qt::ScrollBarAlwaysOff) partially evaluated: hbarpolicy != Qt::ScrollBarAlwaysOff| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 840 | child->setOption(QMdiSubWindow::AllowOutsideAreaHorizontally, true); never executed: child->setOption(QMdiSubWindow::AllowOutsideAreaHorizontally, true); | 0 |
| 841 | else | - |
| 842 | child->setOption(QMdiSubWindow::AllowOutsideAreaHorizontally, false); executed: child->setOption(QMdiSubWindow::AllowOutsideAreaHorizontally, false);Execution Count:101 | 101 |
| 843 | | - |
| 844 | if (vbarpolicy != Qt::ScrollBarAlwaysOff) partially evaluated: vbarpolicy != Qt::ScrollBarAlwaysOff| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 845 | child->setOption(QMdiSubWindow::AllowOutsideAreaVertically, true); never executed: child->setOption(QMdiSubWindow::AllowOutsideAreaVertically, true); | 0 |
| 846 | else | - |
| 847 | child->setOption(QMdiSubWindow::AllowOutsideAreaVertically, false); executed: child->setOption(QMdiSubWindow::AllowOutsideAreaVertically, false);Execution Count:101 | 101 |
| 848 | | - |
| 849 | internalRaise(child); executed (the execution status of this line is deduced): internalRaise(child); | - |
| 850 | indicesToActivatedChildren.prepend(childWindows.size() - 1); executed (the execution status of this line is deduced): indicesToActivatedChildren.prepend(childWindows.size() - 1); | - |
| 851 | Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); executed (the execution status of this line is deduced): qt_noop(); | - |
| 852 | | - |
| 853 | #ifndef QT_NO_TABBAR | - |
| 854 | if (tabBar) { partially evaluated: tabBar| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 855 | tabBar->addTab(child->windowIcon(), tabTextFor(child)); never executed (the execution status of this line is deduced): tabBar->addTab(child->windowIcon(), tabTextFor(child)); | - |
| 856 | updateTabBarGeometry(); never executed (the execution status of this line is deduced): updateTabBarGeometry(); | - |
| 857 | if (childWindows.count() == 1 && !(options & QMdiArea::DontMaximizeSubWindowOnActivation)) never evaluated: childWindows.count() == 1 never evaluated: !(options & QMdiArea::DontMaximizeSubWindowOnActivation) | 0 |
| 858 | showActiveWindowMaximized = true; never executed: showActiveWindowMaximized = true; | 0 |
| 859 | } | 0 |
| 860 | #endif | - |
| 861 | | - |
| 862 | if (!(child->windowFlags() & Qt::SubWindow)) partially evaluated: !(child->windowFlags() & Qt::SubWindow)| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 863 | child->setWindowFlags(Qt::SubWindow); never executed: child->setWindowFlags(Qt::SubWindow); | 0 |
| 864 | child->installEventFilter(q); executed (the execution status of this line is deduced): child->installEventFilter(q); | - |
| 865 | | - |
| 866 | QObject::connect(child, SIGNAL(aboutToActivate()), q, SLOT(_q_deactivateAllWindows())); executed (the execution status of this line is deduced): QObject::connect(child, "2""aboutToActivate()", q, "1""_q_deactivateAllWindows()"); | - |
| 867 | QObject::connect(child, SIGNAL(windowStateChanged(Qt::WindowStates,Qt::WindowStates)), executed (the execution status of this line is deduced): QObject::connect(child, "2""windowStateChanged(Qt::WindowStates,Qt::WindowStates)", | - |
| 868 | q, SLOT(_q_processWindowStateChanged(Qt::WindowStates,Qt::WindowStates))); executed (the execution status of this line is deduced): q, "1""_q_processWindowStateChanged(Qt::WindowStates,Qt::WindowStates)"); | - |
| 869 | } executed: }Execution Count:101 | 101 |
| 870 | | - |
| 871 | /*! | - |
| 872 | \internal | - |
| 873 | */ | - |
| 874 | void QMdiAreaPrivate::place(Placer *placer, QMdiSubWindow *child) | - |
| 875 | { | - |
| 876 | 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 |
| 877 | return; | 0 |
| 878 | | - |
| 879 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 880 | if (!q->isVisible()) { evaluated: !q->isVisible()| yes Evaluation Count:65 | yes Evaluation Count:87 |
| 65-87 |
| 881 | // The window is only laid out when it's added to QMdiArea, | - |
| 882 | // so there's no need to check that we don't have it in the | - |
| 883 | // list already. appendChild() ensures that. | - |
| 884 | pendingPlacements.append(child); executed (the execution status of this line is deduced): pendingPlacements.append(child); | - |
| 885 | return; executed: return;Execution Count:65 | 65 |
| 886 | } | - |
| 887 | | - |
| 888 | QList<QRect> rects; executed (the execution status of this line is deduced): QList<QRect> rects; | - |
| 889 | QRect parentRect = q->rect(); executed (the execution status of this line is deduced): QRect parentRect = q->rect(); | - |
| 890 | foreach (QMdiSubWindow *window, childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 891 | 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 |
| 892 | || !window->testAttribute(Qt::WA_Moved)) { evaluated: !window->testAttribute(Qt::WA_Moved)| yes Evaluation Count:6 | yes Evaluation Count:32 |
| 6-32 |
| 893 | continue; executed: continue;Execution Count:93 | 93 |
| 894 | } | - |
| 895 | QRect occupiedGeometry; executed (the execution status of this line is deduced): QRect occupiedGeometry; | - |
| 896 | if (window->isMaximized()) { evaluated: window->isMaximized()| yes Evaluation Count:4 | yes Evaluation Count:28 |
| 4-28 |
| 897 | occupiedGeometry = QRect(window->d_func()->oldGeometry.topLeft(), executed (the execution status of this line is deduced): occupiedGeometry = QRect(window->d_func()->oldGeometry.topLeft(), | - |
| 898 | window->d_func()->restoreSize); executed (the execution status of this line is deduced): window->d_func()->restoreSize); | - |
| 899 | } else { executed: }Execution Count:4 | 4 |
| 900 | occupiedGeometry = window->geometry(); executed (the execution status of this line is deduced): occupiedGeometry = window->geometry(); | - |
| 901 | } executed: }Execution Count:28 | 28 |
| 902 | rects.append(QStyle::visualRect(child->layoutDirection(), parentRect, occupiedGeometry)); executed (the execution status of this line is deduced): rects.append(QStyle::visualRect(child->layoutDirection(), parentRect, occupiedGeometry)); | - |
| 903 | } executed: }Execution Count:32 | 32 |
| 904 | QPoint newPos = placer->place(child->size(), rects, parentRect); executed (the execution status of this line is deduced): QPoint newPos = placer->place(child->size(), rects, parentRect); | - |
| 905 | QRect newGeometry = QRect(newPos.x(), newPos.y(), child->width(), child->height()); executed (the execution status of this line is deduced): QRect newGeometry = QRect(newPos.x(), newPos.y(), child->width(), child->height()); | - |
| 906 | child->setGeometry(QStyle::visualRect(child->layoutDirection(), parentRect, newGeometry)); executed (the execution status of this line is deduced): child->setGeometry(QStyle::visualRect(child->layoutDirection(), parentRect, newGeometry)); | - |
| 907 | } executed: }Execution Count:87 | 87 |
| 908 | | - |
| 909 | /*! | - |
| 910 | \internal | - |
| 911 | */ | - |
| 912 | void QMdiAreaPrivate::rearrange(Rearranger *rearranger) | - |
| 913 | { | - |
| 914 | if (!rearranger) partially evaluated: !rearranger| no Evaluation Count:0 | yes Evaluation Count:99 |
| 0-99 |
| 915 | return; | 0 |
| 916 | | - |
| 917 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 918 | if (!q->isVisible()) { evaluated: !q->isVisible()| yes Evaluation Count:1 | yes Evaluation Count:98 |
| 1-98 |
| 919 | // Compress if we already have the rearranger in the list. | - |
| 920 | int index = pendingRearrangements.indexOf(rearranger); executed (the execution status of this line is deduced): int index = pendingRearrangements.indexOf(rearranger); | - |
| 921 | if (index != -1) partially evaluated: index != -1| no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
| 922 | pendingRearrangements.move(index, pendingRearrangements.size() - 1); never executed: pendingRearrangements.move(index, pendingRearrangements.size() - 1); | 0 |
| 923 | else | - |
| 924 | pendingRearrangements.append(rearranger); executed: pendingRearrangements.append(rearranger);Execution Count:1 | 1 |
| 925 | return; executed: return;Execution Count:1 | 1 |
| 926 | } | - |
| 927 | | - |
| 928 | QList<QWidget *> widgets; executed (the execution status of this line is deduced): QList<QWidget *> widgets; | - |
| 929 | const bool reverseList = rearranger->type() == Rearranger::RegularTiler; executed (the execution status of this line is deduced): const bool reverseList = rearranger->type() == Rearranger::RegularTiler; | - |
| 930 | const QList<QMdiSubWindow *> subWindows = subWindowList(activationOrder, reverseList); executed (the execution status of this line is deduced): const QList<QMdiSubWindow *> subWindows = subWindowList(activationOrder, reverseList); | - |
| 931 | QSize minSubWindowSize; executed (the execution status of this line is deduced): QSize minSubWindowSize; | - |
| 932 | foreach (QMdiSubWindow *child, subWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 933 | 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 |
| 934 | continue; executed: continue;Execution Count:51 | 51 |
| 935 | if (rearranger->type() == Rearranger::IconTiler) { partially evaluated: rearranger->type() == Rearranger::IconTiler| yes Evaluation Count:75 | no Evaluation Count:0 |
| 0-75 |
| 936 | 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 |
| 937 | widgets.append(child); executed: widgets.append(child);Execution Count:18 | 18 |
| 938 | } else { executed: }Execution Count:75 | 75 |
| 939 | if (child->isMinimized() && !child->isShaded()) never evaluated: child->isMinimized() never evaluated: !child->isShaded() | 0 |
| 940 | continue; never executed: continue; | 0 |
| 941 | if (child->isMaximized() || child->isShaded()) never evaluated: child->isMaximized() never evaluated: child->isShaded() | 0 |
| 942 | child->showNormal(); never executed: child->showNormal(); | 0 |
| 943 | minSubWindowSize = minSubWindowSize.expandedTo(child->minimumSize()) never executed (the execution status of this line is deduced): minSubWindowSize = minSubWindowSize.expandedTo(child->minimumSize()) | - |
| 944 | .expandedTo(child->d_func()->internalMinimumSize); never executed (the execution status of this line is deduced): .expandedTo(child->d_func()->internalMinimumSize); | - |
| 945 | widgets.append(child); never executed (the execution status of this line is deduced): widgets.append(child); | - |
| 946 | } | 0 |
| 947 | } | - |
| 948 | | - |
| 949 | 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 |
| 950 | // Move active window in front if necessary. That's the case if we | - |
| 951 | // have any windows with staysOnTopHint set. | - |
| 952 | int indexToActive = widgets.indexOf((QWidget *)active); never executed (the execution status of this line is deduced): int indexToActive = widgets.indexOf((QWidget *)active); | - |
| 953 | if (indexToActive > 0) never evaluated: indexToActive > 0 | 0 |
| 954 | widgets.move(indexToActive, 0); never executed: widgets.move(indexToActive, 0); | 0 |
| 955 | } | 0 |
| 956 | | - |
| 957 | QRect domain = viewport->rect(); executed (the execution status of this line is deduced): QRect domain = viewport->rect(); | - |
| 958 | 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 |
| 959 | domain = resizeToMinimumTileSize(minSubWindowSize, widgets.count()); never executed: domain = resizeToMinimumTileSize(minSubWindowSize, widgets.count()); | 0 |
| 960 | | - |
| 961 | rearranger->rearrange(widgets, domain); executed (the execution status of this line is deduced): rearranger->rearrange(widgets, domain); | - |
| 962 | | - |
| 963 | 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 |
| 964 | isSubWindowsTiled = true; never executed (the execution status of this line is deduced): isSubWindowsTiled = true; | - |
| 965 | updateScrollBars(); never executed (the execution status of this line is deduced): updateScrollBars(); | - |
| 966 | } else if (rearranger->type() == Rearranger::SimpleCascader) { never executed: } partially evaluated: rearranger->type() == Rearranger::SimpleCascader| no Evaluation Count:0 | yes Evaluation Count:98 |
| 0-98 |
| 967 | isSubWindowsTiled = false; never executed (the execution status of this line is deduced): isSubWindowsTiled = false; | - |
| 968 | } | 0 |
| 969 | } | - |
| 970 | | - |
| 971 | /*! | - |
| 972 | \internal | - |
| 973 | | - |
| 974 | Arranges all minimized windows at the bottom of the workspace. | - |
| 975 | */ | - |
| 976 | void QMdiAreaPrivate::arrangeMinimizedSubWindows() | - |
| 977 | { | - |
| 978 | if (!iconTiler) evaluated: !iconTiler| yes Evaluation Count:62 | yes Evaluation Count:37 |
| 37-62 |
| 979 | iconTiler = new IconTiler; executed: iconTiler = new IconTiler;Execution Count:62 | 62 |
| 980 | rearrange(iconTiler); executed (the execution status of this line is deduced): rearrange(iconTiler); | - |
| 981 | } executed: }Execution Count:99 | 99 |
| 982 | | - |
| 983 | /*! | - |
| 984 | \internal | - |
| 985 | */ | - |
| 986 | void QMdiAreaPrivate::activateWindow(QMdiSubWindow *child) | - |
| 987 | { | - |
| 988 | if (childWindows.isEmpty()) { partially evaluated: childWindows.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:19 |
| 0-19 |
| 989 | Q_ASSERT(!child); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 990 | Q_ASSERT(!active); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 991 | return; | 0 |
| 992 | } | - |
| 993 | | - |
| 994 | if (!child) { evaluated: !child| yes Evaluation Count:6 | yes Evaluation Count:13 |
| 6-13 |
| 995 | if (active) { partially evaluated: active| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 996 | Q_ASSERT(active->d_func()->isActive); executed (the execution status of this line is deduced): qt_noop(); | - |
| 997 | active->d_func()->setActive(false); executed (the execution status of this line is deduced): active->d_func()->setActive(false); | - |
| 998 | resetActiveWindow(); executed (the execution status of this line is deduced): resetActiveWindow(); | - |
| 999 | } executed: }Execution Count:6 | 6 |
| 1000 | return; executed: return;Execution Count:6 | 6 |
| 1001 | } | - |
| 1002 | | - |
| 1003 | 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 |
| 1004 | return; executed: return;Execution Count:3 | 3 |
| 1005 | child->d_func()->setActive(true); executed (the execution status of this line is deduced): child->d_func()->setActive(true); | - |
| 1006 | } executed: }Execution Count:10 | 10 |
| 1007 | | - |
| 1008 | /*! | - |
| 1009 | \internal | - |
| 1010 | */ | - |
| 1011 | void QMdiAreaPrivate::activateCurrentWindow() | - |
| 1012 | { | - |
| 1013 | QMdiSubWindow *current = q_func()->currentSubWindow(); executed (the execution status of this line is deduced): QMdiSubWindow *current = q_func()->currentSubWindow(); | - |
| 1014 | 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 |
| 1015 | current->d_func()->activationEnabled = true; executed (the execution status of this line is deduced): current->d_func()->activationEnabled = true; | - |
| 1016 | current->d_func()->setActive(true, /*changeFocus=*/false); executed (the execution status of this line is deduced): current->d_func()->setActive(true, false); | - |
| 1017 | } executed: }Execution Count:69 | 69 |
| 1018 | } executed: }Execution Count:138 | 138 |
| 1019 | | - |
| 1020 | void QMdiAreaPrivate::activateHighlightedWindow() | - |
| 1021 | { | - |
| 1022 | if (indexToHighlighted < 0) never evaluated: indexToHighlighted < 0 | 0 |
| 1023 | return; | 0 |
| 1024 | | - |
| 1025 | Q_ASSERT(indexToHighlighted < childWindows.size()); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1026 | if (tabToPreviousTimerId != -1) never evaluated: tabToPreviousTimerId != -1 | 0 |
| 1027 | activateWindow(nextVisibleSubWindow(-1, QMdiArea::ActivationHistoryOrder)); never executed: activateWindow(nextVisibleSubWindow(-1, QMdiArea::ActivationHistoryOrder)); | 0 |
| 1028 | else | - |
| 1029 | activateWindow(childWindows.at(indexToHighlighted)); never executed: activateWindow(childWindows.at(indexToHighlighted)); | 0 |
| 1030 | #ifndef QT_NO_RUBBERBAND | - |
| 1031 | hideRubberBand(); never executed (the execution status of this line is deduced): hideRubberBand(); | - |
| 1032 | #endif | - |
| 1033 | } | 0 |
| 1034 | | - |
| 1035 | /*! | - |
| 1036 | \internal | - |
| 1037 | */ | - |
| 1038 | void QMdiAreaPrivate::emitWindowActivated(QMdiSubWindow *activeWindow) | - |
| 1039 | { | - |
| 1040 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 1041 | Q_ASSERT(activeWindow); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1042 | if (activeWindow == active) evaluated: activeWindow == active| yes Evaluation Count:13 | yes Evaluation Count:138 |
| 13-138 |
| 1043 | return; executed: return;Execution Count:13 | 13 |
| 1044 | Q_ASSERT(activeWindow->d_func()->isActive); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1045 | | - |
| 1046 | if (!aboutToBecomeActive) partially evaluated: !aboutToBecomeActive| no Evaluation Count:0 | yes Evaluation Count:138 |
| 0-138 |
| 1047 | _q_deactivateAllWindows(activeWindow); never executed: _q_deactivateAllWindows(activeWindow); | 0 |
| 1048 | Q_ASSERT(aboutToBecomeActive); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1049 | | - |
| 1050 | // This is true only if 'DontMaximizeSubWindowOnActivation' is disabled | - |
| 1051 | // and the previous active window was maximized. | - |
| 1052 | if (showActiveWindowMaximized) { evaluated: showActiveWindowMaximized| yes Evaluation Count:16 | yes Evaluation Count:122 |
| 16-122 |
| 1053 | if (!activeWindow->isMaximized()) partially evaluated: !activeWindow->isMaximized()| yes Evaluation Count:16 | no Evaluation Count:0 |
| 0-16 |
| 1054 | activeWindow->showMaximized(); executed: activeWindow->showMaximized();Execution Count:16 | 16 |
| 1055 | showActiveWindowMaximized = false; executed (the execution status of this line is deduced): showActiveWindowMaximized = false; | - |
| 1056 | } executed: }Execution Count:16 | 16 |
| 1057 | | - |
| 1058 | // Put in front to update activation order. | - |
| 1059 | const int indexToActiveWindow = childWindows.indexOf(activeWindow); executed (the execution status of this line is deduced): const int indexToActiveWindow = childWindows.indexOf(activeWindow); | - |
| 1060 | Q_ASSERT(indexToActiveWindow != -1); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1061 | const int index = indicesToActivatedChildren.indexOf(indexToActiveWindow); executed (the execution status of this line is deduced): const int index = indicesToActivatedChildren.indexOf(indexToActiveWindow); | - |
| 1062 | Q_ASSERT(index != -1); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1063 | indicesToActivatedChildren.move(index, 0); executed (the execution status of this line is deduced): indicesToActivatedChildren.move(index, 0); | - |
| 1064 | internalRaise(activeWindow); executed (the execution status of this line is deduced): internalRaise(activeWindow); | - |
| 1065 | | - |
| 1066 | if (updatesDisabledByUs) { evaluated: updatesDisabledByUs| yes Evaluation Count:11 | yes Evaluation Count:127 |
| 11-127 |
| 1067 | q->setUpdatesEnabled(true); executed (the execution status of this line is deduced): q->setUpdatesEnabled(true); | - |
| 1068 | updatesDisabledByUs = false; executed (the execution status of this line is deduced): updatesDisabledByUs = false; | - |
| 1069 | } executed: }Execution Count:11 | 11 |
| 1070 | | - |
| 1071 | Q_ASSERT(aboutToBecomeActive == activeWindow); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1072 | active = activeWindow; executed (the execution status of this line is deduced): active = activeWindow; | - |
| 1073 | aboutToBecomeActive = 0; executed (the execution status of this line is deduced): aboutToBecomeActive = 0; | - |
| 1074 | Q_ASSERT(active->d_func()->isActive); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1075 | | - |
| 1076 | #ifndef QT_NO_TABBAR | - |
| 1077 | if (tabBar && tabBar->currentIndex() != indexToActiveWindow) partially evaluated: tabBar| no Evaluation Count:0 | yes Evaluation Count:138 |
never evaluated: tabBar->currentIndex() != indexToActiveWindow | 0-138 |
| 1078 | tabBar->setCurrentIndex(indexToActiveWindow); never executed: tabBar->setCurrentIndex(indexToActiveWindow); | 0 |
| 1079 | #endif | - |
| 1080 | | - |
| 1081 | 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 |
| 1082 | updateScrollBars(); never executed: updateScrollBars(); | 0 |
| 1083 | | - |
| 1084 | emit q->subWindowActivated(active); executed (the execution status of this line is deduced): q->subWindowActivated(active); | - |
| 1085 | } executed: }Execution Count:138 | 138 |
| 1086 | | - |
| 1087 | /*! | - |
| 1088 | \internal | - |
| 1089 | */ | - |
| 1090 | void QMdiAreaPrivate::resetActiveWindow(QMdiSubWindow *deactivatedWindow) | - |
| 1091 | { | - |
| 1092 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 1093 | if (deactivatedWindow) { evaluated: deactivatedWindow| yes Evaluation Count:91 | yes Evaluation Count:17 |
| 17-91 |
| 1094 | if (deactivatedWindow != active) partially evaluated: deactivatedWindow != active| no Evaluation Count:0 | yes Evaluation Count:91 |
| 0-91 |
| 1095 | return; | 0 |
| 1096 | active = 0; executed (the execution status of this line is deduced): active = 0; | - |
| 1097 | 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 |
| 1098 | && !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 |
| 1099 | return; executed: return;Execution Count:58 | 58 |
| 1100 | } | - |
| 1101 | emit q->subWindowActivated(0); executed (the execution status of this line is deduced): q->subWindowActivated(0); | - |
| 1102 | return; executed: return;Execution Count:33 | 33 |
| 1103 | } | - |
| 1104 | | - |
| 1105 | if (aboutToBecomeActive) partially evaluated: aboutToBecomeActive| no Evaluation Count:0 | yes Evaluation Count:17 |
| 0-17 |
| 1106 | return; | 0 |
| 1107 | | - |
| 1108 | active = 0; executed (the execution status of this line is deduced): active = 0; | - |
| 1109 | emit q->subWindowActivated(0); executed (the execution status of this line is deduced): q->subWindowActivated(0); | - |
| 1110 | } executed: }Execution Count:17 | 17 |
| 1111 | | - |
| 1112 | /*! | - |
| 1113 | \internal | - |
| 1114 | */ | - |
| 1115 | void QMdiAreaPrivate::updateActiveWindow(int removedIndex, bool activeRemoved) | - |
| 1116 | { | - |
| 1117 | Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1118 | | - |
| 1119 | #ifndef QT_NO_TABBAR | - |
| 1120 | if (tabBar && removedIndex >= 0) { partially evaluated: tabBar| no Evaluation Count:0 | yes Evaluation Count:11 |
never evaluated: removedIndex >= 0 | 0-11 |
| 1121 | tabBar->blockSignals(true); never executed (the execution status of this line is deduced): tabBar->blockSignals(true); | - |
| 1122 | tabBar->removeTab(removedIndex); never executed (the execution status of this line is deduced): tabBar->removeTab(removedIndex); | - |
| 1123 | updateTabBarGeometry(); never executed (the execution status of this line is deduced): updateTabBarGeometry(); | - |
| 1124 | tabBar->blockSignals(false); never executed (the execution status of this line is deduced): tabBar->blockSignals(false); | - |
| 1125 | } | 0 |
| 1126 | #endif | - |
| 1127 | | - |
| 1128 | if (childWindows.isEmpty()) { partially evaluated: childWindows.isEmpty()| yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
| 1129 | showActiveWindowMaximized = false; executed (the execution status of this line is deduced): showActiveWindowMaximized = false; | - |
| 1130 | resetActiveWindow(); executed (the execution status of this line is deduced): resetActiveWindow(); | - |
| 1131 | return; executed: return;Execution Count:11 | 11 |
| 1132 | } | - |
| 1133 | | - |
| 1134 | if (indexToHighlighted >= 0) { never evaluated: indexToHighlighted >= 0 | 0 |
| 1135 | #ifndef QT_NO_RUBBERBAND | - |
| 1136 | // Hide rubber band if highlighted window is removed. | - |
| 1137 | if (indexToHighlighted == removedIndex) never evaluated: indexToHighlighted == removedIndex | 0 |
| 1138 | hideRubberBand(); never executed: hideRubberBand(); | 0 |
| 1139 | else | - |
| 1140 | #endif | - |
| 1141 | // or update index if necessary. | - |
| 1142 | if (indexToHighlighted > removedIndex) never evaluated: indexToHighlighted > removedIndex | 0 |
| 1143 | --indexToHighlighted; never executed: --indexToHighlighted; | 0 |
| 1144 | } | - |
| 1145 | | - |
| 1146 | // Update indices list | - |
| 1147 | for (int i = 0; i < indicesToActivatedChildren.size(); ++i) { never evaluated: i < indicesToActivatedChildren.size() | 0 |
| 1148 | int *index = &indicesToActivatedChildren[i]; never executed (the execution status of this line is deduced): int *index = &indicesToActivatedChildren[i]; | - |
| 1149 | if (*index > removedIndex) never evaluated: *index > removedIndex | 0 |
| 1150 | --*index; never executed: --*index; | 0 |
| 1151 | } | 0 |
| 1152 | | - |
| 1153 | if (!activeRemoved) never evaluated: !activeRemoved | 0 |
| 1154 | return; | 0 |
| 1155 | | - |
| 1156 | // Activate next window. | - |
| 1157 | QMdiSubWindow *next = nextVisibleSubWindow(0, activationOrder, removedIndex); never executed (the execution status of this line is deduced): QMdiSubWindow *next = nextVisibleSubWindow(0, activationOrder, removedIndex); | - |
| 1158 | if (next) | 0 |
| 1159 | activateWindow(next); never executed: activateWindow(next); | 0 |
| 1160 | } | 0 |
| 1161 | | - |
| 1162 | /*! | - |
| 1163 | \internal | - |
| 1164 | */ | - |
| 1165 | void QMdiAreaPrivate::updateScrollBars() | - |
| 1166 | { | - |
| 1167 | 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 |
| 1168 | return; executed: return;Execution Count:1926 | 1926 |
| 1169 | | - |
| 1170 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 1171 | QSize maxSize = q->maximumViewportSize(); executed (the execution status of this line is deduced): QSize maxSize = q->maximumViewportSize(); | - |
| 1172 | QSize hbarExtent = hbar->sizeHint(); executed (the execution status of this line is deduced): QSize hbarExtent = hbar->sizeHint(); | - |
| 1173 | QSize vbarExtent = vbar->sizeHint(); executed (the execution status of this line is deduced): QSize vbarExtent = vbar->sizeHint(); | - |
| 1174 | | - |
| 1175 | 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 |
| 1176 | const int doubleFrameWidth = frameWidth * 2; never executed (the execution status of this line is deduced): const int doubleFrameWidth = frameWidth * 2; | - |
| 1177 | if (hbarpolicy == Qt::ScrollBarAlwaysOn) never evaluated: hbarpolicy == Qt::ScrollBarAlwaysOn | 0 |
| 1178 | maxSize.rheight() -= doubleFrameWidth; never executed: maxSize.rheight() -= doubleFrameWidth; | 0 |
| 1179 | if (vbarpolicy == Qt::ScrollBarAlwaysOn) never evaluated: vbarpolicy == Qt::ScrollBarAlwaysOn | 0 |
| 1180 | maxSize.rwidth() -= doubleFrameWidth; never executed: maxSize.rwidth() -= doubleFrameWidth; | 0 |
| 1181 | hbarExtent.rheight() += doubleFrameWidth; never executed (the execution status of this line is deduced): hbarExtent.rheight() += doubleFrameWidth; | - |
| 1182 | vbarExtent.rwidth() += doubleFrameWidth; never executed (the execution status of this line is deduced): vbarExtent.rwidth() += doubleFrameWidth; | - |
| 1183 | } | 0 |
| 1184 | | - |
| 1185 | 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 |
| 1186 | ? active->geometry() : viewport->childrenRect(); executed (the execution status of this line is deduced): ? active->geometry() : viewport->childrenRect(); | - |
| 1187 | bool useHorizontalScrollBar = useScrollBar(childrenRect, maxSize, Qt::Horizontal); executed (the execution status of this line is deduced): bool useHorizontalScrollBar = useScrollBar(childrenRect, maxSize, Qt::Horizontal); | - |
| 1188 | bool useVerticalScrollBar = useScrollBar(childrenRect, maxSize, Qt::Vertical); executed (the execution status of this line is deduced): bool useVerticalScrollBar = useScrollBar(childrenRect, maxSize, Qt::Vertical); | - |
| 1189 | | - |
| 1190 | if (useHorizontalScrollBar && !useVerticalScrollBar) { partially evaluated: useHorizontalScrollBar| no Evaluation Count:0 | yes Evaluation Count:86 |
never evaluated: !useVerticalScrollBar | 0-86 |
| 1191 | const QSize max = maxSize - QSize(0, hbarExtent.height()); never executed (the execution status of this line is deduced): const QSize max = maxSize - QSize(0, hbarExtent.height()); | - |
| 1192 | useVerticalScrollBar = useScrollBar(childrenRect, max, Qt::Vertical); never executed (the execution status of this line is deduced): useVerticalScrollBar = useScrollBar(childrenRect, max, Qt::Vertical); | - |
| 1193 | } | 0 |
| 1194 | | - |
| 1195 | 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 |
| 1196 | const QSize max = maxSize - QSize(vbarExtent.width(), 0); executed (the execution status of this line is deduced): const QSize max = maxSize - QSize(vbarExtent.width(), 0); | - |
| 1197 | useHorizontalScrollBar = useScrollBar(childrenRect, max, Qt::Horizontal); executed (the execution status of this line is deduced): useHorizontalScrollBar = useScrollBar(childrenRect, max, Qt::Horizontal); | - |
| 1198 | } executed: }Execution Count:43 | 43 |
| 1199 | | - |
| 1200 | 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 |
| 1201 | maxSize.rheight() -= hbarExtent.height(); executed: maxSize.rheight() -= hbarExtent.height();Execution Count:43 | 43 |
| 1202 | 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 |
| 1203 | maxSize.rwidth() -= vbarExtent.width(); executed: maxSize.rwidth() -= vbarExtent.width();Execution Count:43 | 43 |
| 1204 | | - |
| 1205 | QRect viewportRect(QPoint(0, 0), maxSize); executed (the execution status of this line is deduced): QRect viewportRect(QPoint(0, 0), maxSize); | - |
| 1206 | const int startX = q->isLeftToRight() ? childrenRect.left() : viewportRect.right() partially evaluated: q->isLeftToRight()| yes Evaluation Count:86 | no Evaluation Count:0 |
| 0-86 |
| 1207 | - childrenRect.right(); executed (the execution status of this line is deduced): - childrenRect.right(); | - |
| 1208 | | - |
| 1209 | // Horizontal scroll bar. | - |
| 1210 | if (isSubWindowsTiled && hbar->value() != 0) partially evaluated: isSubWindowsTiled| no Evaluation Count:0 | yes Evaluation Count:86 |
never evaluated: hbar->value() != 0 | 0-86 |
| 1211 | hbar->setValue(0); never executed: hbar->setValue(0); | 0 |
| 1212 | const int xOffset = startX + hbar->value(); executed (the execution status of this line is deduced): const int xOffset = startX + hbar->value(); | - |
| 1213 | hbar->setRange(qMin(0, xOffset), executed (the execution status of this line is deduced): hbar->setRange(qMin(0, xOffset), | - |
| 1214 | qMax(0, xOffset + childrenRect.width() - viewportRect.width())); executed (the execution status of this line is deduced): qMax(0, xOffset + childrenRect.width() - viewportRect.width())); | - |
| 1215 | hbar->setPageStep(childrenRect.width()); executed (the execution status of this line is deduced): hbar->setPageStep(childrenRect.width()); | - |
| 1216 | hbar->setSingleStep(childrenRect.width() / 20); executed (the execution status of this line is deduced): hbar->setSingleStep(childrenRect.width() / 20); | - |
| 1217 | | - |
| 1218 | // Vertical scroll bar. | - |
| 1219 | if (isSubWindowsTiled && vbar->value() != 0) partially evaluated: isSubWindowsTiled| no Evaluation Count:0 | yes Evaluation Count:86 |
never evaluated: vbar->value() != 0 | 0-86 |
| 1220 | vbar->setValue(0); never executed: vbar->setValue(0); | 0 |
| 1221 | const int yOffset = childrenRect.top() + vbar->value(); executed (the execution status of this line is deduced): const int yOffset = childrenRect.top() + vbar->value(); | - |
| 1222 | vbar->setRange(qMin(0, yOffset), executed (the execution status of this line is deduced): vbar->setRange(qMin(0, yOffset), | - |
| 1223 | qMax(0, yOffset + childrenRect.height() - viewportRect.height())); executed (the execution status of this line is deduced): qMax(0, yOffset + childrenRect.height() - viewportRect.height())); | - |
| 1224 | vbar->setPageStep(childrenRect.height()); executed (the execution status of this line is deduced): vbar->setPageStep(childrenRect.height()); | - |
| 1225 | vbar->setSingleStep(childrenRect.height() / 20); executed (the execution status of this line is deduced): vbar->setSingleStep(childrenRect.height() / 20); | - |
| 1226 | } executed: }Execution Count:86 | 86 |
| 1227 | | - |
| 1228 | /*! | - |
| 1229 | \internal | - |
| 1230 | */ | - |
| 1231 | void QMdiAreaPrivate::internalRaise(QMdiSubWindow *mdiChild) const | - |
| 1232 | { | - |
| 1233 | 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 |
| 1234 | return; executed: return;Execution Count:319 | 319 |
| 1235 | | - |
| 1236 | QMdiSubWindow *stackUnderChild = 0; executed (the execution status of this line is deduced): QMdiSubWindow *stackUnderChild = 0; | - |
| 1237 | if (!windowStaysOnTop(mdiChild)) { partially evaluated: !windowStaysOnTop(mdiChild)| yes Evaluation Count:178 | no Evaluation Count:0 |
| 0-178 |
| 1238 | foreach (QObject *object, viewport->children()) { executed (the execution status of this line is deduced): 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;})) { | - |
| 1239 | QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(object); executed (the execution status of this line is deduced): QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(object); | - |
| 1240 | 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 |
| 1241 | continue; executed: continue;Execution Count:52 | 52 |
| 1242 | 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 |
| 1243 | if (stackUnderChild) never evaluated: stackUnderChild | 0 |
| 1244 | child->stackUnder(stackUnderChild); never executed: child->stackUnder(stackUnderChild); | 0 |
| 1245 | else | - |
| 1246 | child->raise(); never executed: child->raise(); | 0 |
| 1247 | stackUnderChild = child; never executed (the execution status of this line is deduced): stackUnderChild = child; | - |
| 1248 | } | 0 |
| 1249 | } executed: }Execution Count:739 | 739 |
| 1250 | } executed: }Execution Count:178 | 178 |
| 1251 | | - |
| 1252 | if (stackUnderChild) partially evaluated: stackUnderChild| no Evaluation Count:0 | yes Evaluation Count:178 |
| 0-178 |
| 1253 | mdiChild->stackUnder(stackUnderChild); never executed: mdiChild->stackUnder(stackUnderChild); | 0 |
| 1254 | else | - |
| 1255 | mdiChild->raise(); executed: mdiChild->raise();Execution Count:178 | 178 |
| 1256 | } | - |
| 1257 | | - |
| 1258 | QRect QMdiAreaPrivate::resizeToMinimumTileSize(const QSize &minSubWindowSize, int subWindowCount) | - |
| 1259 | { | - |
| 1260 | Q_Q(QMdiArea); never executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 1261 | if (!minSubWindowSize.isValid() || subWindowCount <= 0) never evaluated: !minSubWindowSize.isValid() never evaluated: subWindowCount <= 0 | 0 |
| 1262 | return viewport->rect(); never executed: return viewport->rect(); | 0 |
| 1263 | | - |
| 1264 | // Calculate minimum size. | - |
| 1265 | const int columns = qMax(qCeil(qSqrt(qreal(subWindowCount))), 1); never executed (the execution status of this line is deduced): const int columns = qMax(qCeil(qSqrt(qreal(subWindowCount))), 1); | - |
| 1266 | const int rows = qMax((subWindowCount % columns) ? (subWindowCount / columns + 1) never executed (the execution status of this line is deduced): const int rows = qMax((subWindowCount % columns) ? (subWindowCount / columns + 1) | - |
| 1267 | : (subWindowCount / columns), 1); never executed (the execution status of this line is deduced): : (subWindowCount / columns), 1); | - |
| 1268 | const int minWidth = minSubWindowSize.width() * columns; never executed (the execution status of this line is deduced): const int minWidth = minSubWindowSize.width() * columns; | - |
| 1269 | const int minHeight = minSubWindowSize.height() * rows; never executed (the execution status of this line is deduced): const int minHeight = minSubWindowSize.height() * rows; | - |
| 1270 | | - |
| 1271 | // Increase area size if necessary. Scroll bars are provided if we're not able | - |
| 1272 | // to resize to the minimum size. | - |
| 1273 | if (!tileCalledFromResizeEvent) { never evaluated: !tileCalledFromResizeEvent | 0 |
| 1274 | QWidget *topLevel = q; never executed (the execution status of this line is deduced): QWidget *topLevel = q; | - |
| 1275 | // Find the topLevel for this area, either a real top-level or a sub-window. | - |
| 1276 | while (topLevel && !topLevel->isWindow() && topLevel->windowType() != Qt::SubWindow) never evaluated: topLevel never evaluated: !topLevel->isWindow() never evaluated: topLevel->windowType() != Qt::SubWindow | 0 |
| 1277 | topLevel = topLevel->parentWidget(); never executed: topLevel = topLevel->parentWidget(); | 0 |
| 1278 | // We don't want sub-subwindows to be placed at the edge, thus add 2 pixels. | - |
| 1279 | int minAreaWidth = minWidth + left + right + 2; never executed (the execution status of this line is deduced): int minAreaWidth = minWidth + left + right + 2; | - |
| 1280 | int minAreaHeight = minHeight + top + bottom + 2; never executed (the execution status of this line is deduced): int minAreaHeight = minHeight + top + bottom + 2; | - |
| 1281 | if (hbar->isVisible()) never evaluated: hbar->isVisible() | 0 |
| 1282 | minAreaHeight += hbar->height(); never executed: minAreaHeight += hbar->height(); | 0 |
| 1283 | if (vbar->isVisible()) never evaluated: vbar->isVisible() | 0 |
| 1284 | minAreaWidth += vbar->width(); never executed: minAreaWidth += vbar->width(); | 0 |
| 1285 | if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q)) { never evaluated: q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents, 0, q) | 0 |
| 1286 | const int frame = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, q); never executed (the execution status of this line is deduced): const int frame = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, q); | - |
| 1287 | minAreaWidth += 2 * frame; never executed (the execution status of this line is deduced): minAreaWidth += 2 * frame; | - |
| 1288 | minAreaHeight += 2 * frame; never executed (the execution status of this line is deduced): minAreaHeight += 2 * frame; | - |
| 1289 | } | 0 |
| 1290 | const QSize diff = QSize(minAreaWidth, minAreaHeight).expandedTo(q->size()) - q->size(); never executed (the execution status of this line is deduced): const QSize diff = QSize(minAreaWidth, minAreaHeight).expandedTo(q->size()) - q->size(); | - |
| 1291 | topLevel->resize(topLevel->size() + diff); never executed (the execution status of this line is deduced): topLevel->resize(topLevel->size() + diff); | - |
| 1292 | } | 0 |
| 1293 | | - |
| 1294 | QRect domain = viewport->rect(); never executed (the execution status of this line is deduced): QRect domain = viewport->rect(); | - |
| 1295 | | - |
| 1296 | // Adjust domain width and provide horizontal scroll bar. | - |
| 1297 | if (domain.width() < minWidth) { never evaluated: domain.width() < minWidth | 0 |
| 1298 | domain.setWidth(minWidth); never executed (the execution status of this line is deduced): domain.setWidth(minWidth); | - |
| 1299 | if (hbarpolicy == Qt::ScrollBarAlwaysOff) never evaluated: hbarpolicy == Qt::ScrollBarAlwaysOff | 0 |
| 1300 | q->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); never executed: q->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); | 0 |
| 1301 | else | - |
| 1302 | hbar->setValue(0); never executed: hbar->setValue(0); | 0 |
| 1303 | } | - |
| 1304 | // Adjust domain height and provide vertical scroll bar. | - |
| 1305 | if (domain.height() < minHeight) { never evaluated: domain.height() < minHeight | 0 |
| 1306 | domain.setHeight(minHeight); never executed (the execution status of this line is deduced): domain.setHeight(minHeight); | - |
| 1307 | if (vbarpolicy == Qt::ScrollBarAlwaysOff) never evaluated: vbarpolicy == Qt::ScrollBarAlwaysOff | 0 |
| 1308 | q->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); never executed: q->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); | 0 |
| 1309 | else | - |
| 1310 | vbar->setValue(0); never executed: vbar->setValue(0); | 0 |
| 1311 | } | - |
| 1312 | return domain; never executed: return domain; | 0 |
| 1313 | } | - |
| 1314 | | - |
| 1315 | /*! | - |
| 1316 | \internal | - |
| 1317 | */ | - |
| 1318 | bool QMdiAreaPrivate::scrollBarsEnabled() const | - |
| 1319 | { | - |
| 1320 | return hbarpolicy != Qt::ScrollBarAlwaysOff || vbarpolicy != Qt::ScrollBarAlwaysOff; executed: return hbarpolicy != Qt::ScrollBarAlwaysOff || vbarpolicy != Qt::ScrollBarAlwaysOff;Execution Count:2110 | 2110 |
| 1321 | } | - |
| 1322 | | - |
| 1323 | /*! | - |
| 1324 | \internal | - |
| 1325 | */ | - |
| 1326 | bool QMdiAreaPrivate::lastWindowAboutToBeDestroyed() const | - |
| 1327 | { | - |
| 1328 | if (childWindows.count() != 1) evaluated: childWindows.count() != 1| yes Evaluation Count:5 | yes Evaluation Count:29 |
| 5-29 |
| 1329 | return false; executed: return false;Execution Count:5 | 5 |
| 1330 | | - |
| 1331 | QMdiSubWindow *last = childWindows.at(0); executed (the execution status of this line is deduced): QMdiSubWindow *last = childWindows.at(0); | - |
| 1332 | if (!last) partially evaluated: !last| no Evaluation Count:0 | yes Evaluation Count:29 |
| 0-29 |
| 1333 | return true; never executed: return true; | 0 |
| 1334 | | - |
| 1335 | if (!last->testAttribute(Qt::WA_DeleteOnClose)) evaluated: !last->testAttribute(Qt::WA_DeleteOnClose)| yes Evaluation Count:23 | yes Evaluation Count:6 |
| 6-23 |
| 1336 | return false; executed: return false;Execution Count:23 | 23 |
| 1337 | | - |
| 1338 | return last->d_func()->data.is_closing; executed: return last->d_func()->data.is_closing;Execution Count:6 | 6 |
| 1339 | } | - |
| 1340 | | - |
| 1341 | /*! | - |
| 1342 | \internal | - |
| 1343 | */ | - |
| 1344 | void QMdiAreaPrivate::setChildActivationEnabled(bool enable, bool onlyNextActivationEvent) const | - |
| 1345 | { | - |
| 1346 | foreach (QMdiSubWindow *subWindow, childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 1347 | 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 |
| 1348 | continue; executed: continue;Execution Count:60 | 60 |
| 1349 | if (onlyNextActivationEvent) evaluated: onlyNextActivationEvent| yes Evaluation Count:84 | yes Evaluation Count:90 |
| 84-90 |
| 1350 | subWindow->d_func()->ignoreNextActivationEvent = !enable; executed: subWindow->d_func()->ignoreNextActivationEvent = !enable;Execution Count:84 | 84 |
| 1351 | else | - |
| 1352 | subWindow->d_func()->activationEnabled = enable; executed: subWindow->d_func()->activationEnabled = enable;Execution Count:90 | 90 |
| 1353 | } | - |
| 1354 | } executed: }Execution Count:249 | 249 |
| 1355 | | - |
| 1356 | /*! | - |
| 1357 | \internal | - |
| 1358 | \reimp | - |
| 1359 | */ | - |
| 1360 | void QMdiAreaPrivate::scrollBarPolicyChanged(Qt::Orientation orientation, Qt::ScrollBarPolicy policy) | - |
| 1361 | { | - |
| 1362 | if (childWindows.isEmpty()) evaluated: childWindows.isEmpty()| yes Evaluation Count:160 | yes Evaluation Count:2 |
| 2-160 |
| 1363 | return; executed: return;Execution Count:160 | 160 |
| 1364 | | - |
| 1365 | const QMdiSubWindow::SubWindowOption option = orientation == Qt::Horizontal ? evaluated: orientation == Qt::Horizontal| yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
| 1366 | QMdiSubWindow::AllowOutsideAreaHorizontally : QMdiSubWindow::AllowOutsideAreaVertically; executed (the execution status of this line is deduced): QMdiSubWindow::AllowOutsideAreaHorizontally : QMdiSubWindow::AllowOutsideAreaVertically; | - |
| 1367 | const bool enable = policy != Qt::ScrollBarAlwaysOff; executed (the execution status of this line is deduced): const bool enable = policy != Qt::ScrollBarAlwaysOff; | - |
| 1368 | foreach (QMdiSubWindow *child, childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 1369 | if (!sanityCheck(child, "QMdiArea::scrollBarPolicyChanged")) partially evaluated: !sanityCheck(child, "QMdiArea::scrollBarPolicyChanged")| no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
| 1370 | continue; never executed: continue; | 0 |
| 1371 | child->setOption(option, enable); executed (the execution status of this line is deduced): child->setOption(option, enable); | - |
| 1372 | } executed: }Execution Count:8 | 8 |
| 1373 | updateScrollBars(); executed (the execution status of this line is deduced): updateScrollBars(); | - |
| 1374 | } executed: }Execution Count:2 | 2 |
| 1375 | | - |
| 1376 | QList<QMdiSubWindow*> | - |
| 1377 | QMdiAreaPrivate::subWindowList(QMdiArea::WindowOrder order, bool reversed) const | - |
| 1378 | { | - |
| 1379 | QList<QMdiSubWindow *> list; executed (the execution status of this line is deduced): QList<QMdiSubWindow *> list; | - |
| 1380 | if (childWindows.isEmpty()) evaluated: childWindows.isEmpty()| yes Evaluation Count:11 | yes Evaluation Count:101 |
| 11-101 |
| 1381 | return list; executed: return list;Execution Count:11 | 11 |
| 1382 | | - |
| 1383 | if (order == QMdiArea::CreationOrder) { partially evaluated: order == QMdiArea::CreationOrder| yes Evaluation Count:101 | no Evaluation Count:0 |
| 0-101 |
| 1384 | foreach (QMdiSubWindow *child, childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 1385 | if (!child) partially evaluated: !child| no Evaluation Count:0 | yes Evaluation Count:184 |
| 0-184 |
| 1386 | continue; never executed: continue; | 0 |
| 1387 | if (!reversed) partially evaluated: !reversed| yes Evaluation Count:184 | no Evaluation Count:0 |
| 0-184 |
| 1388 | list.append(child); executed: list.append(child);Execution Count:184 | 184 |
| 1389 | else | - |
| 1390 | list.prepend(child); never executed: list.prepend(child); | 0 |
| 1391 | } | - |
| 1392 | } else if (order == QMdiArea::StackingOrder) { executed: }Execution Count:101 never evaluated: order == QMdiArea::StackingOrder | 0-101 |
| 1393 | foreach (QObject *object, viewport->children()) { never executed (the execution status of this line is deduced): 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;})) { | - |
| 1394 | QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(object); never executed (the execution status of this line is deduced): QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(object); | - |
| 1395 | if (!child || !childWindows.contains(child)) never evaluated: !child never evaluated: !childWindows.contains(child) | 0 |
| 1396 | continue; never executed: continue; | 0 |
| 1397 | if (!reversed) never evaluated: !reversed | 0 |
| 1398 | list.append(child); never executed: list.append(child); | 0 |
| 1399 | else | - |
| 1400 | list.prepend(child); never executed: list.prepend(child); | 0 |
| 1401 | } | - |
| 1402 | } else { // ActivationHistoryOrder | 0 |
| 1403 | Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1404 | for (int i = indicesToActivatedChildren.count() - 1; i >= 0; --i) { | 0 |
| 1405 | QMdiSubWindow *child = childWindows.at(indicesToActivatedChildren.at(i)); never executed (the execution status of this line is deduced): QMdiSubWindow *child = childWindows.at(indicesToActivatedChildren.at(i)); | - |
| 1406 | if (!child) | 0 |
| 1407 | continue; never executed: continue; | 0 |
| 1408 | if (!reversed) never evaluated: !reversed | 0 |
| 1409 | list.append(child); never executed: list.append(child); | 0 |
| 1410 | else | - |
| 1411 | list.prepend(child); never executed: list.prepend(child); | 0 |
| 1412 | } | - |
| 1413 | } | 0 |
| 1414 | return list; executed: return list;Execution Count:101 | 101 |
| 1415 | } | - |
| 1416 | | - |
| 1417 | /*! | - |
| 1418 | \internal | - |
| 1419 | */ | - |
| 1420 | void QMdiAreaPrivate::disconnectSubWindow(QObject *subWindow) | - |
| 1421 | { | - |
| 1422 | if (!subWindow) partially evaluated: !subWindow| no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
| 1423 | return; | 0 |
| 1424 | | - |
| 1425 | Q_Q(QMdiArea); executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 1426 | QObject::disconnect(subWindow, 0, q, 0); executed (the execution status of this line is deduced): QObject::disconnect(subWindow, 0, q, 0); | - |
| 1427 | subWindow->removeEventFilter(q); executed (the execution status of this line is deduced): subWindow->removeEventFilter(q); | - |
| 1428 | } executed: }Execution Count:11 | 11 |
| 1429 | | - |
| 1430 | /*! | - |
| 1431 | \internal | - |
| 1432 | */ | - |
| 1433 | QMdiSubWindow *QMdiAreaPrivate::nextVisibleSubWindow(int increaseFactor, QMdiArea::WindowOrder order, | - |
| 1434 | int removedIndex, int fromIndex) const | - |
| 1435 | { | - |
| 1436 | if (childWindows.isEmpty()) partially evaluated: childWindows.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 1437 | return 0; never executed: return 0; | 0 |
| 1438 | | - |
| 1439 | Q_Q(const QMdiArea); executed (the execution status of this line is deduced): const QMdiArea * const q = q_func(); | - |
| 1440 | const QList<QMdiSubWindow *> subWindows = q->subWindowList(order); executed (the execution status of this line is deduced): const QList<QMdiSubWindow *> subWindows = q->subWindowList(order); | - |
| 1441 | QMdiSubWindow *current = 0; executed (the execution status of this line is deduced): QMdiSubWindow *current = 0; | - |
| 1442 | | - |
| 1443 | if (removedIndex < 0) { partially evaluated: removedIndex < 0| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 1444 | 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 |
| 1445 | current = childWindows.at(fromIndex); never executed: current = childWindows.at(fromIndex); | 0 |
| 1446 | else | - |
| 1447 | current = q->currentSubWindow(); executed: current = q->currentSubWindow();Execution Count:6 | 6 |
| 1448 | } | - |
| 1449 | | - |
| 1450 | // There's no current sub-window (removed or deactivated), | - |
| 1451 | // so we have to pick the last active or the next in creation order. | - |
| 1452 | if (!current) { partially evaluated: !current| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 1453 | if (removedIndex >= 0 && order == QMdiArea::CreationOrder) { never evaluated: removedIndex >= 0 never evaluated: order == QMdiArea::CreationOrder | 0 |
| 1454 | int candidateIndex = -1; never executed (the execution status of this line is deduced): int candidateIndex = -1; | - |
| 1455 | setIndex(&candidateIndex, removedIndex, 0, subWindows.size() - 1, true); never executed (the execution status of this line is deduced): setIndex(&candidateIndex, removedIndex, 0, subWindows.size() - 1, true); | - |
| 1456 | current = childWindows.at(candidateIndex); never executed (the execution status of this line is deduced): current = childWindows.at(candidateIndex); | - |
| 1457 | } else { | 0 |
| 1458 | current = subWindows.back(); never executed (the execution status of this line is deduced): current = subWindows.back(); | - |
| 1459 | } | 0 |
| 1460 | } | - |
| 1461 | Q_ASSERT(current); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1462 | | - |
| 1463 | // Find the index for the current sub-window in the given activation order | - |
| 1464 | const int indexToCurrent = subWindows.indexOf(current); executed (the execution status of this line is deduced): const int indexToCurrent = subWindows.indexOf(current); | - |
| 1465 | const bool increasing = increaseFactor > 0 ? true : false; partially evaluated: increaseFactor > 0| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 1466 | | - |
| 1467 | // and use that index + increseFactor as a candidate. | - |
| 1468 | int index = -1; executed (the execution status of this line is deduced): int index = -1; | - |
| 1469 | setIndex(&index, indexToCurrent + increaseFactor, 0, subWindows.size() - 1, increasing); executed (the execution status of this line is deduced): setIndex(&index, indexToCurrent + increaseFactor, 0, subWindows.size() - 1, increasing); | - |
| 1470 | Q_ASSERT(index != -1); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1471 | | - |
| 1472 | // Try to find another window if the candidate is hidden. | - |
| 1473 | while (subWindows.at(index)->isHidden()) { partially evaluated: subWindows.at(index)->isHidden()| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 1474 | setIndex(&index, index + increaseFactor, 0, subWindows.size() - 1, increasing); never executed (the execution status of this line is deduced): setIndex(&index, index + increaseFactor, 0, subWindows.size() - 1, increasing); | - |
| 1475 | if (index == indexToCurrent) never evaluated: index == indexToCurrent | 0 |
| 1476 | break; | 0 |
| 1477 | } | 0 |
| 1478 | | - |
| 1479 | if (!subWindows.at(index)->isHidden()) partially evaluated: !subWindows.at(index)->isHidden()| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 1480 | return subWindows.at(index); executed: return subWindows.at(index);Execution Count:6 | 6 |
| 1481 | return 0; never executed: return 0; | 0 |
| 1482 | } | - |
| 1483 | | - |
| 1484 | /*! | - |
| 1485 | \internal | - |
| 1486 | */ | - |
| 1487 | void QMdiAreaPrivate::highlightNextSubWindow(int increaseFactor) | - |
| 1488 | { | - |
| 1489 | if (childWindows.size() == 1) never evaluated: childWindows.size() == 1 | 0 |
| 1490 | return; | 0 |
| 1491 | | - |
| 1492 | Q_Q(QMdiArea); never executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 1493 | // There's no highlighted sub-window atm, use current. | - |
| 1494 | if (indexToHighlighted < 0) { never evaluated: indexToHighlighted < 0 | 0 |
| 1495 | QMdiSubWindow *current = q->currentSubWindow(); never executed (the execution status of this line is deduced): QMdiSubWindow *current = q->currentSubWindow(); | - |
| 1496 | if (!current) never evaluated: !current | 0 |
| 1497 | return; | 0 |
| 1498 | indexToHighlighted = childWindows.indexOf(current); never executed (the execution status of this line is deduced): indexToHighlighted = childWindows.indexOf(current); | - |
| 1499 | } | 0 |
| 1500 | | - |
| 1501 | Q_ASSERT(indexToHighlighted >= 0); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1502 | Q_ASSERT(indexToHighlighted < childWindows.size()); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1503 | | - |
| 1504 | QMdiSubWindow *highlight = nextVisibleSubWindow(increaseFactor, activationOrder, -1, indexToHighlighted); never executed (the execution status of this line is deduced): QMdiSubWindow *highlight = nextVisibleSubWindow(increaseFactor, activationOrder, -1, indexToHighlighted); | - |
| 1505 | if (!highlight) never evaluated: !highlight | 0 |
| 1506 | return; | 0 |
| 1507 | | - |
| 1508 | #ifndef QT_NO_RUBBERBAND | - |
| 1509 | if (!rubberBand) { never evaluated: !rubberBand | 0 |
| 1510 | rubberBand = new QRubberBand(QRubberBand::Rectangle, viewport); never executed (the execution status of this line is deduced): rubberBand = new QRubberBand(QRubberBand::Rectangle, viewport); | - |
| 1511 | // For accessibility to identify this special widget. | - |
| 1512 | rubberBand->setObjectName(QLatin1String("qt_rubberband")); never executed (the execution status of this line is deduced): rubberBand->setObjectName(QLatin1String("qt_rubberband")); | - |
| 1513 | rubberBand->setWindowFlags(rubberBand->windowFlags() | Qt::WindowStaysOnTopHint); never executed (the execution status of this line is deduced): rubberBand->setWindowFlags(rubberBand->windowFlags() | Qt::WindowStaysOnTopHint); | - |
| 1514 | } | 0 |
| 1515 | #endif | - |
| 1516 | | - |
| 1517 | // Only highlight if we're not switching back to the previously active window (Ctrl-Tab once). | - |
| 1518 | #ifndef QT_NO_RUBBERBAND | - |
| 1519 | if (tabToPreviousTimerId == -1) never evaluated: tabToPreviousTimerId == -1 | 0 |
| 1520 | showRubberBandFor(highlight); never executed: showRubberBandFor(highlight); | 0 |
| 1521 | #endif | - |
| 1522 | | - |
| 1523 | indexToHighlighted = childWindows.indexOf(highlight); never executed (the execution status of this line is deduced): indexToHighlighted = childWindows.indexOf(highlight); | - |
| 1524 | Q_ASSERT(indexToHighlighted >= 0); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1525 | } | 0 |
| 1526 | | - |
| 1527 | /*! | - |
| 1528 | \internal | - |
| 1529 | \since 4.4 | - |
| 1530 | */ | - |
| 1531 | void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) | - |
| 1532 | { | - |
| 1533 | Q_Q(QMdiArea); never executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 1534 | if (viewMode == mode || inViewModeChange) never evaluated: viewMode == mode never evaluated: inViewModeChange | 0 |
| 1535 | return; | 0 |
| 1536 | | - |
| 1537 | // Just a guard since we cannot set viewMode = mode here. | - |
| 1538 | inViewModeChange = true; never executed (the execution status of this line is deduced): inViewModeChange = true; | - |
| 1539 | | - |
| 1540 | #ifndef QT_NO_TABBAR | - |
| 1541 | if (mode == QMdiArea::TabbedView) { never evaluated: mode == QMdiArea::TabbedView | 0 |
| 1542 | Q_ASSERT(!tabBar); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1543 | tabBar = new QMdiAreaTabBar(q); never executed (the execution status of this line is deduced): tabBar = new QMdiAreaTabBar(q); | - |
| 1544 | tabBar->setDocumentMode(documentMode); never executed (the execution status of this line is deduced): tabBar->setDocumentMode(documentMode); | - |
| 1545 | tabBar->setTabsClosable(tabsClosable); never executed (the execution status of this line is deduced): tabBar->setTabsClosable(tabsClosable); | - |
| 1546 | tabBar->setMovable(tabsMovable); never executed (the execution status of this line is deduced): tabBar->setMovable(tabsMovable); | - |
| 1547 | #ifndef QT_NO_TABWIDGET | - |
| 1548 | tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); never executed (the execution status of this line is deduced): tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); | - |
| 1549 | #endif | - |
| 1550 | | - |
| 1551 | isSubWindowsTiled = false; never executed (the execution status of this line is deduced): isSubWindowsTiled = false; | - |
| 1552 | | - |
| 1553 | foreach (QMdiSubWindow *subWindow, childWindows) never executed (the execution status of this line is deduced): 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;})) | - |
| 1554 | tabBar->addTab(subWindow->windowIcon(), tabTextFor(subWindow)); never executed: tabBar->addTab(subWindow->windowIcon(), tabTextFor(subWindow)); | 0 |
| 1555 | | - |
| 1556 | QMdiSubWindow *current = q->currentSubWindow(); never executed (the execution status of this line is deduced): QMdiSubWindow *current = q->currentSubWindow(); | - |
| 1557 | if (current) { | 0 |
| 1558 | tabBar->setCurrentIndex(childWindows.indexOf(current)); never executed (the execution status of this line is deduced): tabBar->setCurrentIndex(childWindows.indexOf(current)); | - |
| 1559 | // Restore sub-window (i.e. cleanup buttons in menu bar and window title). | - |
| 1560 | if (current->isMaximized()) never evaluated: current->isMaximized() | 0 |
| 1561 | current->showNormal(); never executed: current->showNormal(); | 0 |
| 1562 | | - |
| 1563 | viewMode = mode; never executed (the execution status of this line is deduced): viewMode = mode; | - |
| 1564 | | - |
| 1565 | // Now, maximize it. | - |
| 1566 | if (!q->testOption(QMdiArea::DontMaximizeSubWindowOnActivation)) { never evaluated: !q->testOption(QMdiArea::DontMaximizeSubWindowOnActivation) | 0 |
| 1567 | current->showMaximized(); never executed (the execution status of this line is deduced): current->showMaximized(); | - |
| 1568 | } | 0 |
| 1569 | } else { | 0 |
| 1570 | viewMode = mode; never executed (the execution status of this line is deduced): viewMode = mode; | - |
| 1571 | } | 0 |
| 1572 | | - |
| 1573 | if (q->isVisible()) never evaluated: q->isVisible() | 0 |
| 1574 | tabBar->show(); never executed: tabBar->show(); | 0 |
| 1575 | updateTabBarGeometry(); never executed (the execution status of this line is deduced): updateTabBarGeometry(); | - |
| 1576 | | - |
| 1577 | QObject::connect(tabBar, SIGNAL(currentChanged(int)), q, SLOT(_q_currentTabChanged(int))); never executed (the execution status of this line is deduced): QObject::connect(tabBar, "2""currentChanged(int)", q, "1""_q_currentTabChanged(int)"); | - |
| 1578 | QObject::connect(tabBar, SIGNAL(tabCloseRequested(int)), q, SLOT(_q_closeTab(int))); never executed (the execution status of this line is deduced): QObject::connect(tabBar, "2""tabCloseRequested(int)", q, "1""_q_closeTab(int)"); | - |
| 1579 | QObject::connect(tabBar, SIGNAL(tabMoved(int,int)), q, SLOT(_q_moveTab(int,int))); never executed (the execution status of this line is deduced): QObject::connect(tabBar, "2""tabMoved(int,int)", q, "1""_q_moveTab(int,int)"); | - |
| 1580 | } else | 0 |
| 1581 | #endif // QT_NO_TABBAR | - |
| 1582 | { // SubWindowView | - |
| 1583 | #ifndef QT_NO_TABBAR | - |
| 1584 | delete tabBar; never executed (the execution status of this line is deduced): delete tabBar; | - |
| 1585 | tabBar = 0; never executed (the execution status of this line is deduced): tabBar = 0; | - |
| 1586 | #endif // QT_NO_TABBAR | - |
| 1587 | | - |
| 1588 | viewMode = mode; never executed (the execution status of this line is deduced): viewMode = mode; | - |
| 1589 | q->setViewportMargins(0, 0, 0, 0); never executed (the execution status of this line is deduced): q->setViewportMargins(0, 0, 0, 0); | - |
| 1590 | indexToLastActiveTab = -1; never executed (the execution status of this line is deduced): indexToLastActiveTab = -1; | - |
| 1591 | | - |
| 1592 | QMdiSubWindow *current = q->currentSubWindow(); never executed (the execution status of this line is deduced): QMdiSubWindow *current = q->currentSubWindow(); | - |
| 1593 | if (current && current->isMaximized()) never evaluated: current never evaluated: current->isMaximized() | 0 |
| 1594 | current->showNormal(); never executed: current->showNormal(); | 0 |
| 1595 | } | 0 |
| 1596 | | - |
| 1597 | Q_ASSERT(viewMode == mode); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1598 | inViewModeChange = false; never executed (the execution status of this line is deduced): inViewModeChange = false; | - |
| 1599 | } | 0 |
| 1600 | | - |
| 1601 | #ifndef QT_NO_TABBAR | - |
| 1602 | /*! | - |
| 1603 | \internal | - |
| 1604 | */ | - |
| 1605 | void QMdiAreaPrivate::updateTabBarGeometry() | - |
| 1606 | { | - |
| 1607 | if (!tabBar) partially evaluated: !tabBar| yes Evaluation Count:97 | no Evaluation Count:0 |
| 0-97 |
| 1608 | return; executed: return;Execution Count:97 | 97 |
| 1609 | | - |
| 1610 | Q_Q(QMdiArea); never executed (the execution status of this line is deduced): QMdiArea * const q = q_func(); | - |
| 1611 | #ifndef QT_NO_TABWIDGET | - |
| 1612 | Q_ASSERT(tabBarShapeFrom(tabShape, tabPosition) == tabBar->shape()); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1613 | #endif | - |
| 1614 | const QSize tabBarSizeHint = tabBar->sizeHint(); never executed (the execution status of this line is deduced): const QSize tabBarSizeHint = tabBar->sizeHint(); | - |
| 1615 | | - |
| 1616 | int areaHeight = q->height(); never executed (the execution status of this line is deduced): int areaHeight = q->height(); | - |
| 1617 | if (hbar && hbar->isVisible()) never evaluated: hbar never evaluated: hbar->isVisible() | 0 |
| 1618 | areaHeight -= hbar->height(); never executed: areaHeight -= hbar->height(); | 0 |
| 1619 | | - |
| 1620 | int areaWidth = q->width(); never executed (the execution status of this line is deduced): int areaWidth = q->width(); | - |
| 1621 | if (vbar && vbar->isVisible()) never evaluated: vbar never evaluated: vbar->isVisible() | 0 |
| 1622 | areaWidth -= vbar->width(); never executed: areaWidth -= vbar->width(); | 0 |
| 1623 | | - |
| 1624 | QRect tabBarRect; never executed (the execution status of this line is deduced): QRect tabBarRect; | - |
| 1625 | #ifndef QT_NO_TABWIDGET | - |
| 1626 | switch (tabPosition) { | - |
| 1627 | case QTabWidget::North: | - |
| 1628 | q->setViewportMargins(0, tabBarSizeHint.height(), 0, 0); never executed (the execution status of this line is deduced): q->setViewportMargins(0, tabBarSizeHint.height(), 0, 0); | - |
| 1629 | tabBarRect = QRect(0, 0, areaWidth, tabBarSizeHint.height()); never executed (the execution status of this line is deduced): tabBarRect = QRect(0, 0, areaWidth, tabBarSizeHint.height()); | - |
| 1630 | break; | 0 |
| 1631 | case QTabWidget::South: | - |
| 1632 | q->setViewportMargins(0, 0, 0, tabBarSizeHint.height()); never executed (the execution status of this line is deduced): q->setViewportMargins(0, 0, 0, tabBarSizeHint.height()); | - |
| 1633 | tabBarRect = QRect(0, areaHeight - tabBarSizeHint.height(), areaWidth, tabBarSizeHint.height()); never executed (the execution status of this line is deduced): tabBarRect = QRect(0, areaHeight - tabBarSizeHint.height(), areaWidth, tabBarSizeHint.height()); | - |
| 1634 | break; | 0 |
| 1635 | case QTabWidget::East: | - |
| 1636 | if (q->layoutDirection() == Qt::LeftToRight) never evaluated: q->layoutDirection() == Qt::LeftToRight | 0 |
| 1637 | q->setViewportMargins(0, 0, tabBarSizeHint.width(), 0); never executed: q->setViewportMargins(0, 0, tabBarSizeHint.width(), 0); | 0 |
| 1638 | else | - |
| 1639 | q->setViewportMargins(tabBarSizeHint.width(), 0, 0, 0); never executed: q->setViewportMargins(tabBarSizeHint.width(), 0, 0, 0); | 0 |
| 1640 | tabBarRect = QRect(areaWidth - tabBarSizeHint.width(), 0, tabBarSizeHint.width(), areaHeight); never executed (the execution status of this line is deduced): tabBarRect = QRect(areaWidth - tabBarSizeHint.width(), 0, tabBarSizeHint.width(), areaHeight); | - |
| 1641 | break; | 0 |
| 1642 | case QTabWidget::West: | - |
| 1643 | if (q->layoutDirection() == Qt::LeftToRight) never evaluated: q->layoutDirection() == Qt::LeftToRight | 0 |
| 1644 | q->setViewportMargins(tabBarSizeHint.width(), 0, 0, 0); never executed: q->setViewportMargins(tabBarSizeHint.width(), 0, 0, 0); | 0 |
| 1645 | else | - |
| 1646 | q->setViewportMargins(0, 0, tabBarSizeHint.width(), 0); never executed: q->setViewportMargins(0, 0, tabBarSizeHint.width(), 0); | 0 |
| 1647 | tabBarRect = QRect(0, 0, tabBarSizeHint.width(), areaHeight); never executed (the execution status of this line is deduced): tabBarRect = QRect(0, 0, tabBarSizeHint.width(), areaHeight); | - |
| 1648 | break; | 0 |
| 1649 | default: | - |
| 1650 | break; | 0 |
| 1651 | } | - |
| 1652 | #endif // QT_NO_TABWIDGET | - |
| 1653 | | - |
| 1654 | tabBar->setGeometry(QStyle::visualRect(q->layoutDirection(), q->contentsRect(), tabBarRect)); never executed (the execution status of this line is deduced): tabBar->setGeometry(QStyle::visualRect(q->layoutDirection(), q->contentsRect(), tabBarRect)); | - |
| 1655 | } | 0 |
| 1656 | | - |
| 1657 | /*! | - |
| 1658 | \internal | - |
| 1659 | */ | - |
| 1660 | void QMdiAreaPrivate::refreshTabBar() | - |
| 1661 | { | - |
| 1662 | if (!tabBar) | 0 |
| 1663 | return; | 0 |
| 1664 | | - |
| 1665 | tabBar->setDocumentMode(documentMode); never executed (the execution status of this line is deduced): tabBar->setDocumentMode(documentMode); | - |
| 1666 | tabBar->setTabsClosable(tabsClosable); never executed (the execution status of this line is deduced): tabBar->setTabsClosable(tabsClosable); | - |
| 1667 | tabBar->setMovable(tabsMovable); never executed (the execution status of this line is deduced): tabBar->setMovable(tabsMovable); | - |
| 1668 | #ifndef QT_NO_TABWIDGET | - |
| 1669 | tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); never executed (the execution status of this line is deduced): tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); | - |
| 1670 | #endif | - |
| 1671 | updateTabBarGeometry(); never executed (the execution status of this line is deduced): updateTabBarGeometry(); | - |
| 1672 | } | 0 |
| 1673 | #endif // QT_NO_TABBAR | - |
| 1674 | | - |
| 1675 | /*! | - |
| 1676 | Constructs an empty mdi area. \a parent is passed to QWidget's | - |
| 1677 | constructor. | - |
| 1678 | */ | - |
| 1679 | QMdiArea::QMdiArea(QWidget *parent) | - |
| 1680 | : QAbstractScrollArea(*new QMdiAreaPrivate, parent) | - |
| 1681 | { | - |
| 1682 | setBackground(palette().brush(QPalette::Dark)); executed (the execution status of this line is deduced): setBackground(palette().brush(QPalette::Dark)); | - |
| 1683 | setFrameStyle(QFrame::NoFrame); executed (the execution status of this line is deduced): setFrameStyle(QFrame::NoFrame); | - |
| 1684 | setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); executed (the execution status of this line is deduced): setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | - |
| 1685 | setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); executed (the execution status of this line is deduced): setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | - |
| 1686 | setViewport(0); executed (the execution status of this line is deduced): setViewport(0); | - |
| 1687 | setFocusPolicy(Qt::NoFocus); executed (the execution status of this line is deduced): setFocusPolicy(Qt::NoFocus); | - |
| 1688 | QApplication::instance()->installEventFilter(this); executed (the execution status of this line is deduced): QApplication::instance()->installEventFilter(this); | - |
| 1689 | } executed: }Execution Count:80 | 80 |
| 1690 | | - |
| 1691 | /*! | - |
| 1692 | Destroys the MDI area. | - |
| 1693 | */ | - |
| 1694 | QMdiArea::~QMdiArea() | - |
| 1695 | { | - |
| 1696 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 1697 | delete d->cascader; executed (the execution status of this line is deduced): delete d->cascader; | - |
| 1698 | d->cascader = 0; executed (the execution status of this line is deduced): d->cascader = 0; | - |
| 1699 | | - |
| 1700 | delete d->regularTiler; executed (the execution status of this line is deduced): delete d->regularTiler; | - |
| 1701 | d->regularTiler = 0; executed (the execution status of this line is deduced): d->regularTiler = 0; | - |
| 1702 | | - |
| 1703 | delete d->iconTiler; executed (the execution status of this line is deduced): delete d->iconTiler; | - |
| 1704 | d->iconTiler = 0; executed (the execution status of this line is deduced): d->iconTiler = 0; | - |
| 1705 | | - |
| 1706 | delete d->placer; executed (the execution status of this line is deduced): delete d->placer; | - |
| 1707 | d->placer = 0; executed (the execution status of this line is deduced): d->placer = 0; | - |
| 1708 | } executed: }Execution Count:77 | 77 |
| 1709 | | - |
| 1710 | /*! | - |
| 1711 | \reimp | - |
| 1712 | */ | - |
| 1713 | QSize QMdiArea::sizeHint() const | - |
| 1714 | { | - |
| 1715 | // Calculate a proper scale factor for QDesktopWidget::size(). | - |
| 1716 | // This also takes into account that we can have nested workspaces. | - |
| 1717 | int nestedCount = 0; executed (the execution status of this line is deduced): int nestedCount = 0; | - |
| 1718 | QWidget *widget = this->parentWidget(); executed (the execution status of this line is deduced): QWidget *widget = this->parentWidget(); | - |
| 1719 | while (widget) { evaluated: widget| yes Evaluation Count:208 | yes Evaluation Count:141 |
| 141-208 |
| 1720 | if (qobject_cast<QMdiArea *>(widget)) evaluated: qobject_cast<QMdiArea *>(widget)| yes Evaluation Count:32 | yes Evaluation Count:176 |
| 32-176 |
| 1721 | ++nestedCount; executed: ++nestedCount;Execution Count:32 | 32 |
| 1722 | widget = widget->parentWidget(); executed (the execution status of this line is deduced): widget = widget->parentWidget(); | - |
| 1723 | } executed: }Execution Count:208 | 208 |
| 1724 | const int scaleFactor = 3 * (nestedCount + 1); executed (the execution status of this line is deduced): const int scaleFactor = 3 * (nestedCount + 1); | - |
| 1725 | | - |
| 1726 | QSize desktopSize = QApplication::desktop()->size(); executed (the execution status of this line is deduced): QSize desktopSize = QApplication::desktop()->size(); | - |
| 1727 | QSize size(desktopSize.width() * 2 / scaleFactor, desktopSize.height() * 2 / scaleFactor); executed (the execution status of this line is deduced): QSize size(desktopSize.width() * 2 / scaleFactor, desktopSize.height() * 2 / scaleFactor); | - |
| 1728 | foreach (QMdiSubWindow *child, d_func()->childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 1729 | if (!sanityCheck(child, "QMdiArea::sizeHint")) partially evaluated: !sanityCheck(child, "QMdiArea::sizeHint")| no Evaluation Count:0 | yes Evaluation Count:76 |
| 0-76 |
| 1730 | continue; never executed: continue; | 0 |
| 1731 | size = size.expandedTo(child->sizeHint()); executed (the execution status of this line is deduced): size = size.expandedTo(child->sizeHint()); | - |
| 1732 | } executed: }Execution Count:76 | 76 |
| 1733 | return size.expandedTo(QApplication::globalStrut()); executed: return size.expandedTo(QApplication::globalStrut());Execution Count:141 | 141 |
| 1734 | } | - |
| 1735 | | - |
| 1736 | /*! | - |
| 1737 | \reimp | - |
| 1738 | */ | - |
| 1739 | QSize QMdiArea::minimumSizeHint() const | - |
| 1740 | { | - |
| 1741 | Q_D(const QMdiArea); executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 1742 | QSize size(style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, this), executed (the execution status of this line is deduced): QSize size(style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, this), | - |
| 1743 | style()->pixelMetric(QStyle::PM_TitleBarHeight, 0, this)); executed (the execution status of this line is deduced): style()->pixelMetric(QStyle::PM_TitleBarHeight, 0, this)); | - |
| 1744 | size = size.expandedTo(QAbstractScrollArea::minimumSizeHint()); executed (the execution status of this line is deduced): size = size.expandedTo(QAbstractScrollArea::minimumSizeHint()); | - |
| 1745 | if (!d->scrollBarsEnabled()) { evaluated: !d->scrollBarsEnabled()| yes Evaluation Count:55 | yes Evaluation Count:1 |
| 1-55 |
| 1746 | foreach (QMdiSubWindow *child, d->childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 1747 | if (!sanityCheck(child, "QMdiArea::sizeHint")) partially evaluated: !sanityCheck(child, "QMdiArea::sizeHint")| no Evaluation Count:0 | yes Evaluation Count:18 |
| 0-18 |
| 1748 | continue; never executed: continue; | 0 |
| 1749 | size = size.expandedTo(child->minimumSizeHint()); executed (the execution status of this line is deduced): size = size.expandedTo(child->minimumSizeHint()); | - |
| 1750 | } executed: }Execution Count:18 | 18 |
| 1751 | } executed: }Execution Count:55 | 55 |
| 1752 | return size.expandedTo(QApplication::globalStrut()); executed: return size.expandedTo(QApplication::globalStrut());Execution Count:56 | 56 |
| 1753 | } | - |
| 1754 | | - |
| 1755 | /*! | - |
| 1756 | Returns a pointer to the current subwindow, or 0 if there is | - |
| 1757 | no current subwindow. | - |
| 1758 | | - |
| 1759 | This function will return the same as activeSubWindow() if | - |
| 1760 | the QApplication containing QMdiArea is active. | - |
| 1761 | | - |
| 1762 | \sa activeSubWindow(), QApplication::activeWindow() | - |
| 1763 | */ | - |
| 1764 | QMdiSubWindow *QMdiArea::currentSubWindow() const | - |
| 1765 | { | - |
| 1766 | Q_D(const QMdiArea); executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 1767 | if (d->childWindows.isEmpty()) evaluated: d->childWindows.isEmpty()| yes Evaluation Count:66 | yes Evaluation Count:78 |
| 66-78 |
| 1768 | return 0; executed: return 0;Execution Count:66 | 66 |
| 1769 | | - |
| 1770 | if (d->active) evaluated: d->active| yes Evaluation Count:75 | yes Evaluation Count:3 |
| 3-75 |
| 1771 | return d->active; executed: return d->active;Execution Count:75 | 75 |
| 1772 | | - |
| 1773 | 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 |
| 1774 | return 0; executed: return 0;Execution Count:3 | 3 |
| 1775 | | - |
| 1776 | Q_ASSERT(d->indicesToActivatedChildren.count() > 0); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1777 | int index = d->indicesToActivatedChildren.at(0); never executed (the execution status of this line is deduced): int index = d->indicesToActivatedChildren.at(0); | - |
| 1778 | Q_ASSERT(index >= 0 && index < d->childWindows.size()); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1779 | QMdiSubWindow *current = d->childWindows.at(index); never executed (the execution status of this line is deduced): QMdiSubWindow *current = d->childWindows.at(index); | - |
| 1780 | Q_ASSERT(current); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 1781 | return current; never executed: return current; | 0 |
| 1782 | } | - |
| 1783 | | - |
| 1784 | /*! | - |
| 1785 | Returns a pointer to the current active subwindow. If no | - |
| 1786 | window is currently active, 0 is returned. | - |
| 1787 | | - |
| 1788 | Subwindows are treated as top-level windows with respect to | - |
| 1789 | window state, i.e., if a widget outside the MDI area is the active | - |
| 1790 | window, no subwindow will be active. Note that if a widget in the | - |
| 1791 | window in which the MDI area lives gains focus, the window will be | - |
| 1792 | activated. | - |
| 1793 | | - |
| 1794 | \sa setActiveSubWindow(), Qt::WindowState | - |
| 1795 | */ | - |
| 1796 | QMdiSubWindow *QMdiArea::activeSubWindow() const | - |
| 1797 | { | - |
| 1798 | Q_D(const QMdiArea); executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 1799 | return d->active; executed: return d->active;Execution Count:9 | 9 |
| 1800 | } | - |
| 1801 | | - |
| 1802 | /*! | - |
| 1803 | Activates the subwindow \a window. If \a window is 0, any | - |
| 1804 | current active window is deactivated. | - |
| 1805 | | - |
| 1806 | \sa activeSubWindow() | - |
| 1807 | */ | - |
| 1808 | void QMdiArea::setActiveSubWindow(QMdiSubWindow *window) | - |
| 1809 | { | - |
| 1810 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 1811 | if (!window) { evaluated: !window| yes Evaluation Count:6 | yes Evaluation Count:7 |
| 6-7 |
| 1812 | d->activateWindow(0); executed (the execution status of this line is deduced): d->activateWindow(0); | - |
| 1813 | return; executed: return;Execution Count:6 | 6 |
| 1814 | } | - |
| 1815 | | - |
| 1816 | if (d->childWindows.isEmpty()) { partially evaluated: d->childWindows.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
| 1817 | qWarning("QMdiArea::setActiveSubWindow: workspace is empty"); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 1817, __PRETTY_FUNCTION__).warning("QMdiArea::setActiveSubWindow: workspace is empty"); | - |
| 1818 | return; | 0 |
| 1819 | } | - |
| 1820 | | - |
| 1821 | if (d->childWindows.indexOf(window) == -1) { partially evaluated: d->childWindows.indexOf(window) == -1| no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
| 1822 | qWarning("QMdiArea::setActiveSubWindow: window is not inside workspace"); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 1822, __PRETTY_FUNCTION__).warning("QMdiArea::setActiveSubWindow: window is not inside workspace"); | - |
| 1823 | return; | 0 |
| 1824 | } | - |
| 1825 | | - |
| 1826 | d->activateWindow(window); executed (the execution status of this line is deduced): d->activateWindow(window); | - |
| 1827 | } executed: }Execution Count:7 | 7 |
| 1828 | | - |
| 1829 | /*! | - |
| 1830 | Closes the active subwindow. | - |
| 1831 | | - |
| 1832 | \sa closeAllSubWindows() | - |
| 1833 | */ | - |
| 1834 | void QMdiArea::closeActiveSubWindow() | - |
| 1835 | { | - |
| 1836 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 1837 | if (d->active) never evaluated: d->active | 0 |
| 1838 | d->active->close(); never executed: d->active->close(); | 0 |
| 1839 | } | 0 |
| 1840 | | - |
| 1841 | /*! | - |
| 1842 | Returns a list of all subwindows in the MDI area. If \a order is | - |
| 1843 | CreationOrder (the default), the windows are sorted in the order | - |
| 1844 | in which they were inserted into the workspace. If \a order is | - |
| 1845 | StackingOrder, the windows are listed in their stacking order, | - |
| 1846 | with the topmost window as the last item in the list. If \a order | - |
| 1847 | is ActivationHistoryOrder, the windows are listed according to | - |
| 1848 | their recent activation history. | - |
| 1849 | | - |
| 1850 | \sa WindowOrder | - |
| 1851 | */ | - |
| 1852 | QList<QMdiSubWindow *> QMdiArea::subWindowList(WindowOrder order) const | - |
| 1853 | { | - |
| 1854 | Q_D(const QMdiArea); executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 1855 | return d->subWindowList(order, false); executed: return d->subWindowList(order, false);Execution Count:14 | 14 |
| 1856 | } | - |
| 1857 | | - |
| 1858 | /*! | - |
| 1859 | Closes all subwindows by sending a QCloseEvent to each window. | - |
| 1860 | You may receive subWindowActivated() signals from subwindows | - |
| 1861 | before they are closed (if the MDI area activates the subwindow | - |
| 1862 | when another is closing). | - |
| 1863 | | - |
| 1864 | Subwindows that ignore the close event will remain open. | - |
| 1865 | | - |
| 1866 | \sa closeActiveSubWindow() | - |
| 1867 | */ | - |
| 1868 | void QMdiArea::closeAllSubWindows() | - |
| 1869 | { | - |
| 1870 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 1871 | if (d->childWindows.isEmpty()) never evaluated: d->childWindows.isEmpty() | 0 |
| 1872 | return; | 0 |
| 1873 | | - |
| 1874 | d->isSubWindowsTiled = false; never executed (the execution status of this line is deduced): d->isSubWindowsTiled = false; | - |
| 1875 | foreach (QMdiSubWindow *child, d->childWindows) { never executed (the execution status of this line is deduced): 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;})) { | - |
| 1876 | if (!sanityCheck(child, "QMdiArea::closeAllSubWindows")) never evaluated: !sanityCheck(child, "QMdiArea::closeAllSubWindows") | 0 |
| 1877 | continue; never executed: continue; | 0 |
| 1878 | child->close(); never executed (the execution status of this line is deduced): child->close(); | - |
| 1879 | } | 0 |
| 1880 | | - |
| 1881 | d->updateScrollBars(); never executed (the execution status of this line is deduced): d->updateScrollBars(); | - |
| 1882 | } | 0 |
| 1883 | | - |
| 1884 | /*! | - |
| 1885 | Gives the keyboard focus to another window in the list of child | - |
| 1886 | windows. The window activated will be the next one determined | - |
| 1887 | by the current \l{QMdiArea::WindowOrder} {activation order}. | - |
| 1888 | | - |
| 1889 | \sa activatePreviousSubWindow(), QMdiArea::WindowOrder | - |
| 1890 | */ | - |
| 1891 | void QMdiArea::activateNextSubWindow() | - |
| 1892 | { | - |
| 1893 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 1894 | if (d->childWindows.isEmpty()) partially evaluated: d->childWindows.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
| 1895 | return; | 0 |
| 1896 | | - |
| 1897 | QMdiSubWindow *next = d->nextVisibleSubWindow(1, d->activationOrder); executed (the execution status of this line is deduced): QMdiSubWindow *next = d->nextVisibleSubWindow(1, d->activationOrder); | - |
| 1898 | if (next) partially evaluated: next| yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
| 1899 | d->activateWindow(next); executed: d->activateWindow(next);Execution Count:6 | 6 |
| 1900 | } executed: }Execution Count:6 | 6 |
| 1901 | | - |
| 1902 | /*! | - |
| 1903 | Gives the keyboard focus to another window in the list of child | - |
| 1904 | windows. The window activated will be the previous one determined | - |
| 1905 | by the current \l{QMdiArea::WindowOrder} {activation order}. | - |
| 1906 | | - |
| 1907 | \sa activateNextSubWindow(), QMdiArea::WindowOrder | - |
| 1908 | */ | - |
| 1909 | void QMdiArea::activatePreviousSubWindow() | - |
| 1910 | { | - |
| 1911 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 1912 | if (d->childWindows.isEmpty()) never evaluated: d->childWindows.isEmpty() | 0 |
| 1913 | return; | 0 |
| 1914 | | - |
| 1915 | QMdiSubWindow *previous = d->nextVisibleSubWindow(-1, d->activationOrder); never executed (the execution status of this line is deduced): QMdiSubWindow *previous = d->nextVisibleSubWindow(-1, d->activationOrder); | - |
| 1916 | if (previous) never evaluated: previous | 0 |
| 1917 | d->activateWindow(previous); never executed: d->activateWindow(previous); | 0 |
| 1918 | } | 0 |
| 1919 | | - |
| 1920 | /*! | - |
| 1921 | Adds \a widget as a new subwindow to the MDI area. If \a | - |
| 1922 | windowFlags are non-zero, they will override the flags set on the | - |
| 1923 | widget. | - |
| 1924 | | - |
| 1925 | The \a widget can be either a QMdiSubWindow or another QWidget | - |
| 1926 | (in which case the MDI area will create a subwindow and set the \a | - |
| 1927 | widget as the internal widget). | - |
| 1928 | | - |
| 1929 | \note Once the subwindow has been added, its parent will be the | - |
| 1930 | \e{viewport widget} of the QMdiArea. | - |
| 1931 | | - |
| 1932 | \snippet mdiareasnippets.cpp 1 | - |
| 1933 | | - |
| 1934 | When you create your own subwindow, you must set the | - |
| 1935 | Qt::WA_DeleteOnClose widget attribute if you want the window to be | - |
| 1936 | deleted when closed in the MDI area. If not, the window will be | - |
| 1937 | hidden and the MDI area will not activate the next subwindow. | - |
| 1938 | | - |
| 1939 | Returns the QMdiSubWindow that is added to the MDI area. | - |
| 1940 | | - |
| 1941 | \sa removeSubWindow() | - |
| 1942 | */ | - |
| 1943 | QMdiSubWindow *QMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags windowFlags) | - |
| 1944 | { | - |
| 1945 | if (!widget) { partially evaluated: !widget| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 1946 | qWarning("QMdiArea::addSubWindow: null pointer to widget"); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 1946, __PRETTY_FUNCTION__).warning("QMdiArea::addSubWindow: null pointer to widget"); | - |
| 1947 | return 0; never executed: return 0; | 0 |
| 1948 | } | - |
| 1949 | | - |
| 1950 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 1951 | // QWidget::setParent clears focusWidget so store it | - |
| 1952 | QWidget *childFocus = widget->focusWidget(); executed (the execution status of this line is deduced): QWidget *childFocus = widget->focusWidget(); | - |
| 1953 | QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(widget); executed (the execution status of this line is deduced): QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(widget); | - |
| 1954 | | - |
| 1955 | // Widget is already a QMdiSubWindow | - |
| 1956 | if (child) { evaluated: child| yes Evaluation Count:19 | yes Evaluation Count:82 |
| 19-82 |
| 1957 | if (d->childWindows.indexOf(child) != -1) { partially evaluated: d->childWindows.indexOf(child) != -1| no Evaluation Count:0 | yes Evaluation Count:19 |
| 0-19 |
| 1958 | qWarning("QMdiArea::addSubWindow: window is already added"); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 1958, __PRETTY_FUNCTION__).warning("QMdiArea::addSubWindow: window is already added"); | - |
| 1959 | return child; never executed: return child; | 0 |
| 1960 | } | - |
| 1961 | child->setParent(viewport(), windowFlags ? windowFlags : child->windowFlags()); executed (the execution status of this line is deduced): child->setParent(viewport(), windowFlags ? windowFlags : child->windowFlags()); | - |
| 1962 | // Create a QMdiSubWindow | - |
| 1963 | } else { executed: }Execution Count:19 | 19 |
| 1964 | child = new QMdiSubWindow(viewport(), windowFlags); executed (the execution status of this line is deduced): child = new QMdiSubWindow(viewport(), windowFlags); | - |
| 1965 | child->setAttribute(Qt::WA_DeleteOnClose); executed (the execution status of this line is deduced): child->setAttribute(Qt::WA_DeleteOnClose); | - |
| 1966 | child->setWidget(widget); executed (the execution status of this line is deduced): child->setWidget(widget); | - |
| 1967 | Q_ASSERT(child->testAttribute(Qt::WA_DeleteOnClose)); executed (the execution status of this line is deduced): qt_noop(); | - |
| 1968 | } executed: }Execution Count:82 | 82 |
| 1969 | | - |
| 1970 | if (childFocus) partially evaluated: childFocus| no Evaluation Count:0 | yes Evaluation Count:101 |
| 0-101 |
| 1971 | childFocus->setFocus(); never executed: childFocus->setFocus(); | 0 |
| 1972 | d->appendChild(child); executed (the execution status of this line is deduced): d->appendChild(child); | - |
| 1973 | return child; executed: return child;Execution Count:101 | 101 |
| 1974 | } | - |
| 1975 | | - |
| 1976 | /*! | - |
| 1977 | Removes \a widget from the MDI area. The \a widget must be | - |
| 1978 | either a QMdiSubWindow or a widget that is the internal widget of | - |
| 1979 | a subwindow. Note \a widget is never actually deleted by QMdiArea. | - |
| 1980 | If a QMdiSubWindow is passed in its parent is set to 0 and it is | - |
| 1981 | removed, but if an internal widget is passed in the child widget | - |
| 1982 | is set to 0 but the QMdiSubWindow is not removed. | - |
| 1983 | | - |
| 1984 | \sa addSubWindow() | - |
| 1985 | */ | - |
| 1986 | void QMdiArea::removeSubWindow(QWidget *widget) | - |
| 1987 | { | - |
| 1988 | if (!widget) { | 0 |
| 1989 | qWarning("QMdiArea::removeSubWindow: null pointer to widget"); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 1989, __PRETTY_FUNCTION__).warning("QMdiArea::removeSubWindow: null pointer to widget"); | - |
| 1990 | return; | 0 |
| 1991 | } | - |
| 1992 | | - |
| 1993 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 1994 | if (d->childWindows.isEmpty()) never evaluated: d->childWindows.isEmpty() | 0 |
| 1995 | return; | 0 |
| 1996 | | - |
| 1997 | if (QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(widget)) { never evaluated: QMdiSubWindow *child = qobject_cast<QMdiSubWindow *>(widget) | 0 |
| 1998 | int index = d->childWindows.indexOf(child); never executed (the execution status of this line is deduced): int index = d->childWindows.indexOf(child); | - |
| 1999 | if (index == -1) { never evaluated: index == -1 | 0 |
| 2000 | qWarning("QMdiArea::removeSubWindow: window is not inside workspace"); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 2000, __PRETTY_FUNCTION__).warning("QMdiArea::removeSubWindow: window is not inside workspace"); | - |
| 2001 | return; | 0 |
| 2002 | } | - |
| 2003 | d->disconnectSubWindow(child); never executed (the execution status of this line is deduced): d->disconnectSubWindow(child); | - |
| 2004 | d->childWindows.removeAll(child); never executed (the execution status of this line is deduced): d->childWindows.removeAll(child); | - |
| 2005 | d->indicesToActivatedChildren.removeAll(index); never executed (the execution status of this line is deduced): d->indicesToActivatedChildren.removeAll(index); | - |
| 2006 | d->updateActiveWindow(index, d->active == child); never executed (the execution status of this line is deduced): d->updateActiveWindow(index, d->active == child); | - |
| 2007 | child->setParent(0); never executed (the execution status of this line is deduced): child->setParent(0); | - |
| 2008 | return; | 0 |
| 2009 | } | - |
| 2010 | | - |
| 2011 | bool found = false; never executed (the execution status of this line is deduced): bool found = false; | - |
| 2012 | foreach (QMdiSubWindow *child, d->childWindows) { never executed (the execution status of this line is deduced): 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;})) { | - |
| 2013 | if (!sanityCheck(child, "QMdiArea::removeSubWindow")) never evaluated: !sanityCheck(child, "QMdiArea::removeSubWindow") | 0 |
| 2014 | continue; never executed: continue; | 0 |
| 2015 | if (child->widget() == widget) { never evaluated: child->widget() == widget | 0 |
| 2016 | child->setWidget(0); never executed (the execution status of this line is deduced): child->setWidget(0); | - |
| 2017 | Q_ASSERT(!child->widget()); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 2018 | found = true; never executed (the execution status of this line is deduced): found = true; | - |
| 2019 | break; | 0 |
| 2020 | } | - |
| 2021 | } | 0 |
| 2022 | | - |
| 2023 | if (!found) | 0 |
| 2024 | qWarning("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 |
| 2025 | } | 0 |
| 2026 | | - |
| 2027 | /*! | - |
| 2028 | \property QMdiArea::background | - |
| 2029 | \brief the background brush for the workspace | - |
| 2030 | | - |
| 2031 | This property sets the background brush for the workspace area | - |
| 2032 | itself. By default, it is a gray color, but can be any brush | - |
| 2033 | (e.g., colors, gradients or pixmaps). | - |
| 2034 | */ | - |
| 2035 | QBrush QMdiArea::background() const | - |
| 2036 | { | - |
| 2037 | return d_func()->background; never executed: return d_func()->background; | 0 |
| 2038 | } | - |
| 2039 | | - |
| 2040 | void QMdiArea::setBackground(const QBrush &brush) | - |
| 2041 | { | - |
| 2042 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2043 | if (d->background != brush) { partially evaluated: d->background != brush| yes Evaluation Count:80 | no Evaluation Count:0 |
| 0-80 |
| 2044 | d->background = brush; executed (the execution status of this line is deduced): d->background = brush; | - |
| 2045 | d->viewport->setAttribute(Qt::WA_OpaquePaintEvent, brush.isOpaque()); executed (the execution status of this line is deduced): d->viewport->setAttribute(Qt::WA_OpaquePaintEvent, brush.isOpaque()); | - |
| 2046 | update(); executed (the execution status of this line is deduced): update(); | - |
| 2047 | } executed: }Execution Count:80 | 80 |
| 2048 | } executed: }Execution Count:80 | 80 |
| 2049 | | - |
| 2050 | | - |
| 2051 | /*! | - |
| 2052 | \property QMdiArea::activationOrder | - |
| 2053 | \brief the ordering criteria for subwindow lists | - |
| 2054 | \since 4.4 | - |
| 2055 | | - |
| 2056 | This property specifies the ordering criteria for the list of | - |
| 2057 | subwindows returned by subWindowList(). By default, it is the window | - |
| 2058 | creation order. | - |
| 2059 | | - |
| 2060 | \sa subWindowList() | - |
| 2061 | */ | - |
| 2062 | QMdiArea::WindowOrder QMdiArea::activationOrder() const | - |
| 2063 | { | - |
| 2064 | Q_D(const QMdiArea); never executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 2065 | return d->activationOrder; never executed: return d->activationOrder; | 0 |
| 2066 | } | - |
| 2067 | | - |
| 2068 | void QMdiArea::setActivationOrder(WindowOrder order) | - |
| 2069 | { | - |
| 2070 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2071 | if (order != d->activationOrder) never evaluated: order != d->activationOrder | 0 |
| 2072 | d->activationOrder = order; never executed: d->activationOrder = order; | 0 |
| 2073 | } | 0 |
| 2074 | | - |
| 2075 | /*! | - |
| 2076 | If \a on is true, \a option is enabled on the MDI area; otherwise | - |
| 2077 | it is disabled. See AreaOption for the effect of each option. | - |
| 2078 | | - |
| 2079 | \sa AreaOption, testOption() | - |
| 2080 | */ | - |
| 2081 | void QMdiArea::setOption(AreaOption option, bool on) | - |
| 2082 | { | - |
| 2083 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2084 | 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 |
| 2085 | d->options |= option; executed: d->options |= option;Execution Count:1 | 1 |
| 2086 | else if (!on && (d->options & option)) never evaluated: !on never evaluated: (d->options & option) | 0 |
| 2087 | d->options &= ~option; never executed: d->options &= ~option; | 0 |
| 2088 | } | - |
| 2089 | | - |
| 2090 | /*! | - |
| 2091 | Returns true if \a option is enabled; otherwise returns false. | - |
| 2092 | | - |
| 2093 | \sa AreaOption, setOption() | - |
| 2094 | */ | - |
| 2095 | bool QMdiArea::testOption(AreaOption option) const | - |
| 2096 | { | - |
| 2097 | return d_func()->options & option; executed: return d_func()->options & option;Execution Count:11 | 11 |
| 2098 | } | - |
| 2099 | | - |
| 2100 | /*! | - |
| 2101 | \property QMdiArea::viewMode | - |
| 2102 | \brief the way sub-windows are displayed in the QMdiArea. | - |
| 2103 | \since 4.4 | - |
| 2104 | | - |
| 2105 | By default, the SubWindowView is used to display sub-windows. | - |
| 2106 | | - |
| 2107 | \sa ViewMode, setTabShape(), setTabPosition() | - |
| 2108 | */ | - |
| 2109 | QMdiArea::ViewMode QMdiArea::viewMode() const | - |
| 2110 | { | - |
| 2111 | Q_D(const QMdiArea); executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 2112 | return d->viewMode; executed: return d->viewMode;Execution Count:5513 | 5513 |
| 2113 | } | - |
| 2114 | | - |
| 2115 | void QMdiArea::setViewMode(ViewMode mode) | - |
| 2116 | { | - |
| 2117 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2118 | d->setViewMode(mode); never executed (the execution status of this line is deduced): d->setViewMode(mode); | - |
| 2119 | } | 0 |
| 2120 | | - |
| 2121 | #ifndef QT_NO_TABBAR | - |
| 2122 | /*! | - |
| 2123 | \property QMdiArea::documentMode | - |
| 2124 | \brief whether the tab bar is set to document mode in tabbed view mode. | - |
| 2125 | \since 4.5 | - |
| 2126 | | - |
| 2127 | Document mode is disabled by default. | - |
| 2128 | | - |
| 2129 | \sa QTabBar::documentMode, setViewMode() | - |
| 2130 | */ | - |
| 2131 | bool QMdiArea::documentMode() const | - |
| 2132 | { | - |
| 2133 | Q_D(const QMdiArea); never executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 2134 | return d->documentMode; never executed: return d->documentMode; | 0 |
| 2135 | } | - |
| 2136 | | - |
| 2137 | void QMdiArea::setDocumentMode(bool enabled) | - |
| 2138 | { | - |
| 2139 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2140 | if (d->documentMode == enabled) never evaluated: d->documentMode == enabled | 0 |
| 2141 | return; | 0 |
| 2142 | | - |
| 2143 | d->documentMode = enabled; never executed (the execution status of this line is deduced): d->documentMode = enabled; | - |
| 2144 | d->refreshTabBar(); never executed (the execution status of this line is deduced): d->refreshTabBar(); | - |
| 2145 | } | 0 |
| 2146 | | - |
| 2147 | /*! | - |
| 2148 | \property QMdiArea::tabsClosable | - |
| 2149 | \brief whether the tab bar should place close buttons on each tab in tabbed view mode. | - |
| 2150 | \since 4.8 | - |
| 2151 | | - |
| 2152 | Tabs are not closable by default. | - |
| 2153 | | - |
| 2154 | \sa QTabBar::tabsClosable, setViewMode() | - |
| 2155 | */ | - |
| 2156 | bool QMdiArea::tabsClosable() const | - |
| 2157 | { | - |
| 2158 | Q_D(const QMdiArea); never executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 2159 | return d->tabsClosable; never executed: return d->tabsClosable; | 0 |
| 2160 | } | - |
| 2161 | | - |
| 2162 | void QMdiArea::setTabsClosable(bool closable) | - |
| 2163 | { | - |
| 2164 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2165 | if (d->tabsClosable == closable) never evaluated: d->tabsClosable == closable | 0 |
| 2166 | return; | 0 |
| 2167 | | - |
| 2168 | d->tabsClosable = closable; never executed (the execution status of this line is deduced): d->tabsClosable = closable; | - |
| 2169 | d->refreshTabBar(); never executed (the execution status of this line is deduced): d->refreshTabBar(); | - |
| 2170 | } | 0 |
| 2171 | | - |
| 2172 | /*! | - |
| 2173 | \property QMdiArea::tabsMovable | - |
| 2174 | \brief whether the user can move the tabs within the tabbar area in tabbed view mode. | - |
| 2175 | \since 4.8 | - |
| 2176 | | - |
| 2177 | Tabs are not movable by default. | - |
| 2178 | | - |
| 2179 | \sa QTabBar::movable, setViewMode() | - |
| 2180 | */ | - |
| 2181 | bool QMdiArea::tabsMovable() const | - |
| 2182 | { | - |
| 2183 | Q_D(const QMdiArea); never executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 2184 | return d->tabsMovable; never executed: return d->tabsMovable; | 0 |
| 2185 | } | - |
| 2186 | | - |
| 2187 | void QMdiArea::setTabsMovable(bool movable) | - |
| 2188 | { | - |
| 2189 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2190 | if (d->tabsMovable == movable) never evaluated: d->tabsMovable == movable | 0 |
| 2191 | return; | 0 |
| 2192 | | - |
| 2193 | d->tabsMovable = movable; never executed (the execution status of this line is deduced): d->tabsMovable = movable; | - |
| 2194 | d->refreshTabBar(); never executed (the execution status of this line is deduced): d->refreshTabBar(); | - |
| 2195 | } | 0 |
| 2196 | #endif // QT_NO_TABBAR | - |
| 2197 | | - |
| 2198 | #ifndef QT_NO_TABWIDGET | - |
| 2199 | /*! | - |
| 2200 | \property QMdiArea::tabShape | - |
| 2201 | \brief the shape of the tabs in tabbed view mode. | - |
| 2202 | \since 4.4 | - |
| 2203 | | - |
| 2204 | Possible values for this property are QTabWidget::Rounded | - |
| 2205 | (default) or QTabWidget::Triangular. | - |
| 2206 | | - |
| 2207 | \sa QTabWidget::TabShape, setViewMode() | - |
| 2208 | */ | - |
| 2209 | QTabWidget::TabShape QMdiArea::tabShape() const | - |
| 2210 | { | - |
| 2211 | Q_D(const QMdiArea); never executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 2212 | return d->tabShape; never executed: return d->tabShape; | 0 |
| 2213 | } | - |
| 2214 | | - |
| 2215 | void QMdiArea::setTabShape(QTabWidget::TabShape shape) | - |
| 2216 | { | - |
| 2217 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2218 | if (d->tabShape == shape) never evaluated: d->tabShape == shape | 0 |
| 2219 | return; | 0 |
| 2220 | | - |
| 2221 | d->tabShape = shape; never executed (the execution status of this line is deduced): d->tabShape = shape; | - |
| 2222 | d->refreshTabBar(); never executed (the execution status of this line is deduced): d->refreshTabBar(); | - |
| 2223 | } | 0 |
| 2224 | | - |
| 2225 | /*! | - |
| 2226 | \property QMdiArea::tabPosition | - |
| 2227 | \brief the position of the tabs in tabbed view mode. | - |
| 2228 | \since 4.4 | - |
| 2229 | | - |
| 2230 | Possible values for this property are described by the | - |
| 2231 | QTabWidget::TabPosition enum. | - |
| 2232 | | - |
| 2233 | \sa QTabWidget::TabPosition, setViewMode() | - |
| 2234 | */ | - |
| 2235 | QTabWidget::TabPosition QMdiArea::tabPosition() const | - |
| 2236 | { | - |
| 2237 | Q_D(const QMdiArea); never executed (the execution status of this line is deduced): const QMdiAreaPrivate * const d = d_func(); | - |
| 2238 | return d->tabPosition; never executed: return d->tabPosition; | 0 |
| 2239 | } | - |
| 2240 | | - |
| 2241 | void QMdiArea::setTabPosition(QTabWidget::TabPosition position) | - |
| 2242 | { | - |
| 2243 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2244 | if (d->tabPosition == position) never evaluated: d->tabPosition == position | 0 |
| 2245 | return; | 0 |
| 2246 | | - |
| 2247 | d->tabPosition = position; never executed (the execution status of this line is deduced): d->tabPosition = position; | - |
| 2248 | d->refreshTabBar(); never executed (the execution status of this line is deduced): d->refreshTabBar(); | - |
| 2249 | } | 0 |
| 2250 | #endif // QT_NO_TABWIDGET | - |
| 2251 | | - |
| 2252 | /*! | - |
| 2253 | \reimp | - |
| 2254 | */ | - |
| 2255 | void QMdiArea::childEvent(QChildEvent *childEvent) | - |
| 2256 | { | - |
| 2257 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2258 | if (childEvent->type() == QEvent::ChildPolished) { evaluated: childEvent->type() == QEvent::ChildPolished| yes Evaluation Count:231 | yes Evaluation Count:300 |
| 231-300 |
| 2259 | 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 |
| 2260 | if (d->childWindows.indexOf(mdiChild) == -1) never evaluated: d->childWindows.indexOf(mdiChild) == -1 | 0 |
| 2261 | d->appendChild(mdiChild); never executed: d->appendChild(mdiChild); | 0 |
| 2262 | } | 0 |
| 2263 | } executed: }Execution Count:231 | 231 |
| 2264 | } executed: }Execution Count:531 | 531 |
| 2265 | | - |
| 2266 | /*! | - |
| 2267 | \reimp | - |
| 2268 | */ | - |
| 2269 | void QMdiArea::resizeEvent(QResizeEvent *resizeEvent) | - |
| 2270 | { | - |
| 2271 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2272 | if (d->childWindows.isEmpty()) { evaluated: d->childWindows.isEmpty()| yes Evaluation Count:57 | yes Evaluation Count:95 |
| 57-95 |
| 2273 | resizeEvent->ignore(); executed (the execution status of this line is deduced): resizeEvent->ignore(); | - |
| 2274 | return; executed: return;Execution Count:57 | 57 |
| 2275 | } | - |
| 2276 | | - |
| 2277 | #ifndef QT_NO_TABBAR | - |
| 2278 | d->updateTabBarGeometry(); executed (the execution status of this line is deduced): d->updateTabBarGeometry(); | - |
| 2279 | #endif | - |
| 2280 | | - |
| 2281 | // Re-tile the views if we're in tiled mode. Re-tile means we will change | - |
| 2282 | // the geometry of the children, which in turn means 'isSubWindowsTiled' | - |
| 2283 | // is set to false, so we have to update the state at the end. | - |
| 2284 | if (d->isSubWindowsTiled) { partially evaluated: d->isSubWindowsTiled| no Evaluation Count:0 | yes Evaluation Count:95 |
| 0-95 |
| 2285 | d->tileCalledFromResizeEvent = true; never executed (the execution status of this line is deduced): d->tileCalledFromResizeEvent = true; | - |
| 2286 | tileSubWindows(); never executed (the execution status of this line is deduced): tileSubWindows(); | - |
| 2287 | d->tileCalledFromResizeEvent = false; never executed (the execution status of this line is deduced): d->tileCalledFromResizeEvent = false; | - |
| 2288 | d->isSubWindowsTiled = true; never executed (the execution status of this line is deduced): d->isSubWindowsTiled = true; | - |
| 2289 | d->startResizeTimer(); never executed (the execution status of this line is deduced): d->startResizeTimer(); | - |
| 2290 | // We don't have scroll bars or any maximized views. | - |
| 2291 | return; | 0 |
| 2292 | } | - |
| 2293 | | - |
| 2294 | // Resize maximized views. | - |
| 2295 | bool hasMaximizedSubWindow = false; executed (the execution status of this line is deduced): bool hasMaximizedSubWindow = false; | - |
| 2296 | foreach (QMdiSubWindow *child, d->childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 2297 | 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 |
| 2298 | && child->size() != resizeEvent->size()) { partially evaluated: child->size() != resizeEvent->size()| yes Evaluation Count:45 | no Evaluation Count:0 |
| 0-45 |
| 2299 | child->resize(resizeEvent->size()); executed (the execution status of this line is deduced): child->resize(resizeEvent->size()); | - |
| 2300 | if (!hasMaximizedSubWindow) evaluated: !hasMaximizedSubWindow| yes Evaluation Count:41 | yes Evaluation Count:4 |
| 4-41 |
| 2301 | hasMaximizedSubWindow = true; executed: hasMaximizedSubWindow = true;Execution Count:41 | 41 |
| 2302 | } executed: }Execution Count:45 | 45 |
| 2303 | } executed: }Execution Count:146 | 146 |
| 2304 | | - |
| 2305 | d->updateScrollBars(); executed (the execution status of this line is deduced): d->updateScrollBars(); | - |
| 2306 | | - |
| 2307 | // Minimized views are stacked under maximized views so there's | - |
| 2308 | // no need to re-arrange minimized views on-demand. Start a timer | - |
| 2309 | // just to make things faster with subsequent resize events. | - |
| 2310 | if (hasMaximizedSubWindow) evaluated: hasMaximizedSubWindow| yes Evaluation Count:41 | yes Evaluation Count:54 |
| 41-54 |
| 2311 | d->startResizeTimer(); executed: d->startResizeTimer();Execution Count:41 | 41 |
| 2312 | else | - |
| 2313 | d->arrangeMinimizedSubWindows(); executed: d->arrangeMinimizedSubWindows();Execution Count:54 | 54 |
| 2314 | } | - |
| 2315 | | - |
| 2316 | /*! | - |
| 2317 | \reimp | - |
| 2318 | */ | - |
| 2319 | void QMdiArea::timerEvent(QTimerEvent *timerEvent) | - |
| 2320 | { | - |
| 2321 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2322 | if (timerEvent->timerId() == d->resizeTimerId) { partially evaluated: timerEvent->timerId() == d->resizeTimerId| yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
| 2323 | killTimer(d->resizeTimerId); executed (the execution status of this line is deduced): killTimer(d->resizeTimerId); | - |
| 2324 | d->resizeTimerId = -1; executed (the execution status of this line is deduced): d->resizeTimerId = -1; | - |
| 2325 | d->arrangeMinimizedSubWindows(); executed (the execution status of this line is deduced): d->arrangeMinimizedSubWindows(); | - |
| 2326 | } else if (timerEvent->timerId() == d->tabToPreviousTimerId) { executed: }Execution Count:2 never evaluated: timerEvent->timerId() == d->tabToPreviousTimerId | 0-2 |
| 2327 | killTimer(d->tabToPreviousTimerId); never executed (the execution status of this line is deduced): killTimer(d->tabToPreviousTimerId); | - |
| 2328 | d->tabToPreviousTimerId = -1; never executed (the execution status of this line is deduced): d->tabToPreviousTimerId = -1; | - |
| 2329 | if (d->indexToHighlighted < 0) never evaluated: d->indexToHighlighted < 0 | 0 |
| 2330 | return; | 0 |
| 2331 | #ifndef QT_NO_RUBBERBAND | - |
| 2332 | // We're not doing a "quick switch" ... show rubber band. | - |
| 2333 | Q_ASSERT(d->indexToHighlighted < d->childWindows.size()); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 2334 | Q_ASSERT(d->rubberBand); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 2335 | d->showRubberBandFor(d->childWindows.at(d->indexToHighlighted)); never executed (the execution status of this line is deduced): d->showRubberBandFor(d->childWindows.at(d->indexToHighlighted)); | - |
| 2336 | #endif | - |
| 2337 | } | 0 |
| 2338 | } | - |
| 2339 | | - |
| 2340 | /*! | - |
| 2341 | \reimp | - |
| 2342 | */ | - |
| 2343 | void QMdiArea::showEvent(QShowEvent *showEvent) | - |
| 2344 | { | - |
| 2345 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2346 | if (!d->pendingRearrangements.isEmpty()) { partially evaluated: !d->pendingRearrangements.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:116 |
| 0-116 |
| 2347 | bool skipPlacement = false; never executed (the execution status of this line is deduced): bool skipPlacement = false; | - |
| 2348 | foreach (Rearranger *rearranger, d->pendingRearrangements) { never executed (the execution status of this line is deduced): 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;})) { | - |
| 2349 | // If this is the case, we don't have to lay out pending child windows | - |
| 2350 | // since the rearranger will find a placement for them. | - |
| 2351 | if (rearranger->type() != Rearranger::IconTiler && !skipPlacement) never evaluated: rearranger->type() != Rearranger::IconTiler never evaluated: !skipPlacement | 0 |
| 2352 | skipPlacement = true; never executed: skipPlacement = true; | 0 |
| 2353 | d->rearrange(rearranger); never executed (the execution status of this line is deduced): d->rearrange(rearranger); | - |
| 2354 | } | 0 |
| 2355 | d->pendingRearrangements.clear(); never executed (the execution status of this line is deduced): d->pendingRearrangements.clear(); | - |
| 2356 | | - |
| 2357 | if (skipPlacement && !d->pendingPlacements.isEmpty()) never evaluated: skipPlacement never evaluated: !d->pendingPlacements.isEmpty() | 0 |
| 2358 | d->pendingPlacements.clear(); never executed: d->pendingPlacements.clear(); | 0 |
| 2359 | } | 0 |
| 2360 | | - |
| 2361 | if (!d->pendingPlacements.isEmpty()) { evaluated: !d->pendingPlacements.isEmpty()| yes Evaluation Count:51 | yes Evaluation Count:65 |
| 51-65 |
| 2362 | foreach (QMdiSubWindow *window, d->pendingPlacements) { executed (the execution status of this line is deduced): 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;})) { | - |
| 2363 | if (!window) partially evaluated: !window| no Evaluation Count:0 | yes Evaluation Count:60 |
| 0-60 |
| 2364 | continue; never executed: continue; | 0 |
| 2365 | if (!window->testAttribute(Qt::WA_Resized)) { evaluated: !window->testAttribute(Qt::WA_Resized)| yes Evaluation Count:49 | yes Evaluation Count:11 |
| 11-49 |
| 2366 | QSize newSize(window->sizeHint().boundedTo(viewport()->size())); executed (the execution status of this line is deduced): QSize newSize(window->sizeHint().boundedTo(viewport()->size())); | - |
| 2367 | window->resize(newSize.expandedTo(qSmartMinSize(window))); executed (the execution status of this line is deduced): window->resize(newSize.expandedTo(qSmartMinSize(window))); | - |
| 2368 | } executed: }Execution Count:49 | 49 |
| 2369 | 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 |
| 2370 | && !window->isMaximized()) { partially evaluated: !window->isMaximized()| yes Evaluation Count:51 | no Evaluation Count:0 |
| 0-51 |
| 2371 | d->place(d->placer, window); executed (the execution status of this line is deduced): d->place(d->placer, window); | - |
| 2372 | } executed: }Execution Count:51 | 51 |
| 2373 | } executed: }Execution Count:60 | 60 |
| 2374 | d->pendingPlacements.clear(); executed (the execution status of this line is deduced): d->pendingPlacements.clear(); | - |
| 2375 | } executed: }Execution Count:51 | 51 |
| 2376 | | - |
| 2377 | d->setChildActivationEnabled(true); executed (the execution status of this line is deduced): d->setChildActivationEnabled(true); | - |
| 2378 | d->activateCurrentWindow(); executed (the execution status of this line is deduced): d->activateCurrentWindow(); | - |
| 2379 | | - |
| 2380 | QAbstractScrollArea::showEvent(showEvent); executed (the execution status of this line is deduced): QAbstractScrollArea::showEvent(showEvent); | - |
| 2381 | } executed: }Execution Count:116 | 116 |
| 2382 | | - |
| 2383 | /*! | - |
| 2384 | \reimp | - |
| 2385 | */ | - |
| 2386 | bool QMdiArea::viewportEvent(QEvent *event) | - |
| 2387 | { | - |
| 2388 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2389 | switch (event->type()) { | - |
| 2390 | case QEvent::ChildRemoved: { | - |
| 2391 | d->isSubWindowsTiled = false; executed (the execution status of this line is deduced): d->isSubWindowsTiled = false; | - |
| 2392 | QObject *removedChild = static_cast<QChildEvent *>(event)->child(); executed (the execution status of this line is deduced): QObject *removedChild = static_cast<QChildEvent *>(event)->child(); | - |
| 2393 | for (int i = 0; i < d->childWindows.size(); ++i) { evaluated: i < d->childWindows.size()| yes Evaluation Count:11 | yes Evaluation Count:1 |
| 1-11 |
| 2394 | QObject *child = d->childWindows.at(i); executed (the execution status of this line is deduced): QObject *child = d->childWindows.at(i); | - |
| 2395 | 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 |
| 2396 | || child->parent() != viewport()) { never evaluated: child->parent() != viewport() | 0 |
| 2397 | if (!testOption(DontMaximizeSubWindowOnActivation)) { partially evaluated: !testOption(DontMaximizeSubWindowOnActivation)| yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
| 2398 | // In this case we can only rely on the child being a QObject | - |
| 2399 | // (or 0), but let's try and see if we can get more information. | - |
| 2400 | QWidget *mdiChild = qobject_cast<QWidget *>(removedChild); executed (the execution status of this line is deduced): QWidget *mdiChild = qobject_cast<QWidget *>(removedChild); | - |
| 2401 | 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 |
| 2402 | d->showActiveWindowMaximized = true; executed: d->showActiveWindowMaximized = true;Execution Count:1 | 1 |
| 2403 | } executed: }Execution Count:11 | 11 |
| 2404 | d->disconnectSubWindow(child); executed (the execution status of this line is deduced): d->disconnectSubWindow(child); | - |
| 2405 | const bool activeRemoved = i == d->indicesToActivatedChildren.at(0); executed (the execution status of this line is deduced): const bool activeRemoved = i == d->indicesToActivatedChildren.at(0); | - |
| 2406 | d->childWindows.removeAt(i); executed (the execution status of this line is deduced): d->childWindows.removeAt(i); | - |
| 2407 | d->indicesToActivatedChildren.removeAll(i); executed (the execution status of this line is deduced): d->indicesToActivatedChildren.removeAll(i); | - |
| 2408 | d->updateActiveWindow(i, activeRemoved); executed (the execution status of this line is deduced): d->updateActiveWindow(i, activeRemoved); | - |
| 2409 | d->arrangeMinimizedSubWindows(); executed (the execution status of this line is deduced): d->arrangeMinimizedSubWindows(); | - |
| 2410 | break; executed: break;Execution Count:11 | 11 |
| 2411 | } | - |
| 2412 | } | 0 |
| 2413 | d->updateScrollBars(); executed (the execution status of this line is deduced): d->updateScrollBars(); | - |
| 2414 | break; executed: break;Execution Count:12 | 12 |
| 2415 | } | - |
| 2416 | case QEvent::Destroy: | - |
| 2417 | d->isSubWindowsTiled = false; never executed (the execution status of this line is deduced): d->isSubWindowsTiled = false; | - |
| 2418 | d->resetActiveWindow(); never executed (the execution status of this line is deduced): d->resetActiveWindow(); | - |
| 2419 | d->childWindows.clear(); never executed (the execution status of this line is deduced): d->childWindows.clear(); | - |
| 2420 | qWarning("QMdiArea: Deleting the view port is undefined, use setViewport instead."); never executed (the execution status of this line is deduced): QMessageLogger("widgets/qmdiarea.cpp", 2420, __PRETTY_FUNCTION__).warning("QMdiArea: Deleting the view port is undefined, use setViewport instead."); | - |
| 2421 | break; | 0 |
| 2422 | default: | - |
| 2423 | break; executed: break;Execution Count:1258 | 1258 |
| 2424 | } | - |
| 2425 | return QAbstractScrollArea::viewportEvent(event); executed: return QAbstractScrollArea::viewportEvent(event);Execution Count:1270 | 1270 |
| 2426 | } | - |
| 2427 | | - |
| 2428 | /*! | - |
| 2429 | \reimp | - |
| 2430 | */ | - |
| 2431 | void QMdiArea::scrollContentsBy(int dx, int dy) | - |
| 2432 | { | - |
| 2433 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2434 | const bool wasSubWindowsTiled = d->isSubWindowsTiled; never executed (the execution status of this line is deduced): const bool wasSubWindowsTiled = d->isSubWindowsTiled; | - |
| 2435 | d->ignoreGeometryChange = true; never executed (the execution status of this line is deduced): d->ignoreGeometryChange = true; | - |
| 2436 | viewport()->scroll(isLeftToRight() ? dx : -dx, dy); never executed (the execution status of this line is deduced): viewport()->scroll(isLeftToRight() ? dx : -dx, dy); | - |
| 2437 | d->arrangeMinimizedSubWindows(); never executed (the execution status of this line is deduced): d->arrangeMinimizedSubWindows(); | - |
| 2438 | d->ignoreGeometryChange = false; never executed (the execution status of this line is deduced): d->ignoreGeometryChange = false; | - |
| 2439 | if (wasSubWindowsTiled) never evaluated: wasSubWindowsTiled | 0 |
| 2440 | d->isSubWindowsTiled = true; never executed: d->isSubWindowsTiled = true; | 0 |
| 2441 | } | 0 |
| 2442 | | - |
| 2443 | /*! | - |
| 2444 | Arranges all child windows in a tile pattern. | - |
| 2445 | | - |
| 2446 | \sa cascadeSubWindows() | - |
| 2447 | */ | - |
| 2448 | void QMdiArea::tileSubWindows() | - |
| 2449 | { | - |
| 2450 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2451 | if (!d->regularTiler) never evaluated: !d->regularTiler | 0 |
| 2452 | d->regularTiler = new RegularTiler; never executed: d->regularTiler = new RegularTiler; | 0 |
| 2453 | d->rearrange(d->regularTiler); never executed (the execution status of this line is deduced): d->rearrange(d->regularTiler); | - |
| 2454 | } | 0 |
| 2455 | | - |
| 2456 | /*! | - |
| 2457 | Arranges all the child windows in a cascade pattern. | - |
| 2458 | | - |
| 2459 | \sa tileSubWindows() | - |
| 2460 | */ | - |
| 2461 | void QMdiArea::cascadeSubWindows() | - |
| 2462 | { | - |
| 2463 | Q_D(QMdiArea); never executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2464 | if (!d->cascader) never evaluated: !d->cascader | 0 |
| 2465 | d->cascader = new SimpleCascader; never executed: d->cascader = new SimpleCascader; | 0 |
| 2466 | d->rearrange(d->cascader); never executed (the execution status of this line is deduced): d->rearrange(d->cascader); | - |
| 2467 | } | 0 |
| 2468 | | - |
| 2469 | /*! | - |
| 2470 | \reimp | - |
| 2471 | */ | - |
| 2472 | bool QMdiArea::event(QEvent *event) | - |
| 2473 | { | - |
| 2474 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2475 | switch (event->type()) { | - |
| 2476 | #ifdef Q_WS_WIN | - |
| 2477 | // QWidgetPrivate::hide_helper activates another sub-window when closing a | - |
| 2478 | // modal dialog on Windows (see activateWindow() inside the ifdef). | - |
| 2479 | case QEvent::WindowUnblocked: | - |
| 2480 | d->activateCurrentWindow(); | - |
| 2481 | break; | - |
| 2482 | #endif | - |
| 2483 | case QEvent::WindowActivate: { | - |
| 2484 | d->isActivated = true; executed (the execution status of this line is deduced): d->isActivated = true; | - |
| 2485 | if (d->childWindows.isEmpty()) evaluated: d->childWindows.isEmpty()| yes Evaluation Count:22 | yes Evaluation Count:49 |
| 22-49 |
| 2486 | break; executed: break;Execution Count:22 | 22 |
| 2487 | if (!d->active) partially evaluated: !d->active| no Evaluation Count:0 | yes Evaluation Count:49 |
| 0-49 |
| 2488 | d->activateCurrentWindow(); never executed: d->activateCurrentWindow(); | 0 |
| 2489 | d->setChildActivationEnabled(false, true); executed (the execution status of this line is deduced): d->setChildActivationEnabled(false, true); | - |
| 2490 | break; executed: break;Execution Count:49 | 49 |
| 2491 | } | - |
| 2492 | case QEvent::WindowDeactivate: | - |
| 2493 | d->isActivated = false; executed (the execution status of this line is deduced): d->isActivated = false; | - |
| 2494 | d->setChildActivationEnabled(false, true); executed (the execution status of this line is deduced): d->setChildActivationEnabled(false, true); | - |
| 2495 | break; executed: break;Execution Count:26 | 26 |
| 2496 | case QEvent::StyleChange: | - |
| 2497 | // Re-tile the views if we're in tiled mode. Re-tile means we will change | - |
| 2498 | // the geometry of the children, which in turn means 'isSubWindowsTiled' | - |
| 2499 | // is set to false, so we have to update the state at the end. | - |
| 2500 | if (d->isSubWindowsTiled) { never evaluated: d->isSubWindowsTiled | 0 |
| 2501 | tileSubWindows(); never executed (the execution status of this line is deduced): tileSubWindows(); | - |
| 2502 | d->isSubWindowsTiled = true; never executed (the execution status of this line is deduced): d->isSubWindowsTiled = true; | - |
| 2503 | } | 0 |
| 2504 | break; | 0 |
| 2505 | case QEvent::WindowIconChange: | - |
| 2506 | foreach (QMdiSubWindow *window, d->childWindows) { never executed (the execution status of this line is deduced): 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;})) { | - |
| 2507 | if (sanityCheck(window, "QMdiArea::WindowIconChange")) never evaluated: sanityCheck(window, "QMdiArea::WindowIconChange") | 0 |
| 2508 | QApplication::sendEvent(window, event); never executed: QApplication::sendEvent(window, event); | 0 |
| 2509 | } | 0 |
| 2510 | break; | 0 |
| 2511 | case QEvent::Hide: | - |
| 2512 | d->setActive(d->active, false, false); executed (the execution status of this line is deduced): d->setActive(d->active, false, false); | - |
| 2513 | d->setChildActivationEnabled(false); executed (the execution status of this line is deduced): d->setChildActivationEnabled(false); | - |
| 2514 | break; executed: break;Execution Count:58 | 58 |
| 2515 | #ifndef QT_NO_TABBAR | - |
| 2516 | case QEvent::LayoutDirectionChange: | - |
| 2517 | d->updateTabBarGeometry(); executed (the execution status of this line is deduced): d->updateTabBarGeometry(); | - |
| 2518 | break; executed: break;Execution Count:2 | 2 |
| 2519 | #endif | - |
| 2520 | default: | - |
| 2521 | break; executed: break;Execution Count:2134 | 2134 |
| 2522 | } | - |
| 2523 | return QAbstractScrollArea::event(event); executed: return QAbstractScrollArea::event(event);Execution Count:2291 | 2291 |
| 2524 | } | - |
| 2525 | | - |
| 2526 | /*! | - |
| 2527 | \reimp | - |
| 2528 | */ | - |
| 2529 | bool QMdiArea::eventFilter(QObject *object, QEvent *event) | - |
| 2530 | { | - |
| 2531 | if (!object) partially evaluated: !object| no Evaluation Count:0 | yes Evaluation Count:71070 |
| 0-71070 |
| 2532 | return QAbstractScrollArea::eventFilter(object, event); never executed: return QAbstractScrollArea::eventFilter(object, event); | 0 |
| 2533 | | - |
| 2534 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2535 | // Global key events with Ctrl modifier. | - |
| 2536 | 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 |
| 2537 | | - |
| 2538 | QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); executed (the execution status of this line is deduced): QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); | - |
| 2539 | // Ingore key events without a Ctrl modifier (except for press/release on the modifier itself). | - |
| 2540 | #ifdef Q_WS_MAC | - |
| 2541 | if (!(keyEvent->modifiers() & Qt::MetaModifier) && keyEvent->key() != Qt::Key_Meta) | - |
| 2542 | #else | - |
| 2543 | 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 |
| 2544 | #endif | - |
| 2545 | return QAbstractScrollArea::eventFilter(object, event); executed: return QAbstractScrollArea::eventFilter(object, event);Execution Count:8 | 8 |
| 2546 | | - |
| 2547 | // Find closest mdi area (in case we have a nested workspace). | - |
| 2548 | QMdiArea *area = mdiAreaParent(static_cast<QWidget *>(object)); never executed (the execution status of this line is deduced): QMdiArea *area = mdiAreaParent(static_cast<QWidget *>(object)); | - |
| 2549 | if (!area) | 0 |
| 2550 | return QAbstractScrollArea::eventFilter(object, event); never executed: return QAbstractScrollArea::eventFilter(object, event); | 0 |
| 2551 | | - |
| 2552 | const bool keyPress = (event->type() == QEvent::KeyPress) ? true : false; never evaluated: (event->type() == QEvent::KeyPress) | 0 |
| 2553 | | - |
| 2554 | // 1) Ctrl-Tab once -> activate the previously active window. | - |
| 2555 | // 2) Ctrl-Tab (Tab, Tab, ...) -> iterate through all windows (activateNextSubWindow()). | - |
| 2556 | // 3) Ctrl-Shift-Tab (Tab, Tab, ...) -> iterate through all windows in the opposite | - |
| 2557 | // direction (activatePreviousSubWindow()) | - |
| 2558 | switch (keyEvent->key()) { | - |
| 2559 | #ifdef Q_WS_MAC | - |
| 2560 | case Qt::Key_Meta: | - |
| 2561 | #else | - |
| 2562 | case Qt::Key_Control: | - |
| 2563 | #endif | - |
| 2564 | if (keyPress) never evaluated: keyPress | 0 |
| 2565 | area->d_func()->startTabToPreviousTimer(); never executed: area->d_func()->startTabToPreviousTimer(); | 0 |
| 2566 | else | - |
| 2567 | area->d_func()->activateHighlightedWindow(); never executed: area->d_func()->activateHighlightedWindow(); | 0 |
| 2568 | break; | 0 |
| 2569 | case Qt::Key_Tab: | - |
| 2570 | case Qt::Key_Backtab: | - |
| 2571 | if (keyPress) never evaluated: keyPress | 0 |
| 2572 | 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 |
| 2573 | return true; never executed: return true; | 0 |
| 2574 | #ifndef QT_NO_RUBBERBAND | - |
| 2575 | case Qt::Key_Escape: | - |
| 2576 | area->d_func()->hideRubberBand(); never executed (the execution status of this line is deduced): area->d_func()->hideRubberBand(); | - |
| 2577 | break; | 0 |
| 2578 | #endif | - |
| 2579 | default: | - |
| 2580 | break; | 0 |
| 2581 | } | - |
| 2582 | return QAbstractScrollArea::eventFilter(object, event); never executed: return QAbstractScrollArea::eventFilter(object, event); | 0 |
| 2583 | } | - |
| 2584 | | - |
| 2585 | QMdiSubWindow *subWindow = qobject_cast<QMdiSubWindow *>(object); executed (the execution status of this line is deduced): QMdiSubWindow *subWindow = qobject_cast<QMdiSubWindow *>(object); | - |
| 2586 | | - |
| 2587 | if (!subWindow) { evaluated: !subWindow| yes Evaluation Count:49121 | yes Evaluation Count:21941 |
| 21941-49121 |
| 2588 | // QApplication events: | - |
| 2589 | 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 |
| 2590 | && 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 |
| 2591 | d->activateCurrentWindow(); executed (the execution status of this line is deduced): d->activateCurrentWindow(); | - |
| 2592 | } 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 |
| 2593 | d->setActive(d->active, false, false); never executed (the execution status of this line is deduced): d->setActive(d->active, false, false); | - |
| 2594 | } | 0 |
| 2595 | return QAbstractScrollArea::eventFilter(object, event); executed: return QAbstractScrollArea::eventFilter(object, event);Execution Count:49121 | 49121 |
| 2596 | } | - |
| 2597 | | - |
| 2598 | // QMdiSubWindow events: | - |
| 2599 | switch (event->type()) { | - |
| 2600 | case QEvent::Move: | - |
| 2601 | case QEvent::Resize: | - |
| 2602 | if (d->tileCalledFromResizeEvent) partially evaluated: d->tileCalledFromResizeEvent| no Evaluation Count:0 | yes Evaluation Count:1903 |
| 0-1903 |
| 2603 | break; | 0 |
| 2604 | d->updateScrollBars(); executed (the execution status of this line is deduced): d->updateScrollBars(); | - |
| 2605 | if (!subWindow->isMinimized()) evaluated: !subWindow->isMinimized()| yes Evaluation Count:1808 | yes Evaluation Count:95 |
| 95-1808 |
| 2606 | d->isSubWindowsTiled = false; executed: d->isSubWindowsTiled = false;Execution Count:1808 | 1808 |
| 2607 | break; executed: break;Execution Count:1903 | 1903 |
| 2608 | case QEvent::Show: | - |
| 2609 | #ifndef QT_NO_TABBAR | - |
| 2610 | if (d->tabBar) { partially evaluated: d->tabBar| no Evaluation Count:0 | yes Evaluation Count:791 |
| 0-791 |
| 2611 | const int tabIndex = d->childWindows.indexOf(subWindow); never executed (the execution status of this line is deduced): const int tabIndex = d->childWindows.indexOf(subWindow); | - |
| 2612 | if (!d->tabBar->isTabEnabled(tabIndex)) never evaluated: !d->tabBar->isTabEnabled(tabIndex) | 0 |
| 2613 | d->tabBar->setTabEnabled(tabIndex, true); never executed: d->tabBar->setTabEnabled(tabIndex, true); | 0 |
| 2614 | } | 0 |
| 2615 | #endif // QT_NO_TABBAR | - |
| 2616 | // fall through | - |
| 2617 | case QEvent::Hide: code before this statement executed: case QEvent::Hide:Execution Count:791 | 791 |
| 2618 | d->isSubWindowsTiled = false; executed (the execution status of this line is deduced): d->isSubWindowsTiled = false; | - |
| 2619 | break; executed: break;Execution Count:1509 | 1509 |
| 2620 | #ifndef QT_NO_RUBBERBAND | - |
| 2621 | case QEvent::Close: | - |
| 2622 | 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 |
| 2623 | d->hideRubberBand(); never executed: d->hideRubberBand(); | 0 |
| 2624 | break; executed: break;Execution Count:8 | 8 |
| 2625 | #endif | - |
| 2626 | #ifndef QT_NO_TABBAR | - |
| 2627 | case QEvent::WindowTitleChange: | - |
| 2628 | case QEvent::ModifiedChange: | - |
| 2629 | if (d->tabBar) partially evaluated: d->tabBar| no Evaluation Count:0 | yes Evaluation Count:85 |
| 0-85 |
| 2630 | d->tabBar->setTabText(d->childWindows.indexOf(subWindow), tabTextFor(subWindow)); never executed: d->tabBar->setTabText(d->childWindows.indexOf(subWindow), tabTextFor(subWindow)); | 0 |
| 2631 | break; executed: break;Execution Count:85 | 85 |
| 2632 | case QEvent::WindowIconChange: | - |
| 2633 | if (d->tabBar) never evaluated: d->tabBar | 0 |
| 2634 | d->tabBar->setTabIcon(d->childWindows.indexOf(subWindow), subWindow->windowIcon()); never executed: d->tabBar->setTabIcon(d->childWindows.indexOf(subWindow), subWindow->windowIcon()); | 0 |
| 2635 | break; | 0 |
| 2636 | #endif // QT_NO_TABBAR | - |
| 2637 | default: | - |
| 2638 | break; executed: break;Execution Count:18436 | 18436 |
| 2639 | } | - |
| 2640 | return QAbstractScrollArea::eventFilter(object, event); executed: return QAbstractScrollArea::eventFilter(object, event);Execution Count:21941 | 21941 |
| 2641 | } | - |
| 2642 | | - |
| 2643 | /*! | - |
| 2644 | \reimp | - |
| 2645 | */ | - |
| 2646 | void QMdiArea::paintEvent(QPaintEvent *paintEvent) | - |
| 2647 | { | - |
| 2648 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2649 | QPainter painter(d->viewport); executed (the execution status of this line is deduced): QPainter painter(d->viewport); | - |
| 2650 | const QVector<QRect> &exposedRects = paintEvent->region().rects(); executed (the execution status of this line is deduced): const QVector<QRect> &exposedRects = paintEvent->region().rects(); | - |
| 2651 | for (int i = 0; i < exposedRects.size(); ++i) evaluated: i < exposedRects.size()| yes Evaluation Count:128 | yes Evaluation Count:81 |
| 81-128 |
| 2652 | painter.fillRect(exposedRects.at(i), d->background); executed: painter.fillRect(exposedRects.at(i), d->background);Execution Count:128 | 128 |
| 2653 | } executed: }Execution Count:81 | 81 |
| 2654 | | - |
| 2655 | /*! | - |
| 2656 | This slot is called by QAbstractScrollArea after setViewport() has been | - |
| 2657 | called. Reimplement this function in a subclass of QMdiArea to | - |
| 2658 | initialize the new \a viewport before it is used. | - |
| 2659 | | - |
| 2660 | \sa setViewport() | - |
| 2661 | */ | - |
| 2662 | void QMdiArea::setupViewport(QWidget *viewport) | - |
| 2663 | { | - |
| 2664 | Q_D(QMdiArea); executed (the execution status of this line is deduced): QMdiAreaPrivate * const d = d_func(); | - |
| 2665 | if (viewport) partially evaluated: viewport| yes Evaluation Count:81 | no Evaluation Count:0 |
| 0-81 |
| 2666 | viewport->setAttribute(Qt::WA_OpaquePaintEvent, d->background.isOpaque()); executed: viewport->setAttribute(Qt::WA_OpaquePaintEvent, d->background.isOpaque());Execution Count:81 | 81 |
| 2667 | foreach (QMdiSubWindow *child, d->childWindows) { executed (the execution status of this line is deduced): 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;})) { | - |
| 2668 | if (!sanityCheck(child, "QMdiArea::setupViewport")) partially evaluated: !sanityCheck(child, "QMdiArea::setupViewport")| no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
| 2669 | continue; never executed: continue; | 0 |
| 2670 | child->setParent(viewport, child->windowFlags()); executed (the execution status of this line is deduced): child->setParent(viewport, child->windowFlags()); | - |
| 2671 | } executed: }Execution Count:1 | 1 |
| 2672 | } executed: }Execution Count:81 | 81 |
| 2673 | | - |
| 2674 | QT_END_NAMESPACE | - |
| 2675 | | - |
| 2676 | #include "moc_qmdiarea.cpp" | - |
| 2677 | | - |
| 2678 | #endif // QT_NO_MDIAREA | - |
| 2679 | | - |
| | |