OpenCoverage

qabstractitemview.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/itemviews/qabstractitemview.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12QAbstractItemViewPrivate::QAbstractItemViewPrivate()-
13 : model(QAbstractItemModelPrivate::staticEmptyModel()),-
14 itemDelegate(0),-
15 selectionModel(0),-
16 ctrlDragSelectionFlag(QItemSelectionModel::NoUpdate),-
17 noSelectionOnMousePress(false),-
18 selectionMode(QAbstractItemView::ExtendedSelection),-
19 selectionBehavior(QAbstractItemView::SelectItems),-
20 currentlyCommittingEditor(0),-
21 pressedModifiers(Qt::NoModifier),-
22 pressedPosition(QPoint(-1, -1)),-
23 pressedAlreadySelected(false),-
24 viewportEnteredNeeded(false),-
25 state(QAbstractItemView::NoState),-
26 stateBeforeAnimation(QAbstractItemView::NoState),-
27 editTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed),-
28 lastTrigger(QAbstractItemView::NoEditTriggers),-
29 tabKeyNavigation(false),-
30-
31 showDropIndicator(true),-
32 dragEnabled(false),-
33 dragDropMode(QAbstractItemView::NoDragDrop),-
34 overwrite(false),-
35 dropIndicatorPosition(QAbstractItemView::OnItem),-
36 defaultDropAction(Qt::IgnoreAction),-
37-
38 autoScroll(true),-
39 autoScrollMargin(16),-
40 autoScrollCount(0),-
41 shouldScrollToCurrentOnShow(false),-
42 shouldClearStatusTip(false),-
43 alternatingColors(false),-
44 textElideMode(Qt::ElideRight),-
45 verticalScrollMode(QAbstractItemView::ScrollPerItem),-
46 horizontalScrollMode(QAbstractItemView::ScrollPerItem),-
47 currentIndexSet(false),-
48 wrapItemText(false),-
49 delayedPendingLayout(true),-
50 moveCursorUpdatedView(false),-
51 verticalScrollModeSet(false),-
52 horizontalScrollModeSet(false)-
53{-
54 keyboardInputTime.invalidate();-
55}
never executed: end of block
0
56-
57QAbstractItemViewPrivate::~QAbstractItemViewPrivate()-
58{-
59}-
60-
61void QAbstractItemViewPrivate::init()-
62{-
63 QAbstractItemView * const q = q_func();-
64 q->setItemDelegate(new QStyledItemDelegate(q));-
65-
66 vbar->setRange(0, 0);-
67 hbar->setRange(0, 0);-
68-
69 QObject::connect(vbar, qFlagLocation("2""actionTriggered(int)" "\0" __FILE__ ":" "132"),-
70 q, qFlagLocation("1""verticalScrollbarAction(int)" "\0" __FILE__ ":" "133"));-
71 QObject::connect(hbar, qFlagLocation("2""actionTriggered(int)" "\0" __FILE__ ":" "134"),-
72 q, qFlagLocation("1""horizontalScrollbarAction(int)" "\0" __FILE__ ":" "135"));-
73 QObject::connect(vbar, qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "136"),-
74 q, qFlagLocation("1""verticalScrollbarValueChanged(int)" "\0" __FILE__ ":" "137"));-
75 QObject::connect(hbar, qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "138"),-
76 q, qFlagLocation("1""horizontalScrollbarValueChanged(int)" "\0" __FILE__ ":" "139"));-
77-
78 viewport->setBackgroundRole(QPalette::Base);-
79-
80 q->setAttribute(Qt::WA_InputMethodEnabled);-
81-
82 verticalScrollMode = static_cast<QAbstractItemView::ScrollMode>(q->style()->styleHint(QStyle::SH_ItemView_ScrollMode, 0, q, 0));-
83 horizontalScrollMode = static_cast<QAbstractItemView::ScrollMode>(q->style()->styleHint(QStyle::SH_ItemView_ScrollMode, 0, q, 0));-
84}
never executed: end of block
0
85-
86void QAbstractItemViewPrivate::setHoverIndex(const QPersistentModelIndex &index)-
87{-
88 QAbstractItemView * const q = q_func();-
89 if (hover == index
hover == indexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
90 return;
never executed: return;
0
91-
92 if (selectionBehavior != QAbstractItemView::SelectRows
selectionBehav...ew::SelectRowsDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
93 q->update(hover);-
94 q->update(index);-
95 }
never executed: end of block
else {
0
96 QRect oldHoverRect = q->visualRect(hover);-
97 QRect newHoverRect = q->visualRect(index);-
98 viewport->update(QRect(0, newHoverRect.y(), viewport->width(), newHoverRect.height()));-
99 viewport->update(QRect(0, oldHoverRect.y(), viewport->width(), oldHoverRect.height()));-
100 }
never executed: end of block
0
101 hover = index;-
102}
never executed: end of block
0
103-
104void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index)-
105{-
106-
107 QAbstractItemView * const q = q_func();-
108 setHoverIndex(index);-
109 if (viewportEnteredNeeded
viewportEnteredNeededDescription
TRUEnever evaluated
FALSEnever evaluated
|| enteredIndex != index
enteredIndex != indexDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
110 viewportEnteredNeeded = false;-
111-
112 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
113 q->entered(index);-
114-
115 QString statustip = model->data(index, Qt::StatusTipRole).toString();-
116 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
&& (shouldClearStatusTip
shouldClearStatusTipDescription
TRUEnever evaluated
FALSEnever evaluated
|| !statustip.isEmpty()
!statustip.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
117 QStatusTipEvent tip(statustip);-
118 QApplication::sendEvent(parent, &tip);-
119 shouldClearStatusTip = !statustip.isEmpty();-
120 }
never executed: end of block
0
121-
122 }
never executed: end of block
else {
0
123-
124 if (parent
parentDescription
TRUEnever evaluated
FALSEnever evaluated
&& shouldClearStatusTip
shouldClearStatusTipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
125 QString emptyString;-
126 QStatusTipEvent tip( emptyString );-
127 QApplication::sendEvent(parent, &tip);-
128 }
never executed: end of block
0
129-
130 q->viewportEntered();-
131 }
never executed: end of block
0
132 enteredIndex = index;-
133 }
never executed: end of block
0
134}
never executed: end of block
0
135-
136-
137-
138-
139void QAbstractItemViewPrivate::_q_scrollerStateChanged()-
140{-
141 QAbstractItemView * const q = q_func();-
142-
143 if (QScroller *scroller = QScroller::scroller(viewport)
QScroller *scr...ller(viewport)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
144 switch (scroller->state()) {-
145 case
never executed: case QScroller::Pressed:
QScroller::Pressed:
never executed: case QScroller::Pressed:
0
146-
147 if (q->selectionModel()
q->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
148 oldSelection = q->selectionModel()->selection();-
149 oldCurrent = q->selectionModel()->currentIndex();-
150 }
never executed: end of block
0
151 break;
never executed: break;
0
152-
153 case
never executed: case QScroller::Dragging:
QScroller::Dragging:
never executed: case QScroller::Dragging:
0
154-
155 if (q->selectionModel()
q->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
156 q->selectionModel()->select(oldSelection, QItemSelectionModel::ClearAndSelect);-
157 q->selectionModel()->setCurrentIndex(oldCurrent, QItemSelectionModel::NoUpdate);-
158 }
never executed: end of block
0
159-
160-
161 default
never executed: default:
:
never executed: default:
code before this statement never executed: default:
0
162 oldSelection = QItemSelection();-
163 oldCurrent = QModelIndex();-
164 break;
never executed: break;
0
165 }-
166 }-
167}
never executed: end of block
0
168QAbstractItemView::QAbstractItemView(QWidget *parent)-
169 : QAbstractScrollArea(*(new QAbstractItemViewPrivate), parent)-
170{-
171 d_func()->init();-
172}
never executed: end of block
0
173-
174-
175-
176-
177QAbstractItemView::QAbstractItemView(QAbstractItemViewPrivate &dd, QWidget *parent)-
178 : QAbstractScrollArea(dd, parent)-
179{-
180 d_func()->init();-
181}
never executed: end of block
0
182-
183-
184-
185-
186QAbstractItemView::~QAbstractItemView()-
187{-
188 QAbstractItemViewPrivate * const d = d_func();-
189-
190 d->delayedReset.stop();-
191 d->updateTimer.stop();-
192 d->delayedEditing.stop();-
193 d->delayedAutoScroll.stop();-
194 d->autoScrollTimer.stop();-
195 d->delayedLayout.stop();-
196 d->fetchMoreTimer.stop();-
197}
never executed: end of block
0
198void QAbstractItemView::setModel(QAbstractItemModel *model)-
199{-
200 QAbstractItemViewPrivate * const d = d_func();-
201 if (model == d->model
model == d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
202 return;
never executed: return;
0
203 if (d->model
d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->model != QAbstractItemModelPrivate::staticEmptyModel()
d->model != QA...icEmptyModel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
204 disconnect(d->model, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "675"),-
205 this, qFlagLocation("1""_q_modelDestroyed()" "\0" __FILE__ ":" "676"));-
206 disconnect(d->model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "677"),-
207 this, qFlagLocation("1""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "678"));-
208 disconnect(d->model, qFlagLocation("2""headerDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "679"),-
209 this, qFlagLocation("1""_q_headerDataChanged()" "\0" __FILE__ ":" "680"));-
210 disconnect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "681"),-
211 this, qFlagLocation("1""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "682"));-
212 disconnect(d->model, qFlagLocation("2""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "683"),-
213 this, qFlagLocation("1""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "684"));-
214 disconnect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "685"),-
215 this, qFlagLocation("1""_q_rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "686"));-
216 disconnect(d->model, qFlagLocation("2""rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "687"),-
217 this, qFlagLocation("1""_q_rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "688"));-
218 disconnect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "689"),-
219 this, qFlagLocation("1""_q_rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "690"));-
220 disconnect(d->model, qFlagLocation("2""columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "691"),-
221 this, qFlagLocation("1""_q_columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "692"));-
222 disconnect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "693"),-
223 this, qFlagLocation("1""_q_columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "694"));-
224 disconnect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "695"),-
225 this, qFlagLocation("1""_q_columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "696"));-
226 disconnect(d->model, qFlagLocation("2""columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "697"),-
227 this, qFlagLocation("1""_q_columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "698"));-
228-
229 disconnect(d->model, qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "700"), this, qFlagLocation("1""reset()" "\0" __FILE__ ":" "700"));-
230 disconnect(d->model, qFlagLocation("2""layoutChanged()" "\0" __FILE__ ":" "701"), this, qFlagLocation("1""_q_layoutChanged()" "\0" __FILE__ ":" "701"));-
231 }
never executed: end of block
0
232 d->model = (model
modelDescription
TRUEnever evaluated
FALSEnever evaluated
? model : QAbstractItemModelPrivate::staticEmptyModel());
0
233-
234-
235 ((!(d->model->index(0,0) == d->model->index(0,0))) ? qt_assert_x("QAbstractItemView::setModel", "A model should return the exact same index " "(including its internal id/pointer) when asked for it twice in a row.",-
236-
237-
238 __FILE__-
239 ,-
240-
241-
242 709-
243 ) : qt_noop())-
244-
245-
246 ;-
247 ((!(!d->model->index(0,0).parent().isValid())) ? qt_assert_x("QAbstractItemView::setModel", "The parent of a top level index should be invalid",-
248-
249 __FILE__-
250 ,-
251-
252 712-
253 ) : qt_noop())-
254-
255 ;-
256-
257 if (d->model != QAbstractItemModelPrivate::staticEmptyModel()
d->model != QA...icEmptyModel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
258 connect(d->model, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "715"),-
259 this, qFlagLocation("1""_q_modelDestroyed()" "\0" __FILE__ ":" "716"));-
260 connect(d->model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "717"),-
261 this, qFlagLocation("1""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "718"));-
262 connect(d->model, qFlagLocation("2""headerDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "719"),-
263 this, qFlagLocation("1""_q_headerDataChanged()" "\0" __FILE__ ":" "720"));-
264 connect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "721"),-
265 this, qFlagLocation("1""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "722"));-
266 connect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "723"),-
267 this, qFlagLocation("1""_q_rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "724"));-
268 connect(d->model, qFlagLocation("2""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "725"),-
269 this, qFlagLocation("1""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "726"));-
270 connect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "727"),-
271 this, qFlagLocation("1""_q_rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "728"));-
272 connect(d->model, qFlagLocation("2""rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "729"),-
273 this, qFlagLocation("1""_q_rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "730"));-
274 connect(d->model, qFlagLocation("2""columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "731"),-
275 this, qFlagLocation("1""_q_columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "732"));-
276 connect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "733"),-
277 this, qFlagLocation("1""_q_columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "734"));-
278 connect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "735"),-
279 this, qFlagLocation("1""_q_columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "736"));-
280 connect(d->model, qFlagLocation("2""columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "737"),-
281 this, qFlagLocation("1""_q_columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "738"));-
282-
283 connect(d->model, qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "740"), this, qFlagLocation("1""reset()" "\0" __FILE__ ":" "740"));-
284 connect(d->model, qFlagLocation("2""layoutChanged()" "\0" __FILE__ ":" "741"), this, qFlagLocation("1""_q_layoutChanged()" "\0" __FILE__ ":" "741"));-
285 }
never executed: end of block
0
286-
287 QItemSelectionModel *selection_model = new QItemSelectionModel(d->model, this);-
288 connect(d->model, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "745"), selection_model, qFlagLocation("1""deleteLater()" "\0" __FILE__ ":" "745"));-
289 setSelectionModel(selection_model);-
290-
291 reset();-
292}
never executed: end of block
0
293-
294-
295-
296-
297QAbstractItemModel *QAbstractItemView::model() const-
298{-
299 const QAbstractItemViewPrivate * const d = d_func();-
300 return
never executed: return (d->model == QAbstractItemModelPrivate::staticEmptyModel() ? 0 : d->model);
(d->model == QAbstractItemModelPrivate::staticEmptyModel() ? 0 : d->model);
never executed: return (d->model == QAbstractItemModelPrivate::staticEmptyModel() ? 0 : d->model);
0
301}-
302void QAbstractItemView::setSelectionModel(QItemSelectionModel *selectionModel)-
303{-
304-
305 ((!(selectionModel)) ? qt_assert("selectionModel",__FILE__,777) : qt_noop());-
306 QAbstractItemViewPrivate * const d = d_func();-
307-
308 if (__builtin_expect(!!(selectionModel->model() != d->model), false)
__builtin_expe...model), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
309 QMessageLogger(__FILE__, 781, __PRETTY_FUNCTION__).warning("QAbstractItemView::setSelectionModel() failed: "-
310 "Trying to set a selection model, which works on "-
311 "a different model than the view.");-
312 return;
never executed: return;
0
313 }-
314-
315 QItemSelection oldSelection;-
316 QModelIndex oldCurrentIndex;-
317-
318 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
319 if (d->selectionModel->model() == selectionModel->model()
d->selectionMo...Model->model()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
320 oldSelection = d->selectionModel->selection();-
321 oldCurrentIndex = d->selectionModel->currentIndex();-
322 }
never executed: end of block
0
323-
324 disconnect(d->selectionModel, qFlagLocation("2""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "796"),-
325 this, qFlagLocation("1""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "797"));-
326 disconnect(d->selectionModel, qFlagLocation("2""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "798"),-
327 this, qFlagLocation("1""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "799"));-
328 }
never executed: end of block
0
329-
330 d->selectionModel = selectionModel;-
331-
332 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
333 connect(d->selectionModel, qFlagLocation("2""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "805"),-
334 this, qFlagLocation("1""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "806"));-
335 connect(d->selectionModel, qFlagLocation("2""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "807"),-
336 this, qFlagLocation("1""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "808"));-
337-
338 selectionChanged(d->selectionModel->selection(), oldSelection);-
339 currentChanged(d->selectionModel->currentIndex(), oldCurrentIndex);-
340 }
never executed: end of block
0
341}
never executed: end of block
0
342-
343-
344-
345-
346-
347-
348QItemSelectionModel* QAbstractItemView::selectionModel() const-
349{-
350 const QAbstractItemViewPrivate * const d = d_func();-
351 return
never executed: return d->selectionModel;
d->selectionModel;
never executed: return d->selectionModel;
0
352}-
353void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate)-
354{-
355 QAbstractItemViewPrivate * const d = d_func();-
356 if (delegate
delegate == d->itemDelegateDescription
TRUEnever evaluated
FALSEnever evaluated
== d->itemDelegate
delegate == d->itemDelegateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
357 return;
never executed: return;
0
358-
359 if (d->itemDelegate
d->itemDelegateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
360 if (d->delegateRefCount(d->itemDelegate) == 1
d->delegateRef...Delegate) == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
361 disconnect(d->itemDelegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "849"),-
362 this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "850"));-
363 disconnect(d->itemDelegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "851"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "851"));-
364 disconnect(d->itemDelegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "852"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "852"));-
365 }
never executed: end of block
0
366 }
never executed: end of block
0
367-
368 if (delegate
delegateDescription
TRUEnever evaluated
FALSEnever evaluated
)
{
0
369 if (d->delegateRefCount(delegate) == 0
d->delegateRef...delegate) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
370 connect(delegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "858"),-
371 this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "859"));-
372 connect(delegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "860"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "860"));-
373 connect(delegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "861"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "861"), Qt::QueuedConnection);-
374 }
never executed: end of block
0
375 }
never executed: end of block
0
376 d->itemDelegate = delegate;-
377 viewport()->update();-
378 d->doDelayedItemsLayout();-
379}
never executed: end of block
0
380-
381-
382-
383-
384-
385-
386-
387QAbstractItemDelegate *QAbstractItemView::itemDelegate() const-
388{-
389 return
never executed: return d_func()->itemDelegate;
d_func()->itemDelegate;
never executed: return d_func()->itemDelegate;
0
390}-
391-
392-
393-
394-
395QVariant QAbstractItemView::inputMethodQuery(Qt::InputMethodQuery query) const-
396{-
397 const QModelIndex current = currentIndex();-
398 if (!current.isValid()
!current.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| query != Qt::ImCursorRectangle
query != Qt::ImCursorRectangleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
399 return
never executed: return QAbstractScrollArea::inputMethodQuery(query);
QAbstractScrollArea::inputMethodQuery(query);
never executed: return QAbstractScrollArea::inputMethodQuery(query);
0
400 return
never executed: return visualRect(current);
visualRect(current);
never executed: return visualRect(current);
0
401}-
402void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *delegate)-
403{-
404 QAbstractItemViewPrivate * const d = d_func();-
405 if (QAbstractItemDelegate *rowDelegate = d->rowDelegates.value(row, 0)
QAbstractItemD....value(row, 0)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
406 if (d->delegateRefCount(rowDelegate) == 1
d->delegateRef...Delegate) == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
407 disconnect(rowDelegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "917"),-
408 this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "918"));-
409 disconnect(rowDelegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "919"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "919"));-
410 disconnect(rowDelegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "920"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "920"));-
411 }
never executed: end of block
0
412 d->rowDelegates.remove(row);-
413 }
never executed: end of block
0
414 if (delegate
delegateDescription
TRUEnever evaluated
FALSEnever evaluated
)
{
0
415 if (d->delegateRefCount(delegate) == 0
d->delegateRef...delegate) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
416 connect(delegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "926"),-
417 this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "927"));-
418 connect(delegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "928"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "928"));-
419 connect(delegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "929"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "929"), Qt::QueuedConnection);-
420 }
never executed: end of block
0
421 d->rowDelegates.insert(row, delegate);-
422 }
never executed: end of block
0
423 viewport()->update();-
424 d->doDelayedItemsLayout();-
425}
never executed: end of block
0
426QAbstractItemDelegate *QAbstractItemView::itemDelegateForRow(int row) const-
427{-
428 const QAbstractItemViewPrivate * const d = d_func();-
429 return
never executed: return d->rowDelegates.value(row, 0);
d->rowDelegates.value(row, 0);
never executed: return d->rowDelegates.value(row, 0);
0
430}-
431void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate)-
432{-
433 QAbstractItemViewPrivate * const d = d_func();-
434 if (QAbstractItemDelegate *columnDelegate = d->columnDelegates.value(column, 0)
QAbstractItemD...lue(column, 0)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
435 if (d->delegateRefCount(columnDelegate) == 1
d->delegateRef...Delegate) == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
436 disconnect(columnDelegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "977"),-
437 this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "978"));-
438 disconnect(columnDelegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "979"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "979"));-
439 disconnect(columnDelegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "980"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "980"));-
440 }
never executed: end of block
0
441 d->columnDelegates.remove(column);-
442 }
never executed: end of block
0
443 if (delegate
delegateDescription
TRUEnever evaluated
FALSEnever evaluated
)
{
0
444 if (d->delegateRefCount(delegate) == 0
d->delegateRef...delegate) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
445 connect(delegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "986"),-
446 this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "987"));-
447 connect(delegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "988"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "988"));-
448 connect(delegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "989"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "989"), Qt::QueuedConnection);-
449 }
never executed: end of block
0
450 d->columnDelegates.insert(column, delegate);-
451 }
never executed: end of block
0
452 viewport()->update();-
453 d->doDelayedItemsLayout();-
454}
never executed: end of block
0
455QAbstractItemDelegate *QAbstractItemView::itemDelegateForColumn(int column) const-
456{-
457 const QAbstractItemViewPrivate * const d = d_func();-
458 return
never executed: return d->columnDelegates.value(column, 0);
d->columnDelegates.value(column, 0);
never executed: return d->columnDelegates.value(column, 0);
0
459}-
460-
461-
462-
463-
464-
465QAbstractItemDelegate *QAbstractItemView::itemDelegate(const QModelIndex &index) const-
466{-
467 const QAbstractItemViewPrivate * const d = d_func();-
468 return
never executed: return d->delegateForIndex(index);
d->delegateForIndex(index);
never executed: return d->delegateForIndex(index);
0
469}-
470void QAbstractItemView::setSelectionMode(SelectionMode mode)-
471{-
472 QAbstractItemViewPrivate * const d = d_func();-
473 d->selectionMode = mode;-
474}
never executed: end of block
0
475-
476QAbstractItemView::SelectionMode QAbstractItemView::selectionMode() const-
477{-
478 const QAbstractItemViewPrivate * const d = d_func();-
479 return
never executed: return d->selectionMode;
d->selectionMode;
never executed: return d->selectionMode;
0
480}-
481void QAbstractItemView::setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)-
482{-
483 QAbstractItemViewPrivate * const d = d_func();-
484 d->selectionBehavior = behavior;-
485}
never executed: end of block
0
486-
487QAbstractItemView::SelectionBehavior QAbstractItemView::selectionBehavior() const-
488{-
489 const QAbstractItemViewPrivate * const d = d_func();-
490 return
never executed: return d->selectionBehavior;
d->selectionBehavior;
never executed: return d->selectionBehavior;
0
491}-
492void QAbstractItemView::setCurrentIndex(const QModelIndex &index)-
493{-
494 QAbstractItemViewPrivate * const d = d_func();-
495 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
&& (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| d->isIndexEnabled(index)
d->isIndexEnabled(index)Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
496 QItemSelectionModel::SelectionFlags command = selectionCommand(index, 0);-
497 d->selectionModel->setCurrentIndex(index, command);-
498 d->currentIndexSet = true;-
499 if ((
(command & QIt...:Current) == 0Description
TRUEnever evaluated
FALSEnever evaluated
command & QItemSelectionModel::Current) == 0
(command & QIt...:Current) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
500 d->currentSelectionStartIndex = index;
never executed: d->currentSelectionStartIndex = index;
0
501 }
never executed: end of block
0
502}
never executed: end of block
0
503-
504-
505-
506-
507-
508-
509QModelIndex QAbstractItemView::currentIndex() const-
510{-
511 const QAbstractItemViewPrivate * const d = d_func();-
512 return
never executed: return d->selectionModel ? d->selectionModel->currentIndex() : QModelIndex();
d->selectionModel ? d->selectionModel->currentIndex() : QModelIndex();
never executed: return d->selectionModel ? d->selectionModel->currentIndex() : QModelIndex();
0
513}-
514void QAbstractItemView::reset()-
515{-
516 QAbstractItemViewPrivate * const d = d_func();-
517 d->delayedReset.stop();-
518 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d->indexEditorHash)>::type> _container_((d->indexEditorHash)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QEditorInfo &info = *_container_.i; _container_.control; _container_.control = 0) {-
519 if (info.widget
info.widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
520 d->releaseEditor(info.widget.data(), d->indexForEditor(info.widget.data()));
never executed: d->releaseEditor(info.widget.data(), d->indexForEditor(info.widget.data()));
0
521 }
never executed: end of block
0
522 d->editorIndexHash.clear();-
523 d->indexEditorHash.clear();-
524 d->persistent.clear();-
525 d->currentIndexSet = false;-
526 setState(NoState);-
527 setRootIndex(QModelIndex());-
528 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
529 d->selectionModel->reset();
never executed: d->selectionModel->reset();
0
530-
531 if (QAccessible::isActive()
QAccessible::isActive()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
532 QAccessibleTableModelChangeEvent accessibleEvent(this, QAccessibleTableModelChangeEvent::ModelReset);-
533 QAccessible::updateAccessibility(&accessibleEvent);-
534 }
never executed: end of block
0
535-
536 d->updateGeometry();-
537}
never executed: end of block
0
538-
539-
540-
541-
542-
543-
544void QAbstractItemView::setRootIndex(const QModelIndex &index)-
545{-
546 QAbstractItemViewPrivate * const d = d_func();-
547 if (__builtin_expect(!!(index.isValid() && index.model() != d->model), false)
__builtin_expe...model), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
548 QMessageLogger(__FILE__, 1147, __PRETTY_FUNCTION__).warning("QAbstractItemView::setRootIndex failed : index must be from the currently set model");-
549 return;
never executed: return;
0
550 }-
551 d->root = index;-
552 d->doDelayedItemsLayout();-
553 d->updateGeometry();-
554}
never executed: end of block
0
555-
556-
557-
558-
559-
560-
561-
562QModelIndex QAbstractItemView::rootIndex() const-
563{-
564 return
never executed: return QModelIndex(d_func()->root);
QModelIndex(d_func()->root);
never executed: return QModelIndex(d_func()->root);
0
565}-
566void QAbstractItemView::selectAll()-
567{-
568 QAbstractItemViewPrivate * const d = d_func();-
569 SelectionMode mode = d->selectionMode;-
570 if (mode == MultiSelection
mode == MultiSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
|| mode == ExtendedSelection
mode == ExtendedSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
571 d->selectAll(QItemSelectionModel::ClearAndSelect
never executed: d->selectAll(QItemSelectionModel::ClearAndSelect |d->selectionBehaviorFlags());
0
572 |d->selectionBehaviorFlags());
never executed: d->selectAll(QItemSelectionModel::ClearAndSelect |d->selectionBehaviorFlags());
0
573 else if (mode != SingleSelection
mode != SingleSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
574 d->selectAll(selectionCommand(d->model->index(0, 0, d->root)));
never executed: d->selectAll(selectionCommand(d->model->index(0, 0, d->root)));
0
575}
never executed: end of block
0
576void QAbstractItemView::edit(const QModelIndex &index)-
577{-
578 QAbstractItemViewPrivate * const d = d_func();-
579 if (__builtin_expect(!!(!d->isIndexValid(index)), false)
__builtin_expe...ndex)), false)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
580 QMessageLogger(__FILE__, 1200, __PRETTY_FUNCTION__).warning("edit: index was invalid");
never executed: QMessageLogger(__FILE__, 1200, __PRETTY_FUNCTION__).warning("edit: index was invalid");
0
581 if (__builtin_expect(!!(!edit(index, AllEditTriggers, 0)), false)
__builtin_expe...s, 0)), false)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
582 QMessageLogger(__FILE__, 1202, __PRETTY_FUNCTION__).warning("edit: editing failed");
never executed: QMessageLogger(__FILE__, 1202, __PRETTY_FUNCTION__).warning("edit: editing failed");
0
583}
never executed: end of block
0
584-
585-
586-
587-
588-
589-
590void QAbstractItemView::clearSelection()-
591{-
592 QAbstractItemViewPrivate * const d = d_func();-
593 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
594 d->selectionModel->clearSelection();
never executed: d->selectionModel->clearSelection();
0
595}
never executed: end of block
0
596-
597-
598-
599-
600-
601-
602-
603void QAbstractItemView::doItemsLayout()-
604{-
605 QAbstractItemViewPrivate * const d = d_func();-
606 d->interruptDelayedItemsLayout();-
607 updateGeometries();-
608 d->viewport->update();-
609}
never executed: end of block
0
610void QAbstractItemView::setEditTriggers(EditTriggers actions)-
611{-
612 QAbstractItemViewPrivate * const d = d_func();-
613 d->editTriggers = actions;-
614}
never executed: end of block
0
615-
616QAbstractItemView::EditTriggers QAbstractItemView::editTriggers() const-
617{-
618 const QAbstractItemViewPrivate * const d = d_func();-
619 return
never executed: return d->editTriggers;
d->editTriggers;
never executed: return d->editTriggers;
0
620}-
621void QAbstractItemView::setVerticalScrollMode(ScrollMode mode)-
622{-
623 QAbstractItemViewPrivate * const d = d_func();-
624 d->verticalScrollModeSet = true;-
625 if (mode == d->verticalScrollMode
mode == d->verticalScrollModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
626 return;
never executed: return;
0
627 QModelIndex topLeft = indexAt(QPoint(0, 0));-
628 d->verticalScrollMode = mode;-
629 if (mode == ScrollPerItem
mode == ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
630 verticalScrollBar()->d_func()->itemviewChangeSingleStep(1);
never executed: verticalScrollBar()->d_func()->itemviewChangeSingleStep(1);
0
631 else-
632 verticalScrollBar()->setSingleStep(-1);
never executed: verticalScrollBar()->setSingleStep(-1);
0
633 updateGeometries();-
634 scrollTo(topLeft, QAbstractItemView::PositionAtTop);-
635}
never executed: end of block
0
636-
637QAbstractItemView::ScrollMode QAbstractItemView::verticalScrollMode() const-
638{-
639 const QAbstractItemViewPrivate * const d = d_func();-
640 return
never executed: return d->verticalScrollMode;
d->verticalScrollMode;
never executed: return d->verticalScrollMode;
0
641}-
642-
643void QAbstractItemView::resetVerticalScrollMode()-
644{-
645 auto sm = static_cast<ScrollMode>(style()->styleHint(QStyle::SH_ItemView_ScrollMode, 0, this, 0));-
646 setVerticalScrollMode(sm);-
647 d_func()->verticalScrollModeSet = false;-
648}
never executed: end of block
0
649void QAbstractItemView::setHorizontalScrollMode(ScrollMode mode)-
650{-
651 QAbstractItemViewPrivate * const d = d_func();-
652 d->horizontalScrollModeSet = true;-
653 if (mode == d->horizontalScrollMode
mode == d->hor...ntalScrollModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
654 return;
never executed: return;
0
655 d->horizontalScrollMode = mode;-
656 if (mode == ScrollPerItem
mode == ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
657 horizontalScrollBar()->d_func()->itemviewChangeSingleStep(1);
never executed: horizontalScrollBar()->d_func()->itemviewChangeSingleStep(1);
0
658 else-
659 horizontalScrollBar()->setSingleStep(-1);
never executed: horizontalScrollBar()->setSingleStep(-1);
0
660 updateGeometries();-
661}
never executed: end of block
0
662-
663QAbstractItemView::ScrollMode QAbstractItemView::horizontalScrollMode() const-
664{-
665 const QAbstractItemViewPrivate * const d = d_func();-
666 return
never executed: return d->horizontalScrollMode;
d->horizontalScrollMode;
never executed: return d->horizontalScrollMode;
0
667}-
668-
669void QAbstractItemView::resetHorizontalScrollMode()-
670{-
671 auto sm = static_cast<ScrollMode>(style()->styleHint(QStyle::SH_ItemView_ScrollMode, 0, this, 0));-
672 setHorizontalScrollMode(sm);-
673 d_func()->horizontalScrollModeSet = false;-
674}
never executed: end of block
0
675void QAbstractItemView::setDragDropOverwriteMode(bool overwrite)-
676{-
677 QAbstractItemViewPrivate * const d = d_func();-
678 d->overwrite = overwrite;-
679}
never executed: end of block
0
680-
681bool QAbstractItemView::dragDropOverwriteMode() const-
682{-
683 const QAbstractItemViewPrivate * const d = d_func();-
684 return
never executed: return d->overwrite;
d->overwrite;
never executed: return d->overwrite;
0
685}-
686void QAbstractItemView::setAutoScroll(bool enable)-
687{-
688 QAbstractItemViewPrivate * const d = d_func();-
689 d->autoScroll = enable;-
690}
never executed: end of block
0
691-
692bool QAbstractItemView::hasAutoScroll() const-
693{-
694 const QAbstractItemViewPrivate * const d = d_func();-
695 return
never executed: return d->autoScroll;
d->autoScroll;
never executed: return d->autoScroll;
0
696}-
697void QAbstractItemView::setAutoScrollMargin(int margin)-
698{-
699 QAbstractItemViewPrivate * const d = d_func();-
700 d->autoScrollMargin = margin;-
701}
never executed: end of block
0
702-
703int QAbstractItemView::autoScrollMargin() const-
704{-
705 const QAbstractItemViewPrivate * const d = d_func();-
706 return
never executed: return d->autoScrollMargin;
d->autoScrollMargin;
never executed: return d->autoScrollMargin;
0
707}-
708-
709-
710-
711-
712-
713-
714void QAbstractItemView::setTabKeyNavigation(bool enable)-
715{-
716 QAbstractItemViewPrivate * const d = d_func();-
717 d->tabKeyNavigation = enable;-
718}
never executed: end of block
0
719-
720bool QAbstractItemView::tabKeyNavigation() const-
721{-
722 const QAbstractItemViewPrivate * const d = d_func();-
723 return
never executed: return d->tabKeyNavigation;
d->tabKeyNavigation;
never executed: return d->tabKeyNavigation;
0
724}-
725-
726-
727-
728-
729-
730QSize QAbstractItemView::viewportSizeHint() const-
731{-
732 return
never executed: return QAbstractScrollArea::viewportSizeHint();
QAbstractScrollArea::viewportSizeHint();
never executed: return QAbstractScrollArea::viewportSizeHint();
0
733}-
734void QAbstractItemView::setDropIndicatorShown(bool enable)-
735{-
736 QAbstractItemViewPrivate * const d = d_func();-
737 d->showDropIndicator = enable;-
738}
never executed: end of block
0
739-
740bool QAbstractItemView::showDropIndicator() const-
741{-
742 const QAbstractItemViewPrivate * const d = d_func();-
743 return
never executed: return d->showDropIndicator;
d->showDropIndicator;
never executed: return d->showDropIndicator;
0
744}-
745void QAbstractItemView::setDragEnabled(bool enable)-
746{-
747 QAbstractItemViewPrivate * const d = d_func();-
748 d->dragEnabled = enable;-
749}
never executed: end of block
0
750-
751bool QAbstractItemView::dragEnabled() const-
752{-
753 const QAbstractItemViewPrivate * const d = d_func();-
754 return
never executed: return d->dragEnabled;
d->dragEnabled;
never executed: return d->dragEnabled;
0
755}-
756void QAbstractItemView::setDragDropMode(DragDropMode behavior)-
757{-
758 QAbstractItemViewPrivate * const d = d_func();-
759 d->dragDropMode = behavior;-
760 setDragEnabled(behavior == DragOnly || behavior == DragDrop || behavior == InternalMove);-
761 setAcceptDrops(behavior == DropOnly || behavior == DragDrop || behavior == InternalMove);-
762}
never executed: end of block
0
763-
764QAbstractItemView::DragDropMode QAbstractItemView::dragDropMode() const-
765{-
766 const QAbstractItemViewPrivate * const d = d_func();-
767 DragDropMode setBehavior = d->dragDropMode;-
768 if (!dragEnabled()
!dragEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
&& !acceptDrops()
!acceptDrops()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
769 return
never executed: return NoDragDrop;
NoDragDrop;
never executed: return NoDragDrop;
0
770-
771 if (dragEnabled()
dragEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
&& !acceptDrops()
!acceptDrops()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
772 return
never executed: return DragOnly;
DragOnly;
never executed: return DragOnly;
0
773-
774 if (!dragEnabled()
!dragEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
&& acceptDrops()
acceptDrops()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
775 return
never executed: return DropOnly;
DropOnly;
never executed: return DropOnly;
0
776-
777 if (dragEnabled()
dragEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
&& acceptDrops()
acceptDrops()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
778 if (setBehavior == InternalMove
setBehavior == InternalMoveDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
779 return
never executed: return setBehavior;
setBehavior;
never executed: return setBehavior;
0
780 else-
781 return
never executed: return DragDrop;
DragDrop;
never executed: return DragDrop;
0
782 }-
783-
784 return
never executed: return NoDragDrop;
NoDragDrop;
never executed: return NoDragDrop;
0
785}-
786void QAbstractItemView::setDefaultDropAction(Qt::DropAction dropAction)-
787{-
788 QAbstractItemViewPrivate * const d = d_func();-
789 d->defaultDropAction = dropAction;-
790}
never executed: end of block
0
791-
792Qt::DropAction QAbstractItemView::defaultDropAction() const-
793{-
794 const QAbstractItemViewPrivate * const d = d_func();-
795 return
never executed: return d->defaultDropAction;
d->defaultDropAction;
never executed: return d->defaultDropAction;
0
796}-
797void QAbstractItemView::setAlternatingRowColors(bool enable)-
798{-
799 QAbstractItemViewPrivate * const d = d_func();-
800 d->alternatingColors = enable;-
801 if (isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
802 d->viewport->update();
never executed: d->viewport->update();
0
803}
never executed: end of block
0
804-
805bool QAbstractItemView::alternatingRowColors() const-
806{-
807 const QAbstractItemViewPrivate * const d = d_func();-
808 return
never executed: return d->alternatingColors;
d->alternatingColors;
never executed: return d->alternatingColors;
0
809}-
810void QAbstractItemView::setIconSize(const QSize &size)-
811{-
812 QAbstractItemViewPrivate * const d = d_func();-
813 if (size == d->iconSize
size == d->iconSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
814 return;
never executed: return;
0
815 d->iconSize = size;-
816 d->doDelayedItemsLayout();-
817 iconSizeChanged(size);-
818}
never executed: end of block
0
819-
820QSize QAbstractItemView::iconSize() const-
821{-
822 const QAbstractItemViewPrivate * const d = d_func();-
823 return
never executed: return d->iconSize;
d->iconSize;
never executed: return d->iconSize;
0
824}-
825void QAbstractItemView::setTextElideMode(Qt::TextElideMode mode)-
826{-
827 QAbstractItemViewPrivate * const d = d_func();-
828 d->textElideMode = mode;-
829}
never executed: end of block
0
830-
831Qt::TextElideMode QAbstractItemView::textElideMode() const-
832{-
833 return
never executed: return d_func()->textElideMode;
d_func()->textElideMode;
never executed: return d_func()->textElideMode;
0
834}-
835-
836-
837-
838-
839bool QAbstractItemView::focusNextPrevChild(bool next)-
840{-
841 QAbstractItemViewPrivate * const d = d_func();-
842 if (d->tabKeyNavigation
d->tabKeyNavigationDescription
TRUEnever evaluated
FALSEnever evaluated
&& isEnabled()
isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->viewport->isEnabled()
d->viewport->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
843 QKeyEvent event(QEvent::KeyPress, next ? Qt::Key_Tab : Qt::Key_Backtab, Qt::NoModifier);-
844 keyPressEvent(&event);-
845 if (event.isAccepted()
event.isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
846 return
never executed: return true;
true;
never executed: return true;
0
847 }
never executed: end of block
0
848 return
never executed: return QAbstractScrollArea::focusNextPrevChild(next);
QAbstractScrollArea::focusNextPrevChild(next);
never executed: return QAbstractScrollArea::focusNextPrevChild(next);
0
849}-
850-
851-
852-
853-
854bool QAbstractItemView::event(QEvent *event)-
855{-
856 QAbstractItemViewPrivate * const d = d_func();-
857 switch (event->type()) {-
858 case
never executed: case QEvent::Paint:
QEvent::Paint:
never executed: case QEvent::Paint:
0
859-
860-
861 d->executePostedLayout();-
862 break;
never executed: break;
0
863 case
never executed: case QEvent::Show:
QEvent::Show:
never executed: case QEvent::Show:
0
864 d->executePostedLayout();-
865 if (d->shouldScrollToCurrentOnShow
d->shouldScrollToCurrentOnShowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
866 d->shouldScrollToCurrentOnShow = false;-
867 const QModelIndex current = currentIndex();-
868 if (current.isValid()
current.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& (d->state == QAbstractItemView::EditingState
d->state == QA...::EditingStateDescription
TRUEnever evaluated
FALSEnever evaluated
|| d->autoScroll
d->autoScrollDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
869 scrollTo(current);
never executed: scrollTo(current);
0
870 }
never executed: end of block
0
871 break;
never executed: break;
0
872 case
never executed: case QEvent::LocaleChange:
QEvent::LocaleChange:
never executed: case QEvent::LocaleChange:
0
873 viewport()->update();-
874 break;
never executed: break;
0
875 case
never executed: case QEvent::LayoutDirectionChange:
QEvent::LayoutDirectionChange:
never executed: case QEvent::LayoutDirectionChange:
0
876 case
never executed: case QEvent::ApplicationLayoutDirectionChange:
QEvent::ApplicationLayoutDirectionChange:
never executed: case QEvent::ApplicationLayoutDirectionChange:
0
877 updateGeometries();-
878 break;
never executed: break;
0
879 case
never executed: case QEvent::StyleChange:
QEvent::StyleChange:
never executed: case QEvent::StyleChange:
0
880 doItemsLayout();-
881 if (!d->verticalScrollModeSet
!d->verticalScrollModeSetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
882 resetVerticalScrollMode();
never executed: resetVerticalScrollMode();
0
883 if (!d->horizontalScrollModeSet
!d->horizontalScrollModeSetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
884 resetHorizontalScrollMode();
never executed: resetHorizontalScrollMode();
0
885 break;
never executed: break;
0
886 case
never executed: case QEvent::FocusOut:
QEvent::FocusOut:
never executed: case QEvent::FocusOut:
0
887 d->checkPersistentEditorFocus();-
888 break;
never executed: break;
0
889 case
never executed: case QEvent::FontChange:
QEvent::FontChange:
never executed: case QEvent::FontChange:
0
890 d->doDelayedItemsLayout();-
891 break;
never executed: break;
0
892 default
never executed: default:
:
never executed: default:
0
893 break;
never executed: break;
0
894 }-
895 return
never executed: return QAbstractScrollArea::event(event);
QAbstractScrollArea::event(event);
never executed: return QAbstractScrollArea::event(event);
0
896}-
897bool QAbstractItemView::viewportEvent(QEvent *event)-
898{-
899 QAbstractItemViewPrivate * const d = d_func();-
900 switch (event->type()) {-
901 case
never executed: case QEvent::HoverMove:
QEvent::HoverMove:
never executed: case QEvent::HoverMove:
0
902 case
never executed: case QEvent::HoverEnter:
QEvent::HoverEnter:
never executed: case QEvent::HoverEnter:
0
903 d->setHoverIndex(indexAt(static_cast<QHoverEvent*>(event)->pos()));-
904 break;
never executed: break;
0
905 case
never executed: case QEvent::HoverLeave:
QEvent::HoverLeave:
never executed: case QEvent::HoverLeave:
0
906 d->setHoverIndex(QModelIndex());-
907 break;
never executed: break;
0
908 case
never executed: case QEvent::Enter:
QEvent::Enter:
never executed: case QEvent::Enter:
0
909 d->viewportEnteredNeeded = true;-
910 break;
never executed: break;
0
911 case
never executed: case QEvent::Leave:
QEvent::Leave:
never executed: case QEvent::Leave:
0
912-
913 if (d->shouldClearStatusTip
d->shouldClearStatusTipDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->parent
d->parentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
914 QString empty;-
915 QStatusTipEvent tip(empty);-
916 QApplication::sendEvent(d->parent, &tip);-
917 d->shouldClearStatusTip = false;-
918 }
never executed: end of block
0
919-
920 d->enteredIndex = QModelIndex();-
921 break;
never executed: break;
0
922 case
never executed: case QEvent::ToolTip:
QEvent::ToolTip:
never executed: case QEvent::ToolTip:
0
923 case
never executed: case QEvent::QueryWhatsThis:
QEvent::QueryWhatsThis:
never executed: case QEvent::QueryWhatsThis:
0
924 case
never executed: case QEvent::WhatsThis:
QEvent::WhatsThis:
never executed: case QEvent::WhatsThis:
{
0
925 QHelpEvent *he = static_cast<QHelpEvent*>(event);-
926 const QModelIndex index = indexAt(he->pos());-
927 QStyleOptionViewItem option = d->viewOptionsV1();-
928 option.rect = visualRect(index);-
929 option.state |= (index == currentIndex()
index == currentIndex()Description
TRUEnever evaluated
FALSEnever evaluated
? QStyle::State_HasFocus : QStyle::State_None);
0
930-
931 QAbstractItemDelegate *delegate = d->delegateForIndex(index);-
932 if (!delegate
!delegateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
933 return
never executed: return false;
false;
never executed: return false;
0
934 return
never executed: return delegate->helpEvent(he, this, option, index);
delegate->helpEvent(he, this, option, index);
never executed: return delegate->helpEvent(he, this, option, index);
0
935 }-
936 case
never executed: case QEvent::FontChange:
QEvent::FontChange:
never executed: case QEvent::FontChange:
0
937 d->doDelayedItemsLayout();-
938 break;
never executed: break;
0
939 case
never executed: case QEvent::WindowActivate:
QEvent::WindowActivate:
never executed: case QEvent::WindowActivate:
0
940 case
never executed: case QEvent::WindowDeactivate:
QEvent::WindowDeactivate:
never executed: case QEvent::WindowDeactivate:
0
941 d->viewport->update();-
942 break;
never executed: break;
0
943 case
never executed: case QEvent::ScrollPrepare:
QEvent::ScrollPrepare:
never executed: case QEvent::ScrollPrepare:
0
944 executeDelayedItemsLayout();-
945-
946 connect(QScroller::scroller(d->viewport), qFlagLocation("2""stateChanged(QScroller::State)" "\0" __FILE__ ":" "1740"), this, qFlagLocation("1""_q_scrollerStateChanged()" "\0" __FILE__ ":" "1740"), Qt::UniqueConnection);-
947-
948 break;
never executed: break;
0
949-
950 default
never executed: default:
:
never executed: default:
0
951 break;
never executed: break;
0
952 }-
953 return
never executed: return QAbstractScrollArea::viewportEvent(event);
QAbstractScrollArea::viewportEvent(event);
never executed: return QAbstractScrollArea::viewportEvent(event);
0
954}-
955-
956-
957-
958-
959-
960-
961void QAbstractItemView::mousePressEvent(QMouseEvent *event)-
962{-
963 QAbstractItemViewPrivate * const d = d_func();-
964 d->delayedAutoScroll.stop();-
965 QPoint pos = event->pos();-
966 QPersistentModelIndex index = indexAt(pos);-
967-
968 if (!d->selectionModel
!d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
0
969 || (d->state == EditingState
d->state == EditingStateDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->hasEditor(index)
d->hasEditor(index)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
970 return;
never executed: return;
0
971-
972 d->pressedAlreadySelected = d->selectionModel->isSelected(index);-
973 d->pressedIndex = index;-
974 d->pressedModifiers = event->modifiers();-
975 QItemSelectionModel::SelectionFlags command = selectionCommand(index, event);-
976 d->noSelectionOnMousePress = command == QItemSelectionModel::NoUpdate
command == QIt...odel::NoUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
|| !index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
977 QPoint offset = d->offset();-
978 if ((
(command & QIt...:Current) == 0Description
TRUEnever evaluated
FALSEnever evaluated
command & QItemSelectionModel::Current) == 0
(command & QIt...:Current) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
979 d->pressedPosition = pos + offset;-
980 d->currentSelectionStartIndex = index;-
981 }
never executed: end of block
0
982 else if (!d->currentSelectionStartIndex.isValid()
!d->currentSel...ndex.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
983 d->currentSelectionStartIndex = currentIndex();
never executed: d->currentSelectionStartIndex = currentIndex();
0
984-
985 if (edit(index, NoEditTriggers, event)
edit(index, No...iggers, event)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
986 return;
never executed: return;
0
987-
988 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->isIndexEnabled(index)
d->isIndexEnabled(index)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
989-
990-
991 bool autoScroll = d->autoScroll;-
992 d->autoScroll = false;-
993 d->selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate);-
994 d->autoScroll = autoScroll;-
995 if (command.testFlag(QItemSelectionModel::Toggle)
command.testFl...Model::Toggle)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
996 command &= ~QItemSelectionModel::Toggle;-
997 d->ctrlDragSelectionFlag = d->selectionModel->isSelected(index)
d->selectionMo...elected(index)Description
TRUEnever evaluated
FALSEnever evaluated
? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
0
998 command |= d->ctrlDragSelectionFlag;-
999 }
never executed: end of block
0
1000-
1001 if ((
(command & QIt...:Current) == 0Description
TRUEnever evaluated
FALSEnever evaluated
command & QItemSelectionModel::Current) == 0
(command & QIt...:Current) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1002 setSelection(QRect(pos, QSize(1, 1)), command);-
1003 }
never executed: end of block
else {
0
1004 QRect rect(visualRect(d->currentSelectionStartIndex).center(), pos);-
1005 setSelection(rect, command);-
1006 }
never executed: end of block
0
1007-
1008-
1009 pressed(index);-
1010 if (d->autoScroll
d->autoScrollDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1011-
1012-
1013 d->delayedAutoScroll.start(QApplication::doubleClickInterval()+100, this);-
1014 }
never executed: end of block
0
1015-
1016 }
never executed: end of block
else {
0
1017-
1018 d->selectionModel->select(QModelIndex(), QItemSelectionModel::Select);-
1019 }
never executed: end of block
0
1020}-
1021-
1022-
1023-
1024-
1025-
1026-
1027void QAbstractItemView::mouseMoveEvent(QMouseEvent *event)-
1028{-
1029 QAbstractItemViewPrivate * const d = d_func();-
1030 QPoint topLeft;-
1031 QPoint bottomRight = event->pos();-
1032-
1033 if (state() == ExpandingState
state() == ExpandingStateDescription
TRUEnever evaluated
FALSEnever evaluated
|| state() == CollapsingState
state() == CollapsingStateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1034 return;
never executed: return;
0
1035-
1036-
1037 if (state() == DraggingState
state() == DraggingStateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1038 topLeft = d->pressedPosition - d->offset();-
1039 if ((
(topLeft - bot...DragDistance()Description
TRUEnever evaluated
FALSEnever evaluated
topLeft - bottomRight).manhattanLength() > QApplication::startDragDistance()
(topLeft - bot...DragDistance()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1040 d->pressedIndex = QModelIndex();-
1041 startDrag(d->model->supportedDragActions());-
1042 setState(NoState);-
1043 stopAutoScroll();-
1044 }
never executed: end of block
0
1045 return;
never executed: return;
0
1046 }-
1047-
1048-
1049 QPersistentModelIndex index = indexAt(bottomRight);-
1050 QModelIndex buddy = d->model->buddy(d->pressedIndex);-
1051 if ((state() == EditingState
state() == EditingStateDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->hasEditor(buddy)
d->hasEditor(buddy)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1052 || edit(index, NoEditTriggers, event)
edit(index, No...iggers, event)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1053 return;
never executed: return;
0
1054-
1055 if (d->selectionMode != SingleSelection
d->selectionMo...ingleSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1056 topLeft = d->pressedPosition - d->offset();
never executed: topLeft = d->pressedPosition - d->offset();
0
1057 else-
1058 topLeft = bottomRight;
never executed: topLeft = bottomRight;
0
1059-
1060 d->checkMouseMove(index);-
1061-
1062-
1063 if (d->pressedIndex.isValid()
d->pressedIndex.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1064 && d->dragEnabled
d->dragEnabledDescription
TRUEnever evaluated
FALSEnever evaluated
0
1065 && (
(state() != Dr...electingState)Description
TRUEnever evaluated
FALSEnever evaluated
state() != DragSelectingState)
(state() != Dr...electingState)Description
TRUEnever evaluated
FALSEnever evaluated
0
1066 && (
(event->button... Qt::NoButton)Description
TRUEnever evaluated
FALSEnever evaluated
event->buttons() != Qt::NoButton)
(event->button... Qt::NoButton)Description
TRUEnever evaluated
FALSEnever evaluated
0
1067 && !d->selectedDraggableIndexes().isEmpty()
!d->selectedDr...es().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1068 setState(DraggingState);-
1069 return;
never executed: return;
0
1070 }-
1071-
1072-
1073 if ((
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
event->buttons() & Qt::LeftButton)
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->selectionAllowed(index)
d->selectionAllowed(index)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1074 setState(DragSelectingState);-
1075 QItemSelectionModel::SelectionFlags command = selectionCommand(index, event);-
1076 if (d->ctrlDragSelectionFlag != QItemSelectionModel::NoUpdate
d->ctrlDragSel...odel::NoUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
&& command.testFlag(QItemSelectionModel::Toggle)
command.testFl...Model::Toggle)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1077 command &= ~QItemSelectionModel::Toggle;-
1078 command |= d->ctrlDragSelectionFlag;-
1079 }
never executed: end of block
0
1080-
1081-
1082 QRect selectionRect = QRect(topLeft, bottomRight);-
1083 setSelection(selectionRect, command);-
1084-
1085-
1086 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1087 && (
(index != d->s...urrentIndex())Description
TRUEnever evaluated
FALSEnever evaluated
index != d->selectionModel->currentIndex())
(index != d->s...urrentIndex())Description
TRUEnever evaluated
FALSEnever evaluated
0
1088 && d->isIndexEnabled(index)
d->isIndexEnabled(index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1089 d->selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate);
never executed: d->selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate);
0
1090 }
never executed: end of block
0
1091}
never executed: end of block
0
1092void QAbstractItemView::mouseReleaseEvent(QMouseEvent *event)-
1093{-
1094 QAbstractItemViewPrivate * const d = d_func();-
1095-
1096 QPoint pos = event->pos();-
1097 QPersistentModelIndex index = indexAt(pos);-
1098-
1099 if (state() == EditingState
state() == EditingStateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1100 if (d->isIndexValid(index)
d->isIndexValid(index)Description
TRUEnever evaluated
FALSEnever evaluated
0
1101 && d->isIndexEnabled(index)
d->isIndexEnabled(index)Description
TRUEnever evaluated
FALSEnever evaluated
0
1102 && d->sendDelegateEvent(index, event)
d->sendDelegat...(index, event)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1103 update(index);
never executed: update(index);
0
1104 return;
never executed: return;
0
1105 }-
1106-
1107 bool click = (index == d->pressedIndex
index == d->pressedIndexDescription
TRUEnever evaluated
FALSEnever evaluated
&& index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
);
0
1108 bool selectedClicked = click
clickDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
event->button() == Qt::LeftButton)
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->pressedAlreadySelected
d->pressedAlreadySelectedDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
1109 EditTrigger trigger = (selectedClicked
selectedClickedDescription
TRUEnever evaluated
FALSEnever evaluated
? SelectedClicked : NoEditTriggers);
0
1110 bool edited = edit(index, trigger, event);-
1111-
1112 d->ctrlDragSelectionFlag = QItemSelectionModel::NoUpdate;-
1113-
1114 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->noSelectionOnMousePress
d->noSelectionOnMousePressDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1115 d->noSelectionOnMousePress = false;-
1116 d->selectionModel->select(index, selectionCommand(index, event));-
1117 }
never executed: end of block
0
1118-
1119 setState(NoState);-
1120-
1121 if (click
clickDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1122 if (event->button() == Qt::LeftButton
event->button(...Qt::LeftButtonDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1123 clicked(index);
never executed: clicked(index);
0
1124 if (edited
editedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1125 return;
never executed: return;
0
1126 QStyleOptionViewItem option = d->viewOptionsV1();-
1127 if (d->pressedAlreadySelected
d->pressedAlreadySelectedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1128 option.state |= QStyle::State_Selected;
never executed: option.state |= QStyle::State_Selected;
0
1129 if ((
(model()->flag...ItemIsEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
model()->flags(index) & Qt::ItemIsEnabled)
(model()->flag...ItemIsEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
0
1130 && style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, &option, this)
style()->style...&option, this)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1131 activated(index);
never executed: activated(index);
0
1132 }
never executed: end of block
0
1133}
never executed: end of block
0
1134-
1135-
1136-
1137-
1138-
1139-
1140void QAbstractItemView::mouseDoubleClickEvent(QMouseEvent *event)-
1141{-
1142 QAbstractItemViewPrivate * const d = d_func();-
1143-
1144 QModelIndex index = indexAt(event->pos());-
1145 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
1146 || !d->isIndexEnabled(index)
!d->isIndexEnabled(index)Description
TRUEnever evaluated
FALSEnever evaluated
0
1147 || (
(d->pressedIndex != index)Description
TRUEnever evaluated
FALSEnever evaluated
d->pressedIndex != index)
(d->pressedIndex != index)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1148 QMouseEvent me(QEvent::MouseButtonPress,-
1149 event->localPos(), event->windowPos(), event->screenPos(),-
1150 event->button(), event->buttons(), event->modifiers(), event->source());-
1151 mousePressEvent(&me);-
1152 return;
never executed: return;
0
1153 }-
1154-
1155 QPersistentModelIndex persistent = index;-
1156 doubleClicked(persistent);-
1157 if ((
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
event->button() == Qt::LeftButton)
(event->button...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
&& !edit(persistent, DoubleClicked, event)
!edit(persiste...licked, event)Description
TRUEnever evaluated
FALSEnever evaluated
0
1158 && !style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, this)
!style()->styl...lick, 0, this)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1159 activated(persistent);
never executed: activated(persistent);
0
1160}
never executed: end of block
0
1161void QAbstractItemView::dragEnterEvent(QDragEnterEvent *event)-
1162{-
1163 if (dragDropMode() == InternalMove
dragDropMode() == InternalMoveDescription
TRUEnever evaluated
FALSEnever evaluated
0
1164 && (event->source() != this
event->source() != thisDescription
TRUEnever evaluated
FALSEnever evaluated
|| !(event->possibleActions() & Qt::MoveAction)
!(event->possi...t::MoveAction)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1165 return;
never executed: return;
0
1166-
1167 if (d_func()->canDrop(event)
d_func()->canDrop(event)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1168 event->accept();-
1169 setState(DraggingState);-
1170 }
never executed: end of block
else {
0
1171 event->ignore();-
1172 }
never executed: end of block
0
1173}-
1174void QAbstractItemView::dragMoveEvent(QDragMoveEvent *event)-
1175{-
1176 QAbstractItemViewPrivate * const d = d_func();-
1177 if (dragDropMode() == InternalMove
dragDropMode() == InternalMoveDescription
TRUEnever evaluated
FALSEnever evaluated
0
1178 && (event->source() != this
event->source() != thisDescription
TRUEnever evaluated
FALSEnever evaluated
|| !(event->possibleActions() & Qt::MoveAction)
!(event->possi...t::MoveAction)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1179 return;
never executed: return;
0
1180-
1181-
1182 event->ignore();-
1183-
1184 QModelIndex index = indexAt(event->pos());-
1185 d->hover = index;-
1186 if (!d->droppingOnItself(event, index)
!d->droppingOn...(event, index)Description
TRUEnever evaluated
FALSEnever evaluated
0
1187 && d->canDrop(event)
d->canDrop(event)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1188-
1189 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->showDropIndicator
d->showDropIndicatorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1190 QRect rect = visualRect(index);-
1191 d->dropIndicatorPosition = d->position(event->pos(), rect, index);-
1192 switch (d->dropIndicatorPosition) {-
1193 case
never executed: case AboveItem:
AboveItem:
never executed: case AboveItem:
0
1194 if (d->isIndexDropEnabled(index.parent())
d->isIndexDrop...ndex.parent())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1195 d->dropIndicatorRect = QRect(rect.left(), rect.top(), rect.width(), 0);-
1196 event->acceptProposedAction();-
1197 }
never executed: end of block
else {
0
1198 d->dropIndicatorRect = QRect();-
1199 }
never executed: end of block
0
1200 break;
never executed: break;
0
1201 case
never executed: case BelowItem:
BelowItem:
never executed: case BelowItem:
0
1202 if (d->isIndexDropEnabled(index.parent())
d->isIndexDrop...ndex.parent())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1203 d->dropIndicatorRect = QRect(rect.left(), rect.bottom(), rect.width(), 0);-
1204 event->acceptProposedAction();-
1205 }
never executed: end of block
else {
0
1206 d->dropIndicatorRect = QRect();-
1207 }
never executed: end of block
0
1208 break;
never executed: break;
0
1209 case
never executed: case OnItem:
OnItem:
never executed: case OnItem:
0
1210 if (d->isIndexDropEnabled(index)
d->isIndexDropEnabled(index)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1211 d->dropIndicatorRect = rect;-
1212 event->acceptProposedAction();-
1213 }
never executed: end of block
else {
0
1214 d->dropIndicatorRect = QRect();-
1215 }
never executed: end of block
0
1216 break;
never executed: break;
0
1217 case
never executed: case OnViewport:
OnViewport:
never executed: case OnViewport:
0
1218 d->dropIndicatorRect = QRect();-
1219 if (d->isIndexDropEnabled(rootIndex())
d->isIndexDrop...d(rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1220 event->acceptProposedAction();-
1221 }
never executed: end of block
0
1222 break;
never executed: break;
0
1223 }-
1224 }
never executed: end of block
else {
0
1225 d->dropIndicatorRect = QRect();-
1226 d->dropIndicatorPosition = OnViewport;-
1227 if (d->isIndexDropEnabled(rootIndex())
d->isIndexDrop...d(rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1228 event->acceptProposedAction();-
1229 }
never executed: end of block
0
1230 }
never executed: end of block
0
1231 d->viewport->update();-
1232 }
never executed: end of block
0
1233-
1234 if (d->shouldAutoScroll(event->pos())
d->shouldAutoS...(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1235 startAutoScroll();
never executed: startAutoScroll();
0
1236}
never executed: end of block
0
1237-
1238-
1239-
1240-
1241-
1242-
1243bool QAbstractItemViewPrivate::droppingOnItself(QDropEvent *event, const QModelIndex &index)-
1244{-
1245 QAbstractItemView * const q = q_func();-
1246 Qt::DropAction dropAction = event->dropAction();-
1247 if (q->dragDropMode() == QAbstractItemView::InternalMove
q->dragDropMod...::InternalMoveDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1248 dropAction = Qt::MoveAction;
never executed: dropAction = Qt::MoveAction;
0
1249 if (event->source() == q
event->source() == qDescription
TRUEnever evaluated
FALSEnever evaluated
0
1250 && event->possibleActions() & Qt::MoveAction
event->possibl...Qt::MoveActionDescription
TRUEnever evaluated
FALSEnever evaluated
0
1251 && dropAction == Qt::MoveAction
dropAction == Qt::MoveActionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1252 QModelIndexList selectedIndexes = q->selectedIndexes();-
1253 QModelIndex child = index;-
1254 while (child.isValid()
child.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& child != root
child != rootDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1255 if (selectedIndexes.contains(child)
selectedIndexe...ontains(child)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1256 return
never executed: return true;
true;
never executed: return true;
0
1257 child = child.parent();-
1258 }
never executed: end of block
0
1259 }
never executed: end of block
0
1260 return
never executed: return false;
false;
never executed: return false;
0
1261}-
1262-
1263-
1264-
1265-
1266-
1267-
1268-
1269void QAbstractItemView::dragLeaveEvent(QDragLeaveEvent *)-
1270{-
1271 QAbstractItemViewPrivate * const d = d_func();-
1272 stopAutoScroll();-
1273 setState(NoState);-
1274 d->hover = QModelIndex();-
1275 d->viewport->update();-
1276}
never executed: end of block
0
1277void QAbstractItemView::dropEvent(QDropEvent *event)-
1278{-
1279 QAbstractItemViewPrivate * const d = d_func();-
1280 if (dragDropMode() == InternalMove
dragDropMode() == InternalMoveDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1281 if (event->source() != this
event->source() != thisDescription
TRUEnever evaluated
FALSEnever evaluated
|| !(event->possibleActions() & Qt::MoveAction)
!(event->possi...t::MoveAction)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1282 return;
never executed: return;
0
1283 }
never executed: end of block
0
1284-
1285 QModelIndex index;-
1286 int col = -1;-
1287 int row = -1;-
1288 if (d->dropOn(event, &row, &col, &index)
d->dropOn(even... &col, &index)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1289 const Qt::DropAction action = dragDropMode() == InternalMove
dragDropMode() == InternalMoveDescription
TRUEnever evaluated
FALSEnever evaluated
? Qt::MoveAction : event->dropAction();
0
1290 if (d->model->dropMimeData(event->mimeData(), action, row, col, index)
d->model->drop...w, col, index)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1291 if (action != event->dropAction()
action != event->dropAction()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1292 event->setDropAction(action);-
1293 event->accept();-
1294 }
never executed: end of block
else {
0
1295 event->acceptProposedAction();-
1296 }
never executed: end of block
0
1297 }-
1298 }
never executed: end of block
0
1299 stopAutoScroll();-
1300 setState(NoState);-
1301 d->viewport->update();-
1302}
never executed: end of block
0
1303bool QAbstractItemViewPrivate::dropOn(QDropEvent *event, int *dropRow, int *dropCol, QModelIndex *dropIndex)-
1304{-
1305 QAbstractItemView * const q = q_func();-
1306 if (event->isAccepted()
event->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1307 return
never executed: return false;
false;
never executed: return false;
0
1308-
1309 QModelIndex index;-
1310-
1311 if (viewport->rect().contains(event->pos())
viewport->rect...(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1312 index = q->indexAt(event->pos());-
1313 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| !q->visualRect(index).contains(event->pos())
!q->visualRect...(event->pos())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1314 index = root;
never executed: index = root;
0
1315 }
never executed: end of block
0
1316-
1317-
1318 if (model->supportedDropActions() & event->dropAction()
model->support...->dropAction()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1319 int row = -1;-
1320 int col = -1;-
1321 if (index != root
index != rootDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1322 dropIndicatorPosition = position(event->pos(), q->visualRect(index), index);-
1323 switch (dropIndicatorPosition) {-
1324 case
never executed: case QAbstractItemView::AboveItem:
QAbstractItemView::AboveItem:
never executed: case QAbstractItemView::AboveItem:
0
1325 row = index.row();-
1326 col = index.column();-
1327 index = index.parent();-
1328 break;
never executed: break;
0
1329 case
never executed: case QAbstractItemView::BelowItem:
QAbstractItemView::BelowItem:
never executed: case QAbstractItemView::BelowItem:
0
1330 row = index.row() + 1;-
1331 col = index.column();-
1332 index = index.parent();-
1333 break;
never executed: break;
0
1334 case
never executed: case QAbstractItemView::OnItem:
QAbstractItemView::OnItem:
never executed: case QAbstractItemView::OnItem:
0
1335 case
never executed: case QAbstractItemView::OnViewport:
QAbstractItemView::OnViewport:
never executed: case QAbstractItemView::OnViewport:
0
1336 break;
never executed: break;
0
1337 }-
1338 }
never executed: end of block
else {
0
1339 dropIndicatorPosition = QAbstractItemView::OnViewport;-
1340 }
never executed: end of block
0
1341 *dropIndex = index;-
1342 *dropRow = row;-
1343 *dropCol = col;-
1344 if (!droppingOnItself(event, index)
!droppingOnIts...(event, index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1345 return
never executed: return true;
true;
never executed: return true;
0
1346 }
never executed: end of block
0
1347 return
never executed: return false;
false;
never executed: return false;
0
1348}-
1349-
1350QAbstractItemView::DropIndicatorPosition-
1351QAbstractItemViewPrivate::position(const QPoint &pos, const QRect &rect, const QModelIndex &index) const-
1352{-
1353 QAbstractItemView::DropIndicatorPosition r = QAbstractItemView::OnViewport;-
1354 if (!overwrite
!overwriteDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1355 const int margin = 2;-
1356 if (pos.y() - rect.top() < margin
pos.y() - rect.top() < marginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1357 r = QAbstractItemView::AboveItem;-
1358 }
never executed: end of block
else if (rect.bottom() - pos.y() < margin
rect.bottom() ...s.y() < marginDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1359 r = QAbstractItemView::BelowItem;-
1360 }
never executed: end of block
else if (rect.contains(pos, true)
rect.contains(pos, true)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1361 r = QAbstractItemView::OnItem;-
1362 }
never executed: end of block
0
1363 }
never executed: end of block
else {
0
1364 QRect touchingRect = rect;-
1365 touchingRect.adjust(-1, -1, 1, 1);-
1366 if (touchingRect.contains(pos, false)
touchingRect.c...ns(pos, false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1367 r = QAbstractItemView::OnItem;-
1368 }
never executed: end of block
0
1369 }
never executed: end of block
0
1370-
1371 if (r == QAbstractItemView::OnItem
r == QAbstractItemView::OnItemDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(!(model->flag...sDropEnabled))Description
TRUEnever evaluated
FALSEnever evaluated
!(model->flags(index) & Qt::ItemIsDropEnabled))
(!(model->flag...sDropEnabled))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1372 r = pos.y() < rect.center().y()
pos.y() < rect.center().y()Description
TRUEnever evaluated
FALSEnever evaluated
? QAbstractItemView::AboveItem : QAbstractItemView::BelowItem;
never executed: r = pos.y() < rect.center().y() ? QAbstractItemView::AboveItem : QAbstractItemView::BelowItem;
0
1373-
1374 return
never executed: return r;
r;
never executed: return r;
0
1375}-
1376void QAbstractItemView::focusInEvent(QFocusEvent *event)-
1377{-
1378 QAbstractItemViewPrivate * const d = d_func();-
1379 QAbstractScrollArea::focusInEvent(event);-
1380-
1381 const QItemSelectionModel* model = selectionModel();-
1382 const bool currentIndexValid = currentIndex().isValid();-
1383-
1384 if (model
modelDescription
TRUEnever evaluated
FALSEnever evaluated
0
1385 && !d->currentIndexSet
!d->currentIndexSetDescription
TRUEnever evaluated
FALSEnever evaluated
0
1386 && !currentIndexValid
!currentIndexValidDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1387 bool autoScroll = d->autoScroll;-
1388 d->autoScroll = false;-
1389 QModelIndex index = moveCursor(MoveNext, Qt::NoModifier);-
1390 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->isIndexEnabled(index)
d->isIndexEnabled(index)Description
TRUEnever evaluated
FALSEnever evaluated
&& event->reason() != Qt::MouseFocusReason
event->reason(...useFocusReasonDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1391 selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate);
never executed: selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate);
0
1392 d->autoScroll = autoScroll;-
1393 }
never executed: end of block
0
1394-
1395 if (model
modelDescription
TRUEnever evaluated
FALSEnever evaluated
&& currentIndexValid
currentIndexValidDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1396 if (currentIndex().flags() != Qt::ItemIsEditable
currentIndex()...ItemIsEditableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1397 setAttribute(Qt::WA_InputMethodEnabled, false);
never executed: setAttribute(Qt::WA_InputMethodEnabled, false);
0
1398 else-
1399 setAttribute(Qt::WA_InputMethodEnabled);
never executed: setAttribute(Qt::WA_InputMethodEnabled);
0
1400 }-
1401-
1402 if (!currentIndexValid
!currentIndexValidDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1403 setAttribute(Qt::WA_InputMethodEnabled, false);
never executed: setAttribute(Qt::WA_InputMethodEnabled, false);
0
1404-
1405 d->viewport->update();-
1406}
never executed: end of block
0
1407-
1408-
1409-
1410-
1411-
1412-
1413-
1414void QAbstractItemView::focusOutEvent(QFocusEvent *event)-
1415{-
1416 QAbstractItemViewPrivate * const d = d_func();-
1417 QAbstractScrollArea::focusOutEvent(event);-
1418 d->viewport->update();-
1419}
never executed: end of block
0
1420void QAbstractItemView::keyPressEvent(QKeyEvent *event)-
1421{-
1422 QAbstractItemViewPrivate * const d = d_func();-
1423 d->delayedAutoScroll.stop();-
1424 if (event == QKeySequence::Copy
event == QKeySequence::CopyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1425 QVariant variant;-
1426 if (d->model
d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1427 variant = d->model->data(currentIndex(), Qt::DisplayRole);
never executed: variant = d->model->data(currentIndex(), Qt::DisplayRole);
0
1428 if (variant.type() == QVariant::String
variant.type()...ariant::StringDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1429 QApplication::clipboard()->setText(variant.toString());
never executed: QApplication::clipboard()->setText(variant.toString());
0
1430 event->accept();-
1431 }
never executed: end of block
0
1432-
1433-
1434 QPersistentModelIndex newCurrent;-
1435 d->moveCursorUpdatedView = false;-
1436 switch (event->key()) {-
1437 case
never executed: case Qt::Key_Down:
Qt::Key_Down:
never executed: case Qt::Key_Down:
0
1438 newCurrent = moveCursor(MoveDown, event->modifiers());-
1439 break;
never executed: break;
0
1440 case
never executed: case Qt::Key_Up:
Qt::Key_Up:
never executed: case Qt::Key_Up:
0
1441 newCurrent = moveCursor(MoveUp, event->modifiers());-
1442 break;
never executed: break;
0
1443 case
never executed: case Qt::Key_Left:
Qt::Key_Left:
never executed: case Qt::Key_Left:
0
1444 newCurrent = moveCursor(MoveLeft, event->modifiers());-
1445 break;
never executed: break;
0
1446 case
never executed: case Qt::Key_Right:
Qt::Key_Right:
never executed: case Qt::Key_Right:
0
1447 newCurrent = moveCursor(MoveRight, event->modifiers());-
1448 break;
never executed: break;
0
1449 case
never executed: case Qt::Key_Home:
Qt::Key_Home:
never executed: case Qt::Key_Home:
0
1450 newCurrent = moveCursor(MoveHome, event->modifiers());-
1451 break;
never executed: break;
0
1452 case
never executed: case Qt::Key_End:
Qt::Key_End:
never executed: case Qt::Key_End:
0
1453 newCurrent = moveCursor(MoveEnd, event->modifiers());-
1454 break;
never executed: break;
0
1455 case
never executed: case Qt::Key_PageUp:
Qt::Key_PageUp:
never executed: case Qt::Key_PageUp:
0
1456 newCurrent = moveCursor(MovePageUp, event->modifiers());-
1457 break;
never executed: break;
0
1458 case
never executed: case Qt::Key_PageDown:
Qt::Key_PageDown:
never executed: case Qt::Key_PageDown:
0
1459 newCurrent = moveCursor(MovePageDown, event->modifiers());-
1460 break;
never executed: break;
0
1461 case
never executed: case Qt::Key_Tab:
Qt::Key_Tab:
never executed: case Qt::Key_Tab:
0
1462 if (d->tabKeyNavigation
d->tabKeyNavigationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1463 newCurrent = moveCursor(MoveNext, event->modifiers());
never executed: newCurrent = moveCursor(MoveNext, event->modifiers());
0
1464 break;
never executed: break;
0
1465 case
never executed: case Qt::Key_Backtab:
Qt::Key_Backtab:
never executed: case Qt::Key_Backtab:
0
1466 if (d->tabKeyNavigation
d->tabKeyNavigationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1467 newCurrent = moveCursor(MovePrevious, event->modifiers());
never executed: newCurrent = moveCursor(MovePrevious, event->modifiers());
0
1468 break;
never executed: break;
0
1469 }-
1470-
1471 QPersistentModelIndex oldCurrent = currentIndex();-
1472 if (newCurrent != oldCurrent
newCurrent != oldCurrentDescription
TRUEnever evaluated
FALSEnever evaluated
&& newCurrent.isValid()
newCurrent.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->isIndexEnabled(newCurrent)
d->isIndexEnabled(newCurrent)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1473 if (!hasFocus()
!hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
&& QApplication::focusWidget() == indexWidget(oldCurrent)
QApplication::...et(oldCurrent)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1474 setFocus();
never executed: setFocus();
0
1475 QItemSelectionModel::SelectionFlags command = selectionCommand(newCurrent, event);-
1476 if (command != QItemSelectionModel::NoUpdate
command != QIt...odel::NoUpdateDescription
TRUEnever evaluated
FALSEnever evaluated
0
1477 || style()->styleHint(QStyle::SH_ItemView_MovementWithoutUpdatingSelection, 0, this)
style()->style...tion, 0, this)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1478-
1479 if (command & QItemSelectionModel::Current
command & QIte...Model::CurrentDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1480 d->selectionModel->setCurrentIndex(newCurrent, QItemSelectionModel::NoUpdate);-
1481 if (!d->currentSelectionStartIndex.isValid()
!d->currentSel...ndex.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1482 d->currentSelectionStartIndex = oldCurrent;
never executed: d->currentSelectionStartIndex = oldCurrent;
0
1483 QRect rect(visualRect(d->currentSelectionStartIndex).center(), visualRect(newCurrent).center());-
1484 setSelection(rect, command);-
1485 }
never executed: end of block
else {
0
1486 d->selectionModel->setCurrentIndex(newCurrent, command);-
1487 d->currentSelectionStartIndex = newCurrent;-
1488 if (newCurrent.isValid()
newCurrent.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1489-
1490 QRect rect(visualRect(newCurrent).center(), QSize(1, 1));-
1491 setSelection(rect, command);-
1492 }
never executed: end of block
0
1493 }
never executed: end of block
0
1494 event->accept();-
1495 return;
never executed: return;
0
1496 }-
1497 }
never executed: end of block
0
1498-
1499 switch (event->key()) {-
1500-
1501 case
never executed: case Qt::Key_Down:
Qt::Key_Down:
never executed: case Qt::Key_Down:
0
1502 case
never executed: case Qt::Key_Up:
Qt::Key_Up:
never executed: case Qt::Key_Up:
0
1503-
1504-
1505-
1506-
1507-
1508-
1509 case
never executed: case Qt::Key_Left:
Qt::Key_Left:
never executed: case Qt::Key_Left:
0
1510 case
never executed: case Qt::Key_Right:
Qt::Key_Right:
never executed: case Qt::Key_Right:
0
1511 case
never executed: case Qt::Key_Home:
Qt::Key_Home:
never executed: case Qt::Key_Home:
0
1512 case
never executed: case Qt::Key_End:
Qt::Key_End:
never executed: case Qt::Key_End:
0
1513 case
never executed: case Qt::Key_PageUp:
Qt::Key_PageUp:
never executed: case Qt::Key_PageUp:
0
1514 case
never executed: case Qt::Key_PageDown:
Qt::Key_PageDown:
never executed: case Qt::Key_PageDown:
0
1515 case
never executed: case Qt::Key_Escape:
Qt::Key_Escape:
never executed: case Qt::Key_Escape:
0
1516 case
never executed: case Qt::Key_Shift:
Qt::Key_Shift:
never executed: case Qt::Key_Shift:
0
1517 case
never executed: case Qt::Key_Control:
Qt::Key_Control:
never executed: case Qt::Key_Control:
0
1518 case
never executed: case Qt::Key_Delete:
Qt::Key_Delete:
never executed: case Qt::Key_Delete:
0
1519 case
never executed: case Qt::Key_Backspace:
Qt::Key_Backspace:
never executed: case Qt::Key_Backspace:
0
1520 event->ignore();-
1521 break;
never executed: break;
0
1522 case
never executed: case Qt::Key_Space:
Qt::Key_Space:
never executed: case Qt::Key_Space:
0
1523 case
never executed: case Qt::Key_Select:
Qt::Key_Select:
never executed: case Qt::Key_Select:
0
1524 if (!edit(currentIndex(), AnyKeyPressed, event)
!edit(currentI...ressed, event)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1525 d->selectionModel->select(currentIndex(), selectionCommand(currentIndex(), event));
never executed: d->selectionModel->select(currentIndex(), selectionCommand(currentIndex(), event));
0
1526 break;
never executed: break;
0
1527 case
never executed: case Qt::Key_F2:
Qt::Key_F2:
never executed: case Qt::Key_F2:
0
1528 if (!edit(currentIndex(), EditKeyPressed, event)
!edit(currentI...ressed, event)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1529 event->ignore();
never executed: event->ignore();
0
1530 break;
never executed: break;
0
1531 case
never executed: case Qt::Key_Enter:
Qt::Key_Enter:
never executed: case Qt::Key_Enter:
0
1532 case
never executed: case Qt::Key_Return:
Qt::Key_Return:
never executed: case Qt::Key_Return:
0
1533-
1534-
1535-
1536 if (state() != EditingState
state() != EditingStateDescription
TRUEnever evaluated
FALSEnever evaluated
|| hasFocus()
hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1537 if (currentIndex().isValid()
currentIndex().isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1538 activated(currentIndex());
never executed: activated(currentIndex());
0
1539 event->ignore();-
1540 }
never executed: end of block
0
1541 break;
never executed: break;
0
1542-
1543 default
never executed: default:
:
never executed: default:
{
0
1544 if (event == QKeySequence::SelectAll
event == QKeyS...nce::SelectAllDescription
TRUEnever evaluated
FALSEnever evaluated
&& selectionMode() != NoSelection
selectionMode() != NoSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1545 selectAll();-
1546 break;
never executed: break;
0
1547 }-
1548-
1549-
1550-
1551-
1552-
1553-
1554 bool modified = (event->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier));-
1555 if (!event->text().isEmpty()
!event->text().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& !modified
!modifiedDescription
TRUEnever evaluated
FALSEnever evaluated
&& !edit(currentIndex(), AnyKeyPressed, event)
!edit(currentI...ressed, event)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1556 keyboardSearch(event->text());-
1557 event->accept();-
1558 }
never executed: end of block
else {
0
1559 event->ignore();-
1560 }
never executed: end of block
0
1561 break;
never executed: break;
}
0
1562 }-
1563 if (d->moveCursorUpdatedView
d->moveCursorUpdatedViewDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1564 event->accept();
never executed: event->accept();
0
1565}
never executed: end of block
0
1566-
1567-
1568-
1569-
1570-
1571-
1572-
1573void QAbstractItemView::resizeEvent(QResizeEvent *event)-
1574{-
1575 QAbstractScrollArea::resizeEvent(event);-
1576 updateGeometries();-
1577}
never executed: end of block
0
1578-
1579-
1580-
1581-
1582-
1583-
1584-
1585void QAbstractItemView::timerEvent(QTimerEvent *event)-
1586{-
1587 QAbstractItemViewPrivate * const d = d_func();-
1588 if (event->timerId() == d->fetchMoreTimer.timerId()
event->timerId...imer.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1589 d->fetchMore();
never executed: d->fetchMore();
0
1590 else if (event->timerId() == d->delayedReset.timerId()
event->timerId...eset.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1591 reset();
never executed: reset();
0
1592 else if (event->timerId() == d->autoScrollTimer.timerId()
event->timerId...imer.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1593 doAutoScroll();
never executed: doAutoScroll();
0
1594 else if (event->timerId() == d->updateTimer.timerId()
event->timerId...imer.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1595 d->updateDirtyRegion();
never executed: d->updateDirtyRegion();
0
1596 else if (event->timerId() == d->delayedEditing.timerId()
event->timerId...ting.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1597 d->delayedEditing.stop();-
1598 edit(currentIndex());-
1599 }
never executed: end of block
else if (event->timerId() == d->delayedLayout.timerId()
event->timerId...yout.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1600 d->delayedLayout.stop();-
1601 if (isVisible()
isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1602 d->interruptDelayedItemsLayout();-
1603 doItemsLayout();-
1604 const QModelIndex current = currentIndex();-
1605 if (current.isValid()
current.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->state == QAbstractItemView::EditingState
d->state == QA...::EditingStateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1606 scrollTo(current);
never executed: scrollTo(current);
0
1607 }
never executed: end of block
0
1608 }
never executed: end of block
else if (event->timerId() == d->delayedAutoScroll.timerId()
event->timerId...roll.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1609 d->delayedAutoScroll.stop();-
1610-
1611-
1612 if (d->pressedIndex.isValid()
d->pressedIndex.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->pressedIndex == currentIndex()
d->pressedInde...currentIndex()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1613 scrollTo(d->pressedIndex);
never executed: scrollTo(d->pressedIndex);
0
1614 }
never executed: end of block
0
1615}
never executed: end of block
0
1616-
1617-
1618-
1619-
1620void QAbstractItemView::inputMethodEvent(QInputMethodEvent *event)-
1621{-
1622 if (event->commitString().isEmpty()
event->commitS...ng().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& event->preeditString().isEmpty()
event->preedit...ng().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1623 event->ignore();-
1624 return;
never executed: return;
0
1625 }-
1626 if (!edit(currentIndex(), AnyKeyPressed, event)
!edit(currentI...ressed, event)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1627 if (!event->commitString().isEmpty()
!event->commit...ng().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1628 keyboardSearch(event->commitString());
never executed: keyboardSearch(event->commitString());
0
1629 event->ignore();-
1630 }
never executed: end of block
0
1631}
never executed: end of block
0
1632QAbstractItemView::DropIndicatorPosition QAbstractItemView::dropIndicatorPosition() const-
1633{-
1634 const QAbstractItemViewPrivate * const d = d_func();-
1635 return
never executed: return d->dropIndicatorPosition;
d->dropIndicatorPosition;
never executed: return d->dropIndicatorPosition;
0
1636}-
1637QModelIndexList QAbstractItemView::selectedIndexes() const-
1638{-
1639 const QAbstractItemViewPrivate * const d = d_func();-
1640 QModelIndexList indexes;-
1641 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1642 indexes = d->selectionModel->selectedIndexes();-
1643 auto isHidden = [this](const QModelIndex &idx) {-
1644 return
never executed: return isIndexHidden(idx);
isIndexHidden(idx);
never executed: return isIndexHidden(idx);
0
1645 };-
1646 const auto end = indexes.end();-
1647 indexes.erase(std::remove_if(indexes.begin(), end, isHidden), end);-
1648 }
never executed: end of block
0
1649 return
never executed: return indexes;
indexes;
never executed: return indexes;
0
1650}-
1651bool QAbstractItemView::edit(const QModelIndex &index, EditTrigger trigger, QEvent *event)-
1652{-
1653 QAbstractItemViewPrivate * const d = d_func();-
1654-
1655 if (!d->isIndexValid(index)
!d->isIndexValid(index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1656 return
never executed: return false;
false;
never executed: return false;
0
1657-
1658 if (QWidget *w = (d->persistent.isEmpty()
d->persistent.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
? static_cast<QWidget*>(0) : d->editorForIndex(index).widget.data())
QWidget *w = (...widget.data())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1659 if (w->focusPolicy() == Qt::NoFocus
w->focusPolicy...== Qt::NoFocusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1660 return
never executed: return false;
false;
never executed: return false;
0
1661 w->setFocus();-
1662 return
never executed: return true;
true;
never executed: return true;
0
1663 }-
1664-
1665 if (trigger == DoubleClicked
trigger == DoubleClickedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1666 d->delayedEditing.stop();-
1667 d->delayedAutoScroll.stop();-
1668 }
never executed: end of block
else if (trigger == CurrentChanged
trigger == CurrentChangedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1669 d->delayedEditing.stop();-
1670 }
never executed: end of block
0
1671-
1672 if (d->sendDelegateEvent(index, event)
d->sendDelegat...(index, event)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1673 update(index);-
1674 return
never executed: return true;
true;
never executed: return true;
0
1675 }-
1676-
1677-
1678 EditTriggers lastTrigger = d->lastTrigger;-
1679 d->lastTrigger = trigger;-
1680-
1681 if (!d->shouldEdit(trigger, d->model->buddy(index))
!d->shouldEdit...>buddy(index))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1682 return
never executed: return false;
false;
never executed: return false;
0
1683-
1684 if (d->delayedEditing.isActive()
d->delayedEditing.isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1685 return
never executed: return false;
false;
never executed: return false;
0
1686-
1687-
1688-
1689 if (lastTrigger == DoubleClicked
lastTrigger == DoubleClickedDescription
TRUEnever evaluated
FALSEnever evaluated
&& trigger == SelectedClicked
trigger == SelectedClickedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1690 return
never executed: return false;
false;
never executed: return false;
0
1691-
1692-
1693 if (trigger == SelectedClicked
trigger == SelectedClickedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1694 d->delayedEditing.start(QApplication::doubleClickInterval(), this);
never executed: d->delayedEditing.start(QApplication::doubleClickInterval(), this);
0
1695 else-
1696 d->openEditor(index, d->shouldForwardEvent(trigger, event) ? event : 0);
never executed: d->openEditor(index, d->shouldForwardEvent(trigger, event) ? event : 0);
0
1697-
1698 return
never executed: return true;
true;
never executed: return true;
0
1699}-
1700-
1701-
1702-
1703-
1704-
1705void QAbstractItemView::updateEditorData()-
1706{-
1707 QAbstractItemViewPrivate * const d = d_func();-
1708 d->updateEditorData(QModelIndex(), QModelIndex());-
1709}
never executed: end of block
0
1710-
1711-
1712-
1713-
1714-
1715void QAbstractItemView::updateEditorGeometries()-
1716{-
1717 QAbstractItemViewPrivate * const d = d_func();-
1718 if(d->editorIndexHash.isEmpty()
d->editorIndexHash.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1719 return;
never executed: return;
0
1720 if (d->delayedPendingLayout
d->delayedPendingLayoutDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1721-
1722 d->executePostedLayout();-
1723 return;
never executed: return;
0
1724 }-
1725 QStyleOptionViewItem option = d->viewOptionsV1();-
1726 QEditorIndexHash::iterator it = d->editorIndexHash.begin();-
1727 QWidgetList editorsToRelease;-
1728 QWidgetList editorsToHide;-
1729 while (it != d->editorIndexHash.end()
it != d->editorIndexHash.end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1730 QModelIndex index = it.value();-
1731 QWidget *editor = it.key();-
1732 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& editor
editorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1733 option.rect = visualRect(index);-
1734 if (option.rect.isValid()
option.rect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1735 editor->show();-
1736 QAbstractItemDelegate *delegate = d->delegateForIndex(index);-
1737 if (delegate
delegateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1738 delegate->
never executed: delegate->updateEditorGeometry(editor, option, index);
updateEditorGeometry(editor, option, index);
never executed: delegate->updateEditorGeometry(editor, option, index);
0
1739 }
never executed: end of block
else {
0
1740 editorsToHide << editor;-
1741 }
never executed: end of block
0
1742 ++it;-
1743 }
never executed: end of block
else {
0
1744 d->indexEditorHash.remove(it.value());-
1745 it = d->editorIndexHash.erase(it);-
1746 editorsToRelease << editor;-
1747 }
never executed: end of block
0
1748 }-
1749-
1750-
1751-
1752 for (int i = 0; i < editorsToHide.count()
i < editorsToHide.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1753 editorsToHide.at(i)->hide();-
1754 }
never executed: end of block
0
1755 for (int i = 0; i < editorsToRelease.count()
i < editorsToRelease.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1756 d->releaseEditor(editorsToRelease.at(i));-
1757 }
never executed: end of block
0
1758}
never executed: end of block
0
1759-
1760-
1761-
1762-
1763-
1764-
1765void QAbstractItemView::updateGeometries()-
1766{-
1767 QAbstractItemViewPrivate * const d = d_func();-
1768 updateEditorGeometries();-
1769 d->fetchMoreTimer.start(0, this);-
1770 d->updateGeometry();-
1771}
never executed: end of block
0
1772-
1773-
1774-
1775-
1776void QAbstractItemView::verticalScrollbarValueChanged(int value)-
1777{-
1778 QAbstractItemViewPrivate * const d = d_func();-
1779 if (verticalScrollBar()->maximum() == value
verticalScroll...mum() == valueDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->model->canFetchMore(d->root)
d->model->canF...hMore(d->root)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1780 d->model->fetchMore(d->root);
never executed: d->model->fetchMore(d->root);
0
1781 QPoint posInVp = viewport()->mapFromGlobal(QCursor::pos());-
1782 if (viewport()->rect().contains(posInVp)
viewport()->re...tains(posInVp)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1783 d->checkMouseMove(posInVp);
never executed: d->checkMouseMove(posInVp);
0
1784}
never executed: end of block
0
1785-
1786-
1787-
1788-
1789void QAbstractItemView::horizontalScrollbarValueChanged(int value)-
1790{-
1791 QAbstractItemViewPrivate * const d = d_func();-