qitemselectionmodel.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
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 The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/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 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qitemselectionmodel.h"-
35#include <private/qitemselectionmodel_p.h>-
36#include <qdebug.h>-
37-
38#include <algorithm>-
39-
40#ifndef QT_NO_ITEMVIEWS-
41-
42QT_BEGIN_NAMESPACE-
43-
44/*!-
45 \class QItemSelectionRange-
46 \inmodule QtCore-
47-
48 \brief The QItemSelectionRange class manages information about a-
49 range of selected items in a model.-
50-
51 \ingroup model-view-
52-
53 A QItemSelectionRange contains information about a range of-
54 selected items in a model. A range of items is a contiguous array-
55 of model items, extending to cover a number of adjacent rows and-
56 columns with a common parent item; this can be visualized as a-
57 two-dimensional block of cells in a table. A selection range has a-
58 top(), left() a bottom(), right() and a parent().-
59-
60 The QItemSelectionRange class is one of the \l{Model/View Classes}-
61 and is part of Qt's \l{Model/View Programming}{model/view framework}.-
62-
63 The model items contained in the selection range can be obtained-
64 using the indexes() function. Use QItemSelectionModel::selectedIndexes()-
65 to get a list of all selected items for a view.-
66-
67 You can determine whether a given model item lies within a-
68 particular range by using the contains() function. Ranges can also-
69 be compared using the overloaded operators for equality and-
70 inequality, and the intersects() function allows you to determine-
71 whether two ranges overlap.-
72-
73 \sa {Model/View Programming}, QAbstractItemModel, QItemSelection,-
74 QItemSelectionModel-
75*/-
76-
77/*!-
78 \fn QItemSelectionRange::QItemSelectionRange()-
79-
80 Constructs an empty selection range.-
81*/-
82-
83/*!-
84 \fn QItemSelectionRange::QItemSelectionRange(const QItemSelectionRange &other)-
85-
86 Copy constructor. Constructs a new selection range with the same contents-
87 as the \a other range given.-
88-
89*/-
90-
91/*!-
92 \fn QItemSelectionRange::QItemSelectionRange(const QModelIndex &topLeft, const QModelIndex &bottomRight)-
93-
94 Constructs a new selection range containing only the index specified-
95 by the \a topLeft and the index \a bottomRight.-
96-
97*/-
98-
99/*!-
100 \fn QItemSelectionRange::QItemSelectionRange(const QModelIndex &index)-
101-
102 Constructs a new selection range containing only the model item specified-
103 by the model index \a index.-
104*/-
105-
106/*!-
107 \fn QItemSelectionRange::swap(QItemSelectionRange &other)-
108 \since 5.6-
109-
110 Swaps this selection range's contents with \a other.-
111 This function is very fast and never fails.-
112*/-
113-
114/*!-
115 \fn int QItemSelectionRange::top() const-
116-
117 Returns the row index corresponding to the uppermost selected row in the-
118 selection range.-
119-
120*/-
121-
122/*!-
123 \fn int QItemSelectionRange::left() const-
124-
125 Returns the column index corresponding to the leftmost selected column in the-
126 selection range.-
127*/-
128-
129/*!-
130 \fn int QItemSelectionRange::bottom() const-
131-
132 Returns the row index corresponding to the lowermost selected row in the-
133 selection range.-
134-
135*/-
136-
137/*!-
138 \fn int QItemSelectionRange::right() const-
139-
140 Returns the column index corresponding to the rightmost selected column in-
141 the selection range.-
142-
143*/-
144-
145/*!-
146 \fn int QItemSelectionRange::width() const-
147-
148 Returns the number of selected columns in the selection range.-
149-
150*/-
151-
152/*!-
153 \fn int QItemSelectionRange::height() const-
154-
155 Returns the number of selected rows in the selection range.-
156-
157*/-
158-
159/*!-
160 \fn const QAbstractItemModel *QItemSelectionRange::model() const-
161-
162 Returns the model that the items in the selection range belong to.-
163*/-
164-
165/*!-
166 \fn QModelIndex QItemSelectionRange::topLeft() const-
167-
168 Returns the index for the item located at the top-left corner of-
169 the selection range.-
170-
171 \sa top(), left(), bottomRight()-
172*/-
173-
174/*!-
175 \fn QModelIndex QItemSelectionRange::bottomRight() const-
176-
177 Returns the index for the item located at the bottom-right corner-
178 of the selection range.-
179-
180 \sa bottom(), right(), topLeft()-
181*/-
182-
183/*!-
184 \fn QModelIndex QItemSelectionRange::parent() const-
185-
186 Returns the parent model item index of the items in the selection range.-
187-
188*/-
189-
190/*!-
191 \fn bool QItemSelectionRange::contains(const QModelIndex &index) const-
192-
193 Returns \c true if the model item specified by the \a index lies within the-
194 range of selected items; otherwise returns \c false.-
195*/-
196-
197/*!-
198 \fn bool QItemSelectionRange::contains(int row, int column,-
199 const QModelIndex &parentIndex) const-
200 \overload-
201-
202 Returns \c true if the model item specified by (\a row, \a column)-
203 and with \a parentIndex as the parent item lies within the range-
204 of selected items; otherwise returns \c false.-
205*/-
206-
207/*!-
208 \fn bool QItemSelectionRange::intersects(const QItemSelectionRange &other) const-
209-
210 Returns \c true if this selection range intersects (overlaps with) the \a other-
211 range given; otherwise returns \c false.-
212-
213*/-
214bool QItemSelectionRange::intersects(const QItemSelectionRange &other) const-
215{-
216 return (isValid() && other.isValid()
executed 11720 times by 21 tests: return (isValid() && other.isValid() && parent() == other.parent() && model() == other.model() && ((top() <= other.top() && bottom() >= other.top()) || (top() >= other.top() && top() <= other.bottom())) && ((left() <= other.left() && right() >= other.left()) || (left() >= other.left() && left() <= other.right())));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
isValid()Description
TRUEevaluated 11720 times by 21 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEnever evaluated
other.isValid()Description
TRUEevaluated 11720 times by 21 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEnever evaluated
0-11720
217 && parent() == other.parent()
executed 11720 times by 21 tests: return (isValid() && other.isValid() && parent() == other.parent() && model() == other.model() && ((top() <= other.top() && bottom() >= other.top()) || (top() >= other.top() && top() <= other.bottom())) && ((left() <= other.left() && right() >= other.left()) || (left() >= other.left() && left() <= other.right())));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
parent() == other.parent()Description
TRUEevaluated 10020 times by 21 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 1700 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
1700-11720
218 && model() == other.model()
executed 11720 times by 21 tests: return (isValid() && other.isValid() && parent() == other.parent() && model() == other.model() && ((top() <= other.top() && bottom() >= other.top()) || (top() >= other.top() && top() <= other.bottom())) && ((left() <= other.left() && right() >= other.left()) || (left() >= other.left() && left() <= other.right())));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
model() == other.model()Description
TRUEevaluated 10019 times by 21 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
1-11720
219 && ((top() <= other.top() && bottom() >= other.top())
executed 11720 times by 21 tests: return (isValid() && other.isValid() && parent() == other.parent() && model() == other.model() && ((top() <= other.top() && bottom() >= other.top()) || (top() >= other.top() && top() <= other.bottom())) && ((left() <= other.left() && right() >= other.left()) || (left() >= other.left() && left() <= other.right())));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
top() <= other.top()Description
TRUEevaluated 7157 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 2862 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
bottom() >= other.top()Description
TRUEevaluated 4030 times by 13 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 3127 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
2862-11720
220 || (top() >= other.top() && top() <= other.bottom()))
executed 11720 times by 21 tests: return (isValid() && other.isValid() && parent() == other.parent() && model() == other.model() && ((top() <= other.top() && bottom() >= other.top()) || (top() >= other.top() && top() <= other.bottom())) && ((left() <= other.left() && right() >= other.left()) || (left() >= other.left() && left() <= other.right())));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
top() >= other.top()Description
TRUEevaluated 2862 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 3127 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
top() <= other.bottom()Description
TRUEevaluated 299 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
FALSEevaluated 2563 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
299-11720
221 && ((left() <= other.left() && right() >= other.left())
executed 11720 times by 21 tests: return (isValid() && other.isValid() && parent() == other.parent() && model() == other.model() && ((top() <= other.top() && bottom() >= other.top()) || (top() >= other.top() && top() <= other.bottom())) && ((left() <= other.left() && right() >= other.left()) || (left() >= other.left() && left() <= other.right())));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
left() <= other.left()Description
TRUEevaluated 3536 times by 13 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 793 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
right() >= other.left()Description
TRUEevaluated 2733 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 803 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeWidget
793-11720
222 || (left() >= other.left() && left() <= other.right())));
executed 11720 times by 21 tests: return (isValid() && other.isValid() && parent() == other.parent() && model() == other.model() && ((top() <= other.top() && bottom() >= other.top()) || (top() >= other.top() && top() <= other.bottom())) && ((left() <= other.left() && right() >= other.left()) || (left() >= other.left() && left() <= other.right())));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
left() >= other.left()Description
TRUEevaluated 793 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 803 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeWidget
left() <= other.right()Description
TRUEevaluated 140 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 653 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
140-11720
223}-
224-
225/*!-
226 \fn QItemSelectionRange QItemSelectionRange::intersect(const QItemSelectionRange &other) const-
227 \obsolete-
228-
229 Use intersected(\a other) instead.-
230*/-
231-
232/*!-
233 \fn QItemSelectionRange QItemSelectionRange::intersected(const QItemSelectionRange &other) const-
234 \since 4.2-
235-
236 Returns a new selection range containing only the items that are found in-
237 both the selection range and the \a other selection range.-
238*/-
239-
240QItemSelectionRange QItemSelectionRange::intersected(const QItemSelectionRange &other) const-
241{-
242 if (model() == other.model() && parent() == other.parent()) {
model() == other.model()Description
TRUEevaluated 1264 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEnever evaluated
parent() == other.parent()Description
TRUEevaluated 1264 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEnever evaluated
0-1264
243 QModelIndex topLeft = model()->index(qMax(top(), other.top()),-
244 qMax(left(), other.left()),-
245 other.parent());-
246 QModelIndex bottomRight = model()->index(qMin(bottom(), other.bottom()),-
247 qMin(right(), other.right()),-
248 other.parent());-
249 return QItemSelectionRange(topLeft, bottomRight);
executed 1264 times by 11 tests: return QItemSelectionRange(topLeft, bottomRight);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
1264
250 }-
251 return QItemSelectionRange();
never executed: return QItemSelectionRange();
0
252}-
253-
254/*!-
255 \fn bool QItemSelectionRange::operator==(const QItemSelectionRange &other) const-
256-
257 Returns \c true if the selection range is exactly the same as the \a other-
258 range given; otherwise returns \c false.-
259-
260*/-
261-
262/*!-
263 \fn bool QItemSelectionRange::operator!=(const QItemSelectionRange &other) const-
264-
265 Returns \c true if the selection range differs from the \a other range given;-
266 otherwise returns \c false.-
267-
268*/-
269-
270/*!-
271 \fn bool QItemSelectionRange::operator<(const QItemSelectionRange &other) const-
272-
273 Returns \c true if the selection range is less than the \a other-
274 range given; otherwise returns \c false.-
275-
276 The less than calculation is not directly useful to developers - the way that ranges-
277 with different parents compare is not defined. This operator only exists so that the-
278 class can be used with QMap.-
279-
280*/-
281-
282/*!-
283 \fn bool QItemSelectionRange::isValid() const-
284-
285 Returns \c true if the selection range is valid; otherwise returns \c false.-
286-
287*/-
288-
289static void rowLengthsFromRange(const QItemSelectionRange &range, QVector<QPair<QPersistentModelIndex, uint> > &result)-
290{-
291 if (range.isValid() && range.model()) {
range.isValid()Description
TRUEevaluated 15 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEnever evaluated
range.model()Description
TRUEevaluated 15 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEnever evaluated
0-15
292 const QModelIndex topLeft = range.topLeft();-
293 const int bottom = range.bottom();-
294 const uint width = range.width();-
295 const int column = topLeft.column();-
296 for (int row = topLeft.row(); row <= bottom; ++row) {
row <= bottomDescription
TRUEevaluated 23 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEevaluated 15 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
15-23
297 // We don't need to keep track of ItemIsSelectable and ItemIsEnabled here. That is-
298 // required in indexesFromRange() because that method is called from public API-
299 // which requires the limitation.-
300 result.push_back(qMakePair(QPersistentModelIndex(topLeft.sibling(row, column)), width));-
301 }
executed 23 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
23
302 }
executed 15 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
15
303}
executed 15 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
15
304-
305template<typename ModelIndexContainer>-
306static void indexesFromRange(const QItemSelectionRange &range, ModelIndexContainer &result)-
307{-
308 if (range.isValid() && range.model()) {
range.isValid()Description
TRUEevaluated 1038 times by 18 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEnever evaluated
range.model()Description
TRUEevaluated 1038 times by 18 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEnever evaluated
0-1038
309 const QModelIndex topLeft = range.topLeft();-
310 const int bottom = range.bottom();-
311 const int right = range.right();-
312 for (int row = topLeft.row(); row <= bottom; ++row) {
row <= bottomDescription
TRUEevaluated 2168 times by 18 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 1038 times by 18 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
1038-2168
313 const QModelIndex columnLeader = topLeft.sibling(row, topLeft.column());-
314 for (int column = topLeft.column(); column <= right; ++column) {
column <= rightDescription
TRUEevaluated 5893 times by 18 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 2168 times by 18 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
2168-5893
315 QModelIndex index = columnLeader.sibling(row, column);-
316 Qt::ItemFlags flags = range.model()->flags(index);-
317 if ((flags & Qt::ItemIsSelectable) && (flags & Qt::ItemIsEnabled))-
318 result.push_back(index);
executed 5880 times by 18 tests: result.push_back(index);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
5880
319 }
executed 5893 times by 18 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
5893
320 }
executed 2168 times by 18 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
2168
321 }
executed 1038 times by 18 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
1038
322}
executed 1038 times by 18 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
1038
323-
324/*!-
325 Returns \c true if the selection range contains no selectable item-
326 \since 4.7-
327*/-
328-
329bool QItemSelectionRange::isEmpty() const-
330{-
331 if (!isValid() || !model())
!isValid()Description
TRUEnever evaluated
FALSEevaluated 424 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemView
  • tst_QTableView
!model()Description
TRUEnever evaluated
FALSEevaluated 424 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemView
  • tst_QTableView
0-424
332 return true;
never executed: return true;
0
333-
334 for (int column = left(); column <= right(); ++column) {
column <= right()Description
TRUEevaluated 424 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemView
  • tst_QTableView
FALSEnever evaluated
0-424
335 for (int row = top(); row <= bottom(); ++row) {
row <= bottom()Description
TRUEevaluated 424 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemView
  • tst_QTableView
FALSEnever evaluated
0-424
336 QModelIndex index = model()->index(row, column, parent());-
337 Qt::ItemFlags flags = model()->flags(index);-
338 if ((flags & Qt::ItemIsSelectable) && (flags & Qt::ItemIsEnabled))-
339 return false;
executed 424 times by 3 tests: return false;
Executed by:
  • tst_QAbstractItemView
  • tst_QItemView
  • tst_QTableView
424
340 }
never executed: end of block
0
341 }
never executed: end of block
0
342 return true;
never executed: return true;
0
343}-
344-
345/*!-
346 Returns the list of model index items stored in the selection.-
347*/-
348-
349QModelIndexList QItemSelectionRange::indexes() const-
350{-
351 QModelIndexList result;-
352 indexesFromRange(*this, result);-
353 return result;
never executed: return result;
0
354}-
355-
356/*!-
357 \class QItemSelection-
358 \inmodule QtCore-
359-
360 \brief The QItemSelection class manages information about selected items in a model.-
361-
362 \ingroup model-view-
363-
364 A QItemSelection describes the items in a model that have been-
365 selected by the user. A QItemSelection is basically a list of-
366 selection ranges, see QItemSelectionRange. It provides functions for-
367 creating and manipulating selections, and selecting a range of items-
368 from a model.-
369-
370 The QItemSelection class is one of the \l{Model/View Classes}-
371 and is part of Qt's \l{Model/View Programming}{model/view framework}.-
372-
373 An item selection can be constructed and initialized to contain a-
374 range of items from an existing model. The following example constructs-
375 a selection that contains a range of items from the given \c model,-
376 beginning at the \c topLeft, and ending at the \c bottomRight.-
377-
378 \snippet code/src_gui_itemviews_qitemselectionmodel.cpp 0-
379-
380 An empty item selection can be constructed, and later populated as-
381 required. So, if the model is going to be unavailable when we construct-
382 the item selection, we can rewrite the above code in the following way:-
383-
384 \snippet code/src_gui_itemviews_qitemselectionmodel.cpp 1-
385-
386 QItemSelection saves memory, and avoids unnecessary work, by working with-
387 selection ranges rather than recording the model item index for each-
388 item in the selection. Generally, an instance of this class will contain-
389 a list of non-overlapping selection ranges.-
390-
391 Use merge() to merge one item selection into another without making-
392 overlapping ranges. Use split() to split one selection range into-
393 smaller ranges based on a another selection range.-
394-
395 \sa {Model/View Programming}, QItemSelectionModel-
396*/-
397-
398/*!-
399 \fn QItemSelection::QItemSelection()-
400-
401 Constructs an empty selection.-
402*/-
403-
404/*!-
405 Constructs an item selection that extends from the top-left model item,-
406 specified by the \a topLeft index, to the bottom-right item, specified-
407 by \a bottomRight.-
408*/-
409QItemSelection::QItemSelection(const QModelIndex &topLeft, const QModelIndex &bottomRight)-
410{-
411 select(topLeft, bottomRight);-
412}
executed 4844 times by 30 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractProxyModel
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • ...
4844
413-
414/*!-
415 Adds the items in the range that extends from the top-left model-
416 item, specified by the \a topLeft index, to the bottom-right item,-
417 specified by \a bottomRight to the list.-
418-
419 \note \a topLeft and \a bottomRight must have the same parent.-
420*/-
421void QItemSelection::select(const QModelIndex &topLeft, const QModelIndex &bottomRight)-
422{-
423 if (!topLeft.isValid() || !bottomRight.isValid())
!topLeft.isValid()Description
TRUEevaluated 274 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractProxyModel
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 5300 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
!bottomRight.isValid()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 5299 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
1-5300
424 return;
executed 275 times by 18 tests: return;
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractProxyModel
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
275
425-
426 if ((topLeft.model() != bottomRight.model())
(topLeft.model...Right.model())Description
TRUEnever evaluated
FALSEevaluated 5299 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
0-5299
427 || topLeft.parent() != bottomRight.parent()) {
topLeft.parent...Right.parent()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 5298 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
1-5298
428 qWarning("Can't select indexes from different model or with different parents");-
429 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QItemSelectionModel
1
430 }-
431 if (topLeft.row() > bottomRight.row() || topLeft.column() > bottomRight.column()) {
topLeft.row() ...tomRight.row()Description
TRUEnever evaluated
FALSEevaluated 5298 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
topLeft.column...Right.column()Description
TRUEnever evaluated
FALSEevaluated 5298 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
0-5298
432 int top = qMin(topLeft.row(), bottomRight.row());-
433 int bottom = qMax(topLeft.row(), bottomRight.row());-
434 int left = qMin(topLeft.column(), bottomRight.column());-
435 int right = qMax(topLeft.column(), bottomRight.column());-
436 QModelIndex tl = topLeft.sibling(top, left);-
437 QModelIndex br = bottomRight.sibling(bottom, right);-
438 append(QItemSelectionRange(tl, br));-
439 return;
never executed: return;
0
440 }-
441 append(QItemSelectionRange(topLeft, bottomRight));-
442}
executed 5298 times by 29 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
5298
443-
444/*!-
445 Returns \c true if the selection contains the given \a index; otherwise-
446 returns \c false.-
447*/-
448-
449bool QItemSelection::contains(const QModelIndex &index) const-
450{-
451 if (index.flags() & Qt::ItemIsSelectable) {
index.flags() ...emIsSelectableDescription
TRUEevaluated 8400 times by 20 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QCalendarWidget
7-8400
452 QList<QItemSelectionRange>::const_iterator it = begin();-
453 for (; it != end(); ++it)
it != end()Description
TRUEevaluated 10592 times by 20 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 6835 times by 18 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
6835-10592
454 if ((*it).contains(index))
(*it).contains(index)Description
TRUEevaluated 1565 times by 20 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 9027 times by 18 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
1565-9027
455 return true;
executed 1565 times by 20 tests: return true;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
1565
456 }
executed 6835 times by 18 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
6835
457 return false;
executed 6842 times by 18 tests: return false;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
6842
458}-
459-
460/*!-
461 Returns a list of model indexes that correspond to the selected items.-
462*/-
463-
464QModelIndexList QItemSelection::indexes() const-
465{-
466 QModelIndexList result;-
467 QList<QItemSelectionRange>::const_iterator it = begin();-
468 for (; it != end(); ++it)
it != end()Description
TRUEevaluated 954 times by 16 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 1153 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAbstractProxyModel
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
954-1153
469 indexesFromRange(*it, result);
executed 954 times by 16 tests: indexesFromRange(*it, result);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
954
470 return result;
executed 1153 times by 17 tests: return result;
Executed by:
  • tst_QAbstractItemView
  • tst_QAbstractProxyModel
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
1153
471}-
472-
473static QVector<QPersistentModelIndex> qSelectionPersistentindexes(const QItemSelection &sel)-
474{-
475 QVector<QPersistentModelIndex> result;-
476 QList<QItemSelectionRange>::const_iterator it = sel.constBegin();-
477 for (; it != sel.constEnd(); ++it)
it != sel.constEnd()Description
TRUEevaluated 84 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEevaluated 5650 times by 16 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
84-5650
478 indexesFromRange(*it, result);
executed 84 times by 8 tests: indexesFromRange(*it, result);
Executed by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
84
479 return result;
executed 5650 times by 16 tests: return result;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
5650
480}-
481-
482static QVector<QPair<QPersistentModelIndex, uint> > qSelectionPersistentRowLengths(const QItemSelection &sel)-
483{-
484 QVector<QPair<QPersistentModelIndex, uint> > result;-
485 Q_FOREACH (const QItemSelectionRange &range, sel)-
486 rowLengthsFromRange(range, result);
executed 15 times by 2 tests: rowLengthsFromRange(range, result);
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
15
487 return result;
executed 250 times by 9 tests: return result;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
250
488}-
489-
490/*!-
491 Merges the \a other selection with this QItemSelection using the-
492 \a command given. This method guarantees that no ranges are overlapping.-
493-
494 Note that only QItemSelectionModel::Select,-
495 QItemSelectionModel::Deselect, and QItemSelectionModel::Toggle are-
496 supported.-
497-
498 \sa split()-
499*/-
500void QItemSelection::merge(const QItemSelection &other, QItemSelectionModel::SelectionFlags command)-
501{-
502 if (other.isEmpty() ||
other.isEmpty()Description
TRUEevaluated 227632 times by 42 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
FALSEevaluated 13459 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
13459-227632
503 !(command & QItemSelectionModel::Select ||-
504 command & QItemSelectionModel::Deselect ||-
505 command & QItemSelectionModel::Toggle))-
506 return;
executed 227632 times by 42 tests: return;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
227632
507-
508 QItemSelection newSelection = other;-
509 // Collect intersections-
510 QItemSelection intersections;-
511 QItemSelection::iterator it = newSelection.begin();-
512 while (it != newSelection.end()) {
it != newSelection.end()Description
TRUEevaluated 13996 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
FALSEevaluated 13459 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
13459-13996
513 if (!(*it).isValid()) {
!(*it).isValid()Description
TRUEevaluated 227 times by 15 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QMenu
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 13769 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
227-13769
514 it = newSelection.erase(it);-
515 continue;
executed 227 times by 15 tests: continue;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QMenu
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
227
516 }-
517 for (int t = 0; t < count(); ++t) {
t < count()Description
TRUEevaluated 4391 times by 15 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 13769 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
4391-13769
518 if ((*it).intersects(at(t)))
(*it).intersects(at(t))Description
TRUEevaluated 887 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 3504 times by 15 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
887-3504
519 intersections.append(at(t).intersected(*it));
executed 887 times by 10 tests: intersections.append(at(t).intersected(*it));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
887
520 }
executed 4391 times by 15 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
4391
521 ++it;-
522 }
executed 13769 times by 29 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
13769
523-
524 // Split the old (and new) ranges using the intersections-
525 for (int i = 0; i < intersections.count(); ++i) { // for each intersection
i < intersections.count()Description
TRUEevaluated 887 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 13459 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
887-13459
526 for (int t = 0; t < count();) { // splitt each old range
t < count()Description
TRUEevaluated 2914 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 887 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
887-2914
527 if (at(t).intersects(intersections.at(i))) {
at(t).intersec...ections.at(i))Description
TRUEevaluated 887 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 2027 times by 9 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
887-2027
528 split(at(t), intersections.at(i), this);-
529 removeAt(t);-
530 } else {
executed 887 times by 10 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
887
531 ++t;-
532 }
executed 2027 times by 9 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
2027
533 }-
534 // only split newSelection if Toggle is specified-
535 for (int n = 0; (command & QItemSelectionModel::Toggle) && n < newSelection.count();) {
n < newSelection.count()Description
TRUEevaluated 181 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
FALSEevaluated 170 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
170-181
536 if (newSelection.at(n).intersects(intersections.at(i))) {
newSelection.a...ections.at(i))Description
TRUEevaluated 170 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
11-170
537 split(newSelection.at(n), intersections.at(i), &newSelection);-
538 newSelection.removeAt(n);-
539 } else {
executed 170 times by 3 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
170
540 ++n;-
541 }
executed 11 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
11
542 }-
543 }
executed 887 times by 10 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
887
544 // do not add newSelection for Deselect-
545 if (!(command & QItemSelectionModel::Deselect))
!(command & QI...del::Deselect)Description
TRUEevaluated 12648 times by 27 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
FALSEevaluated 811 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
811-12648
546 operator+=(newSelection);
executed 12648 times by 27 tests: operator+=(newSelection);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
12648
547}
executed 13459 times by 29 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
13459
548-
549/*!-
550 Splits the selection \a range using the selection \a other range.-
551 Removes all items in \a other from \a range and puts the result in \a result.-
552 This can be compared with the semantics of the \e subtract operation of a set.-
553 \sa merge()-
554*/-
555-
556void QItemSelection::split(const QItemSelectionRange &range,-
557 const QItemSelectionRange &other, QItemSelection *result)-
558{-
559 if (range.parent() != other.parent() || range.model() != other.model())
range.parent()...other.parent()Description
TRUEnever evaluated
FALSEevaluated 1684 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
range.model() != other.model()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 1683 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
0-1684
560 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QItemSelectionModel
1
561-
562 QModelIndex parent = other.parent();-
563 int top = range.top();-
564 int left = range.left();-
565 int bottom = range.bottom();-
566 int right = range.right();-
567 int other_top = other.top();-
568 int other_left = other.left();-
569 int other_bottom = other.bottom();-
570 int other_right = other.right();-
571 const QAbstractItemModel *model = range.model();-
572 Q_ASSERT(model);-
573 if (other_top > top) {
other_top > topDescription
TRUEevaluated 261 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
FALSEevaluated 1422 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
261-1422
574 QModelIndex tl = model->index(top, left, parent);-
575 QModelIndex br = model->index(other_top - 1, right, parent);-
576 result->append(QItemSelectionRange(tl, br));-
577 top = other_top;-
578 }
executed 261 times by 6 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
261
579 if (other_bottom < bottom) {
other_bottom < bottomDescription
TRUEevaluated 260 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 1423 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
260-1423
580 QModelIndex tl = model->index(other_bottom + 1, left, parent);-
581 QModelIndex br = model->index(bottom, right, parent);-
582 result->append(QItemSelectionRange(tl, br));-
583 bottom = other_bottom;-
584 }
executed 260 times by 6 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
260
585 if (other_left > left) {
other_left > leftDescription
TRUEevaluated 178 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 1505 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
178-1505
586 QModelIndex tl = model->index(top, left, parent);-
587 QModelIndex br = model->index(bottom, other_left - 1, parent);-
588 result->append(QItemSelectionRange(tl, br));-
589 left = other_left;-
590 }
executed 178 times by 5 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
178
591 if (other_right < right) {
other_right < rightDescription
TRUEevaluated 195 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 1488 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
195-1488
592 QModelIndex tl = model->index(top, other_right + 1, parent);-
593 QModelIndex br = model->index(bottom, right, parent);-
594 result->append(QItemSelectionRange(tl, br));-
595 right = other_right;-
596 }
executed 195 times by 6 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
195
597}
executed 1683 times by 11 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
1683
598-
599-
600void QItemSelectionModelPrivate::initModel(QAbstractItemModel *m)-
601{-
602 struct Cx {-
603 const char *signal;-
604 const char *slot;-
605 };-
606 static const Cx connections[] = {-
607 { SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),-
608 SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int)) },-
609 { SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),-
610 SLOT(_q_columnsAboutToBeRemoved(QModelIndex,int,int)) },-
611 { SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)),-
612 SLOT(_q_rowsAboutToBeInserted(QModelIndex,int,int)) },-
613 { SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)),-
614 SLOT(_q_columnsAboutToBeInserted(QModelIndex,int,int)) },-
615 { SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),-
616 SLOT(_q_layoutAboutToBeChanged()) },-
617 { SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),-
618 SLOT(_q_layoutAboutToBeChanged()) },-
619 { SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),-
620 SLOT(_q_layoutChanged()) },-
621 { SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),-
622 SLOT(_q_layoutChanged()) },-
623 { SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),-
624 SLOT(_q_layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)) },-
625 { SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),-
626 SLOT(_q_layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)) },-
627 { SIGNAL(modelReset()),-
628 SLOT(reset()) },-
629 { 0, 0 }-
630 };-
631-
632 if (model == m)
model == mDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 4986 times by 42 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
1-4986
633 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QItemSelectionModel
1
634-
635 Q_Q(QItemSelectionModel);-
636 if (model) {
modelDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 4985 times by 42 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
1-4985
637 for (const Cx *cx = &connections[0]; cx->signal; cx++)
cx->signalDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
1-11
638 QObject::disconnect(model, cx->signal, q, cx->slot);
executed 11 times by 1 test: QObject::disconnect(model, cx->signal, q, cx->slot);
Executed by:
  • tst_QItemSelectionModel
11
639 q->reset();-
640 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QItemSelectionModel
1
641 model = m;-
642 if (model) {
modelDescription
TRUEevaluated 4985 times by 42 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
1-4985
643 for (const Cx *cx = &connections[0]; cx->signal; cx++)
cx->signalDescription
TRUEevaluated 54835 times by 42 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
FALSEevaluated 4985 times by 42 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
4985-54835
644 QObject::connect(model, cx->signal, q, cx->slot);
executed 54835 times by 42 tests: QObject::connect(model, cx->signal, q, cx->slot);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
54835
645 }
executed 4985 times by 42 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
4985
646}
executed 4986 times by 42 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
4986
647-
648/*!-
649 \internal-
650-
651 returns a QItemSelection where all ranges have been expanded to:-
652 Rows: left: 0 and right: columnCount()-1-
653 Columns: top: 0 and bottom: rowCount()-1-
654*/-
655-
656QItemSelection QItemSelectionModelPrivate::expandSelection(const QItemSelection &selection,-
657 QItemSelectionModel::SelectionFlags command) const-
658{-
659 if (selection.isEmpty() && !((command & QItemSelectionModel::Rows) ||
selection.isEmpty()Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 553 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
11-553
660 (command & QItemSelectionModel::Columns)))
(command & QIt...odel::Columns)Description
TRUEnever evaluated
FALSEnever evaluated
0
661 return selection;
never executed: return selection;
0
662-
663 QItemSelection expanded;-
664 if (command & QItemSelectionModel::Rows) {
command & QIte...ionModel::RowsDescription
TRUEevaluated 528 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 36 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTableView
36-528
665 for (int i = 0; i < selection.count(); ++i) {
i < selection.count()Description
TRUEevaluated 522 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 528 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
522-528
666 QModelIndex parent = selection.at(i).parent();-
667 int colCount = model->columnCount(parent);-
668 QModelIndex tl = model->index(selection.at(i).top(), 0, parent);-
669 QModelIndex br = model->index(selection.at(i).bottom(), colCount - 1, parent);-
670 //we need to merge because the same row could have already been inserted-
671 expanded.merge(QItemSelection(tl, br), QItemSelectionModel::Select);-
672 }
executed 522 times by 14 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
522
673 }
executed 528 times by 14 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
528
674 if (command & QItemSelectionModel::Columns) {
command & QIte...Model::ColumnsDescription
TRUEevaluated 36 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTableView
FALSEevaluated 528 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
36-528
675 for (int i = 0; i < selection.count(); ++i) {
i < selection.count()Description
TRUEevaluated 36 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTableView
FALSEevaluated 36 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTableView
36
676 QModelIndex parent = selection.at(i).parent();-
677 int rowCount = model->rowCount(parent);-
678 QModelIndex tl = model->index(0, selection.at(i).left(), parent);-
679 QModelIndex br = model->index(rowCount - 1, selection.at(i).right(), parent);-
680 //we need to merge because the same column could have already been inserted-
681 expanded.merge(QItemSelection(tl, br), QItemSelectionModel::Select);-
682 }
executed 36 times by 3 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTableView
36
683 }
executed 36 times by 3 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTableView
36
684 return expanded;
executed 564 times by 14 tests: return expanded;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
564
685}-
686-
687/*!-
688 \internal-
689*/-
690void QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(const QModelIndex &parent,-
691 int start, int end)-
692{-
693 Q_Q(QItemSelectionModel);-
694 finalize();-
695-
696 // update current index-
697 if (currentIndex.isValid() && parent == currentIndex.parent()
currentIndex.isValid()Description
TRUEevaluated 38 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 3317 times by 23 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
parent == curr...Index.parent()Description
TRUEevaluated 25 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 13 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
13-3317
698 && currentIndex.row() >= start && currentIndex.row() <= end) {
currentIndex.row() >= startDescription
TRUEevaluated 16 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 9 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
currentIndex.row() <= endDescription
TRUEevaluated 5 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QTreeView
FALSEevaluated 11 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeWidget
5-16
699 QModelIndex old = currentIndex;-
700 if (start > 0) // there are rows left above the change
start > 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTreeView
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QTreeView
1-4
701 currentIndex = model->index(start - 1, old.column(), parent);
executed 1 time by 1 test: currentIndex = model->index(start - 1, old.column(), parent);
Executed by:
  • tst_QTreeView
1
702 else if (model && end < model->rowCount(parent) - 1) // there are rows left below the change
end < model->r...nt(parent) - 1Description
TRUEnever evaluated
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QTreeView
0-4
703 currentIndex = model->index(end + 1, old.column(), parent);
never executed: currentIndex = model->index(end + 1, old.column(), parent);
0
704 else // there are no rows left in the table-
705 currentIndex = QModelIndex();
executed 4 times by 3 tests: currentIndex = QModelIndex();
Executed by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QTreeView
4
706 emit q->currentChanged(currentIndex, old);-
707 emit q->currentRowChanged(currentIndex, old);-
708 if (currentIndex.column() != old.column())
currentIndex.c...= old.column()Description
TRUEevaluated 4 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QTreeView
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTreeView
1-4
709 emit q->currentColumnChanged(currentIndex, old);
executed 4 times by 3 tests: q->currentColumnChanged(currentIndex, old);
Executed by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QTreeView
4
710 }
executed 5 times by 3 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QTreeView
5
711-
712 QItemSelection deselected;-
713 QItemSelection newParts;-
714 QItemSelection::iterator it = ranges.begin();-
715 while (it != ranges.end()) {
it != ranges.end()Description
TRUEevaluated 60 times by 12 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 3355 times by 24 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
60-3355
716 if (it->topLeft().parent() != parent) { // Check parents until reaching root or contained in range
it->topLeft()....nt() != parentDescription
TRUEevaluated 15 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
FALSEevaluated 45 times by 12 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
15-45
717 QModelIndex itParent = it->topLeft().parent();-
718 while (itParent.isValid() && itParent.parent() != parent)
itParent.isValid()Description
TRUEevaluated 9 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
FALSEevaluated 12 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
itParent.parent() != parentDescription
TRUEevaluated 6 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
FALSEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
3-12
719 itParent = itParent.parent();
executed 6 times by 4 tests: itParent = itParent.parent();
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
6
720-
721 if (itParent.isValid() && start <= itParent.row() && itParent.row() <= end) {
itParent.isValid()Description
TRUEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
FALSEevaluated 12 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
start <= itParent.row()Description
TRUEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
FALSEnever evaluated
itParent.row() <= endDescription
TRUEevaluated 3 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
FALSEnever evaluated
0-12
722 deselected.append(*it);-
723 it = ranges.erase(it);-
724 } else {
executed 3 times by 3 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
3
725 ++it;-
726 }
executed 12 times by 5 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
12
727 } else if (start <= it->bottom() && it->bottom() <= end // Full inclusion
start <= it->bottom()Description
TRUEevaluated 40 times by 12 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 5 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
it->bottom() <= endDescription
TRUEevaluated 22 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 18 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeWidget
5-40
728 && start <= it->top() && it->top() <= end) {
start <= it->top()Description
TRUEevaluated 20 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
it->top() <= endDescription
TRUEevaluated 20 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
FALSEnever evaluated
0-20
729 deselected.append(*it);-
730 it = ranges.erase(it);-
731 } else if (start <= it->top() && it->top() <= end) { // Top intersection
executed 20 times by 8 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
start <= it->top()Description
TRUEevaluated 15 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeWidget
FALSEevaluated 10 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
it->top() <= endDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 12 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeWidget
3-20
732 deselected.append(QItemSelectionRange(it->topLeft(), model->index(end, it->right(), it->parent())));-
733 *it = QItemSelectionRange(model->index(end + 1, it->left(), it->parent()), it->bottomRight());-
734 ++it;-
735 } else if (start <= it->bottom() && it->bottom() <= end) { // Bottom intersection
executed 3 times by 1 test: end of block
Executed by:
  • tst_QItemSelectionModel
start <= it->bottom()Description
TRUEevaluated 17 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeWidget
FALSEevaluated 5 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
it->bottom() <= endDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 15 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeWidget
2-17
736 deselected.append(QItemSelectionRange(model->index(start, it->left(), it->parent()), it->bottomRight()));-
737 *it = QItemSelectionRange(it->topLeft(), model->index(start - 1, it->right(), it->parent()));-
738 ++it;-
739 } else if (it->top() < start && end < it->bottom()) { // Middle intersection
executed 2 times by 1 test: end of block
Executed by:
  • tst_QItemSelectionModel
it->top() < startDescription
TRUEevaluated 8 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 12 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeWidget
end < it->bottom()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 5 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
2-12
740 // If the parent contains (1, 2, 3, 4, 5, 6, 7, 8) and [3, 4, 5, 6] is selected,-
741 // and [4, 5] is removed, we need to split [3, 4, 5, 6] into [3], [4, 5] and [6].-
742 // [4, 5] is appended to deselected, and [3] and [6] remain part of the selection-
743 // in ranges.-
744 const QItemSelectionRange removedRange(model->index(start, it->left(), it->parent()),-
745 model->index(end, it->right(), it->parent()));-
746 deselected.append(removedRange);-
747 QItemSelection::split(*it, removedRange, &newParts);-
748 it = ranges.erase(it);-
749 } else
executed 3 times by 1 test: end of block
Executed by:
  • tst_QItemSelectionModel
3
750 ++it;
executed 17 times by 9 tests: ++it;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
  • tst_QTreeWidget
17
751 }-
752 ranges.append(newParts);-
753-
754 if (!deselected.isEmpty())
!deselected.isEmpty()Description
TRUEevaluated 30 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 3325 times by 24 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
30-3325
755 emit q->selectionChanged(QItemSelection(), deselected);
executed 30 times by 8 tests: q->selectionChanged(QItemSelection(), deselected);
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
30
756}
executed 3355 times by 24 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
3355
757-
758/*!-
759 \internal-
760*/-
761void QItemSelectionModelPrivate::_q_columnsAboutToBeRemoved(const QModelIndex &parent,-
762 int start, int end)-
763{-
764 Q_Q(QItemSelectionModel);-
765-
766 // update current index-
767 if (currentIndex.isValid() && parent == currentIndex.parent()
currentIndex.isValid()Description
TRUEevaluated 8 times by 4 tests
Evaluated by:
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QListView
  • tst_QTableView
FALSEevaluated 272 times by 10 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
parent == curr...Index.parent()Description
TRUEevaluated 8 times by 4 tests
Evaluated by:
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QListView
  • tst_QTableView
FALSEnever evaluated
0-272
768 && currentIndex.column() >= start && currentIndex.column() <= end) {
currentIndex.column() >= startDescription
TRUEevaluated 7 times by 3 tests
Evaluated by:
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QListView
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QTableView
currentIndex.column() <= endDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QListView
FALSEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
1-7
769 QModelIndex old = currentIndex;-
770 if (start > 0) // there are columns to the left of the change
start > 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QListView
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QListView
1
771 currentIndex = model->index(old.row(), start - 1, parent);
executed 1 time by 1 test: currentIndex = model->index(old.row(), start - 1, parent);
Executed by:
  • tst_QListView
1
772 else if (model && end < model->columnCount() - 1) // there are columns to the right of the change
end < model->columnCount() - 1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QListView
FALSEnever evaluated
0-1
773 currentIndex = model->index(old.row(), end + 1, parent);
executed 1 time by 1 test: currentIndex = model->index(old.row(), end + 1, parent);
Executed by:
  • tst_QListView
1
774 else // there are no columns left in the table-
775 currentIndex = QModelIndex();
never executed: currentIndex = QModelIndex();
0
776 emit q->currentChanged(currentIndex, old);-
777 if (currentIndex.row() != old.row())
currentIndex.r...) != old.row()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QListView
0-2
778 emit q->currentRowChanged(currentIndex, old);
never executed: q->currentRowChanged(currentIndex, old);
0
779 emit q->currentColumnChanged(currentIndex, old);-
780 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QListView
2
781-
782 // update selections-
783 QModelIndex tl = model->index(0, start, parent);-
784 QModelIndex br = model->index(model->rowCount(parent) - 1, end, parent);-
785 q->select(QItemSelection(tl, br), QItemSelectionModel::Deselect);-
786 finalize();-
787}
executed 280 times by 11 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
280
788-
789/*!-
790 \internal-
791-
792 Split selection ranges if columns are about to be inserted in the middle.-
793*/-
794void QItemSelectionModelPrivate::_q_columnsAboutToBeInserted(const QModelIndex &parent,-
795 int start, int end)-
796{-
797 Q_UNUSED(end);-
798 finalize();-
799 QList<QItemSelectionRange> split;-
800 QList<QItemSelectionRange>::iterator it = ranges.begin();-
801 for (; it != ranges.end(); ) {
it != ranges.end()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QAccessibility
FALSEevaluated 842 times by 12 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
1-842
802 if ((*it).isValid() && (*it).parent() == parent
(*it).isValid()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QAccessibility
FALSEnever evaluated
(*it).parent() == parentDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QAccessibility
FALSEnever evaluated
0-1
803 && (*it).left() < start && (*it).right() >= start) {
(*it).left() < startDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QAccessibility
FALSEnever evaluated
(*it).right() >= startDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QAccessibility
0-1
804 QModelIndex bottomMiddle = model->index((*it).bottom(), start - 1, (*it).parent());-
805 QItemSelectionRange left((*it).topLeft(), bottomMiddle);-
806 QModelIndex topMiddle = model->index((*it).top(), start, (*it).parent());-
807 QItemSelectionRange right(topMiddle, (*it).bottomRight());-
808 it = ranges.erase(it);-
809 split.append(left);-
810 split.append(right);-
811 } else {
never executed: end of block
0
812 ++it;-
813 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QAccessibility
1
814 }-
815 ranges += split;-
816}
executed 842 times by 12 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
842
817-
818/*!-
819 \internal-
820-
821 Split selection ranges if rows are about to be inserted in the middle.-
822*/-
823void QItemSelectionModelPrivate::_q_rowsAboutToBeInserted(const QModelIndex &parent,-
824 int start, int end)-
825{-
826 Q_UNUSED(end);-
827 finalize();-
828 QList<QItemSelectionRange> split;-
829 QList<QItemSelectionRange>::iterator it = ranges.begin();-
830 for (; it != ranges.end(); ) {
it != ranges.end()Description
TRUEevaluated 3043 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 200855 times by 31 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QPrinter
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QStandardItemModel
  • tst_QStyleSheetStyle
  • ...
3043-200855
831 if ((*it).isValid() && (*it).parent() == parent
(*it).isValid()Description
TRUEevaluated 3043 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEnever evaluated
(*it).parent() == parentDescription
TRUEevaluated 284 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 2759 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
0-3043
832 && (*it).top() < start && (*it).bottom() >= start) {
(*it).top() < startDescription
TRUEevaluated 276 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 8 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QItemSelectionModel
(*it).bottom() >= startDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 273 times by 8 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
3-276
833 QModelIndex middleRight = model->index(start - 1, (*it).right(), (*it).parent());-
834 QItemSelectionRange top((*it).topLeft(), middleRight);-
835 QModelIndex middleLeft = model->index(start, (*it).left(), (*it).parent());-
836 QItemSelectionRange bottom(middleLeft, (*it).bottomRight());-
837 it = ranges.erase(it);-
838 split.append(top);-
839 split.append(bottom);-
840 } else {
executed 3 times by 1 test: end of block
Executed by:
  • tst_QItemSelectionModel
3
841 ++it;-
842 }
executed 3040 times by 11 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
3040
843 }-
844 ranges += split;-
845}
executed 200855 times by 31 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QPrinter
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QStandardItemModel
  • tst_QStyleSheetStyle
  • ...
200855
846-
847/*!-
848 \internal-
849-
850 Split selection into individual (persistent) indexes. This is done in-
851 preparation for the layoutChanged() signal, where the indexes can be-
852 merged again.-
853*/-
854void QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(const QList<QPersistentModelIndex> &, QAbstractItemModel::LayoutChangeHint hint)-
855{-
856 savedPersistentIndexes.clear();-
857 savedPersistentCurrentIndexes.clear();-
858 savedPersistentRowLengths.clear();-
859 savedPersistentCurrentRowLengths.clear();-
860-
861 // optimization for when all indexes are selected-
862 // (only if there is lots of items (1000) because this is not entirely correct)-
863 if (ranges.isEmpty() && currentSelection.count() == 1) {
ranges.isEmpty()Description
TRUEevaluated 2915 times by 20 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
FALSEevaluated 35 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTreeWidget
currentSelection.count() == 1Description
TRUEevaluated 14 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableWidget
FALSEevaluated 2901 times by 19 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
14-2915
864 QItemSelectionRange range = currentSelection.first();-
865 QModelIndex parent = range.parent();-
866 tableRowCount = model->rowCount(parent);-
867 tableColCount = model->columnCount(parent);-
868 if (tableRowCount * tableColCount > 1000
tableRowCount ...olCount > 1000Description
TRUEnever evaluated
FALSEevaluated 14 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableWidget
0-14
869 && range.top() == 0
range.top() == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
870 && range.left() == 0
range.left() == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
871 && range.bottom() == tableRowCount - 1
range.bottom()...leRowCount - 1Description
TRUEnever evaluated
FALSEnever evaluated
0
872 && range.right() == tableColCount - 1) {
range.right() ...leColCount - 1Description
TRUEnever evaluated
FALSEnever evaluated
0
873 tableSelected = true;-
874 tableParent = parent;-
875 return;
never executed: return;
0
876 }-
877 }
executed 14 times by 6 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableWidget
14
878 tableSelected = false;-
879-
880 if (hint == QAbstractItemModel::VerticalSortHint) {
hint == QAbstr...rticalSortHintDescription
TRUEevaluated 125 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 2825 times by 16 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
125-2825
881 // Special case when we know we're sorting vertically. We can assume that all indexes for columns-
882 // are displaced the same way, and therefore we only need to track an index from one column per-
883 // row with a QPersistentModelIndex together with the length of items to the right of it-
884 // which are displaced the same way.-
885 // An algorithm which contains the same assumption is used to process layoutChanged.-
886 savedPersistentRowLengths = qSelectionPersistentRowLengths(ranges);-
887 savedPersistentCurrentRowLengths = qSelectionPersistentRowLengths(currentSelection);-
888 } else {
executed 125 times by 9 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
125
889 savedPersistentIndexes = qSelectionPersistentindexes(ranges);-
890 savedPersistentCurrentIndexes = qSelectionPersistentindexes(currentSelection);-
891 }
executed 2825 times by 16 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
2825
892}-
893/*!-
894 \internal-
895*/-
896static QItemSelection mergeRowLengths(const QVector<QPair<QPersistentModelIndex, uint> > &rowLengths)-
897{-
898 if (rowLengths.isEmpty())
rowLengths.isEmpty()Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
8-12
899 return QItemSelection();
executed 8 times by 2 tests: return QItemSelection();
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
8
900-
901 QItemSelection result;-
902 int i = 0;-
903 while (i < rowLengths.count()) {
i < rowLengths.count()Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
12-13
904 const QPersistentModelIndex &tl = rowLengths.at(i).first;-
905 if (!tl.isValid()) {
!tl.isValid()Description
TRUEnever evaluated
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
0-13
906 ++i;-
907 continue;
never executed: continue;
0
908 }-
909 QPersistentModelIndex br = tl;-
910 const uint length = rowLengths.at(i).second;-
911 while (++i < rowLengths.count()) {
++i < rowLengths.count()Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
11-12
912 const QPersistentModelIndex &next = rowLengths.at(i).first;-
913 if (!next.isValid())
!next.isValid()Description
TRUEnever evaluated
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
0-11
914 continue;
never executed: continue;
0
915 const uint nextLength = rowLengths.at(i).second;-
916 if ((nextLength == length)
(nextLength == length)Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEnever evaluated
0-11
917 && (next.row() == br.row() + 1)
(next.row() == br.row() + 1)Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemSelectionModel
1-10
918 && (next.parent() == br.parent())) {
(next.parent() == br.parent())Description
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
FALSEnever evaluated
0-10
919 br = next;-
920 } else {
executed 10 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
10
921 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_QItemSelectionModel
1
922 }-
923 }-
924 result.append(QItemSelectionRange(tl, br.sibling(br.row(), length - 1)));-
925 }
executed 13 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
13
926 return result;
executed 12 times by 2 tests: return result;
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
12
927}-
928-
929/*!-
930 \internal-
931-
932 Merges \a indexes into an item selection made up of ranges.-
933 Assumes that the indexes are sorted.-
934*/-
935static QItemSelection mergeIndexes(const QVector<QPersistentModelIndex> &indexes)-
936{-
937 QItemSelection colSpans;-
938 // merge columns-
939 int i = 0;-
940 while (i < indexes.count()) {
i < indexes.count()Description
TRUEevaluated 102 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEevaluated 78 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
78-102
941 const QPersistentModelIndex &tl = indexes.at(i);-
942 if (!tl.isValid()) {
!tl.isValid()Description
TRUEnever evaluated
FALSEevaluated 102 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
0-102
943 ++i;-
944 continue;
never executed: continue;
0
945 }-
946 QPersistentModelIndex br = tl;-
947 QModelIndex brParent = br.parent();-
948 int brRow = br.row();-
949 int brColumn = br.column();-
950 while (++i < indexes.count()) {
++i < indexes.count()Description
TRUEevaluated 555 times by 7 tests
Evaluated by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEevaluated 46 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
46-555
951 const QPersistentModelIndex &next = indexes.at(i);-
952 if (!next.isValid())
!next.isValid()Description
TRUEnever evaluated
FALSEevaluated 555 times by 7 tests
Evaluated by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
0-555
953 continue;
never executed: continue;
0
954 const QModelIndex nextParent = next.parent();-
955 const int nextRow = next.row();-
956 const int nextColumn = next.column();-
957 if ((nextParent == brParent)
(nextParent == brParent)Description
TRUEevaluated 519 times by 7 tests
Evaluated by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEevaluated 36 times by 2 tests
Evaluated by:
  • tst_QFiledialog
  • tst_QStandardItemModel
36-519
958 && (nextRow == brRow)
(nextRow == brRow)Description
TRUEevaluated 499 times by 7 tests
Evaluated by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
20-499
959 && (nextColumn == brColumn + 1)) {
(nextColumn == brColumn + 1)Description
TRUEevaluated 499 times by 7 tests
Evaluated by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEnever evaluated
0-499
960 br = next;-
961 brParent = nextParent;-
962 brRow = nextRow;-
963 brColumn = nextColumn;-
964 } else {
executed 499 times by 7 tests: end of block
Executed by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
499
965 break;
executed 56 times by 3 tests: break;
Executed by:
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
56
966 }-
967 }-
968 colSpans.append(QItemSelectionRange(tl, br));-
969 }
executed 102 times by 8 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
102
970 // merge rows-
971 QItemSelection rowSpans;-
972 i = 0;-
973 while (i < colSpans.count()) {
i < colSpans.count()Description
TRUEevaluated 96 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEevaluated 78 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
78-96
974 QModelIndex tl = colSpans.at(i).topLeft();-
975 QModelIndex br = colSpans.at(i).bottomRight();-
976 QModelIndex prevTl = tl;-
977 while (++i < colSpans.count()) {
++i < colSpans.count()Description
TRUEevaluated 56 times by 3 tests
Evaluated by:
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
FALSEevaluated 46 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
46-56
978 QModelIndex nextTl = colSpans.at(i).topLeft();-
979 QModelIndex nextBr = colSpans.at(i).bottomRight();-
980-
981 if (nextTl.parent() != tl.parent())
nextTl.parent() != tl.parent()Description
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_QFiledialog
  • tst_QStandardItemModel
FALSEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
20-36
982 break; // we can't merge selection ranges from different parents
executed 36 times by 2 tests: break;
Executed by:
  • tst_QFiledialog
  • tst_QStandardItemModel
36
983-
984 if ((nextTl.column() == prevTl.column()) && (nextBr.column() == br.column())
(nextTl.column...evTl.column())Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
FALSEnever evaluated
(nextBr.column...= br.column())Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
FALSEnever evaluated
0-20
985 && (nextTl.row() == prevTl.row() + 1) && (nextBr.row() == br.row() + 1)) {
(nextTl.row() ...vTl.row() + 1)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QStandardItemModel
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
(nextBr.row() == br.row() + 1)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QStandardItemModel
FALSEnever evaluated
0-14
986 br = nextBr;-
987 prevTl = nextTl;-
988 } else {
executed 6 times by 1 test: end of block
Executed by:
  • tst_QStandardItemModel
6
989 break;
executed 14 times by 1 test: break;
Executed by:
  • tst_QItemSelectionModel
14
990 }-
991 }-
992 rowSpans.append(QItemSelectionRange(tl, br));-
993 }
executed 96 times by 8 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
96
994 return rowSpans;
executed 78 times by 8 tests: return rowSpans;
Executed by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
78
995}-
996-
997/*!-
998 \internal-
999-
1000 Sort predicate function for QItemSelectionModelPrivate::_q_layoutChanged(),-
1001 sorting by parent first in addition to operator<(). This is to prevent-
1002 fragmentation of the selection by grouping indexes with the same row, column-
1003 of different parents next to each other, which may happen when a selection-
1004 spans sub-trees.-
1005*/-
1006static bool qt_PersistentModelIndexLessThan(const QPersistentModelIndex &i1, const QPersistentModelIndex &i2)-
1007{-
1008 const QModelIndex parent1 = i1.parent();-
1009 const QModelIndex parent2 = i2.parent();-
1010 return parent1 == parent2 ? i1 < i2 : parent1 < parent2;
executed 2151 times by 7 tests: return parent1 == parent2 ? i1 < i2 : parent1 < parent2;
Executed by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
parent1 == parent2Description
TRUEevaluated 1868 times by 7 tests
Evaluated by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEevaluated 283 times by 2 tests
Evaluated by:
  • tst_QFiledialog
  • tst_QStandardItemModel
283-2151
1011}-
1012-
1013/*!-
1014 \internal-
1015-
1016 Merge the selected indexes into selection ranges again.-
1017*/-
1018void QItemSelectionModelPrivate::_q_layoutChanged(const QList<QPersistentModelIndex> &, QAbstractItemModel::LayoutChangeHint hint)-
1019{-
1020 // special case for when all indexes are selected-
1021 if (tableSelected && tableColCount == model->columnCount(tableParent)
tableSelectedDescription
TRUEnever evaluated
FALSEevaluated 2951 times by 20 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
tableColCount ...t(tableParent)Description
TRUEnever evaluated
FALSEnever evaluated
0-2951
1022 && tableRowCount == model->rowCount(tableParent)) {
tableRowCount ...t(tableParent)Description
TRUEnever evaluated
FALSEnever evaluated
0
1023 ranges.clear();-
1024 currentSelection.clear();-
1025 int bottom = tableRowCount - 1;-
1026 int right = tableColCount - 1;-
1027 QModelIndex tl = model->index(0, 0, tableParent);-
1028 QModelIndex br = model->index(bottom, right, tableParent);-
1029 currentSelection << QItemSelectionRange(tl, br);-
1030 tableParent = QModelIndex();-
1031 tableSelected = false;-
1032 return;
never executed: return;
0
1033 }-
1034-
1035 if ((hint != QAbstractItemModel::VerticalSortHint && savedPersistentCurrentIndexes.isEmpty() && savedPersistentIndexes.isEmpty())
hint != QAbstr...rticalSortHintDescription
TRUEevaluated 2826 times by 17 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
FALSEevaluated 125 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
savedPersisten...exes.isEmpty()Description
TRUEevaluated 2810 times by 16 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
FALSEevaluated 16 times by 5 tests
Evaluated by:
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableWidget
savedPersisten...exes.isEmpty()Description
TRUEevaluated 2787 times by 16 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
FALSEevaluated 23 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QStandardItemModel
  • tst_QTreeWidget
16-2826
1036 || (hint == QAbstractItemModel::VerticalSortHint && savedPersistentRowLengths.isEmpty() && savedPersistentCurrentRowLengths.isEmpty())) {
hint == QAbstr...rticalSortHintDescription
TRUEevaluated 125 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 39 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
savedPersisten...gths.isEmpty()Description
TRUEevaluated 120 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
savedPersisten...gths.isEmpty()Description
TRUEevaluated 115 times by 7 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 5 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
5-125
1037 // either the selection was actually empty, or we-
1038 // didn't get the layoutAboutToBeChanged() signal-
1039 return;
executed 2902 times by 19 tests: return;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
2902
1040 }-
1041-
1042 // clear the "old" selection-
1043 ranges.clear();-
1044 currentSelection.clear();-
1045-
1046 if (hint != QAbstractItemModel::VerticalSortHint) {
hint != QAbstr...rticalSortHintDescription
TRUEevaluated 39 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
10-39
1047 // sort the "new" selection, as preparation for merging-
1048 std::stable_sort(savedPersistentIndexes.begin(), savedPersistentIndexes.end(),-
1049 qt_PersistentModelIndexLessThan);-
1050 std::stable_sort(savedPersistentCurrentIndexes.begin(), savedPersistentCurrentIndexes.end(),-
1051 qt_PersistentModelIndexLessThan);-
1052-
1053 // update the selection by merging the individual indexes-
1054 ranges = mergeIndexes(savedPersistentIndexes);-
1055 currentSelection = mergeIndexes(savedPersistentCurrentIndexes);-
1056-
1057 // release the persistent indexes-
1058 savedPersistentIndexes.clear();-
1059 savedPersistentCurrentIndexes.clear();-
1060 } else {
executed 39 times by 8 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QStandardItemModel
  • tst_QTableWidget
  • tst_QTreeWidget
39
1061 // sort the "new" selection, as preparation for merging-
1062 std::stable_sort(savedPersistentRowLengths.begin(), savedPersistentRowLengths.end());-
1063 std::stable_sort(savedPersistentCurrentRowLengths.begin(), savedPersistentCurrentRowLengths.end());-
1064-
1065 // update the selection by merging the individual indexes-
1066 ranges = mergeRowLengths(savedPersistentRowLengths);-
1067 currentSelection = mergeRowLengths(savedPersistentCurrentRowLengths);-
1068-
1069 // release the persistent indexes-
1070 savedPersistentRowLengths.clear();-
1071 savedPersistentCurrentRowLengths.clear();-
1072 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
10
1073}-
1074-
1075/*!-
1076 \class QItemSelectionModel-
1077 \inmodule QtCore-
1078-
1079 \brief The QItemSelectionModel class keeps track of a view's selected items.-
1080-
1081 \ingroup model-view-
1082-
1083 A QItemSelectionModel keeps track of the selected items in a view, or-
1084 in several views onto the same model. It also keeps track of the-
1085 currently selected item in a view.-
1086-
1087 The QItemSelectionModel class is one of the \l{Model/View Classes}-
1088 and is part of Qt's \l{Model/View Programming}{model/view framework}.-
1089-
1090 The selected items are stored using ranges. Whenever you want to-
1091 modify the selected items use select() and provide either a-
1092 QItemSelection, or a QModelIndex and a QItemSelectionModel::SelectionFlag.-
1093-
1094 The QItemSelectionModel takes a two layer approach to selection-
1095 management, dealing with both selected items that have been committed-
1096 and items that are part of the current selection. The current-
1097 selected items are part of the current interactive selection (for-
1098 example with rubber-band selection or keyboard-shift selections).-
1099-
1100 To update the currently selected items, use the bitwise OR of-
1101 QItemSelectionModel::Current and any of the other SelectionFlags.-
1102 If you omit the QItemSelectionModel::Current command, a new current-
1103 selection will be created, and the previous one added to the whole-
1104 selection. All functions operate on both layers; for example,-
1105 \l {QTableWidget::selectedItems()}{selecteditems()} will return items from both layers.-
1106-
1107 \note Since 5.5, \l{QItemSelectionModel::model()}{model},-
1108 \l{QItemSelectionModel::hasSelection()}{hasSelection}, and-
1109 \l{QItemSelectionModel::currentIndex()}{currentIndex} are meta-object properties.-
1110-
1111 \sa {Model/View Programming}, QAbstractItemModel, {Chart Example}-
1112*/-
1113-
1114/*!-
1115 Constructs a selection model that operates on the specified item \a model.-
1116*/-
1117QItemSelectionModel::QItemSelectionModel(QAbstractItemModel *model)-
1118 : QObject(*new QItemSelectionModelPrivate, model)-
1119{-
1120 d_func()->initModel(model);-
1121}
executed 92 times by 7 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
  • tst_QTreeWidget
92
1122-
1123/*!-
1124 Constructs a selection model that operates on the specified item \a model with \a parent.-
1125*/-
1126QItemSelectionModel::QItemSelectionModel(QAbstractItemModel *model, QObject *parent)-
1127 : QObject(*new QItemSelectionModelPrivate, parent)-
1128{-
1129 d_func()->initModel(model);-
1130}
executed 4893 times by 42 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
4893
1131-
1132/*!-
1133 \internal-
1134*/-
1135QItemSelectionModel::QItemSelectionModel(QItemSelectionModelPrivate &dd, QAbstractItemModel *model)-
1136 : QObject(dd, model)-
1137{-
1138 dd.initModel(model);-
1139}
never executed: end of block
0
1140-
1141/*!-
1142 Destroys the selection model.-
1143*/-
1144QItemSelectionModel::~QItemSelectionModel()-
1145{-
1146}-
1147-
1148/*!-
1149 Selects the model item \a index using the specified \a command, and emits-
1150 selectionChanged().-
1151-
1152 \sa QItemSelectionModel::SelectionFlags-
1153*/-
1154void QItemSelectionModel::select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)-
1155{-
1156 QItemSelection selection(index, index);-
1157 select(selection, command);-
1158}
executed 3859 times by 27 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
3859
1159-
1160/*!-
1161 \fn void QItemSelectionModel::currentChanged(const QModelIndex &current, const QModelIndex &previous)-
1162-
1163 This signal is emitted whenever the current item changes. The \a previous-
1164 model item index is replaced by the \a current index as the selection's-
1165 current item.-
1166-
1167 Note that this signal will not be emitted when the item model is reset.-
1168-
1169 \sa currentIndex(), setCurrentIndex(), selectionChanged()-
1170*/-
1171-
1172/*!-
1173 \fn void QItemSelectionModel::currentColumnChanged(const QModelIndex &current, const QModelIndex &previous)-
1174-
1175 This signal is emitted if the \a current item changes and its column is-
1176 different to the column of the \a previous current item.-
1177-
1178 Note that this signal will not be emitted when the item model is reset.-
1179-
1180 \sa currentChanged(), currentRowChanged(), currentIndex(), setCurrentIndex()-
1181*/-
1182-
1183/*!-
1184 \fn void QItemSelectionModel::currentRowChanged(const QModelIndex &current, const QModelIndex &previous)-
1185-
1186 This signal is emitted if the \a current item changes and its row is-
1187 different to the row of the \a previous current item.-
1188-
1189 Note that this signal will not be emitted when the item model is reset.-
1190-
1191 \sa currentChanged(), currentColumnChanged(), currentIndex(), setCurrentIndex()-
1192*/-
1193-
1194/*!-
1195 \fn void QItemSelectionModel::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)-
1196-
1197 This signal is emitted whenever the selection changes. The change in the-
1198 selection is represented as an item selection of \a deselected items and-
1199 an item selection of \a selected items.-
1200-
1201 Note the that the current index changes independently from the selection.-
1202 Also note that this signal will not be emitted when the item model is reset.-
1203-
1204 \sa select(), currentChanged()-
1205*/-
1206-
1207/*!-
1208 \fn void QItemSelectionModel::modelChanged(QAbstractItemModel *model)-
1209 \since 5.5-
1210-
1211 This signal is emitted when the \a model is successfully set with setModel().-
1212-
1213 \sa model(), setModel()-
1214*/-
1215-
1216-
1217/*!-
1218 \enum QItemSelectionModel::SelectionFlag-
1219-
1220 This enum describes the way the selection model will be updated.-
1221-
1222 \value NoUpdate No selection will be made.-
1223 \value Clear The complete selection will be cleared.-
1224 \value Select All specified indexes will be selected.-
1225 \value Deselect All specified indexes will be deselected.-
1226 \value Toggle All specified indexes will be selected or-
1227 deselected depending on their current state.-
1228 \value Current The current selection will be updated.-
1229 \value Rows All indexes will be expanded to span rows.-
1230 \value Columns All indexes will be expanded to span columns.-
1231 \value SelectCurrent A combination of Select and Current, provided for-
1232 convenience.-
1233 \value ToggleCurrent A combination of Toggle and Current, provided for-
1234 convenience.-
1235 \value ClearAndSelect A combination of Clear and Select, provided for-
1236 convenience.-
1237*/-
1238-
1239/*!-
1240 Selects the item \a selection using the specified \a command, and emits-
1241 selectionChanged().-
1242-
1243 \sa QItemSelectionModel::SelectionFlag-
1244*/-
1245void QItemSelectionModel::select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command)-
1246{-
1247 Q_D(QItemSelectionModel);-
1248 if (!d->model) {
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 7342 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
0-7342
1249 qWarning("QItemSelectionModel: Selecting when no model has been set will result in a no-op.");-
1250 return;
never executed: return;
0
1251 }-
1252 if (command == NoUpdate)
command == NoUpdateDescription
TRUEevaluated 38 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTreeWidget
FALSEevaluated 7304 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
38-7304
1253 return;
executed 38 times by 5 tests: return;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTreeWidget
38
1254-
1255 // store old selection-
1256 QItemSelection sel = selection;-
1257 // If d->ranges is non-empty when the source model is reset the persistent indexes-
1258 // it contains will be invalid. We can't clear them in a modelReset slot because that might already-
1259 // be too late if another model observer is connected to the same modelReset slot and is invoked first-
1260 // it might call select() on this selection model before any such QItemSelectionModelPrivate::_q_modelReset() slot-
1261 // is invoked, so it would not be cleared yet. We clear it invalid ranges in it here.-
1262 QItemSelection::iterator it = d->ranges.begin();-
1263 while (it != d->ranges.end()) {
it != d->ranges.end()Description
TRUEevaluated 1421 times by 15 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 7304 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
1421-7304
1264 if (!it->isValid())
!it->isValid()Description
TRUEevaluated 24 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 1397 times by 15 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
24-1397
1265 it = d->ranges.erase(it);
executed 24 times by 4 tests: it = d->ranges.erase(it);
Executed by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
24
1266 else-
1267 ++it;
executed 1397 times by 15 tests: ++it;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
1397
1268 }-
1269-
1270 QItemSelection old = d->ranges;-
1271 old.merge(d->currentSelection, d->currentCommand);-
1272-
1273 // expand selection according to SelectionBehavior-
1274 if (command & Rows || command & Columns)-
1275 sel = d->expandSelection(sel, command);
executed 564 times by 14 tests: sel = d->expandSelection(sel, command);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
564
1276-
1277 // clear ranges and currentSelection-
1278 if (command & Clear) {
command & ClearDescription
TRUEevaluated 5291 times by 27 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
FALSEevaluated 2013 times by 26 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • ...
2013-5291
1279 d->ranges.clear();-
1280 d->currentSelection.clear();-
1281 }
executed 5291 times by 27 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
5291
1282-
1283 // merge and clear currentSelection if Current was not set (ie. start new currentSelection)-
1284 if (!(command & Current))
!(command & Current)Description
TRUEevaluated 6527 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
FALSEevaluated 777 times by 12 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QDateTimeEdit
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
777-6527
1285 d->finalize();
executed 6527 times by 29 tests: d->finalize();
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
6527
1286-
1287 // update currentSelection-
1288 if (command & Toggle || command & Select || command & Deselect) {-
1289 d->currentCommand = command;-
1290 d->currentSelection = sel;-
1291 }
executed 5805 times by 29 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
5805
1292-
1293 // generate new selection, compare with old and emit selectionChanged()-
1294 QItemSelection newSelection = d->ranges;-
1295 newSelection.merge(d->currentSelection, d->currentCommand);-
1296 emitSelectionChanged(newSelection, old);-
1297}
executed 7304 times by 29 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
7304
1298-
1299/*!-
1300 Clears the selection model. Emits selectionChanged() and currentChanged().-
1301*/-
1302void QItemSelectionModel::clear()-
1303{-
1304 clearSelection();-
1305 clearCurrentIndex();-
1306}
executed 12224 times by 43 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
12224
1307-
1308/*!-
1309 Clears the current index. Emits currentChanged().-
1310 */-
1311void QItemSelectionModel::clearCurrentIndex()-
1312{-
1313 Q_D(QItemSelectionModel);-
1314 QModelIndex previous = d->currentIndex;-
1315 d->currentIndex = QModelIndex();-
1316 if (previous.isValid()) {
previous.isValid()Description
TRUEevaluated 879 times by 12 tests
Evaluated by:
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTreeWidget
  • tst_languageChange
FALSEevaluated 11348 times by 43 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
879-11348
1317 emit currentChanged(d->currentIndex, previous);-
1318 emit currentRowChanged(d->currentIndex, previous);-
1319 emit currentColumnChanged(d->currentIndex, previous);-
1320 }
executed 879 times by 12 tests: end of block
Executed by:
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTreeWidget
  • tst_languageChange
879
1321}
executed 12227 times by 43 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
12227
1322-
1323/*!-
1324 Clears the selection model. Does not emit any signals.-
1325*/-
1326void QItemSelectionModel::reset()-
1327{-
1328 const QSignalBlocker blocker(this);-
1329 clear();-
1330}
executed 9588 times by 43 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
9588
1331-
1332/*!-
1333 \since 4.2-
1334 Clears the selection in the selection model. Emits selectionChanged().-
1335*/-
1336void QItemSelectionModel::clearSelection()-
1337{-
1338 Q_D(QItemSelectionModel);-
1339 if (d->ranges.count() == 0 && d->currentSelection.count() == 0)
d->ranges.count() == 0Description
TRUEevaluated 12217 times by 43 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
FALSEevaluated 66 times by 9 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QDateTimeEdit
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
d->currentSele...n.count() == 0Description
TRUEevaluated 10836 times by 43 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
FALSEevaluated 1381 times by 22 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
66-12217
1340 return;
executed 10836 times by 43 tests: return;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
10836
1341-
1342 select(QItemSelection(), Clear);-
1343}
executed 1447 times by 23 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
1447
1344-
1345-
1346/*!-
1347 Sets the model item \a index to be the current item, and emits-
1348 currentChanged(). The current item is used for keyboard navigation and-
1349 focus indication; it is independent of any selected items, although a-
1350 selected item can also be the current item.-
1351-
1352 Depending on the specified \a command, the \a index can also become part-
1353 of the current selection.-
1354 \sa select()-
1355*/-
1356void QItemSelectionModel::setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)-
1357{-
1358 Q_D(QItemSelectionModel);-
1359 if (!d->model) {
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 4176 times by 28 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • ...
0-4176
1360 qWarning("QItemSelectionModel: Setting the current index when no model has been set will result in a no-op.");-
1361 return;
never executed: return;
0
1362 }-
1363 if (index == d->currentIndex) {
index == d->currentIndexDescription
TRUEevaluated 250 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 3926 times by 28 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • ...
250-3926
1364 if (command != NoUpdate)
command != NoUpdateDescription
TRUEevaluated 145 times by 15 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 105 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QItemView
  • tst_QListView
  • tst_QTreeView
  • tst_QTreeWidget
105-145
1365 select(index, command); // select item
executed 145 times by 15 tests: select(index, command);
Executed by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
145
1366 return;
executed 250 times by 17 tests: return;
Executed by:
  • tst_QAbstractItemView
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
250
1367 }-
1368 QPersistentModelIndex previous = d->currentIndex;-
1369 d->currentIndex = index; // set current before emitting selection changed below-
1370 if (command != NoUpdate)
command != NoUpdateDescription
TRUEevaluated 2955 times by 25 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
FALSEevaluated 971 times by 21 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
971-2955
1371 select(d->currentIndex, command); // select item
executed 2955 times by 25 tests: select(d->currentIndex, command);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
2955
1372 emit currentChanged(d->currentIndex, previous);-
1373 if (d->currentIndex.row() != previous.row() ||
d->currentInde...previous.row()Description
TRUEevaluated 3298 times by 26 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • ...
FALSEevaluated 628 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
628-3298
1374 d->currentIndex.parent() != previous.parent())
d->currentInde...vious.parent()Description
TRUEevaluated 51 times by 6 tests
Evaluated by:
  • tst_QColumnView
  • tst_QComboBox
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 577 times by 11 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
51-577
1375 emit currentRowChanged(d->currentIndex, previous);
executed 3349 times by 26 tests: currentRowChanged(d->currentIndex, previous);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • ...
3349
1376 if (d->currentIndex.column() != previous.column() ||
d->currentInde...vious.column()Description
TRUEevaluated 2032 times by 26 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • ...
FALSEevaluated 1894 times by 21 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
1894-2032
1377 d->currentIndex.parent() != previous.parent())
d->currentInde...vious.parent()Description
TRUEevaluated 83 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 1811 times by 21 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
83-1811
1378 emit currentColumnChanged(d->currentIndex, previous);
executed 2115 times by 26 tests: currentColumnChanged(d->currentIndex, previous);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • ...
2115
1379}
executed 3926 times by 28 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • ...
3926
1380-
1381/*!-
1382 Returns the model item index for the current item, or an invalid index-
1383 if there is no current item.-
1384*/-
1385QModelIndex QItemSelectionModel::currentIndex() const-
1386{-
1387 return static_cast<QModelIndex>(d_func()->currentIndex);
executed 38280 times by 42 tests: return static_cast<QModelIndex>(d_func()->currentIndex);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
38280
1388}-
1389-
1390/*!-
1391 Returns \c true if the given model item \a index is selected.-
1392*/-
1393bool QItemSelectionModel::isSelected(const QModelIndex &index) const-
1394{-
1395 Q_D(const QItemSelectionModel);-
1396 if (d->model != index.model() || !index.isValid())
d->model != index.model()Description
TRUEevaluated 20 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QTreeView
FALSEevaluated 27808 times by 25 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
!index.isValid()Description
TRUEnever evaluated
FALSEevaluated 27808 times by 25 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
0-27808
1397 return false;
executed 20 times by 5 tests: return false;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QTreeView
20
1398-
1399 bool selected = false;-
1400 // search model ranges-
1401 QList<QItemSelectionRange>::const_iterator it = d->ranges.begin();-
1402 for (; it != d->ranges.end(); ++it) {
it != d->ranges.end()Description
TRUEevaluated 5722 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 27206 times by 25 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
5722-27206
1403 if ((*it).isValid() && (*it).contains(index)) {
(*it).isValid()Description
TRUEevaluated 5722 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
FALSEnever evaluated
(*it).contains(index)Description
TRUEevaluated 602 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 5120 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListWidget
  • tst_QTableView
0-5722
1404 selected = true;-
1405 break;
executed 602 times by 9 tests: break;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
602
1406 }-
1407 }
executed 5120 times by 8 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListWidget
  • tst_QTableView
5120
1408-
1409 // check currentSelection-
1410 if (d->currentSelection.count()) {
d->currentSelection.count()Description
TRUEevaluated 8631 times by 20 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 19177 times by 21 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
8631-19177
1411 if ((d->currentCommand & Deselect) && selected)
selectedDescription
TRUEevaluated 213 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 112 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
112-213
1412 selected = !d->currentSelection.contains(index);
executed 213 times by 5 tests: selected = !d->currentSelection.contains(index);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
213
1413 else if (d->currentCommand & Toggle)
d->currentCommand & ToggleDescription
TRUEevaluated 120 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
FALSEevaluated 8298 times by 20 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
120-8298
1414 selected ^= d->currentSelection.contains(index);
executed 120 times by 3 tests: selected ^= d->currentSelection.contains(index);
Executed by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
120
1415 else if ((d->currentCommand & Select) && !selected)
!selectedDescription
TRUEevaluated 8008 times by 20 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 178 times by 6 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListWidget
  • tst_QTableView
  • tst_QTreeView
178-8008
1416 selected = d->currentSelection.contains(index);
executed 8008 times by 20 tests: selected = d->currentSelection.contains(index);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
8008
1417 }
executed 8631 times by 20 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
8631
1418-
1419 if (selected) {
selectedDescription
TRUEevaluated 1804 times by 20 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 26004 times by 23 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
1804-26004
1420 Qt::ItemFlags flags = d->model->flags(index);-
1421 return (flags & Qt::ItemIsSelectable);
executed 1804 times by 20 tests: return (flags & Qt::ItemIsSelectable);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
1804
1422 }-
1423-
1424 return false;
executed 26004 times by 23 tests: return false;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
26004
1425}-
1426-
1427/*!-
1428 Returns \c true if all items are selected in the \a row with the given-
1429 \a parent.-
1430-
1431 Note that this function is usually faster than calling isSelected()-
1432 on all items in the same row and that unselectable items are-
1433 ignored.-
1434*/-
1435bool QItemSelectionModel::isRowSelected(int row, const QModelIndex &parent) const-
1436{-
1437 Q_D(const QItemSelectionModel);-
1438 if (!d->model)
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 1555 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
0-1555
1439 return false;
never executed: return false;
0
1440 if (parent.isValid() && d->model != parent.model())
parent.isValid()Description
TRUEevaluated 516 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTreeView
FALSEevaluated 1039 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
d->model != parent.model()Description
TRUEnever evaluated
FALSEevaluated 516 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTreeView
0-1039
1441 return false;
never executed: return false;
0
1442-
1443 // return false if row exist in currentSelection (Deselect)-
1444 if (d->currentCommand & Deselect && d->currentSelection.count()) {
d->currentSelection.count()Description
TRUEevaluated 62 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemView
  • tst_QTableView
FALSEnever evaluated
0-62
1445 for (int i=0; i<d->currentSelection.count(); ++i) {
i<d->currentSelection.count()Description
TRUEevaluated 62 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 44 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
44-62
1446 if (d->currentSelection.at(i).parent() == parent &&
d->currentSele...nt() == parentDescription
TRUEevaluated 62 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemView
  • tst_QTableView
FALSEnever evaluated
0-62
1447 row >= d->currentSelection.at(i).top() &&
row >= d->curr...on.at(i).top()Description
TRUEevaluated 36 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 26 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
26-36
1448 row <= d->currentSelection.at(i).bottom())
row <= d->curr...at(i).bottom()Description
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 18 times by 1 test
Evaluated by:
  • tst_QItemView
18
1449 return false;
executed 18 times by 3 tests: return false;
Executed by:
  • tst_QAccessibility
  • tst_QItemView
  • tst_QTableView
18
1450 }
executed 44 times by 2 tests: end of block
Executed by:
  • tst_QItemView
  • tst_QTableView
44
1451 }
executed 44 times by 2 tests: end of block
Executed by:
  • tst_QItemView
  • tst_QTableView
44
1452 // return false if ranges in both currentSelection and ranges-
1453 // intersect and have the same row contained-
1454 if (d->currentCommand & Toggle && d->currentSelection.count()) {
d->currentSelection.count()Description
TRUEevaluated 94 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
FALSEnever evaluated
0-94
1455 for (int i=0; i<d->currentSelection.count(); ++i)
i<d->currentSelection.count()Description
TRUEevaluated 94 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
FALSEevaluated 22 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
22-94
1456 if (d->currentSelection.at(i).top() <= row &&
d->currentSele...).top() <= rowDescription
TRUEevaluated 84 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
10-84
1457 d->currentSelection.at(i).bottom() >= row)
d->currentSele...ottom() >= rowDescription
TRUEevaluated 74 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFiledialog
FALSEevaluated 10 times by 2 tests
Evaluated by:
  • tst_QFiledialog
  • tst_QItemSelectionModel
10-74
1458 for (int j=0; j<d->ranges.count(); ++j)
j<d->ranges.count()Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_QFiledialog
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QAbstractItemView
2-72
1459 if (d->ranges.at(j).top() <= row && d->ranges.at(j).bottom() >= row
d->ranges.at(j).top() <= rowDescription
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_QFiledialog
FALSEnever evaluated
d->ranges.at(j...ottom() >= rowDescription
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_QFiledialog
FALSEnever evaluated
0-72
1460 && d->currentSelection.at(i).intersected(d->ranges.at(j)).isValid())
d->currentSele...(j)).isValid()Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_QFiledialog
FALSEnever evaluated
0-72
1461 return false;
executed 72 times by 1 test: return false;
Executed by:
  • tst_QFiledialog
72
1462 }
executed 22 times by 3 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QFiledialog
  • tst_QItemSelectionModel
22
1463 // add ranges and currentSelection and check through them all-
1464 QList<QItemSelectionRange>::const_iterator it;-
1465 QList<QItemSelectionRange> joined = d->ranges;-
1466 if (d->currentSelection.count())
d->currentSelection.count()Description
TRUEevaluated 1218 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 247 times by 5 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemView
  • tst_QTreeWidget
247-1218
1467 joined += d->currentSelection;
executed 1218 times by 9 tests: joined += d->currentSelection;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
1218
1468 int colCount = d->model->columnCount(parent);-
1469 for (int column = 0; column < colCount; ++column) {
column < colCountDescription
TRUEevaluated 1766 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 622 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
622-1766
1470 for (it = joined.constBegin(); it != joined.constEnd(); ++it) {
it != joined.constEnd()Description
TRUEevaluated 3882 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 843 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
843-3882
1471 if ((*it).contains(row, column, parent)) {
(*it).contains...olumn, parent)Description
TRUEevaluated 933 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 2949 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
933-2949
1472 bool selectable = false;-
1473 for (int i = column; !selectable && i <= (*it).right(); ++i) {
!selectableDescription
TRUEevaluated 944 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 923 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
i <= (*it).right()Description
TRUEevaluated 934 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
10-944
1474 Qt::ItemFlags flags = d->model->index(row, i, parent).flags();-
1475 selectable = flags & Qt::ItemIsSelectable;-
1476 }
executed 934 times by 10 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
934
1477 if (selectable){
selectableDescription
TRUEevaluated 923 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
10-923
1478 column = qMax(column, (*it).right());-
1479 break;
executed 923 times by 10 tests: break;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
923
1480 }-
1481 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_QItemSelectionModel
10
1482 }
executed 2959 times by 7 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
2959
1483 if (it == joined.constEnd())
it == joined.constEnd()Description
TRUEevaluated 843 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 923 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
843-923
1484 return false;
executed 843 times by 5 tests: return false;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
843
1485 }
executed 923 times by 10 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
923
1486 return colCount > 0; // no columns means no selected items
executed 622 times by 9 tests: return colCount > 0;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
622
1487}-
1488-
1489/*!-
1490 Returns \c true if all items are selected in the \a column with the given-
1491 \a parent.-
1492-
1493 Note that this function is usually faster than calling isSelected()-
1494 on all items in the same column and that unselectable items are-
1495 ignored.-
1496*/-
1497bool QItemSelectionModel::isColumnSelected(int column, const QModelIndex &parent) const-
1498{-
1499 Q_D(const QItemSelectionModel);-
1500 if (!d->model)
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 943 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
0-943
1501 return false;
never executed: return false;
0
1502 if (parent.isValid() && d->model != parent.model())
parent.isValid()Description
TRUEevaluated 56 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
FALSEevaluated 887 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
d->model != parent.model()Description
TRUEnever evaluated
FALSEevaluated 56 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
0-887
1503 return false;
never executed: return false;
0
1504-
1505 // return false if column exist in currentSelection (Deselect)-
1506 if (d->currentCommand & Deselect && d->currentSelection.count()) {
d->currentSelection.count()Description
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
FALSEnever evaluated
0-34
1507 for (int i = 0; i < d->currentSelection.count(); ++i) {
i < d->current...ection.count()Description
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
18-34
1508 if (d->currentSelection.at(i).parent() == parent &&
d->currentSele...nt() == parentDescription
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
FALSEnever evaluated
0-34
1509 column >= d->currentSelection.at(i).left() &&
column >= d->c...n.at(i).left()Description
TRUEevaluated 28 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
6-28
1510 column <= d->currentSelection.at(i).right())
column <= d->c....at(i).right()Description
TRUEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_QItemView
12-16
1511 return false;
executed 16 times by 2 tests: return false;
Executed by:
  • tst_QItemView
  • tst_QTableView
16
1512 }
executed 18 times by 2 tests: end of block
Executed by:
  • tst_QItemView
  • tst_QTableView
18
1513 }
executed 18 times by 2 tests: end of block
Executed by:
  • tst_QItemView
  • tst_QTableView
18
1514 // return false if ranges in both currentSelection and the selection model-
1515 // intersect and have the same column contained-
1516 if (d->currentCommand & Toggle && d->currentSelection.count()) {
d->currentSelection.count()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QAbstractItemView
FALSEnever evaluated
0-6
1517 for (int i = 0; i < d->currentSelection.count(); ++i) {
i < d->current...ection.count()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QAbstractItemView
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QAbstractItemView
6
1518 if (d->currentSelection.at(i).left() <= column &&
d->currentSele...ft() <= columnDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QAbstractItemView
FALSEnever evaluated
0-6
1519 d->currentSelection.at(i).right() >= column) {
d->currentSele...ht() >= columnDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QAbstractItemView
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QAbstractItemView
2-4
1520 for (int j = 0; j < d->ranges.count(); ++j) {
j < d->ranges.count()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QAbstractItemView
0-2
1521 if (d->ranges.at(j).left() <= column && d->ranges.at(j).right() >= column
d->ranges.at(j...ft() <= columnDescription
TRUEnever evaluated
FALSEnever evaluated
d->ranges.at(j...ht() >= columnDescription
TRUEnever evaluated
FALSEnever evaluated
0
1522 && d->currentSelection.at(i).intersected(d->ranges.at(j)).isValid()) {
d->currentSele...(j)).isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1523 return false;
never executed: return false;
0
1524 }-
1525 }
never executed: end of block
0
1526 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QAbstractItemView
2
1527 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QAbstractItemView
6
1528 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QAbstractItemView
6
1529 // add ranges and currentSelection and check through them all-
1530 QList<QItemSelectionRange>::const_iterator it;-
1531 QList<QItemSelectionRange> joined = d->ranges;-
1532 if (d->currentSelection.count())
d->currentSelection.count()Description
TRUEevaluated 754 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 173 times by 4 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemView
173-754
1533 joined += d->currentSelection;
executed 754 times by 10 tests: joined += d->currentSelection;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
754
1534 int rowCount = d->model->rowCount(parent);-
1535 for (int row = 0; row < rowCount; ++row) {
row < rowCountDescription
TRUEevaluated 1024 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 130 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
130-1024
1536 for (it = joined.constBegin(); it != joined.constEnd(); ++it) {
it != joined.constEnd()Description
TRUEevaluated 1870 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 797 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
797-1870
1537 if ((*it).contains(row, column, parent)) {
(*it).contains...olumn, parent)Description
TRUEevaluated 238 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 1632 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
238-1632
1538 Qt::ItemFlags flags = d->model->index(row, column, parent).flags();-
1539 if ((flags & Qt::ItemIsSelectable) && (flags & Qt::ItemIsEnabled)) {-
1540 row = qMax(row, (*it).bottom());-
1541 break;
executed 227 times by 9 tests: break;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
227
1542 }-
1543 }
executed 11 times by 1 test: end of block
Executed by:
  • tst_QItemView
11
1544 }
executed 1643 times by 9 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
1643
1545 if (it == joined.constEnd())
it == joined.constEnd()Description
TRUEevaluated 797 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 227 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
227-797
1546 return false;
executed 797 times by 9 tests: return false;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
797
1547 }
executed 227 times by 9 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
227
1548 return rowCount > 0; // no rows means no selected items
executed 130 times by 6 tests: return rowCount > 0;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
130
1549}-
1550-
1551/*!-
1552 Returns \c true if there are any items selected in the \a row with the given-
1553 \a parent.-
1554*/-
1555bool QItemSelectionModel::rowIntersectsSelection(int row, const QModelIndex &parent) const-
1556{-
1557 Q_D(const QItemSelectionModel);-
1558 if (!d->model)
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 1266 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QStyleSheetStyle
  • tst_QTableView
0-1266
1559 return false;
never executed: return false;
0
1560 if (parent.isValid() && d->model != parent.model())
parent.isValid()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 1263 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QStyleSheetStyle
  • tst_QTableView
d->model != parent.model()Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
0-1263
1561 return false;
never executed: return false;
0
1562-
1563 QItemSelection sel = d->ranges;-
1564 sel.merge(d->currentSelection, d->currentCommand);-
1565 for (int i = 0; i < sel.count(); ++i) {
i < sel.count()Description
TRUEevaluated 1038 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 954 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QStyleSheetStyle
  • tst_QTableView
954-1038
1566 QItemSelectionRange range = sel.at(i);-
1567 if (range.parent() != parent)
range.parent() != parentDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
FALSEevaluated 1035 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
3-1035
1568 return false;
executed 3 times by 1 test: return false;
Executed by:
  • tst_QItemSelectionModel
3
1569 int top = range.top();-
1570 int bottom = range.bottom();-
1571 int left = range.left();-
1572 int right = range.right();-
1573 if (top <= row && bottom >= row) {
top <= rowDescription
TRUEevaluated 626 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 409 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
bottom >= rowDescription
TRUEevaluated 351 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 275 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
275-626
1574 for (int j = left; j <= right; j++) {
j <= rightDescription
TRUEevaluated 361 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 42 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QItemView
42-361
1575 const Qt::ItemFlags flags = d->model->index(row, j, parent).flags();-
1576 if ((flags & Qt::ItemIsSelectable) && (flags & Qt::ItemIsEnabled))-
1577 return true;
executed 309 times by 5 tests: return true;
Executed by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
309
1578 }
executed 52 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QItemView
52
1579 }
executed 42 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QItemView
42
1580 }
executed 726 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
726
1581-
1582 return false;
executed 954 times by 8 tests: return false;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QStyleSheetStyle
  • tst_QTableView
954
1583}-
1584-
1585/*!-
1586 Returns \c true if there are any items selected in the \a column with the given-
1587 \a parent.-
1588*/-
1589bool QItemSelectionModel::columnIntersectsSelection(int column, const QModelIndex &parent) const-
1590{-
1591 Q_D(const QItemSelectionModel);-
1592 if (!d->model)
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 659 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QStyleSheetStyle
  • tst_QTableView
0-659
1593 return false;
never executed: return false;
0
1594 if (parent.isValid() && d->model != parent.model())
parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 659 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QStyleSheetStyle
  • tst_QTableView
d->model != parent.model()Description
TRUEnever evaluated
FALSEnever evaluated
0-659
1595 return false;
never executed: return false;
0
1596-
1597 QItemSelection sel = d->ranges;-
1598 sel.merge(d->currentSelection, d->currentCommand);-
1599 for (int i = 0; i < sel.count(); ++i) {
i < sel.count()Description
TRUEevaluated 405 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 426 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QStyleSheetStyle
  • tst_QTableView
405-426
1600 int left = sel.at(i).left();-
1601 int right = sel.at(i).right();-
1602 int top = sel.at(i).top();-
1603 int bottom = sel.at(i).bottom();-
1604 if (left <= column && right >= column) {
left <= columnDescription
TRUEevaluated 345 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 60 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
right >= columnDescription
TRUEevaluated 240 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 105 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
60-345
1605 for (int j = top; j <= bottom; j++) {
j <= bottomDescription
TRUEevaluated 252 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
FALSEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QItemView
7-252
1606 const Qt::ItemFlags flags = d->model->index(j, column, parent).flags();-
1607 if ((flags & Qt::ItemIsSelectable) && (flags & Qt::ItemIsEnabled))-
1608 return true;
executed 233 times by 5 tests: return true;
Executed by:
  • tst_QAbstractItemView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
233
1609 }
executed 19 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QItemView
19
1610 }
executed 7 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QItemView
7
1611 }
executed 172 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
172
1612-
1613 return false;
executed 426 times by 8 tests: return false;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QStyleSheetStyle
  • tst_QTableView
426
1614}-
1615-
1616/*!-
1617 \since 4.2-
1618-
1619 Returns \c true if the selection model contains any selection ranges;-
1620 otherwise returns \c false.-
1621*/-
1622bool QItemSelectionModel::hasSelection() const-
1623{-
1624 Q_D(const QItemSelectionModel);-
1625 if (d->currentCommand & (Toggle | Deselect)) {
d->currentComm...le | Deselect)Description
TRUEevaluated 61 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeWidget
FALSEevaluated 1096 times by 16 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
61-1096
1626 QItemSelection sel = d->ranges;-
1627 sel.merge(d->currentSelection, d->currentCommand);-
1628 return !sel.isEmpty();
executed 61 times by 7 tests: return !sel.isEmpty();
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeWidget
61
1629 } else {-
1630 return !(d->ranges.isEmpty() && d->currentSelection.isEmpty());
executed 1096 times by 16 tests: return !(d->ranges.isEmpty() && d->currentSelection.isEmpty());
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
d->ranges.isEmpty()Description
TRUEevaluated 921 times by 16 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
FALSEevaluated 175 times by 5 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTreeWidget
d->currentSelection.isEmpty()Description
TRUEevaluated 586 times by 16 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QStyleSheetStyle
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
FALSEevaluated 335 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
175-1096
1631 }-
1632}-
1633-
1634/*!-
1635 Returns a list of all selected model item indexes. The list contains no-
1636 duplicates, and is not sorted.-
1637*/-
1638QModelIndexList QItemSelectionModel::selectedIndexes() const-
1639{-
1640 Q_D(const QItemSelectionModel);-
1641 QItemSelection selected = d->ranges;-
1642 selected.merge(d->currentSelection, d->currentCommand);-
1643 return selected.indexes();
executed 588 times by 15 tests: return selected.indexes();
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
588
1644}-
1645-
1646/*!-
1647 \since 4.2-
1648 Returns the indexes in the given \a column for the rows where all columns are selected.-
1649-
1650 \sa selectedIndexes(), selectedColumns()-
1651*/-
1652-
1653QModelIndexList QItemSelectionModel::selectedRows(int column) const-
1654{-
1655 QModelIndexList indexes;-
1656 //the QSet contains pairs of parent modelIndex-
1657 //and row number-
1658 QSet< QPair<QModelIndex, int> > rowsSeen;-
1659-
1660 const QItemSelection ranges = selection();-
1661 for (int i = 0; i < ranges.count(); ++i) {
i < ranges.count()Description
TRUEevaluated 533 times by 6 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 1160 times by 9 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
533-1160
1662 const QItemSelectionRange &range = ranges.at(i);-
1663 QModelIndex parent = range.parent();-
1664 for (int row = range.top(); row <= range.bottom(); row++) {
row <= range.bottom()Description
TRUEevaluated 578 times by 6 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 533 times by 6 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
533-578
1665 QPair<QModelIndex, int> rowDef = qMakePair(parent, row);-
1666 if (!rowsSeen.contains(rowDef)) {
!rowsSeen.contains(rowDef)Description
TRUEevaluated 578 times by 6 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEnever evaluated
0-578
1667 rowsSeen << rowDef;-
1668 if (isRowSelected(row, parent)) {
isRowSelected(row, parent)Description
TRUEevaluated 496 times by 6 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 82 times by 2 tests
Evaluated by:
  • tst_QFiledialog
  • tst_QItemSelectionModel
82-496
1669 indexes.append(model()->index(row, column, parent));-
1670 }
executed 496 times by 6 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
496
1671 }
executed 578 times by 6 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
578
1672 }
executed 578 times by 6 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
578
1673 }
executed 533 times by 6 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
533
1674-
1675 return indexes;
executed 1160 times by 9 tests: return indexes;
Executed by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
1160
1676}-
1677-
1678/*!-
1679 \since 4.2-
1680 Returns the indexes in the given \a row for columns where all rows are selected.-
1681-
1682 \sa selectedIndexes(), selectedRows()-
1683*/-
1684-
1685QModelIndexList QItemSelectionModel::selectedColumns(int row) const-
1686{-
1687 QModelIndexList indexes;-
1688 //the QSet contains pairs of parent modelIndex-
1689 //and column number-
1690 QSet< QPair<QModelIndex, int> > columnsSeen;-
1691-
1692 const QItemSelection ranges = selection();-
1693 for (int i = 0; i < ranges.count(); ++i) {
i < ranges.count()Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QTableView
FALSEevaluated 11 times by 3 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTableView
11-22
1694 const QItemSelectionRange &range = ranges.at(i);-
1695 QModelIndex parent = range.parent();-
1696 for (int column = range.left(); column <= range.right(); column++) {
column <= range.right()Description
TRUEevaluated 59 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QTableView
FALSEevaluated 22 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QTableView
22-59
1697 QPair<QModelIndex, int> columnDef = qMakePair(parent, column);-
1698 if (!columnsSeen.contains(columnDef)) {
!columnsSeen.c...ins(columnDef)Description
TRUEevaluated 59 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QTableView
FALSEnever evaluated
0-59
1699 columnsSeen << columnDef;-
1700 if (isColumnSelected(column, parent)) {
isColumnSelect...olumn, parent)Description
TRUEevaluated 29 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QTableView
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_QTableView
29-30
1701 indexes.append(model()->index(row, column, parent));-
1702 }
executed 29 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QTableView
29
1703 }
executed 59 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QTableView
59
1704 }
executed 59 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QTableView
59
1705 }
executed 22 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QTableView
22
1706-
1707 return indexes;
executed 11 times by 3 tests: return indexes;
Executed by:
  • tst_QAccessibility
  • tst_QItemSelectionModel
  • tst_QTableView
11
1708}-
1709-
1710/*!-
1711 Returns the selection ranges stored in the selection model.-
1712*/-
1713const QItemSelection QItemSelectionModel::selection() const-
1714{-
1715 Q_D(const QItemSelectionModel);-
1716 QItemSelection selected = d->ranges;-
1717 selected.merge(d->currentSelection, d->currentCommand);-
1718 int i = 0;-
1719 // make sure we have no invalid ranges-
1720 // ### should probably be handled more generic somewhere else-
1721 while (i<selected.count()) {
i<selected.count()Description
TRUEevaluated 951 times by 12 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 11428 times by 42 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
951-11428
1722 if (selected.at(i).isValid())
selected.at(i).isValid()Description
TRUEevaluated 951 times by 12 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
FALSEnever evaluated
0-951
1723 ++i;
executed 951 times by 12 tests: ++i;
Executed by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
951
1724 else-
1725 (selected.removeAt(i));
never executed: (selected.removeAt(i));
0
1726 }-
1727 return selected;
executed 11428 times by 42 tests: return selected;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
11428
1728}-
1729-
1730/*!-
1731 \since 5.5-
1732-
1733 \property QItemSelectionModel::hasSelection-
1734 \internal-
1735*/-
1736/*!-
1737 \since 5.5-
1738-
1739 \property QItemSelectionModel::currentIndex-
1740 \internal-
1741*/-
1742/*!-
1743 \since 5.5-
1744-
1745 \property QItemSelectionModel::selectedIndexes-
1746*/-
1747-
1748/*!-
1749 \since 5.5-
1750-
1751 \property QItemSelectionModel::selection-
1752 \internal-
1753*/-
1754/*!-
1755 \since 5.5-
1756-
1757 \property QItemSelectionModel::model-
1758 \internal-
1759*/-
1760/*!-
1761 \since 5.5-
1762-
1763 Returns the item model operated on by the selection model.-
1764*/-
1765QAbstractItemModel *QItemSelectionModel::model()-
1766{-
1767 return d_func()->model;
executed 12749 times by 42 tests: return d_func()->model;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QInputDialog
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • ...
12749
1768}-
1769-
1770/*!-
1771 Returns the item model operated on by the selection model.-
1772*/-
1773const QAbstractItemModel *QItemSelectionModel::model() const-
1774{-
1775 return d_func()->model;
executed 525 times by 6 tests: return d_func()->model;
Executed by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
525
1776}-
1777-
1778/*!-
1779 \since 5.5-
1780-
1781 Sets the model to \a model. The modelChanged() signal will be emitted.-
1782-
1783 \sa model(), modelChanged()-
1784*/-
1785void QItemSelectionModel::setModel(QAbstractItemModel *model)-
1786{-
1787 Q_D(QItemSelectionModel);-
1788 if (d->model == model)
d->model == modelDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QItemSelectionModel
0-2
1789 return;
never executed: return;
0
1790-
1791 d->initModel(model);-
1792 emit modelChanged(model);-
1793}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QItemSelectionModel
2
1794-
1795/*!-
1796 Compares the two selections \a newSelection and \a oldSelection-
1797 and emits selectionChanged() with the deselected and selected items.-
1798*/-
1799void QItemSelectionModel::emitSelectionChanged(const QItemSelection &newSelection,-
1800 const QItemSelection &oldSelection)-
1801{-
1802 // if both selections are empty or equal we return-
1803 if ((oldSelection.isEmpty() && newSelection.isEmpty()) ||
oldSelection.isEmpty()Description
TRUEevaluated 2588 times by 29 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • ...
FALSEevaluated 4716 times by 26 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • ...
newSelection.isEmpty()Description
TRUEevaluated 611 times by 24 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFontDialog
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 1977 times by 27 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
611-4716
1804 oldSelection == newSelection)
oldSelection == newSelectionDescription
TRUEevaluated 1070 times by 22 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 5623 times by 27 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
1070-5623
1805 return;
executed 1681 times by 26 tests: return;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QItemDelegate
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
1681
1806-
1807 // if either selection is empty we do not need to compare-
1808 if (oldSelection.isEmpty() || newSelection.isEmpty()) {
oldSelection.isEmpty()Description
TRUEevaluated 1977 times by 27 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
FALSEevaluated 3646 times by 25 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
  • tst_languageChange
newSelection.isEmpty()Description
TRUEevaluated 1248 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QDateTimeEdit
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSidebar
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
FALSEevaluated 2398 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
1248-3646
1809 emit selectionChanged(newSelection, oldSelection);-
1810 return;
executed 3225 times by 27 tests: return;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDirModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QMenu
  • tst_QSidebar
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTableWidget
  • tst_QTreeView
  • tst_QTreeWidget
  • ...
3225
1811 }-
1812-
1813 QItemSelection deselected = oldSelection;-
1814 QItemSelection selected = newSelection;-
1815-
1816 // remove equal ranges-
1817 bool advance;-
1818 for (int o = 0; o < deselected.count(); ++o) {
o < deselected.count()Description
TRUEevaluated 2570 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 2398 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
2398-2570
1819 advance = true;-
1820 for (int s = 0; s < selected.count() && o < deselected.count();) {
s < selected.count()Description
TRUEevaluated 3665 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 2360 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
o < deselected.count()Description
TRUEevaluated 3455 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 210 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
210-3665
1821 if (deselected.at(o) == selected.at(s)) {
deselected.at(...selected.at(s)Description
TRUEevaluated 817 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 2638 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
817-2638
1822 deselected.removeAt(o);-
1823 selected.removeAt(s);-
1824 advance = false;-
1825 } else {
executed 817 times by 14 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
817
1826 ++s;-
1827 }
executed 2638 times by 17 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
2638
1828 }-
1829 if (advance)
advanceDescription
TRUEevaluated 2269 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 301 times by 14 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
301-2269
1830 ++o;
executed 2269 times by 17 tests: ++o;
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
2269
1831 }
executed 2570 times by 19 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
2570
1832-
1833 // find intersections-
1834 QItemSelection intersections;-
1835 for (int o = 0; o < deselected.count(); ++o) {
o < deselected.count()Description
TRUEevaluated 2492 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 2398 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
2398-2492
1836 for (int s = 0; s < selected.count(); ++s) {
s < selected.count()Description
TRUEevaluated 2737 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
FALSEevaluated 2492 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
2492-2737
1837 if (deselected.at(o).intersects(selected.at(s)))
deselected.at(...elected.at(s))Description
TRUEevaluated 305 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
FALSEevaluated 2432 times by 17 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
305-2432
1838 intersections.append(deselected.at(o).intersected(selected.at(s)));
executed 305 times by 10 tests: intersections.append(deselected.at(o).intersected(selected.at(s)));
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
305
1839 }
executed 2737 times by 17 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
2737
1840 }
executed 2492 times by 17 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
2492
1841-
1842 // compare remaining ranges with intersections and split them to find deselected and selected-
1843 for (int i = 0; i < intersections.count(); ++i) {
i < intersections.count()Description
TRUEevaluated 305 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
FALSEevaluated 2398 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
305-2398
1844 // split deselected-
1845 for (int o = 0; o < deselected.count();) {
o < deselected.count()Description
TRUEevaluated 754 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
FALSEevaluated 305 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
305-754
1846 if (deselected.at(o).intersects(intersections.at(i))) {
deselected.at(...ections.at(i))Description
TRUEevaluated 307 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
FALSEevaluated 447 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeWidget
307-447
1847 QItemSelection::split(deselected.at(o), intersections.at(i), &deselected);-
1848 deselected.removeAt(o);-
1849 } else {
executed 307 times by 10 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
307
1850 ++o;-
1851 }
executed 447 times by 8 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeWidget
447
1852 }-
1853 // split selected-
1854 for (int s = 0; s < selected.count();) {
s < selected.count()Description
TRUEevaluated 741 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
FALSEevaluated 305 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
305-741
1855 if (selected.at(s).intersects(intersections.at(i))) {
selected.at(s)...ections.at(i))Description
TRUEevaluated 316 times by 10 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
FALSEevaluated 425 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
316-425
1856 QItemSelection::split(selected.at(s), intersections.at(i), &selected);-
1857 selected.removeAt(s);-
1858 } else {
executed 316 times by 10 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
316
1859 ++s;-
1860 }
executed 425 times by 7 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
425
1861 }-
1862 }
executed 305 times by 10 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QTableView
  • tst_QTreeWidget
305
1863-
1864 if (!selected.isEmpty() || !deselected.isEmpty())
!selected.isEmpty()Description
TRUEevaluated 2285 times by 19 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
FALSEevaluated 113 times by 9 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeWidget
!deselected.isEmpty()Description
TRUEevaluated 103 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QTableView
  • tst_QTreeWidget
FALSEevaluated 10 times by 3 tests
Evaluated by:
  • tst_QItemDelegate
  • tst_QItemView
  • tst_QTableView
10-2285
1865 emit selectionChanged(selected, deselected);
executed 2388 times by 19 tests: selectionChanged(selected, deselected);
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
2388
1866}
executed 2398 times by 19 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QAccessibility
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QItemDelegate
  • tst_QItemSelectionModel
  • tst_QItemView
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStandardItemModel
  • tst_QTableView
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_QTreeWidgetItemIterator
2398
1867-
1868#ifndef QT_NO_DEBUG_STREAM-
1869QDebug operator<<(QDebug dbg, const QItemSelectionRange &range)-
1870{-
1871 QDebugStateSaver saver(dbg);-
1872 dbg.nospace() << "QItemSelectionRange(" << range.topLeft()-
1873 << ',' << range.bottomRight() << ')';-
1874 return dbg;
never executed: return dbg;
0
1875}-
1876#endif-
1877-
1878QT_END_NAMESPACE-
1879-
1880#include "moc_qitemselectionmodel.cpp"-
1881-
1882#endif // QT_NO_ITEMVIEWS-
Source codeSwitch to Preprocessed file

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