Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/itemviews/qabstractitemview.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||
9 | - | |||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||
12 | QAbstractItemViewPrivate::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 | - | |||||||||||||||||||||||||
57 | QAbstractItemViewPrivate::~QAbstractItemViewPrivate() | - | ||||||||||||||||||||||||
58 | { | - | ||||||||||||||||||||||||
59 | } | - | ||||||||||||||||||||||||
60 | - | |||||||||||||||||||||||||
61 | void 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 | - | |||||||||||||||||||||||||
86 | void QAbstractItemViewPrivate::setHoverIndex(const QPersistentModelIndex &index) | - | ||||||||||||||||||||||||
87 | { | - | ||||||||||||||||||||||||
88 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
89 | if (hover == index
| 0 | ||||||||||||||||||||||||
90 | return; never executed: return; | 0 | ||||||||||||||||||||||||
91 | - | |||||||||||||||||||||||||
92 | if (selectionBehavior != QAbstractItemView::SelectRows
| 0 | ||||||||||||||||||||||||
93 | q->update(hover); | - | ||||||||||||||||||||||||
94 | q->update(index); | - | ||||||||||||||||||||||||
95 | } never executed: else {end of block | 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 | - | |||||||||||||||||||||||||
104 | void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index) | - | ||||||||||||||||||||||||
105 | { | - | ||||||||||||||||||||||||
106 | - | |||||||||||||||||||||||||
107 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
108 | setHoverIndex(index); | - | ||||||||||||||||||||||||
109 | if (viewportEnteredNeeded
| 0 | ||||||||||||||||||||||||
110 | viewportEnteredNeeded = false; | - | ||||||||||||||||||||||||
111 | - | |||||||||||||||||||||||||
112 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
113 | q->entered(index); | - | ||||||||||||||||||||||||
114 | - | |||||||||||||||||||||||||
115 | QString statustip = model->data(index, Qt::StatusTipRole).toString(); | - | ||||||||||||||||||||||||
116 | if (parent
| 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: else {end of block | 0 | ||||||||||||||||||||||||
123 | - | |||||||||||||||||||||||||
124 | if (parent
| 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 | - | |||||||||||||||||||||||||
139 | void QAbstractItemViewPrivate::_q_scrollerStateChanged() | - | ||||||||||||||||||||||||
140 | { | - | ||||||||||||||||||||||||
141 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
142 | - | |||||||||||||||||||||||||
143 | if (QScroller *scroller = QScroller::scroller(viewport)
| 0 | ||||||||||||||||||||||||
144 | switch (scroller->state()) { | - | ||||||||||||||||||||||||
145 | case never executed: QScroller::Pressed:case QScroller::Pressed: never executed: case QScroller::Pressed: | 0 | ||||||||||||||||||||||||
146 | - | |||||||||||||||||||||||||
147 | if (q->selectionModel()
| 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: QScroller::Dragging:case QScroller::Dragging: never executed: case QScroller::Dragging: | 0 | ||||||||||||||||||||||||
154 | - | |||||||||||||||||||||||||
155 | if (q->selectionModel()
| 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 | ||||||||||||||||||||||||
168 | QAbstractItemView::QAbstractItemView(QWidget *parent) | - | ||||||||||||||||||||||||
169 | : QAbstractScrollArea(*(new QAbstractItemViewPrivate), parent) | - | ||||||||||||||||||||||||
170 | { | - | ||||||||||||||||||||||||
171 | d_func()->init(); | - | ||||||||||||||||||||||||
172 | } never executed: end of block | 0 | ||||||||||||||||||||||||
173 | - | |||||||||||||||||||||||||
174 | - | |||||||||||||||||||||||||
175 | - | |||||||||||||||||||||||||
176 | - | |||||||||||||||||||||||||
177 | QAbstractItemView::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 | - | |||||||||||||||||||||||||
186 | QAbstractItemView::~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 | ||||||||||||||||||||||||
198 | void QAbstractItemView::setModel(QAbstractItemModel *model) | - | ||||||||||||||||||||||||
199 | { | - | ||||||||||||||||||||||||
200 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
201 | if (model == d->model
| 0 | ||||||||||||||||||||||||
202 | return; never executed: return; | 0 | ||||||||||||||||||||||||
203 | if (d->model
| 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
| 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()
| 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 | - | |||||||||||||||||||||||||
297 | QAbstractItemModel *QAbstractItemView::model() const | - | ||||||||||||||||||||||||
298 | { | - | ||||||||||||||||||||||||
299 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
300 | return never executed: (d->model == QAbstractItemModelPrivate::staticEmptyModel() ? 0 : d->model);return (d->model == QAbstractItemModelPrivate::staticEmptyModel() ? 0 : d->model); never executed: return (d->model == QAbstractItemModelPrivate::staticEmptyModel() ? 0 : d->model); | 0 | ||||||||||||||||||||||||
301 | } | - | ||||||||||||||||||||||||
302 | void 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)
| 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
| 0 | ||||||||||||||||||||||||
319 | if (d->selectionModel->model() == selectionModel->model()
| 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
| 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 | - | |||||||||||||||||||||||||
348 | QItemSelectionModel* QAbstractItemView::selectionModel() const | - | ||||||||||||||||||||||||
349 | { | - | ||||||||||||||||||||||||
350 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
351 | return never executed: d->selectionModel;return d->selectionModel; never executed: return d->selectionModel; | 0 | ||||||||||||||||||||||||
352 | } | - | ||||||||||||||||||||||||
353 | void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate) | - | ||||||||||||||||||||||||
354 | { | - | ||||||||||||||||||||||||
355 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
356 | if (delegate
| 0 | ||||||||||||||||||||||||
357 | return; never executed: return; | 0 | ||||||||||||||||||||||||
358 | - | |||||||||||||||||||||||||
359 | if (d->itemDelegate
| 0 | ||||||||||||||||||||||||
360 | if (d->delegateRefCount(d->itemDelegate) == 1
| 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
| 0 | ||||||||||||||||||||||||
369 | if (d->delegateRefCount(delegate) == 0
| 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 | - | |||||||||||||||||||||||||
387 | QAbstractItemDelegate *QAbstractItemView::itemDelegate() const | - | ||||||||||||||||||||||||
388 | { | - | ||||||||||||||||||||||||
389 | return never executed: d_func()->itemDelegate;return d_func()->itemDelegate; never executed: return d_func()->itemDelegate; | 0 | ||||||||||||||||||||||||
390 | } | - | ||||||||||||||||||||||||
391 | - | |||||||||||||||||||||||||
392 | - | |||||||||||||||||||||||||
393 | - | |||||||||||||||||||||||||
394 | - | |||||||||||||||||||||||||
395 | QVariant QAbstractItemView::inputMethodQuery(Qt::InputMethodQuery query) const | - | ||||||||||||||||||||||||
396 | { | - | ||||||||||||||||||||||||
397 | const QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||
398 | if (!current.isValid()
| 0 | ||||||||||||||||||||||||
399 | return never executed: QAbstractScrollArea::inputMethodQuery(query);return QAbstractScrollArea::inputMethodQuery(query); never executed: return QAbstractScrollArea::inputMethodQuery(query); | 0 | ||||||||||||||||||||||||
400 | return never executed: visualRect(current);return visualRect(current); never executed: return visualRect(current); | 0 | ||||||||||||||||||||||||
401 | } | - | ||||||||||||||||||||||||
402 | void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *delegate) | - | ||||||||||||||||||||||||
403 | { | - | ||||||||||||||||||||||||
404 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
405 | if (QAbstractItemDelegate *rowDelegate = d->rowDelegates.value(row, 0)
| 0 | ||||||||||||||||||||||||
406 | if (d->delegateRefCount(rowDelegate) == 1
| 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
| 0 | ||||||||||||||||||||||||
415 | if (d->delegateRefCount(delegate) == 0
| 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 | ||||||||||||||||||||||||
426 | QAbstractItemDelegate *QAbstractItemView::itemDelegateForRow(int row) const | - | ||||||||||||||||||||||||
427 | { | - | ||||||||||||||||||||||||
428 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
429 | return never executed: d->rowDelegates.value(row, 0);return d->rowDelegates.value(row, 0); never executed: return d->rowDelegates.value(row, 0); | 0 | ||||||||||||||||||||||||
430 | } | - | ||||||||||||||||||||||||
431 | void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate) | - | ||||||||||||||||||||||||
432 | { | - | ||||||||||||||||||||||||
433 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
434 | if (QAbstractItemDelegate *columnDelegate = d->columnDelegates.value(column, 0)
| 0 | ||||||||||||||||||||||||
435 | if (d->delegateRefCount(columnDelegate) == 1
| 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
| 0 | ||||||||||||||||||||||||
444 | if (d->delegateRefCount(delegate) == 0
| 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 | ||||||||||||||||||||||||
455 | QAbstractItemDelegate *QAbstractItemView::itemDelegateForColumn(int column) const | - | ||||||||||||||||||||||||
456 | { | - | ||||||||||||||||||||||||
457 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
458 | return never executed: d->columnDelegates.value(column, 0);return d->columnDelegates.value(column, 0); never executed: return d->columnDelegates.value(column, 0); | 0 | ||||||||||||||||||||||||
459 | } | - | ||||||||||||||||||||||||
460 | - | |||||||||||||||||||||||||
461 | - | |||||||||||||||||||||||||
462 | - | |||||||||||||||||||||||||
463 | - | |||||||||||||||||||||||||
464 | - | |||||||||||||||||||||||||
465 | QAbstractItemDelegate *QAbstractItemView::itemDelegate(const QModelIndex &index) const | - | ||||||||||||||||||||||||
466 | { | - | ||||||||||||||||||||||||
467 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
468 | return never executed: d->delegateForIndex(index);return d->delegateForIndex(index); never executed: return d->delegateForIndex(index); | 0 | ||||||||||||||||||||||||
469 | } | - | ||||||||||||||||||||||||
470 | void QAbstractItemView::setSelectionMode(SelectionMode mode) | - | ||||||||||||||||||||||||
471 | { | - | ||||||||||||||||||||||||
472 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
473 | d->selectionMode = mode; | - | ||||||||||||||||||||||||
474 | } never executed: end of block | 0 | ||||||||||||||||||||||||
475 | - | |||||||||||||||||||||||||
476 | QAbstractItemView::SelectionMode QAbstractItemView::selectionMode() const | - | ||||||||||||||||||||||||
477 | { | - | ||||||||||||||||||||||||
478 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
479 | return never executed: d->selectionMode;return d->selectionMode; never executed: return d->selectionMode; | 0 | ||||||||||||||||||||||||
480 | } | - | ||||||||||||||||||||||||
481 | void QAbstractItemView::setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior) | - | ||||||||||||||||||||||||
482 | { | - | ||||||||||||||||||||||||
483 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
484 | d->selectionBehavior = behavior; | - | ||||||||||||||||||||||||
485 | } never executed: end of block | 0 | ||||||||||||||||||||||||
486 | - | |||||||||||||||||||||||||
487 | QAbstractItemView::SelectionBehavior QAbstractItemView::selectionBehavior() const | - | ||||||||||||||||||||||||
488 | { | - | ||||||||||||||||||||||||
489 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
490 | return never executed: d->selectionBehavior;return d->selectionBehavior; never executed: return d->selectionBehavior; | 0 | ||||||||||||||||||||||||
491 | } | - | ||||||||||||||||||||||||
492 | void QAbstractItemView::setCurrentIndex(const QModelIndex &index) | - | ||||||||||||||||||||||||
493 | { | - | ||||||||||||||||||||||||
494 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
495 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
496 | QItemSelectionModel::SelectionFlags command = selectionCommand(index, 0); | - | ||||||||||||||||||||||||
497 | d->selectionModel->setCurrentIndex(index, command); | - | ||||||||||||||||||||||||
498 | d->currentIndexSet = true; | - | ||||||||||||||||||||||||
499 | if ((
| 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 | - | |||||||||||||||||||||||||
509 | QModelIndex QAbstractItemView::currentIndex() const | - | ||||||||||||||||||||||||
510 | { | - | ||||||||||||||||||||||||
511 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
512 | return never executed: d->selectionModel ? d->selectionModel->currentIndex() : QModelIndex();return d->selectionModel ? d->selectionModel->currentIndex() : QModelIndex(); never executed: return d->selectionModel ? d->selectionModel->currentIndex() : QModelIndex(); | 0 | ||||||||||||||||||||||||
513 | } | - | ||||||||||||||||||||||||
514 | void 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
| 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
| 0 | ||||||||||||||||||||||||
529 | d->selectionModel->reset(); never executed: d->selectionModel->reset(); | 0 | ||||||||||||||||||||||||
530 | - | |||||||||||||||||||||||||
531 | if (QAccessible::isActive()
| 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 | - | |||||||||||||||||||||||||
544 | void QAbstractItemView::setRootIndex(const QModelIndex &index) | - | ||||||||||||||||||||||||
545 | { | - | ||||||||||||||||||||||||
546 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
547 | if (__builtin_expect(!!(index.isValid() && index.model() != d->model), false)
| 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 | - | |||||||||||||||||||||||||
562 | QModelIndex QAbstractItemView::rootIndex() const | - | ||||||||||||||||||||||||
563 | { | - | ||||||||||||||||||||||||
564 | return never executed: QModelIndex(d_func()->root);return QModelIndex(d_func()->root); never executed: return QModelIndex(d_func()->root); | 0 | ||||||||||||||||||||||||
565 | } | - | ||||||||||||||||||||||||
566 | void QAbstractItemView::selectAll() | - | ||||||||||||||||||||||||
567 | { | - | ||||||||||||||||||||||||
568 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
569 | SelectionMode mode = d->selectionMode; | - | ||||||||||||||||||||||||
570 | if (mode == MultiSelection
| 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
| 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 | ||||||||||||||||||||||||
576 | void QAbstractItemView::edit(const QModelIndex &index) | - | ||||||||||||||||||||||||
577 | { | - | ||||||||||||||||||||||||
578 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
579 | if (__builtin_expect(!!(!d->isIndexValid(index)), false)
| 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)
| 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 | - | |||||||||||||||||||||||||
590 | void QAbstractItemView::clearSelection() | - | ||||||||||||||||||||||||
591 | { | - | ||||||||||||||||||||||||
592 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
593 | if (d->selectionModel
| 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 | - | |||||||||||||||||||||||||
603 | void 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 | ||||||||||||||||||||||||
610 | void QAbstractItemView::setEditTriggers(EditTriggers actions) | - | ||||||||||||||||||||||||
611 | { | - | ||||||||||||||||||||||||
612 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
613 | d->editTriggers = actions; | - | ||||||||||||||||||||||||
614 | } never executed: end of block | 0 | ||||||||||||||||||||||||
615 | - | |||||||||||||||||||||||||
616 | QAbstractItemView::EditTriggers QAbstractItemView::editTriggers() const | - | ||||||||||||||||||||||||
617 | { | - | ||||||||||||||||||||||||
618 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
619 | return never executed: d->editTriggers;return d->editTriggers; never executed: return d->editTriggers; | 0 | ||||||||||||||||||||||||
620 | } | - | ||||||||||||||||||||||||
621 | void QAbstractItemView::setVerticalScrollMode(ScrollMode mode) | - | ||||||||||||||||||||||||
622 | { | - | ||||||||||||||||||||||||
623 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
624 | d->verticalScrollModeSet = true; | - | ||||||||||||||||||||||||
625 | if (mode == d->verticalScrollMode
| 0 | ||||||||||||||||||||||||
626 | return; never executed: return; | 0 | ||||||||||||||||||||||||
627 | QModelIndex topLeft = indexAt(QPoint(0, 0)); | - | ||||||||||||||||||||||||
628 | d->verticalScrollMode = mode; | - | ||||||||||||||||||||||||
629 | if (mode == ScrollPerItem
| 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 | - | |||||||||||||||||||||||||
637 | QAbstractItemView::ScrollMode QAbstractItemView::verticalScrollMode() const | - | ||||||||||||||||||||||||
638 | { | - | ||||||||||||||||||||||||
639 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
640 | return never executed: d->verticalScrollMode;return d->verticalScrollMode; never executed: return d->verticalScrollMode; | 0 | ||||||||||||||||||||||||
641 | } | - | ||||||||||||||||||||||||
642 | - | |||||||||||||||||||||||||
643 | void 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 | ||||||||||||||||||||||||
649 | void QAbstractItemView::setHorizontalScrollMode(ScrollMode mode) | - | ||||||||||||||||||||||||
650 | { | - | ||||||||||||||||||||||||
651 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
652 | d->horizontalScrollModeSet = true; | - | ||||||||||||||||||||||||
653 | if (mode == d->horizontalScrollMode
| 0 | ||||||||||||||||||||||||
654 | return; never executed: return; | 0 | ||||||||||||||||||||||||
655 | d->horizontalScrollMode = mode; | - | ||||||||||||||||||||||||
656 | if (mode == ScrollPerItem
| 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 | - | |||||||||||||||||||||||||
663 | QAbstractItemView::ScrollMode QAbstractItemView::horizontalScrollMode() const | - | ||||||||||||||||||||||||
664 | { | - | ||||||||||||||||||||||||
665 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
666 | return never executed: d->horizontalScrollMode;return d->horizontalScrollMode; never executed: return d->horizontalScrollMode; | 0 | ||||||||||||||||||||||||
667 | } | - | ||||||||||||||||||||||||
668 | - | |||||||||||||||||||||||||
669 | void 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 | ||||||||||||||||||||||||
675 | void QAbstractItemView::setDragDropOverwriteMode(bool overwrite) | - | ||||||||||||||||||||||||
676 | { | - | ||||||||||||||||||||||||
677 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
678 | d->overwrite = overwrite; | - | ||||||||||||||||||||||||
679 | } never executed: end of block | 0 | ||||||||||||||||||||||||
680 | - | |||||||||||||||||||||||||
681 | bool QAbstractItemView::dragDropOverwriteMode() const | - | ||||||||||||||||||||||||
682 | { | - | ||||||||||||||||||||||||
683 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
684 | return never executed: d->overwrite;return d->overwrite; never executed: return d->overwrite; | 0 | ||||||||||||||||||||||||
685 | } | - | ||||||||||||||||||||||||
686 | void QAbstractItemView::setAutoScroll(bool enable) | - | ||||||||||||||||||||||||
687 | { | - | ||||||||||||||||||||||||
688 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
689 | d->autoScroll = enable; | - | ||||||||||||||||||||||||
690 | } never executed: end of block | 0 | ||||||||||||||||||||||||
691 | - | |||||||||||||||||||||||||
692 | bool QAbstractItemView::hasAutoScroll() const | - | ||||||||||||||||||||||||
693 | { | - | ||||||||||||||||||||||||
694 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
695 | return never executed: d->autoScroll;return d->autoScroll; never executed: return d->autoScroll; | 0 | ||||||||||||||||||||||||
696 | } | - | ||||||||||||||||||||||||
697 | void QAbstractItemView::setAutoScrollMargin(int margin) | - | ||||||||||||||||||||||||
698 | { | - | ||||||||||||||||||||||||
699 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
700 | d->autoScrollMargin = margin; | - | ||||||||||||||||||||||||
701 | } never executed: end of block | 0 | ||||||||||||||||||||||||
702 | - | |||||||||||||||||||||||||
703 | int QAbstractItemView::autoScrollMargin() const | - | ||||||||||||||||||||||||
704 | { | - | ||||||||||||||||||||||||
705 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
706 | return never executed: d->autoScrollMargin;return d->autoScrollMargin; never executed: return d->autoScrollMargin; | 0 | ||||||||||||||||||||||||
707 | } | - | ||||||||||||||||||||||||
708 | - | |||||||||||||||||||||||||
709 | - | |||||||||||||||||||||||||
710 | - | |||||||||||||||||||||||||
711 | - | |||||||||||||||||||||||||
712 | - | |||||||||||||||||||||||||
713 | - | |||||||||||||||||||||||||
714 | void QAbstractItemView::setTabKeyNavigation(bool enable) | - | ||||||||||||||||||||||||
715 | { | - | ||||||||||||||||||||||||
716 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
717 | d->tabKeyNavigation = enable; | - | ||||||||||||||||||||||||
718 | } never executed: end of block | 0 | ||||||||||||||||||||||||
719 | - | |||||||||||||||||||||||||
720 | bool QAbstractItemView::tabKeyNavigation() const | - | ||||||||||||||||||||||||
721 | { | - | ||||||||||||||||||||||||
722 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
723 | return never executed: d->tabKeyNavigation;return d->tabKeyNavigation; never executed: return d->tabKeyNavigation; | 0 | ||||||||||||||||||||||||
724 | } | - | ||||||||||||||||||||||||
725 | - | |||||||||||||||||||||||||
726 | - | |||||||||||||||||||||||||
727 | - | |||||||||||||||||||||||||
728 | - | |||||||||||||||||||||||||
729 | - | |||||||||||||||||||||||||
730 | QSize QAbstractItemView::viewportSizeHint() const | - | ||||||||||||||||||||||||
731 | { | - | ||||||||||||||||||||||||
732 | return never executed: QAbstractScrollArea::viewportSizeHint();return QAbstractScrollArea::viewportSizeHint(); never executed: return QAbstractScrollArea::viewportSizeHint(); | 0 | ||||||||||||||||||||||||
733 | } | - | ||||||||||||||||||||||||
734 | void QAbstractItemView::setDropIndicatorShown(bool enable) | - | ||||||||||||||||||||||||
735 | { | - | ||||||||||||||||||||||||
736 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
737 | d->showDropIndicator = enable; | - | ||||||||||||||||||||||||
738 | } never executed: end of block | 0 | ||||||||||||||||||||||||
739 | - | |||||||||||||||||||||||||
740 | bool QAbstractItemView::showDropIndicator() const | - | ||||||||||||||||||||||||
741 | { | - | ||||||||||||||||||||||||
742 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
743 | return never executed: d->showDropIndicator;return d->showDropIndicator; never executed: return d->showDropIndicator; | 0 | ||||||||||||||||||||||||
744 | } | - | ||||||||||||||||||||||||
745 | void QAbstractItemView::setDragEnabled(bool enable) | - | ||||||||||||||||||||||||
746 | { | - | ||||||||||||||||||||||||
747 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
748 | d->dragEnabled = enable; | - | ||||||||||||||||||||||||
749 | } never executed: end of block | 0 | ||||||||||||||||||||||||
750 | - | |||||||||||||||||||||||||
751 | bool QAbstractItemView::dragEnabled() const | - | ||||||||||||||||||||||||
752 | { | - | ||||||||||||||||||||||||
753 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
754 | return never executed: d->dragEnabled;return d->dragEnabled; never executed: return d->dragEnabled; | 0 | ||||||||||||||||||||||||
755 | } | - | ||||||||||||||||||||||||
756 | void 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 | - | |||||||||||||||||||||||||
764 | QAbstractItemView::DragDropMode QAbstractItemView::dragDropMode() const | - | ||||||||||||||||||||||||
765 | { | - | ||||||||||||||||||||||||
766 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
767 | DragDropMode setBehavior = d->dragDropMode; | - | ||||||||||||||||||||||||
768 | if (!dragEnabled()
| 0 | ||||||||||||||||||||||||
769 | return never executed: NoDragDrop;return NoDragDrop; never executed: return NoDragDrop; | 0 | ||||||||||||||||||||||||
770 | - | |||||||||||||||||||||||||
771 | if (dragEnabled()
| 0 | ||||||||||||||||||||||||
772 | return never executed: DragOnly;return DragOnly; never executed: return DragOnly; | 0 | ||||||||||||||||||||||||
773 | - | |||||||||||||||||||||||||
774 | if (!dragEnabled()
| 0 | ||||||||||||||||||||||||
775 | return never executed: DropOnly;return DropOnly; never executed: return DropOnly; | 0 | ||||||||||||||||||||||||
776 | - | |||||||||||||||||||||||||
777 | if (dragEnabled()
| 0 | ||||||||||||||||||||||||
778 | if (setBehavior == InternalMove
| 0 | ||||||||||||||||||||||||
779 | return never executed: setBehavior;return setBehavior; never executed: return setBehavior; | 0 | ||||||||||||||||||||||||
780 | else | - | ||||||||||||||||||||||||
781 | return never executed: DragDrop;return DragDrop; never executed: return DragDrop; | 0 | ||||||||||||||||||||||||
782 | } | - | ||||||||||||||||||||||||
783 | - | |||||||||||||||||||||||||
784 | return never executed: NoDragDrop;return NoDragDrop; never executed: return NoDragDrop; | 0 | ||||||||||||||||||||||||
785 | } | - | ||||||||||||||||||||||||
786 | void QAbstractItemView::setDefaultDropAction(Qt::DropAction dropAction) | - | ||||||||||||||||||||||||
787 | { | - | ||||||||||||||||||||||||
788 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
789 | d->defaultDropAction = dropAction; | - | ||||||||||||||||||||||||
790 | } never executed: end of block | 0 | ||||||||||||||||||||||||
791 | - | |||||||||||||||||||||||||
792 | Qt::DropAction QAbstractItemView::defaultDropAction() const | - | ||||||||||||||||||||||||
793 | { | - | ||||||||||||||||||||||||
794 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
795 | return never executed: d->defaultDropAction;return d->defaultDropAction; never executed: return d->defaultDropAction; | 0 | ||||||||||||||||||||||||
796 | } | - | ||||||||||||||||||||||||
797 | void QAbstractItemView::setAlternatingRowColors(bool enable) | - | ||||||||||||||||||||||||
798 | { | - | ||||||||||||||||||||||||
799 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
800 | d->alternatingColors = enable; | - | ||||||||||||||||||||||||
801 | if (isVisible()
| 0 | ||||||||||||||||||||||||
802 | d->viewport->update(); never executed: d->viewport->update(); | 0 | ||||||||||||||||||||||||
803 | } never executed: end of block | 0 | ||||||||||||||||||||||||
804 | - | |||||||||||||||||||||||||
805 | bool QAbstractItemView::alternatingRowColors() const | - | ||||||||||||||||||||||||
806 | { | - | ||||||||||||||||||||||||
807 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
808 | return never executed: d->alternatingColors;return d->alternatingColors; never executed: return d->alternatingColors; | 0 | ||||||||||||||||||||||||
809 | } | - | ||||||||||||||||||||||||
810 | void QAbstractItemView::setIconSize(const QSize &size) | - | ||||||||||||||||||||||||
811 | { | - | ||||||||||||||||||||||||
812 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
813 | if (size == d->iconSize
| 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 | - | |||||||||||||||||||||||||
820 | QSize QAbstractItemView::iconSize() const | - | ||||||||||||||||||||||||
821 | { | - | ||||||||||||||||||||||||
822 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
823 | return never executed: d->iconSize;return d->iconSize; never executed: return d->iconSize; | 0 | ||||||||||||||||||||||||
824 | } | - | ||||||||||||||||||||||||
825 | void QAbstractItemView::setTextElideMode(Qt::TextElideMode mode) | - | ||||||||||||||||||||||||
826 | { | - | ||||||||||||||||||||||||
827 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
828 | d->textElideMode = mode; | - | ||||||||||||||||||||||||
829 | } never executed: end of block | 0 | ||||||||||||||||||||||||
830 | - | |||||||||||||||||||||||||
831 | Qt::TextElideMode QAbstractItemView::textElideMode() const | - | ||||||||||||||||||||||||
832 | { | - | ||||||||||||||||||||||||
833 | return never executed: d_func()->textElideMode;return d_func()->textElideMode; never executed: return d_func()->textElideMode; | 0 | ||||||||||||||||||||||||
834 | } | - | ||||||||||||||||||||||||
835 | - | |||||||||||||||||||||||||
836 | - | |||||||||||||||||||||||||
837 | - | |||||||||||||||||||||||||
838 | - | |||||||||||||||||||||||||
839 | bool QAbstractItemView::focusNextPrevChild(bool next) | - | ||||||||||||||||||||||||
840 | { | - | ||||||||||||||||||||||||
841 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
842 | if (d->tabKeyNavigation
| 0 | ||||||||||||||||||||||||
843 | QKeyEvent event(QEvent::KeyPress, next ? Qt::Key_Tab : Qt::Key_Backtab, Qt::NoModifier); | - | ||||||||||||||||||||||||
844 | keyPressEvent(&event); | - | ||||||||||||||||||||||||
845 | if (event.isAccepted()
| 0 | ||||||||||||||||||||||||
846 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
847 | } never executed: end of block | 0 | ||||||||||||||||||||||||
848 | return never executed: QAbstractScrollArea::focusNextPrevChild(next);return QAbstractScrollArea::focusNextPrevChild(next); never executed: return QAbstractScrollArea::focusNextPrevChild(next); | 0 | ||||||||||||||||||||||||
849 | } | - | ||||||||||||||||||||||||
850 | - | |||||||||||||||||||||||||
851 | - | |||||||||||||||||||||||||
852 | - | |||||||||||||||||||||||||
853 | - | |||||||||||||||||||||||||
854 | bool QAbstractItemView::event(QEvent *event) | - | ||||||||||||||||||||||||
855 | { | - | ||||||||||||||||||||||||
856 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
857 | switch (event->type()) { | - | ||||||||||||||||||||||||
858 | case never executed: QEvent::Paint:case QEvent::Paint: never executed: case QEvent::Paint: | 0 | ||||||||||||||||||||||||
859 | - | |||||||||||||||||||||||||
860 | - | |||||||||||||||||||||||||
861 | d->executePostedLayout(); | - | ||||||||||||||||||||||||
862 | break; never executed: break; | 0 | ||||||||||||||||||||||||
863 | case never executed: QEvent::Show:case QEvent::Show: never executed: case QEvent::Show: | 0 | ||||||||||||||||||||||||
864 | d->executePostedLayout(); | - | ||||||||||||||||||||||||
865 | if (d->shouldScrollToCurrentOnShow
| 0 | ||||||||||||||||||||||||
866 | d->shouldScrollToCurrentOnShow = false; | - | ||||||||||||||||||||||||
867 | const QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||
868 | if (current.isValid()
| 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: QEvent::LocaleChange:case QEvent::LocaleChange: never executed: case QEvent::LocaleChange: | 0 | ||||||||||||||||||||||||
873 | viewport()->update(); | - | ||||||||||||||||||||||||
874 | break; never executed: break; | 0 | ||||||||||||||||||||||||
875 | case never executed: QEvent::LayoutDirectionChange:case QEvent::LayoutDirectionChange: never executed: case QEvent::LayoutDirectionChange: | 0 | ||||||||||||||||||||||||
876 | case never executed: QEvent::ApplicationLayoutDirectionChange:case QEvent::ApplicationLayoutDirectionChange: never executed: case QEvent::ApplicationLayoutDirectionChange: | 0 | ||||||||||||||||||||||||
877 | updateGeometries(); | - | ||||||||||||||||||||||||
878 | break; never executed: break; | 0 | ||||||||||||||||||||||||
879 | case never executed: QEvent::StyleChange:case QEvent::StyleChange: never executed: case QEvent::StyleChange: | 0 | ||||||||||||||||||||||||
880 | doItemsLayout(); | - | ||||||||||||||||||||||||
881 | if (!d->verticalScrollModeSet
| 0 | ||||||||||||||||||||||||
882 | resetVerticalScrollMode(); never executed: resetVerticalScrollMode(); | 0 | ||||||||||||||||||||||||
883 | if (!d->horizontalScrollModeSet
| 0 | ||||||||||||||||||||||||
884 | resetHorizontalScrollMode(); never executed: resetHorizontalScrollMode(); | 0 | ||||||||||||||||||||||||
885 | break; never executed: break; | 0 | ||||||||||||||||||||||||
886 | case never executed: QEvent::FocusOut:case QEvent::FocusOut: never executed: case QEvent::FocusOut: | 0 | ||||||||||||||||||||||||
887 | d->checkPersistentEditorFocus(); | - | ||||||||||||||||||||||||
888 | break; never executed: break; | 0 | ||||||||||||||||||||||||
889 | case never executed: QEvent::FontChange:case 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: QAbstractScrollArea::event(event);return QAbstractScrollArea::event(event); never executed: return QAbstractScrollArea::event(event); | 0 | ||||||||||||||||||||||||
896 | } | - | ||||||||||||||||||||||||
897 | bool QAbstractItemView::viewportEvent(QEvent *event) | - | ||||||||||||||||||||||||
898 | { | - | ||||||||||||||||||||||||
899 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
900 | switch (event->type()) { | - | ||||||||||||||||||||||||
901 | case never executed: QEvent::HoverMove:case QEvent::HoverMove: never executed: case QEvent::HoverMove: | 0 | ||||||||||||||||||||||||
902 | case never executed: QEvent::HoverEnter:case 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: QEvent::HoverLeave:case QEvent::HoverLeave: never executed: case QEvent::HoverLeave: | 0 | ||||||||||||||||||||||||
906 | d->setHoverIndex(QModelIndex()); | - | ||||||||||||||||||||||||
907 | break; never executed: break; | 0 | ||||||||||||||||||||||||
908 | case never executed: QEvent::Enter:case QEvent::Enter: never executed: case QEvent::Enter: | 0 | ||||||||||||||||||||||||
909 | d->viewportEnteredNeeded = true; | - | ||||||||||||||||||||||||
910 | break; never executed: break; | 0 | ||||||||||||||||||||||||
911 | case never executed: QEvent::Leave:case QEvent::Leave: never executed: case QEvent::Leave: | 0 | ||||||||||||||||||||||||
912 | - | |||||||||||||||||||||||||
913 | if (d->shouldClearStatusTip
| 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: QEvent::ToolTip:case QEvent::ToolTip: never executed: case QEvent::ToolTip: | 0 | ||||||||||||||||||||||||
923 | case never executed: QEvent::QueryWhatsThis:case QEvent::QueryWhatsThis: never executed: case QEvent::QueryWhatsThis: | 0 | ||||||||||||||||||||||||
924 | case never executed: QEvent::WhatsThis:case 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()
| 0 | ||||||||||||||||||||||||
930 | - | |||||||||||||||||||||||||
931 | QAbstractItemDelegate *delegate = d->delegateForIndex(index); | - | ||||||||||||||||||||||||
932 | if (!delegate
| 0 | ||||||||||||||||||||||||
933 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
934 | return never executed: delegate->helpEvent(he, this, option, index);return delegate->helpEvent(he, this, option, index); never executed: return delegate->helpEvent(he, this, option, index); | 0 | ||||||||||||||||||||||||
935 | } | - | ||||||||||||||||||||||||
936 | case never executed: QEvent::FontChange:case QEvent::FontChange: never executed: case QEvent::FontChange: | 0 | ||||||||||||||||||||||||
937 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
938 | break; never executed: break; | 0 | ||||||||||||||||||||||||
939 | case never executed: QEvent::WindowActivate:case QEvent::WindowActivate: never executed: case QEvent::WindowActivate: | 0 | ||||||||||||||||||||||||
940 | case never executed: QEvent::WindowDeactivate:case QEvent::WindowDeactivate: never executed: case QEvent::WindowDeactivate: | 0 | ||||||||||||||||||||||||
941 | d->viewport->update(); | - | ||||||||||||||||||||||||
942 | break; never executed: break; | 0 | ||||||||||||||||||||||||
943 | case never executed: QEvent::ScrollPrepare:case 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: QAbstractScrollArea::viewportEvent(event);return QAbstractScrollArea::viewportEvent(event); never executed: return QAbstractScrollArea::viewportEvent(event); | 0 | ||||||||||||||||||||||||
954 | } | - | ||||||||||||||||||||||||
955 | - | |||||||||||||||||||||||||
956 | - | |||||||||||||||||||||||||
957 | - | |||||||||||||||||||||||||
958 | - | |||||||||||||||||||||||||
959 | - | |||||||||||||||||||||||||
960 | - | |||||||||||||||||||||||||
961 | void 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
| 0 | ||||||||||||||||||||||||
969 | || (d->state == EditingState
| 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
| 0 | ||||||||||||||||||||||||
977 | QPoint offset = d->offset(); | - | ||||||||||||||||||||||||
978 | if ((
| 0 | ||||||||||||||||||||||||
979 | d->pressedPosition = pos + offset; | - | ||||||||||||||||||||||||
980 | d->currentSelectionStartIndex = index; | - | ||||||||||||||||||||||||
981 | } never executed: end of block | 0 | ||||||||||||||||||||||||
982 | else if (!d->currentSelectionStartIndex.isValid()
| 0 | ||||||||||||||||||||||||
983 | d->currentSelectionStartIndex = currentIndex(); never executed: d->currentSelectionStartIndex = currentIndex(); | 0 | ||||||||||||||||||||||||
984 | - | |||||||||||||||||||||||||
985 | if (edit(index, NoEditTriggers, event)
| 0 | ||||||||||||||||||||||||
986 | return; never executed: return; | 0 | ||||||||||||||||||||||||
987 | - | |||||||||||||||||||||||||
988 | if (index.isValid()
| 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)
| 0 | ||||||||||||||||||||||||
996 | command &= ~QItemSelectionModel::Toggle; | - | ||||||||||||||||||||||||
997 | d->ctrlDragSelectionFlag = d->selectionModel->isSelected(index)
| 0 | ||||||||||||||||||||||||
998 | command |= d->ctrlDragSelectionFlag; | - | ||||||||||||||||||||||||
999 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1000 | - | |||||||||||||||||||||||||
1001 | if ((
| 0 | ||||||||||||||||||||||||
1002 | setSelection(QRect(pos, QSize(1, 1)), command); | - | ||||||||||||||||||||||||
1003 | } never executed: else {end of block | 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
| 0 | ||||||||||||||||||||||||
1011 | - | |||||||||||||||||||||||||
1012 | - | |||||||||||||||||||||||||
1013 | d->delayedAutoScroll.start(QApplication::doubleClickInterval()+100, this); | - | ||||||||||||||||||||||||
1014 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1015 | - | |||||||||||||||||||||||||
1016 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1017 | - | |||||||||||||||||||||||||
1018 | d->selectionModel->select(QModelIndex(), QItemSelectionModel::Select); | - | ||||||||||||||||||||||||
1019 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1020 | } | - | ||||||||||||||||||||||||
1021 | - | |||||||||||||||||||||||||
1022 | - | |||||||||||||||||||||||||
1023 | - | |||||||||||||||||||||||||
1024 | - | |||||||||||||||||||||||||
1025 | - | |||||||||||||||||||||||||
1026 | - | |||||||||||||||||||||||||
1027 | void QAbstractItemView::mouseMoveEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
1028 | { | - | ||||||||||||||||||||||||
1029 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1030 | QPoint topLeft; | - | ||||||||||||||||||||||||
1031 | QPoint bottomRight = event->pos(); | - | ||||||||||||||||||||||||
1032 | - | |||||||||||||||||||||||||
1033 | if (state() == ExpandingState
| 0 | ||||||||||||||||||||||||
1034 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1035 | - | |||||||||||||||||||||||||
1036 | - | |||||||||||||||||||||||||
1037 | if (state() == DraggingState
| 0 | ||||||||||||||||||||||||
1038 | topLeft = d->pressedPosition - d->offset(); | - | ||||||||||||||||||||||||
1039 | if ((
| 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
| 0 | ||||||||||||||||||||||||
1052 | || edit(index, NoEditTriggers, event)
| 0 | ||||||||||||||||||||||||
1053 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1054 | - | |||||||||||||||||||||||||
1055 | if (d->selectionMode != SingleSelection
| 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()
| 0 | ||||||||||||||||||||||||
1064 | && d->dragEnabled
| 0 | ||||||||||||||||||||||||
1065 | && (
| 0 | ||||||||||||||||||||||||
1066 | && (
| 0 | ||||||||||||||||||||||||
1067 | && !d->selectedDraggableIndexes().isEmpty()
| 0 | ||||||||||||||||||||||||
1068 | setState(DraggingState); | - | ||||||||||||||||||||||||
1069 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1070 | } | - | ||||||||||||||||||||||||
1071 | - | |||||||||||||||||||||||||
1072 | - | |||||||||||||||||||||||||
1073 | if ((
| 0 | ||||||||||||||||||||||||
1074 | setState(DragSelectingState); | - | ||||||||||||||||||||||||
1075 | QItemSelectionModel::SelectionFlags command = selectionCommand(index, event); | - | ||||||||||||||||||||||||
1076 | if (d->ctrlDragSelectionFlag != QItemSelectionModel::NoUpdate
| 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()
| 0 | ||||||||||||||||||||||||
1087 | && (
| 0 | ||||||||||||||||||||||||
1088 | && d->isIndexEnabled(index)
| 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 | ||||||||||||||||||||||||
1092 | void 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
| 0 | ||||||||||||||||||||||||
1100 | if (d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||
1101 | && d->isIndexEnabled(index)
| 0 | ||||||||||||||||||||||||
1102 | && d->sendDelegateEvent(index, event)
| 0 | ||||||||||||||||||||||||
1103 | update(index); never executed: update(index); | 0 | ||||||||||||||||||||||||
1104 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1105 | } | - | ||||||||||||||||||||||||
1106 | - | |||||||||||||||||||||||||
1107 | bool click = (index == d->pressedIndex
| 0 | ||||||||||||||||||||||||
1108 | bool selectedClicked = click
| 0 | ||||||||||||||||||||||||
1109 | EditTrigger trigger = (selectedClicked
| 0 | ||||||||||||||||||||||||
1110 | bool edited = edit(index, trigger, event); | - | ||||||||||||||||||||||||
1111 | - | |||||||||||||||||||||||||
1112 | d->ctrlDragSelectionFlag = QItemSelectionModel::NoUpdate; | - | ||||||||||||||||||||||||
1113 | - | |||||||||||||||||||||||||
1114 | if (d->selectionModel
| 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
| 0 | ||||||||||||||||||||||||
1122 | if (event->button() == Qt::LeftButton
| 0 | ||||||||||||||||||||||||
1123 | clicked(index); never executed: clicked(index); | 0 | ||||||||||||||||||||||||
1124 | if (edited
| 0 | ||||||||||||||||||||||||
1125 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1126 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||
1127 | if (d->pressedAlreadySelected
| 0 | ||||||||||||||||||||||||
1128 | option.state |= QStyle::State_Selected; never executed: option.state |= QStyle::State_Selected; | 0 | ||||||||||||||||||||||||
1129 | if ((
| 0 | ||||||||||||||||||||||||
1130 | && style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, &option, this)
| 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 | - | |||||||||||||||||||||||||
1140 | void QAbstractItemView::mouseDoubleClickEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
1141 | { | - | ||||||||||||||||||||||||
1142 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1143 | - | |||||||||||||||||||||||||
1144 | QModelIndex index = indexAt(event->pos()); | - | ||||||||||||||||||||||||
1145 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
1146 | || !d->isIndexEnabled(index)
| 0 | ||||||||||||||||||||||||
1147 | || (
| 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 ((
| 0 | ||||||||||||||||||||||||
1158 | && !style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, this)
| 0 | ||||||||||||||||||||||||
1159 | activated(persistent); never executed: activated(persistent); | 0 | ||||||||||||||||||||||||
1160 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1161 | void QAbstractItemView::dragEnterEvent(QDragEnterEvent *event) | - | ||||||||||||||||||||||||
1162 | { | - | ||||||||||||||||||||||||
1163 | if (dragDropMode() == InternalMove
| 0 | ||||||||||||||||||||||||
1164 | && (event->source() != this
| 0 | ||||||||||||||||||||||||
1165 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1166 | - | |||||||||||||||||||||||||
1167 | if (d_func()->canDrop(event)
| 0 | ||||||||||||||||||||||||
1168 | event->accept(); | - | ||||||||||||||||||||||||
1169 | setState(DraggingState); | - | ||||||||||||||||||||||||
1170 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1171 | event->ignore(); | - | ||||||||||||||||||||||||
1172 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1173 | } | - | ||||||||||||||||||||||||
1174 | void QAbstractItemView::dragMoveEvent(QDragMoveEvent *event) | - | ||||||||||||||||||||||||
1175 | { | - | ||||||||||||||||||||||||
1176 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1177 | if (dragDropMode() == InternalMove
| 0 | ||||||||||||||||||||||||
1178 | && (event->source() != this
| 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)
| 0 | ||||||||||||||||||||||||
1187 | && d->canDrop(event)
| 0 | ||||||||||||||||||||||||
1188 | - | |||||||||||||||||||||||||
1189 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
1190 | QRect rect = visualRect(index); | - | ||||||||||||||||||||||||
1191 | d->dropIndicatorPosition = d->position(event->pos(), rect, index); | - | ||||||||||||||||||||||||
1192 | switch (d->dropIndicatorPosition) { | - | ||||||||||||||||||||||||
1193 | case never executed: AboveItem:case AboveItem: never executed: case AboveItem: | 0 | ||||||||||||||||||||||||
1194 | if (d->isIndexDropEnabled(index.parent())
| 0 | ||||||||||||||||||||||||
1195 | d->dropIndicatorRect = QRect(rect.left(), rect.top(), rect.width(), 0); | - | ||||||||||||||||||||||||
1196 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1197 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1198 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1199 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1200 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1201 | case never executed: BelowItem:case BelowItem: never executed: case BelowItem: | 0 | ||||||||||||||||||||||||
1202 | if (d->isIndexDropEnabled(index.parent())
| 0 | ||||||||||||||||||||||||
1203 | d->dropIndicatorRect = QRect(rect.left(), rect.bottom(), rect.width(), 0); | - | ||||||||||||||||||||||||
1204 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1205 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1206 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1207 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1208 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1209 | case never executed: OnItem:case OnItem: never executed: case OnItem: | 0 | ||||||||||||||||||||||||
1210 | if (d->isIndexDropEnabled(index)
| 0 | ||||||||||||||||||||||||
1211 | d->dropIndicatorRect = rect; | - | ||||||||||||||||||||||||
1212 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1213 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1214 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1215 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1216 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1217 | case never executed: OnViewport:case OnViewport: never executed: case OnViewport: | 0 | ||||||||||||||||||||||||
1218 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1219 | if (d->isIndexDropEnabled(rootIndex())
| 0 | ||||||||||||||||||||||||
1220 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1221 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1222 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1223 | } | - | ||||||||||||||||||||||||
1224 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1225 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1226 | d->dropIndicatorPosition = OnViewport; | - | ||||||||||||||||||||||||
1227 | if (d->isIndexDropEnabled(rootIndex())
| 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())
| 0 | ||||||||||||||||||||||||
1235 | startAutoScroll(); never executed: startAutoScroll(); | 0 | ||||||||||||||||||||||||
1236 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1237 | - | |||||||||||||||||||||||||
1238 | - | |||||||||||||||||||||||||
1239 | - | |||||||||||||||||||||||||
1240 | - | |||||||||||||||||||||||||
1241 | - | |||||||||||||||||||||||||
1242 | - | |||||||||||||||||||||||||
1243 | bool 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
| 0 | ||||||||||||||||||||||||
1248 | dropAction = Qt::MoveAction; never executed: dropAction = Qt::MoveAction; | 0 | ||||||||||||||||||||||||
1249 | if (event->source() == q
| 0 | ||||||||||||||||||||||||
1250 | && event->possibleActions() & Qt::MoveAction
| 0 | ||||||||||||||||||||||||
1251 | && dropAction == Qt::MoveAction
| 0 | ||||||||||||||||||||||||
1252 | QModelIndexList selectedIndexes = q->selectedIndexes(); | - | ||||||||||||||||||||||||
1253 | QModelIndex child = index; | - | ||||||||||||||||||||||||
1254 | while (child.isValid()
| 0 | ||||||||||||||||||||||||
1255 | if (selectedIndexes.contains(child)
| 0 | ||||||||||||||||||||||||
1256 | return never executed: true;return 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: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1261 | } | - | ||||||||||||||||||||||||
1262 | - | |||||||||||||||||||||||||
1263 | - | |||||||||||||||||||||||||
1264 | - | |||||||||||||||||||||||||
1265 | - | |||||||||||||||||||||||||
1266 | - | |||||||||||||||||||||||||
1267 | - | |||||||||||||||||||||||||
1268 | - | |||||||||||||||||||||||||
1269 | void 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 | ||||||||||||||||||||||||
1277 | void QAbstractItemView::dropEvent(QDropEvent *event) | - | ||||||||||||||||||||||||
1278 | { | - | ||||||||||||||||||||||||
1279 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1280 | if (dragDropMode() == InternalMove
| 0 | ||||||||||||||||||||||||
1281 | if (event->source() != this
| 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)
| 0 | ||||||||||||||||||||||||
1289 | const Qt::DropAction action = dragDropMode() == InternalMove
| 0 | ||||||||||||||||||||||||
1290 | if (d->model->dropMimeData(event->mimeData(), action, row, col, index)
| 0 | ||||||||||||||||||||||||
1291 | if (action != event->dropAction()
| 0 | ||||||||||||||||||||||||
1292 | event->setDropAction(action); | - | ||||||||||||||||||||||||
1293 | event->accept(); | - | ||||||||||||||||||||||||
1294 | } never executed: else {end of block | 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 | ||||||||||||||||||||||||
1303 | bool QAbstractItemViewPrivate::dropOn(QDropEvent *event, int *dropRow, int *dropCol, QModelIndex *dropIndex) | - | ||||||||||||||||||||||||
1304 | { | - | ||||||||||||||||||||||||
1305 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
1306 | if (event->isAccepted()
| 0 | ||||||||||||||||||||||||
1307 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1308 | - | |||||||||||||||||||||||||
1309 | QModelIndex index; | - | ||||||||||||||||||||||||
1310 | - | |||||||||||||||||||||||||
1311 | if (viewport->rect().contains(event->pos())
| 0 | ||||||||||||||||||||||||
1312 | index = q->indexAt(event->pos()); | - | ||||||||||||||||||||||||
1313 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
1314 | index = root; never executed: index = root; | 0 | ||||||||||||||||||||||||
1315 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1316 | - | |||||||||||||||||||||||||
1317 | - | |||||||||||||||||||||||||
1318 | if (model->supportedDropActions() & event->dropAction()
| 0 | ||||||||||||||||||||||||
1319 | int row = -1; | - | ||||||||||||||||||||||||
1320 | int col = -1; | - | ||||||||||||||||||||||||
1321 | if (index != root
| 0 | ||||||||||||||||||||||||
1322 | dropIndicatorPosition = position(event->pos(), q->visualRect(index), index); | - | ||||||||||||||||||||||||
1323 | switch (dropIndicatorPosition) { | - | ||||||||||||||||||||||||
1324 | case never executed: QAbstractItemView::AboveItem:case 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: QAbstractItemView::BelowItem:case 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: QAbstractItemView::OnItem:case QAbstractItemView::OnItem: never executed: case QAbstractItemView::OnItem: | 0 | ||||||||||||||||||||||||
1335 | case never executed: QAbstractItemView::OnViewport:case QAbstractItemView::OnViewport: never executed: case QAbstractItemView::OnViewport: | 0 | ||||||||||||||||||||||||
1336 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1337 | } | - | ||||||||||||||||||||||||
1338 | } never executed: else {end of block | 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)
| 0 | ||||||||||||||||||||||||
1345 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1346 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1347 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1348 | } | - | ||||||||||||||||||||||||
1349 | - | |||||||||||||||||||||||||
1350 | QAbstractItemView::DropIndicatorPosition | - | ||||||||||||||||||||||||
1351 | QAbstractItemViewPrivate::position(const QPoint &pos, const QRect &rect, const QModelIndex &index) const | - | ||||||||||||||||||||||||
1352 | { | - | ||||||||||||||||||||||||
1353 | QAbstractItemView::DropIndicatorPosition r = QAbstractItemView::OnViewport; | - | ||||||||||||||||||||||||
1354 | if (!overwrite
| 0 | ||||||||||||||||||||||||
1355 | const int margin = 2; | - | ||||||||||||||||||||||||
1356 | if (pos.y() - rect.top() < margin
| 0 | ||||||||||||||||||||||||
1357 | r = QAbstractItemView::AboveItem; | - | ||||||||||||||||||||||||
1358 | } never executed: else if (rect.bottom() - pos.y() < marginend of block
| 0 | ||||||||||||||||||||||||
1359 | r = QAbstractItemView::BelowItem; | - | ||||||||||||||||||||||||
1360 | } never executed: else if (rect.contains(pos, true)end of block
| 0 | ||||||||||||||||||||||||
1361 | r = QAbstractItemView::OnItem; | - | ||||||||||||||||||||||||
1362 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1363 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1364 | QRect touchingRect = rect; | - | ||||||||||||||||||||||||
1365 | touchingRect.adjust(-1, -1, 1, 1); | - | ||||||||||||||||||||||||
1366 | if (touchingRect.contains(pos, false)
| 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
| 0 | ||||||||||||||||||||||||
1372 | r = pos.y() < rect.center().y()
never executed: r = pos.y() < rect.center().y() ? QAbstractItemView::AboveItem : QAbstractItemView::BelowItem; | 0 | ||||||||||||||||||||||||
1373 | - | |||||||||||||||||||||||||
1374 | return never executed: r;return r; never executed: return r; | 0 | ||||||||||||||||||||||||
1375 | } | - | ||||||||||||||||||||||||
1376 | void 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
| 0 | ||||||||||||||||||||||||
1385 | && !d->currentIndexSet
| 0 | ||||||||||||||||||||||||
1386 | && !currentIndexValid
| 0 | ||||||||||||||||||||||||
1387 | bool autoScroll = d->autoScroll; | - | ||||||||||||||||||||||||
1388 | d->autoScroll = false; | - | ||||||||||||||||||||||||
1389 | QModelIndex index = moveCursor(MoveNext, Qt::NoModifier); | - | ||||||||||||||||||||||||
1390 | if (index.isValid()
| 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
| 0 | ||||||||||||||||||||||||
1396 | if (currentIndex().flags() != Qt::ItemIsEditable
| 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
| 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 | - | |||||||||||||||||||||||||
1414 | void 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 | ||||||||||||||||||||||||
1420 | void QAbstractItemView::keyPressEvent(QKeyEvent *event) | - | ||||||||||||||||||||||||
1421 | { | - | ||||||||||||||||||||||||
1422 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1423 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||
1424 | if (event == QKeySequence::Copy
| 0 | ||||||||||||||||||||||||
1425 | QVariant variant; | - | ||||||||||||||||||||||||
1426 | if (d->model
| 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
| 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: Qt::Key_Down:case 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: Qt::Key_Up:case 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: Qt::Key_Left:case 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: Qt::Key_Right:case 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: Qt::Key_Home:case 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: Qt::Key_End:case 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: Qt::Key_PageUp:case 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: Qt::Key_PageDown:case 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: Qt::Key_Tab:case Qt::Key_Tab: never executed: case Qt::Key_Tab: | 0 | ||||||||||||||||||||||||
1462 | if (d->tabKeyNavigation
| 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: Qt::Key_Backtab:case Qt::Key_Backtab: never executed: case Qt::Key_Backtab: | 0 | ||||||||||||||||||||||||
1466 | if (d->tabKeyNavigation
| 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
| 0 | ||||||||||||||||||||||||
1473 | if (!hasFocus()
| 0 | ||||||||||||||||||||||||
1474 | setFocus(); never executed: setFocus(); | 0 | ||||||||||||||||||||||||
1475 | QItemSelectionModel::SelectionFlags command = selectionCommand(newCurrent, event); | - | ||||||||||||||||||||||||
1476 | if (command != QItemSelectionModel::NoUpdate
| 0 | ||||||||||||||||||||||||
1477 | || style()->styleHint(QStyle::SH_ItemView_MovementWithoutUpdatingSelection, 0, this)
| 0 | ||||||||||||||||||||||||
1478 | - | |||||||||||||||||||||||||
1479 | if (command & QItemSelectionModel::Current
| 0 | ||||||||||||||||||||||||
1480 | d->selectionModel->setCurrentIndex(newCurrent, QItemSelectionModel::NoUpdate); | - | ||||||||||||||||||||||||
1481 | if (!d->currentSelectionStartIndex.isValid()
| 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: else {end of block | 0 | ||||||||||||||||||||||||
1486 | d->selectionModel->setCurrentIndex(newCurrent, command); | - | ||||||||||||||||||||||||
1487 | d->currentSelectionStartIndex = newCurrent; | - | ||||||||||||||||||||||||
1488 | if (newCurrent.isValid()
| 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: Qt::Key_Down:case Qt::Key_Down: never executed: case Qt::Key_Down: | 0 | ||||||||||||||||||||||||
1502 | case never executed: Qt::Key_Up:case Qt::Key_Up: never executed: case Qt::Key_Up: | 0 | ||||||||||||||||||||||||
1503 | - | |||||||||||||||||||||||||
1504 | - | |||||||||||||||||||||||||
1505 | - | |||||||||||||||||||||||||
1506 | - | |||||||||||||||||||||||||
1507 | - | |||||||||||||||||||||||||
1508 | - | |||||||||||||||||||||||||
1509 | case never executed: Qt::Key_Left:case Qt::Key_Left: never executed: case Qt::Key_Left: | 0 | ||||||||||||||||||||||||
1510 | case never executed: Qt::Key_Right:case Qt::Key_Right: never executed: case Qt::Key_Right: | 0 | ||||||||||||||||||||||||
1511 | case never executed: Qt::Key_Home:case Qt::Key_Home: never executed: case Qt::Key_Home: | 0 | ||||||||||||||||||||||||
1512 | case never executed: Qt::Key_End:case Qt::Key_End: never executed: case Qt::Key_End: | 0 | ||||||||||||||||||||||||
1513 | case never executed: Qt::Key_PageUp:case Qt::Key_PageUp: never executed: case Qt::Key_PageUp: | 0 | ||||||||||||||||||||||||
1514 | case never executed: Qt::Key_PageDown:case Qt::Key_PageDown: never executed: case Qt::Key_PageDown: | 0 | ||||||||||||||||||||||||
1515 | case never executed: Qt::Key_Escape:case Qt::Key_Escape: never executed: case Qt::Key_Escape: | 0 | ||||||||||||||||||||||||
1516 | case never executed: Qt::Key_Shift:case Qt::Key_Shift: never executed: case Qt::Key_Shift: | 0 | ||||||||||||||||||||||||
1517 | case never executed: Qt::Key_Control:case Qt::Key_Control: never executed: case Qt::Key_Control: | 0 | ||||||||||||||||||||||||
1518 | case never executed: Qt::Key_Delete:case Qt::Key_Delete: never executed: case Qt::Key_Delete: | 0 | ||||||||||||||||||||||||
1519 | case never executed: Qt::Key_Backspace:case Qt::Key_Backspace: never executed: case Qt::Key_Backspace: | 0 | ||||||||||||||||||||||||
1520 | event->ignore(); | - | ||||||||||||||||||||||||
1521 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1522 | case never executed: Qt::Key_Space:case Qt::Key_Space: never executed: case Qt::Key_Space: | 0 | ||||||||||||||||||||||||
1523 | case never executed: Qt::Key_Select:case Qt::Key_Select: never executed: case Qt::Key_Select: | 0 | ||||||||||||||||||||||||
1524 | if (!edit(currentIndex(), AnyKeyPressed, event)
| 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: Qt::Key_F2:case Qt::Key_F2: never executed: case Qt::Key_F2: | 0 | ||||||||||||||||||||||||
1528 | if (!edit(currentIndex(), EditKeyPressed, event)
| 0 | ||||||||||||||||||||||||
1529 | event->ignore(); never executed: event->ignore(); | 0 | ||||||||||||||||||||||||
1530 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1531 | case never executed: Qt::Key_Enter:case Qt::Key_Enter: never executed: case Qt::Key_Enter: | 0 | ||||||||||||||||||||||||
1532 | case never executed: Qt::Key_Return:case Qt::Key_Return: never executed: case Qt::Key_Return: | 0 | ||||||||||||||||||||||||
1533 | - | |||||||||||||||||||||||||
1534 | - | |||||||||||||||||||||||||
1535 | - | |||||||||||||||||||||||||
1536 | if (state() != EditingState
| 0 | ||||||||||||||||||||||||
1537 | if (currentIndex().isValid()
| 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
| 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()
| 0 | ||||||||||||||||||||||||
1556 | keyboardSearch(event->text()); | - | ||||||||||||||||||||||||
1557 | event->accept(); | - | ||||||||||||||||||||||||
1558 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1559 | event->ignore(); | - | ||||||||||||||||||||||||
1560 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1561 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
1562 | } | - | ||||||||||||||||||||||||
1563 | if (d->moveCursorUpdatedView
| 0 | ||||||||||||||||||||||||
1564 | event->accept(); never executed: event->accept(); | 0 | ||||||||||||||||||||||||
1565 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1566 | - | |||||||||||||||||||||||||
1567 | - | |||||||||||||||||||||||||
1568 | - | |||||||||||||||||||||||||
1569 | - | |||||||||||||||||||||||||
1570 | - | |||||||||||||||||||||||||
1571 | - | |||||||||||||||||||||||||
1572 | - | |||||||||||||||||||||||||
1573 | void 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 | - | |||||||||||||||||||||||||
1585 | void QAbstractItemView::timerEvent(QTimerEvent *event) | - | ||||||||||||||||||||||||
1586 | { | - | ||||||||||||||||||||||||
1587 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1588 | if (event->timerId() == d->fetchMoreTimer.timerId()
| 0 | ||||||||||||||||||||||||
1589 | d->fetchMore(); never executed: d->fetchMore(); | 0 | ||||||||||||||||||||||||
1590 | else if (event->timerId() == d->delayedReset.timerId()
| 0 | ||||||||||||||||||||||||
1591 | reset(); never executed: reset(); | 0 | ||||||||||||||||||||||||
1592 | else if (event->timerId() == d->autoScrollTimer.timerId()
| 0 | ||||||||||||||||||||||||
1593 | doAutoScroll(); never executed: doAutoScroll(); | 0 | ||||||||||||||||||||||||
1594 | else if (event->timerId() == d->updateTimer.timerId()
| 0 | ||||||||||||||||||||||||
1595 | d->updateDirtyRegion(); never executed: d->updateDirtyRegion(); | 0 | ||||||||||||||||||||||||
1596 | else if (event->timerId() == d->delayedEditing.timerId()
| 0 | ||||||||||||||||||||||||
1597 | d->delayedEditing.stop(); | - | ||||||||||||||||||||||||
1598 | edit(currentIndex()); | - | ||||||||||||||||||||||||
1599 | } never executed: else if (event->timerId() == d->delayedLayout.timerId()end of block
| 0 | ||||||||||||||||||||||||
1600 | d->delayedLayout.stop(); | - | ||||||||||||||||||||||||
1601 | if (isVisible()
| 0 | ||||||||||||||||||||||||
1602 | d->interruptDelayedItemsLayout(); | - | ||||||||||||||||||||||||
1603 | doItemsLayout(); | - | ||||||||||||||||||||||||
1604 | const QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||
1605 | if (current.isValid()
| 0 | ||||||||||||||||||||||||
1606 | scrollTo(current); never executed: scrollTo(current); | 0 | ||||||||||||||||||||||||
1607 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1608 | } never executed: else if (event->timerId() == d->delayedAutoScroll.timerId()end of block
| 0 | ||||||||||||||||||||||||
1609 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||
1610 | - | |||||||||||||||||||||||||
1611 | - | |||||||||||||||||||||||||
1612 | if (d->pressedIndex.isValid()
| 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 | - | |||||||||||||||||||||||||
1620 | void QAbstractItemView::inputMethodEvent(QInputMethodEvent *event) | - | ||||||||||||||||||||||||
1621 | { | - | ||||||||||||||||||||||||
1622 | if (event->commitString().isEmpty()
| 0 | ||||||||||||||||||||||||
1623 | event->ignore(); | - | ||||||||||||||||||||||||
1624 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1625 | } | - | ||||||||||||||||||||||||
1626 | if (!edit(currentIndex(), AnyKeyPressed, event)
| 0 | ||||||||||||||||||||||||
1627 | if (!event->commitString().isEmpty()
| 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 | ||||||||||||||||||||||||
1632 | QAbstractItemView::DropIndicatorPosition QAbstractItemView::dropIndicatorPosition() const | - | ||||||||||||||||||||||||
1633 | { | - | ||||||||||||||||||||||||
1634 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1635 | return never executed: d->dropIndicatorPosition;return d->dropIndicatorPosition; never executed: return d->dropIndicatorPosition; | 0 | ||||||||||||||||||||||||
1636 | } | - | ||||||||||||||||||||||||
1637 | QModelIndexList QAbstractItemView::selectedIndexes() const | - | ||||||||||||||||||||||||
1638 | { | - | ||||||||||||||||||||||||
1639 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1640 | QModelIndexList indexes; | - | ||||||||||||||||||||||||
1641 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
1642 | indexes = d->selectionModel->selectedIndexes(); | - | ||||||||||||||||||||||||
1643 | auto isHidden = [this](const QModelIndex &idx) { | - | ||||||||||||||||||||||||
1644 | return never executed: isIndexHidden(idx);return 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: indexes;return indexes; never executed: return indexes; | 0 | ||||||||||||||||||||||||
1650 | } | - | ||||||||||||||||||||||||
1651 | bool QAbstractItemView::edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) | - | ||||||||||||||||||||||||
1652 | { | - | ||||||||||||||||||||||||
1653 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1654 | - | |||||||||||||||||||||||||
1655 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||
1656 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1657 | - | |||||||||||||||||||||||||
1658 | if (QWidget *w = (d->persistent.isEmpty()
| 0 | ||||||||||||||||||||||||
1659 | if (w->focusPolicy() == Qt::NoFocus
| 0 | ||||||||||||||||||||||||
1660 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1661 | w->setFocus(); | - | ||||||||||||||||||||||||
1662 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1663 | } | - | ||||||||||||||||||||||||
1664 | - | |||||||||||||||||||||||||
1665 | if (trigger == DoubleClicked
| 0 | ||||||||||||||||||||||||
1666 | d->delayedEditing.stop(); | - | ||||||||||||||||||||||||
1667 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||
1668 | } never executed: else if (trigger == CurrentChangedend of block
| 0 | ||||||||||||||||||||||||
1669 | d->delayedEditing.stop(); | - | ||||||||||||||||||||||||
1670 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1671 | - | |||||||||||||||||||||||||
1672 | if (d->sendDelegateEvent(index, event)
| 0 | ||||||||||||||||||||||||
1673 | update(index); | - | ||||||||||||||||||||||||
1674 | return never executed: true;return 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))
| 0 | ||||||||||||||||||||||||
1682 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1683 | - | |||||||||||||||||||||||||
1684 | if (d->delayedEditing.isActive()
| 0 | ||||||||||||||||||||||||
1685 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1686 | - | |||||||||||||||||||||||||
1687 | - | |||||||||||||||||||||||||
1688 | - | |||||||||||||||||||||||||
1689 | if (lastTrigger == DoubleClicked
| 0 | ||||||||||||||||||||||||
1690 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1691 | - | |||||||||||||||||||||||||
1692 | - | |||||||||||||||||||||||||
1693 | if (trigger == SelectedClicked
| 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: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1699 | } | - | ||||||||||||||||||||||||
1700 | - | |||||||||||||||||||||||||
1701 | - | |||||||||||||||||||||||||
1702 | - | |||||||||||||||||||||||||
1703 | - | |||||||||||||||||||||||||
1704 | - | |||||||||||||||||||||||||
1705 | void 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 | - | |||||||||||||||||||||||||
1715 | void QAbstractItemView::updateEditorGeometries() | - | ||||||||||||||||||||||||
1716 | { | - | ||||||||||||||||||||||||
1717 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1718 | if(d->editorIndexHash.isEmpty()
| 0 | ||||||||||||||||||||||||
1719 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1720 | if (d->delayedPendingLayout
| 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()
| 0 | ||||||||||||||||||||||||
1730 | QModelIndex index = it.value(); | - | ||||||||||||||||||||||||
1731 | QWidget *editor = it.key(); | - | ||||||||||||||||||||||||
1732 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
1733 | option.rect = visualRect(index); | - | ||||||||||||||||||||||||
1734 | if (option.rect.isValid()
| 0 | ||||||||||||||||||||||||
1735 | editor->show(); | - | ||||||||||||||||||||||||
1736 | QAbstractItemDelegate *delegate = d->delegateForIndex(index); | - | ||||||||||||||||||||||||
1737 | if (delegate
| 0 | ||||||||||||||||||||||||
1738 | delegate-> never executed: updateEditorGeometry(editor, option, index);delegate->updateEditorGeometry(editor, option, index); never executed: delegate->updateEditorGeometry(editor, option, index); | 0 | ||||||||||||||||||||||||
1739 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1740 | editorsToHide << editor; | - | ||||||||||||||||||||||||
1741 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1742 | ++it; | - | ||||||||||||||||||||||||
1743 | } never executed: else {end of block | 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()
| 0 | ||||||||||||||||||||||||
1753 | editorsToHide.at(i)->hide(); | - | ||||||||||||||||||||||||
1754 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1755 | for (int i = 0; i < editorsToRelease.count()
| 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 | - | |||||||||||||||||||||||||
1765 | void 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 | - | |||||||||||||||||||||||||
1776 | void QAbstractItemView::verticalScrollbarValueChanged(int value) | - | ||||||||||||||||||||||||
1777 | { | - | ||||||||||||||||||||||||
1778 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1779 | if (verticalScrollBar()->maximum() == value
| 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)
| 0 | ||||||||||||||||||||||||
1783 | d->checkMouseMove(posInVp); never executed: d->checkMouseMove(posInVp); | 0 | ||||||||||||||||||||||||
1784 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1785 | - | |||||||||||||||||||||||||
1786 | - | |||||||||||||||||||||||||
1787 | - | |||||||||||||||||||||||||
1788 | - | |||||||||||||||||||||||||
1789 | void QAbstractItemView::horizontalScrollbarValueChanged(int value) | - | ||||||||||||||||||||||||
1790 | { | - | ||||||||||||||||||||||||
1791 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||