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 | QAbstractItemViewPrivate::QAbstractItemViewPrivate() | - | ||||||||||||||||||||||||
11 | : model(QAbstractItemModelPrivate::staticEmptyModel()), | - | ||||||||||||||||||||||||
12 | itemDelegate(0), | - | ||||||||||||||||||||||||
13 | selectionModel(0), | - | ||||||||||||||||||||||||
14 | ctrlDragSelectionFlag(QItemSelectionModel::NoUpdate), | - | ||||||||||||||||||||||||
15 | noSelectionOnMousePress(false), | - | ||||||||||||||||||||||||
16 | selectionMode(QAbstractItemView::ExtendedSelection), | - | ||||||||||||||||||||||||
17 | selectionBehavior(QAbstractItemView::SelectItems), | - | ||||||||||||||||||||||||
18 | currentlyCommittingEditor(0), | - | ||||||||||||||||||||||||
19 | pressedModifiers(Qt::NoModifier), | - | ||||||||||||||||||||||||
20 | pressedPosition(QPoint(-1, -1)), | - | ||||||||||||||||||||||||
21 | pressedAlreadySelected(false), | - | ||||||||||||||||||||||||
22 | viewportEnteredNeeded(false), | - | ||||||||||||||||||||||||
23 | state(QAbstractItemView::NoState), | - | ||||||||||||||||||||||||
24 | stateBeforeAnimation(QAbstractItemView::NoState), | - | ||||||||||||||||||||||||
25 | editTriggers(QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed), | - | ||||||||||||||||||||||||
26 | lastTrigger(QAbstractItemView::NoEditTriggers), | - | ||||||||||||||||||||||||
27 | tabKeyNavigation(false), | - | ||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||
29 | showDropIndicator(true), | - | ||||||||||||||||||||||||
30 | dragEnabled(false), | - | ||||||||||||||||||||||||
31 | dragDropMode(QAbstractItemView::NoDragDrop), | - | ||||||||||||||||||||||||
32 | overwrite(false), | - | ||||||||||||||||||||||||
33 | dropIndicatorPosition(QAbstractItemView::OnItem), | - | ||||||||||||||||||||||||
34 | defaultDropAction(Qt::IgnoreAction), | - | ||||||||||||||||||||||||
35 | - | |||||||||||||||||||||||||
36 | autoScroll(true), | - | ||||||||||||||||||||||||
37 | autoScrollMargin(16), | - | ||||||||||||||||||||||||
38 | autoScrollCount(0), | - | ||||||||||||||||||||||||
39 | shouldScrollToCurrentOnShow(false), | - | ||||||||||||||||||||||||
40 | shouldClearStatusTip(false), | - | ||||||||||||||||||||||||
41 | alternatingColors(false), | - | ||||||||||||||||||||||||
42 | textElideMode(Qt::ElideRight), | - | ||||||||||||||||||||||||
43 | verticalScrollMode(QAbstractItemView::ScrollPerItem), | - | ||||||||||||||||||||||||
44 | horizontalScrollMode(QAbstractItemView::ScrollPerItem), | - | ||||||||||||||||||||||||
45 | currentIndexSet(false), | - | ||||||||||||||||||||||||
46 | wrapItemText(false), | - | ||||||||||||||||||||||||
47 | delayedPendingLayout(true), | - | ||||||||||||||||||||||||
48 | moveCursorUpdatedView(false) | - | ||||||||||||||||||||||||
49 | { | - | ||||||||||||||||||||||||
50 | keyboardInputTime.invalidate(); | - | ||||||||||||||||||||||||
51 | } never executed: end of block | 0 | ||||||||||||||||||||||||
52 | - | |||||||||||||||||||||||||
53 | QAbstractItemViewPrivate::~QAbstractItemViewPrivate() | - | ||||||||||||||||||||||||
54 | { | - | ||||||||||||||||||||||||
55 | } | - | ||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||
57 | void QAbstractItemViewPrivate::init() | - | ||||||||||||||||||||||||
58 | { | - | ||||||||||||||||||||||||
59 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
60 | q->setItemDelegate(new QStyledItemDelegate(q)); | - | ||||||||||||||||||||||||
61 | - | |||||||||||||||||||||||||
62 | vbar->setRange(0, 0); | - | ||||||||||||||||||||||||
63 | hbar->setRange(0, 0); | - | ||||||||||||||||||||||||
64 | - | |||||||||||||||||||||||||
65 | QObject::connect(vbar, qFlagLocation("2""actionTriggered(int)" "\0" __FILE__ ":" "121"), | - | ||||||||||||||||||||||||
66 | q, qFlagLocation("1""verticalScrollbarAction(int)" "\0" __FILE__ ":" "122")); | - | ||||||||||||||||||||||||
67 | QObject::connect(hbar, qFlagLocation("2""actionTriggered(int)" "\0" __FILE__ ":" "123"), | - | ||||||||||||||||||||||||
68 | q, qFlagLocation("1""horizontalScrollbarAction(int)" "\0" __FILE__ ":" "124")); | - | ||||||||||||||||||||||||
69 | QObject::connect(vbar, qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "125"), | - | ||||||||||||||||||||||||
70 | q, qFlagLocation("1""verticalScrollbarValueChanged(int)" "\0" __FILE__ ":" "126")); | - | ||||||||||||||||||||||||
71 | QObject::connect(hbar, qFlagLocation("2""valueChanged(int)" "\0" __FILE__ ":" "127"), | - | ||||||||||||||||||||||||
72 | q, qFlagLocation("1""horizontalScrollbarValueChanged(int)" "\0" __FILE__ ":" "128")); | - | ||||||||||||||||||||||||
73 | - | |||||||||||||||||||||||||
74 | viewport->setBackgroundRole(QPalette::Base); | - | ||||||||||||||||||||||||
75 | - | |||||||||||||||||||||||||
76 | q->setAttribute(Qt::WA_InputMethodEnabled); | - | ||||||||||||||||||||||||
77 | } never executed: end of block | 0 | ||||||||||||||||||||||||
78 | - | |||||||||||||||||||||||||
79 | void QAbstractItemViewPrivate::setHoverIndex(const QPersistentModelIndex &index) | - | ||||||||||||||||||||||||
80 | { | - | ||||||||||||||||||||||||
81 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
82 | if (hover == index
| 0 | ||||||||||||||||||||||||
83 | return; never executed: return; | 0 | ||||||||||||||||||||||||
84 | - | |||||||||||||||||||||||||
85 | if (selectionBehavior != QAbstractItemView::SelectRows
| 0 | ||||||||||||||||||||||||
86 | q->update(hover); | - | ||||||||||||||||||||||||
87 | q->update(index); | - | ||||||||||||||||||||||||
88 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
89 | QRect oldHoverRect = q->visualRect(hover); | - | ||||||||||||||||||||||||
90 | QRect newHoverRect = q->visualRect(index); | - | ||||||||||||||||||||||||
91 | viewport->update(QRect(0, newHoverRect.y(), viewport->width(), newHoverRect.height())); | - | ||||||||||||||||||||||||
92 | viewport->update(QRect(0, oldHoverRect.y(), viewport->width(), oldHoverRect.height())); | - | ||||||||||||||||||||||||
93 | } never executed: end of block | 0 | ||||||||||||||||||||||||
94 | hover = index; | - | ||||||||||||||||||||||||
95 | } never executed: end of block | 0 | ||||||||||||||||||||||||
96 | - | |||||||||||||||||||||||||
97 | void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index) | - | ||||||||||||||||||||||||
98 | { | - | ||||||||||||||||||||||||
99 | - | |||||||||||||||||||||||||
100 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
101 | setHoverIndex(index); | - | ||||||||||||||||||||||||
102 | if (viewportEnteredNeeded
| 0 | ||||||||||||||||||||||||
103 | viewportEnteredNeeded = false; | - | ||||||||||||||||||||||||
104 | - | |||||||||||||||||||||||||
105 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
106 | q->entered(index); | - | ||||||||||||||||||||||||
107 | - | |||||||||||||||||||||||||
108 | QString statustip = model->data(index, Qt::StatusTipRole).toString(); | - | ||||||||||||||||||||||||
109 | if (parent
| 0 | ||||||||||||||||||||||||
110 | QStatusTipEvent tip(statustip); | - | ||||||||||||||||||||||||
111 | QApplication::sendEvent(parent, &tip); | - | ||||||||||||||||||||||||
112 | shouldClearStatusTip = !statustip.isEmpty(); | - | ||||||||||||||||||||||||
113 | } never executed: end of block | 0 | ||||||||||||||||||||||||
114 | - | |||||||||||||||||||||||||
115 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
116 | - | |||||||||||||||||||||||||
117 | if (parent
| 0 | ||||||||||||||||||||||||
118 | QString emptyString; | - | ||||||||||||||||||||||||
119 | QStatusTipEvent tip( emptyString ); | - | ||||||||||||||||||||||||
120 | QApplication::sendEvent(parent, &tip); | - | ||||||||||||||||||||||||
121 | } never executed: end of block | 0 | ||||||||||||||||||||||||
122 | - | |||||||||||||||||||||||||
123 | q->viewportEntered(); | - | ||||||||||||||||||||||||
124 | } never executed: end of block | 0 | ||||||||||||||||||||||||
125 | enteredIndex = index; | - | ||||||||||||||||||||||||
126 | } never executed: end of block | 0 | ||||||||||||||||||||||||
127 | } never executed: end of block | 0 | ||||||||||||||||||||||||
128 | - | |||||||||||||||||||||||||
129 | - | |||||||||||||||||||||||||
130 | - | |||||||||||||||||||||||||
131 | - | |||||||||||||||||||||||||
132 | void QAbstractItemViewPrivate::_q_scrollerStateChanged() | - | ||||||||||||||||||||||||
133 | { | - | ||||||||||||||||||||||||
134 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
135 | - | |||||||||||||||||||||||||
136 | if (QScroller *scroller = QScroller::scroller(viewport)
| 0 | ||||||||||||||||||||||||
137 | switch (scroller->state()) { | - | ||||||||||||||||||||||||
138 | case never executed: QScroller::Pressed:case QScroller::Pressed: never executed: case QScroller::Pressed: | 0 | ||||||||||||||||||||||||
139 | - | |||||||||||||||||||||||||
140 | if (q->selectionModel()
| 0 | ||||||||||||||||||||||||
141 | oldSelection = q->selectionModel()->selection(); | - | ||||||||||||||||||||||||
142 | oldCurrent = q->selectionModel()->currentIndex(); | - | ||||||||||||||||||||||||
143 | } never executed: end of block | 0 | ||||||||||||||||||||||||
144 | break; never executed: break; | 0 | ||||||||||||||||||||||||
145 | - | |||||||||||||||||||||||||
146 | case never executed: QScroller::Dragging:case QScroller::Dragging: never executed: case QScroller::Dragging: | 0 | ||||||||||||||||||||||||
147 | - | |||||||||||||||||||||||||
148 | if (q->selectionModel()
| 0 | ||||||||||||||||||||||||
149 | q->selectionModel()->select(oldSelection, QItemSelectionModel::ClearAndSelect); | - | ||||||||||||||||||||||||
150 | q->selectionModel()->setCurrentIndex(oldCurrent, QItemSelectionModel::NoUpdate); | - | ||||||||||||||||||||||||
151 | } never executed: end of block | 0 | ||||||||||||||||||||||||
152 | - | |||||||||||||||||||||||||
153 | - | |||||||||||||||||||||||||
154 | default never executed: :default: never executed: default: code before this statement never executed: default: | 0 | ||||||||||||||||||||||||
155 | oldSelection = QItemSelection(); | - | ||||||||||||||||||||||||
156 | oldCurrent = QModelIndex(); | - | ||||||||||||||||||||||||
157 | break; never executed: break; | 0 | ||||||||||||||||||||||||
158 | } | - | ||||||||||||||||||||||||
159 | } | - | ||||||||||||||||||||||||
160 | } never executed: end of block | 0 | ||||||||||||||||||||||||
161 | QAbstractItemView::QAbstractItemView(QWidget *parent) | - | ||||||||||||||||||||||||
162 | : QAbstractScrollArea(*(new QAbstractItemViewPrivate), parent) | - | ||||||||||||||||||||||||
163 | { | - | ||||||||||||||||||||||||
164 | d_func()->init(); | - | ||||||||||||||||||||||||
165 | } never executed: end of block | 0 | ||||||||||||||||||||||||
166 | - | |||||||||||||||||||||||||
167 | - | |||||||||||||||||||||||||
168 | - | |||||||||||||||||||||||||
169 | - | |||||||||||||||||||||||||
170 | QAbstractItemView::QAbstractItemView(QAbstractItemViewPrivate &dd, QWidget *parent) | - | ||||||||||||||||||||||||
171 | : QAbstractScrollArea(dd, parent) | - | ||||||||||||||||||||||||
172 | { | - | ||||||||||||||||||||||||
173 | d_func()->init(); | - | ||||||||||||||||||||||||
174 | } never executed: end of block | 0 | ||||||||||||||||||||||||
175 | - | |||||||||||||||||||||||||
176 | - | |||||||||||||||||||||||||
177 | - | |||||||||||||||||||||||||
178 | - | |||||||||||||||||||||||||
179 | QAbstractItemView::~QAbstractItemView() | - | ||||||||||||||||||||||||
180 | { | - | ||||||||||||||||||||||||
181 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
182 | - | |||||||||||||||||||||||||
183 | d->delayedReset.stop(); | - | ||||||||||||||||||||||||
184 | d->updateTimer.stop(); | - | ||||||||||||||||||||||||
185 | d->delayedEditing.stop(); | - | ||||||||||||||||||||||||
186 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||
187 | d->autoScrollTimer.stop(); | - | ||||||||||||||||||||||||
188 | d->delayedLayout.stop(); | - | ||||||||||||||||||||||||
189 | d->fetchMoreTimer.stop(); | - | ||||||||||||||||||||||||
190 | } never executed: end of block | 0 | ||||||||||||||||||||||||
191 | void QAbstractItemView::setModel(QAbstractItemModel *model) | - | ||||||||||||||||||||||||
192 | { | - | ||||||||||||||||||||||||
193 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
194 | if (model == d->model
| 0 | ||||||||||||||||||||||||
195 | return; never executed: return; | 0 | ||||||||||||||||||||||||
196 | if (d->model
| 0 | ||||||||||||||||||||||||
197 | disconnect(d->model, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "656"), | - | ||||||||||||||||||||||||
198 | this, qFlagLocation("1""_q_modelDestroyed()" "\0" __FILE__ ":" "657")); | - | ||||||||||||||||||||||||
199 | disconnect(d->model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "658"), | - | ||||||||||||||||||||||||
200 | this, qFlagLocation("1""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "659")); | - | ||||||||||||||||||||||||
201 | disconnect(d->model, qFlagLocation("2""headerDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "660"), | - | ||||||||||||||||||||||||
202 | this, qFlagLocation("1""_q_headerDataChanged()" "\0" __FILE__ ":" "661")); | - | ||||||||||||||||||||||||
203 | disconnect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "662"), | - | ||||||||||||||||||||||||
204 | this, qFlagLocation("1""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "663")); | - | ||||||||||||||||||||||||
205 | disconnect(d->model, qFlagLocation("2""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "664"), | - | ||||||||||||||||||||||||
206 | this, qFlagLocation("1""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "665")); | - | ||||||||||||||||||||||||
207 | disconnect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "666"), | - | ||||||||||||||||||||||||
208 | this, qFlagLocation("1""_q_rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "667")); | - | ||||||||||||||||||||||||
209 | disconnect(d->model, qFlagLocation("2""rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "668"), | - | ||||||||||||||||||||||||
210 | this, qFlagLocation("1""_q_rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "669")); | - | ||||||||||||||||||||||||
211 | disconnect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "670"), | - | ||||||||||||||||||||||||
212 | this, qFlagLocation("1""_q_rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "671")); | - | ||||||||||||||||||||||||
213 | disconnect(d->model, qFlagLocation("2""columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "672"), | - | ||||||||||||||||||||||||
214 | this, qFlagLocation("1""_q_columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "673")); | - | ||||||||||||||||||||||||
215 | disconnect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "674"), | - | ||||||||||||||||||||||||
216 | this, qFlagLocation("1""_q_columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "675")); | - | ||||||||||||||||||||||||
217 | disconnect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "676"), | - | ||||||||||||||||||||||||
218 | this, qFlagLocation("1""_q_columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "677")); | - | ||||||||||||||||||||||||
219 | disconnect(d->model, qFlagLocation("2""columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "678"), | - | ||||||||||||||||||||||||
220 | this, qFlagLocation("1""_q_columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "679")); | - | ||||||||||||||||||||||||
221 | - | |||||||||||||||||||||||||
222 | disconnect(d->model, qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "681"), this, qFlagLocation("1""reset()" "\0" __FILE__ ":" "681")); | - | ||||||||||||||||||||||||
223 | disconnect(d->model, qFlagLocation("2""layoutChanged()" "\0" __FILE__ ":" "682"), this, qFlagLocation("1""_q_layoutChanged()" "\0" __FILE__ ":" "682")); | - | ||||||||||||||||||||||||
224 | } never executed: end of block | 0 | ||||||||||||||||||||||||
225 | d->model = (model
| 0 | ||||||||||||||||||||||||
226 | - | |||||||||||||||||||||||||
227 | - | |||||||||||||||||||||||||
228 | ((!(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.", | - | ||||||||||||||||||||||||
229 | - | |||||||||||||||||||||||||
230 | - | |||||||||||||||||||||||||
231 | __FILE__ | - | ||||||||||||||||||||||||
232 | , | - | ||||||||||||||||||||||||
233 | - | |||||||||||||||||||||||||
234 | - | |||||||||||||||||||||||||
235 | 690 | - | ||||||||||||||||||||||||
236 | ) : qt_noop()) | - | ||||||||||||||||||||||||
237 | - | |||||||||||||||||||||||||
238 | - | |||||||||||||||||||||||||
239 | ; | - | ||||||||||||||||||||||||
240 | ((!(!d->model->index(0,0).parent().isValid())) ? qt_assert_x("QAbstractItemView::setModel", "The parent of a top level index should be invalid", | - | ||||||||||||||||||||||||
241 | - | |||||||||||||||||||||||||
242 | __FILE__ | - | ||||||||||||||||||||||||
243 | , | - | ||||||||||||||||||||||||
244 | - | |||||||||||||||||||||||||
245 | 693 | - | ||||||||||||||||||||||||
246 | ) : qt_noop()) | - | ||||||||||||||||||||||||
247 | - | |||||||||||||||||||||||||
248 | ; | - | ||||||||||||||||||||||||
249 | - | |||||||||||||||||||||||||
250 | if (d->model != QAbstractItemModelPrivate::staticEmptyModel()
| 0 | ||||||||||||||||||||||||
251 | connect(d->model, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "696"), | - | ||||||||||||||||||||||||
252 | this, qFlagLocation("1""_q_modelDestroyed()" "\0" __FILE__ ":" "697")); | - | ||||||||||||||||||||||||
253 | connect(d->model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "698"), | - | ||||||||||||||||||||||||
254 | this, qFlagLocation("1""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "699")); | - | ||||||||||||||||||||||||
255 | connect(d->model, qFlagLocation("2""headerDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "700"), | - | ||||||||||||||||||||||||
256 | this, qFlagLocation("1""_q_headerDataChanged()" "\0" __FILE__ ":" "701")); | - | ||||||||||||||||||||||||
257 | connect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "702"), | - | ||||||||||||||||||||||||
258 | this, qFlagLocation("1""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "703")); | - | ||||||||||||||||||||||||
259 | connect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "704"), | - | ||||||||||||||||||||||||
260 | this, qFlagLocation("1""_q_rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "705")); | - | ||||||||||||||||||||||||
261 | connect(d->model, qFlagLocation("2""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "706"), | - | ||||||||||||||||||||||||
262 | this, qFlagLocation("1""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "707")); | - | ||||||||||||||||||||||||
263 | connect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "708"), | - | ||||||||||||||||||||||||
264 | this, qFlagLocation("1""_q_rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "709")); | - | ||||||||||||||||||||||||
265 | connect(d->model, qFlagLocation("2""rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "710"), | - | ||||||||||||||||||||||||
266 | this, qFlagLocation("1""_q_rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "711")); | - | ||||||||||||||||||||||||
267 | connect(d->model, qFlagLocation("2""columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "712"), | - | ||||||||||||||||||||||||
268 | this, qFlagLocation("1""_q_columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "713")); | - | ||||||||||||||||||||||||
269 | connect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "714"), | - | ||||||||||||||||||||||||
270 | this, qFlagLocation("1""_q_columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "715")); | - | ||||||||||||||||||||||||
271 | connect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "716"), | - | ||||||||||||||||||||||||
272 | this, qFlagLocation("1""_q_columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "717")); | - | ||||||||||||||||||||||||
273 | connect(d->model, qFlagLocation("2""columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "718"), | - | ||||||||||||||||||||||||
274 | this, qFlagLocation("1""_q_columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "719")); | - | ||||||||||||||||||||||||
275 | - | |||||||||||||||||||||||||
276 | connect(d->model, qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "721"), this, qFlagLocation("1""reset()" "\0" __FILE__ ":" "721")); | - | ||||||||||||||||||||||||
277 | connect(d->model, qFlagLocation("2""layoutChanged()" "\0" __FILE__ ":" "722"), this, qFlagLocation("1""_q_layoutChanged()" "\0" __FILE__ ":" "722")); | - | ||||||||||||||||||||||||
278 | } never executed: end of block | 0 | ||||||||||||||||||||||||
279 | - | |||||||||||||||||||||||||
280 | QItemSelectionModel *selection_model = new QItemSelectionModel(d->model, this); | - | ||||||||||||||||||||||||
281 | connect(d->model, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "726"), selection_model, qFlagLocation("1""deleteLater()" "\0" __FILE__ ":" "726")); | - | ||||||||||||||||||||||||
282 | setSelectionModel(selection_model); | - | ||||||||||||||||||||||||
283 | - | |||||||||||||||||||||||||
284 | reset(); | - | ||||||||||||||||||||||||
285 | } never executed: end of block | 0 | ||||||||||||||||||||||||
286 | - | |||||||||||||||||||||||||
287 | - | |||||||||||||||||||||||||
288 | - | |||||||||||||||||||||||||
289 | - | |||||||||||||||||||||||||
290 | QAbstractItemModel *QAbstractItemView::model() const | - | ||||||||||||||||||||||||
291 | { | - | ||||||||||||||||||||||||
292 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
293 | return never executed: (d->model == QAbstractItemModelPrivate::staticEmptyModel()return (d->model == QAbstractItemModelPrivate::staticEmptyModel() ? 0 : d->model);
never executed: return (d->model == QAbstractItemModelPrivate::staticEmptyModel() ? 0 : d->model); | 0 | ||||||||||||||||||||||||
294 | } | - | ||||||||||||||||||||||||
295 | void QAbstractItemView::setSelectionModel(QItemSelectionModel *selectionModel) | - | ||||||||||||||||||||||||
296 | { | - | ||||||||||||||||||||||||
297 | - | |||||||||||||||||||||||||
298 | ((!(selectionModel)) ? qt_assert("selectionModel",__FILE__,758) : qt_noop()); | - | ||||||||||||||||||||||||
299 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
300 | - | |||||||||||||||||||||||||
301 | if (selectionModel->model() != d->model
| 0 | ||||||||||||||||||||||||
302 | QMessageLogger(__FILE__, 762, __PRETTY_FUNCTION__).warning("QAbstractItemView::setSelectionModel() failed: " | - | ||||||||||||||||||||||||
303 | "Trying to set a selection model, which works on " | - | ||||||||||||||||||||||||
304 | "a different model than the view."); | - | ||||||||||||||||||||||||
305 | return; never executed: return; | 0 | ||||||||||||||||||||||||
306 | } | - | ||||||||||||||||||||||||
307 | - | |||||||||||||||||||||||||
308 | QItemSelection oldSelection; | - | ||||||||||||||||||||||||
309 | QModelIndex oldCurrentIndex; | - | ||||||||||||||||||||||||
310 | - | |||||||||||||||||||||||||
311 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
312 | if (d->selectionModel->model() == selectionModel->model()
| 0 | ||||||||||||||||||||||||
313 | oldSelection = d->selectionModel->selection(); | - | ||||||||||||||||||||||||
314 | oldCurrentIndex = d->selectionModel->currentIndex(); | - | ||||||||||||||||||||||||
315 | } never executed: end of block | 0 | ||||||||||||||||||||||||
316 | - | |||||||||||||||||||||||||
317 | disconnect(d->selectionModel, qFlagLocation("2""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "777"), | - | ||||||||||||||||||||||||
318 | this, qFlagLocation("1""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "778")); | - | ||||||||||||||||||||||||
319 | disconnect(d->selectionModel, qFlagLocation("2""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "779"), | - | ||||||||||||||||||||||||
320 | this, qFlagLocation("1""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "780")); | - | ||||||||||||||||||||||||
321 | } never executed: end of block | 0 | ||||||||||||||||||||||||
322 | - | |||||||||||||||||||||||||
323 | d->selectionModel = selectionModel; | - | ||||||||||||||||||||||||
324 | - | |||||||||||||||||||||||||
325 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
326 | connect(d->selectionModel, qFlagLocation("2""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "786"), | - | ||||||||||||||||||||||||
327 | this, qFlagLocation("1""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "787")); | - | ||||||||||||||||||||||||
328 | connect(d->selectionModel, qFlagLocation("2""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "788"), | - | ||||||||||||||||||||||||
329 | this, qFlagLocation("1""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "789")); | - | ||||||||||||||||||||||||
330 | - | |||||||||||||||||||||||||
331 | selectionChanged(d->selectionModel->selection(), oldSelection); | - | ||||||||||||||||||||||||
332 | currentChanged(d->selectionModel->currentIndex(), oldCurrentIndex); | - | ||||||||||||||||||||||||
333 | } never executed: end of block | 0 | ||||||||||||||||||||||||
334 | } never executed: end of block | 0 | ||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||
336 | - | |||||||||||||||||||||||||
337 | - | |||||||||||||||||||||||||
338 | - | |||||||||||||||||||||||||
339 | - | |||||||||||||||||||||||||
340 | - | |||||||||||||||||||||||||
341 | QItemSelectionModel* QAbstractItemView::selectionModel() const | - | ||||||||||||||||||||||||
342 | { | - | ||||||||||||||||||||||||
343 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
344 | return never executed: d->selectionModel;return d->selectionModel; never executed: return d->selectionModel; | 0 | ||||||||||||||||||||||||
345 | } | - | ||||||||||||||||||||||||
346 | void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate) | - | ||||||||||||||||||||||||
347 | { | - | ||||||||||||||||||||||||
348 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
349 | if (delegate
| 0 | ||||||||||||||||||||||||
350 | return; never executed: return; | 0 | ||||||||||||||||||||||||
351 | - | |||||||||||||||||||||||||
352 | if (d->itemDelegate
| 0 | ||||||||||||||||||||||||
353 | if (d->delegateRefCount(d->itemDelegate) == 1
| 0 | ||||||||||||||||||||||||
354 | disconnect(d->itemDelegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "830"), | - | ||||||||||||||||||||||||
355 | this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "831")); | - | ||||||||||||||||||||||||
356 | disconnect(d->itemDelegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "832"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "832")); | - | ||||||||||||||||||||||||
357 | disconnect(d->itemDelegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "833"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "833")); | - | ||||||||||||||||||||||||
358 | } never executed: end of block | 0 | ||||||||||||||||||||||||
359 | } never executed: end of block | 0 | ||||||||||||||||||||||||
360 | - | |||||||||||||||||||||||||
361 | if (delegate
| 0 | ||||||||||||||||||||||||
362 | if (d->delegateRefCount(delegate) == 0
| 0 | ||||||||||||||||||||||||
363 | connect(delegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "839"), | - | ||||||||||||||||||||||||
364 | this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "840")); | - | ||||||||||||||||||||||||
365 | connect(delegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "841"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "841")); | - | ||||||||||||||||||||||||
366 | connect(delegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "842"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "842"), Qt::QueuedConnection); | - | ||||||||||||||||||||||||
367 | } never executed: end of block | 0 | ||||||||||||||||||||||||
368 | } never executed: end of block | 0 | ||||||||||||||||||||||||
369 | d->itemDelegate = delegate; | - | ||||||||||||||||||||||||
370 | viewport()->update(); | - | ||||||||||||||||||||||||
371 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
372 | } never executed: end of block | 0 | ||||||||||||||||||||||||
373 | - | |||||||||||||||||||||||||
374 | - | |||||||||||||||||||||||||
375 | - | |||||||||||||||||||||||||
376 | - | |||||||||||||||||||||||||
377 | - | |||||||||||||||||||||||||
378 | - | |||||||||||||||||||||||||
379 | - | |||||||||||||||||||||||||
380 | QAbstractItemDelegate *QAbstractItemView::itemDelegate() const | - | ||||||||||||||||||||||||
381 | { | - | ||||||||||||||||||||||||
382 | return never executed: d_func()->itemDelegate;return d_func()->itemDelegate; never executed: return d_func()->itemDelegate; | 0 | ||||||||||||||||||||||||
383 | } | - | ||||||||||||||||||||||||
384 | - | |||||||||||||||||||||||||
385 | - | |||||||||||||||||||||||||
386 | - | |||||||||||||||||||||||||
387 | - | |||||||||||||||||||||||||
388 | QVariant QAbstractItemView::inputMethodQuery(Qt::InputMethodQuery query) const | - | ||||||||||||||||||||||||
389 | { | - | ||||||||||||||||||||||||
390 | const QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||
391 | if (!current.isValid()
| 0 | ||||||||||||||||||||||||
392 | return never executed: QAbstractScrollArea::inputMethodQuery(query);return QAbstractScrollArea::inputMethodQuery(query); never executed: return QAbstractScrollArea::inputMethodQuery(query); | 0 | ||||||||||||||||||||||||
393 | return never executed: visualRect(current);return visualRect(current); never executed: return visualRect(current); | 0 | ||||||||||||||||||||||||
394 | } | - | ||||||||||||||||||||||||
395 | void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *delegate) | - | ||||||||||||||||||||||||
396 | { | - | ||||||||||||||||||||||||
397 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
398 | if (QAbstractItemDelegate *rowDelegate = d->rowDelegates.value(row, 0)
| 0 | ||||||||||||||||||||||||
399 | if (d->delegateRefCount(rowDelegate) == 1
| 0 | ||||||||||||||||||||||||
400 | disconnect(rowDelegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "898"), | - | ||||||||||||||||||||||||
401 | this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "899")); | - | ||||||||||||||||||||||||
402 | disconnect(rowDelegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "900"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "900")); | - | ||||||||||||||||||||||||
403 | disconnect(rowDelegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "901"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "901")); | - | ||||||||||||||||||||||||
404 | } never executed: end of block | 0 | ||||||||||||||||||||||||
405 | d->rowDelegates.remove(row); | - | ||||||||||||||||||||||||
406 | } never executed: end of block | 0 | ||||||||||||||||||||||||
407 | if (delegate
| 0 | ||||||||||||||||||||||||
408 | if (d->delegateRefCount(delegate) == 0
| 0 | ||||||||||||||||||||||||
409 | connect(delegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "907"), | - | ||||||||||||||||||||||||
410 | this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "908")); | - | ||||||||||||||||||||||||
411 | connect(delegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "909"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "909")); | - | ||||||||||||||||||||||||
412 | connect(delegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "910"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "910"), Qt::QueuedConnection); | - | ||||||||||||||||||||||||
413 | } never executed: end of block | 0 | ||||||||||||||||||||||||
414 | d->rowDelegates.insert(row, delegate); | - | ||||||||||||||||||||||||
415 | } never executed: end of block | 0 | ||||||||||||||||||||||||
416 | viewport()->update(); | - | ||||||||||||||||||||||||
417 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
418 | } never executed: end of block | 0 | ||||||||||||||||||||||||
419 | QAbstractItemDelegate *QAbstractItemView::itemDelegateForRow(int row) const | - | ||||||||||||||||||||||||
420 | { | - | ||||||||||||||||||||||||
421 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
422 | return never executed: d->rowDelegates.value(row, 0);return d->rowDelegates.value(row, 0); never executed: return d->rowDelegates.value(row, 0); | 0 | ||||||||||||||||||||||||
423 | } | - | ||||||||||||||||||||||||
424 | void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate) | - | ||||||||||||||||||||||||
425 | { | - | ||||||||||||||||||||||||
426 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
427 | if (QAbstractItemDelegate *columnDelegate = d->columnDelegates.value(column, 0)
| 0 | ||||||||||||||||||||||||
428 | if (d->delegateRefCount(columnDelegate) == 1
| 0 | ||||||||||||||||||||||||
429 | disconnect(columnDelegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "958"), | - | ||||||||||||||||||||||||
430 | this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "959")); | - | ||||||||||||||||||||||||
431 | disconnect(columnDelegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "960"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "960")); | - | ||||||||||||||||||||||||
432 | disconnect(columnDelegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "961"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "961")); | - | ||||||||||||||||||||||||
433 | } never executed: end of block | 0 | ||||||||||||||||||||||||
434 | d->columnDelegates.remove(column); | - | ||||||||||||||||||||||||
435 | } never executed: end of block | 0 | ||||||||||||||||||||||||
436 | if (delegate
| 0 | ||||||||||||||||||||||||
437 | if (d->delegateRefCount(delegate) == 0
| 0 | ||||||||||||||||||||||||
438 | connect(delegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "967"), | - | ||||||||||||||||||||||||
439 | this, qFlagLocation("1""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "968")); | - | ||||||||||||||||||||||||
440 | connect(delegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "969"), this, qFlagLocation("1""commitData(QWidget*)" "\0" __FILE__ ":" "969")); | - | ||||||||||||||||||||||||
441 | connect(delegate, qFlagLocation("2""sizeHintChanged(QModelIndex)" "\0" __FILE__ ":" "970"), this, qFlagLocation("1""doItemsLayout()" "\0" __FILE__ ":" "970"), Qt::QueuedConnection); | - | ||||||||||||||||||||||||
442 | } never executed: end of block | 0 | ||||||||||||||||||||||||
443 | d->columnDelegates.insert(column, delegate); | - | ||||||||||||||||||||||||
444 | } never executed: end of block | 0 | ||||||||||||||||||||||||
445 | viewport()->update(); | - | ||||||||||||||||||||||||
446 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
447 | } never executed: end of block | 0 | ||||||||||||||||||||||||
448 | QAbstractItemDelegate *QAbstractItemView::itemDelegateForColumn(int column) const | - | ||||||||||||||||||||||||
449 | { | - | ||||||||||||||||||||||||
450 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
451 | return never executed: d->columnDelegates.value(column, 0);return d->columnDelegates.value(column, 0); never executed: return d->columnDelegates.value(column, 0); | 0 | ||||||||||||||||||||||||
452 | } | - | ||||||||||||||||||||||||
453 | - | |||||||||||||||||||||||||
454 | - | |||||||||||||||||||||||||
455 | - | |||||||||||||||||||||||||
456 | - | |||||||||||||||||||||||||
457 | - | |||||||||||||||||||||||||
458 | QAbstractItemDelegate *QAbstractItemView::itemDelegate(const QModelIndex &index) const | - | ||||||||||||||||||||||||
459 | { | - | ||||||||||||||||||||||||
460 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
461 | return never executed: d->delegateForIndex(index);return d->delegateForIndex(index); never executed: return d->delegateForIndex(index); | 0 | ||||||||||||||||||||||||
462 | } | - | ||||||||||||||||||||||||
463 | void QAbstractItemView::setSelectionMode(SelectionMode mode) | - | ||||||||||||||||||||||||
464 | { | - | ||||||||||||||||||||||||
465 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
466 | d->selectionMode = mode; | - | ||||||||||||||||||||||||
467 | } never executed: end of block | 0 | ||||||||||||||||||||||||
468 | - | |||||||||||||||||||||||||
469 | QAbstractItemView::SelectionMode QAbstractItemView::selectionMode() const | - | ||||||||||||||||||||||||
470 | { | - | ||||||||||||||||||||||||
471 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
472 | return never executed: d->selectionMode;return d->selectionMode; never executed: return d->selectionMode; | 0 | ||||||||||||||||||||||||
473 | } | - | ||||||||||||||||||||||||
474 | void QAbstractItemView::setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior) | - | ||||||||||||||||||||||||
475 | { | - | ||||||||||||||||||||||||
476 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
477 | d->selectionBehavior = behavior; | - | ||||||||||||||||||||||||
478 | } never executed: end of block | 0 | ||||||||||||||||||||||||
479 | - | |||||||||||||||||||||||||
480 | QAbstractItemView::SelectionBehavior QAbstractItemView::selectionBehavior() const | - | ||||||||||||||||||||||||
481 | { | - | ||||||||||||||||||||||||
482 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
483 | return never executed: d->selectionBehavior;return d->selectionBehavior; never executed: return d->selectionBehavior; | 0 | ||||||||||||||||||||||||
484 | } | - | ||||||||||||||||||||||||
485 | void QAbstractItemView::setCurrentIndex(const QModelIndex &index) | - | ||||||||||||||||||||||||
486 | { | - | ||||||||||||||||||||||||
487 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
488 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
489 | QItemSelectionModel::SelectionFlags command = selectionCommand(index, 0); | - | ||||||||||||||||||||||||
490 | d->selectionModel->setCurrentIndex(index, command); | - | ||||||||||||||||||||||||
491 | d->currentIndexSet = true; | - | ||||||||||||||||||||||||
492 | if ((
| 0 | ||||||||||||||||||||||||
493 | d->currentSelectionStartIndex = index; never executed: d->currentSelectionStartIndex = index; | 0 | ||||||||||||||||||||||||
494 | } never executed: end of block | 0 | ||||||||||||||||||||||||
495 | } never executed: end of block | 0 | ||||||||||||||||||||||||
496 | - | |||||||||||||||||||||||||
497 | - | |||||||||||||||||||||||||
498 | - | |||||||||||||||||||||||||
499 | - | |||||||||||||||||||||||||
500 | - | |||||||||||||||||||||||||
501 | - | |||||||||||||||||||||||||
502 | QModelIndex QAbstractItemView::currentIndex() const | - | ||||||||||||||||||||||||
503 | { | - | ||||||||||||||||||||||||
504 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
505 | return never executed: d->selectionModelreturn d->selectionModel ? d->selectionModel->currentIndex() : QModelIndex();
never executed: return d->selectionModel ? d->selectionModel->currentIndex() : QModelIndex(); | 0 | ||||||||||||||||||||||||
506 | } | - | ||||||||||||||||||||||||
507 | void QAbstractItemView::reset() | - | ||||||||||||||||||||||||
508 | { | - | ||||||||||||||||||||||||
509 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
510 | d->delayedReset.stop(); | - | ||||||||||||||||||||||||
511 | 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) { | - | ||||||||||||||||||||||||
512 | if (info.widget
| 0 | ||||||||||||||||||||||||
513 | d->releaseEditor(info.widget.data(), d->indexForEditor(info.widget.data())); never executed: d->releaseEditor(info.widget.data(), d->indexForEditor(info.widget.data())); | 0 | ||||||||||||||||||||||||
514 | } never executed: end of block | 0 | ||||||||||||||||||||||||
515 | d->editorIndexHash.clear(); | - | ||||||||||||||||||||||||
516 | d->indexEditorHash.clear(); | - | ||||||||||||||||||||||||
517 | d->persistent.clear(); | - | ||||||||||||||||||||||||
518 | d->currentIndexSet = false; | - | ||||||||||||||||||||||||
519 | setState(NoState); | - | ||||||||||||||||||||||||
520 | setRootIndex(QModelIndex()); | - | ||||||||||||||||||||||||
521 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
522 | d->selectionModel->reset(); never executed: d->selectionModel->reset(); | 0 | ||||||||||||||||||||||||
523 | - | |||||||||||||||||||||||||
524 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||
525 | QAccessibleTableModelChangeEvent accessibleEvent(this, QAccessibleTableModelChangeEvent::ModelReset); | - | ||||||||||||||||||||||||
526 | QAccessible::updateAccessibility(&accessibleEvent); | - | ||||||||||||||||||||||||
527 | } never executed: end of block | 0 | ||||||||||||||||||||||||
528 | - | |||||||||||||||||||||||||
529 | d->updateGeometry(); | - | ||||||||||||||||||||||||
530 | } never executed: end of block | 0 | ||||||||||||||||||||||||
531 | - | |||||||||||||||||||||||||
532 | - | |||||||||||||||||||||||||
533 | - | |||||||||||||||||||||||||
534 | - | |||||||||||||||||||||||||
535 | - | |||||||||||||||||||||||||
536 | - | |||||||||||||||||||||||||
537 | void QAbstractItemView::setRootIndex(const QModelIndex &index) | - | ||||||||||||||||||||||||
538 | { | - | ||||||||||||||||||||||||
539 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
540 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
541 | QMessageLogger(__FILE__, 1128, __PRETTY_FUNCTION__).warning("QAbstractItemView::setRootIndex failed : index must be from the currently set model"); | - | ||||||||||||||||||||||||
542 | return; never executed: return; | 0 | ||||||||||||||||||||||||
543 | } | - | ||||||||||||||||||||||||
544 | d->root = index; | - | ||||||||||||||||||||||||
545 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
546 | d->updateGeometry(); | - | ||||||||||||||||||||||||
547 | } never executed: end of block | 0 | ||||||||||||||||||||||||
548 | - | |||||||||||||||||||||||||
549 | - | |||||||||||||||||||||||||
550 | - | |||||||||||||||||||||||||
551 | - | |||||||||||||||||||||||||
552 | - | |||||||||||||||||||||||||
553 | - | |||||||||||||||||||||||||
554 | - | |||||||||||||||||||||||||
555 | QModelIndex QAbstractItemView::rootIndex() const | - | ||||||||||||||||||||||||
556 | { | - | ||||||||||||||||||||||||
557 | return never executed: QModelIndex(d_func()->root);return QModelIndex(d_func()->root); never executed: return QModelIndex(d_func()->root); | 0 | ||||||||||||||||||||||||
558 | } | - | ||||||||||||||||||||||||
559 | void QAbstractItemView::selectAll() | - | ||||||||||||||||||||||||
560 | { | - | ||||||||||||||||||||||||
561 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
562 | SelectionMode mode = d->selectionMode; | - | ||||||||||||||||||||||||
563 | if (mode == MultiSelection
| 0 | ||||||||||||||||||||||||
564 | d->selectAll(QItemSelectionModel::ClearAndSelect never executed: d->selectAll(QItemSelectionModel::ClearAndSelect |d->selectionBehaviorFlags()); | 0 | ||||||||||||||||||||||||
565 | |d->selectionBehaviorFlags()); never executed: d->selectAll(QItemSelectionModel::ClearAndSelect |d->selectionBehaviorFlags()); | 0 | ||||||||||||||||||||||||
566 | else if (mode != SingleSelection
| 0 | ||||||||||||||||||||||||
567 | d->selectAll(selectionCommand(d->model->index(0, 0, d->root))); never executed: d->selectAll(selectionCommand(d->model->index(0, 0, d->root))); | 0 | ||||||||||||||||||||||||
568 | } never executed: end of block | 0 | ||||||||||||||||||||||||
569 | void QAbstractItemView::edit(const QModelIndex &index) | - | ||||||||||||||||||||||||
570 | { | - | ||||||||||||||||||||||||
571 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
572 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||
573 | QMessageLogger(__FILE__, 1181, __PRETTY_FUNCTION__).warning("edit: index was invalid"); never executed: QMessageLogger(__FILE__, 1181, __PRETTY_FUNCTION__).warning("edit: index was invalid"); | 0 | ||||||||||||||||||||||||
574 | if (!edit(index, AllEditTriggers, 0)
| 0 | ||||||||||||||||||||||||
575 | QMessageLogger(__FILE__, 1183, __PRETTY_FUNCTION__).warning("edit: editing failed"); never executed: QMessageLogger(__FILE__, 1183, __PRETTY_FUNCTION__).warning("edit: editing failed"); | 0 | ||||||||||||||||||||||||
576 | } never executed: end of block | 0 | ||||||||||||||||||||||||
577 | - | |||||||||||||||||||||||||
578 | - | |||||||||||||||||||||||||
579 | - | |||||||||||||||||||||||||
580 | - | |||||||||||||||||||||||||
581 | - | |||||||||||||||||||||||||
582 | - | |||||||||||||||||||||||||
583 | void QAbstractItemView::clearSelection() | - | ||||||||||||||||||||||||
584 | { | - | ||||||||||||||||||||||||
585 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
586 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
587 | d->selectionModel->clearSelection(); never executed: d->selectionModel->clearSelection(); | 0 | ||||||||||||||||||||||||
588 | } never executed: end of block | 0 | ||||||||||||||||||||||||
589 | - | |||||||||||||||||||||||||
590 | - | |||||||||||||||||||||||||
591 | - | |||||||||||||||||||||||||
592 | - | |||||||||||||||||||||||||
593 | - | |||||||||||||||||||||||||
594 | - | |||||||||||||||||||||||||
595 | - | |||||||||||||||||||||||||
596 | void QAbstractItemView::doItemsLayout() | - | ||||||||||||||||||||||||
597 | { | - | ||||||||||||||||||||||||
598 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
599 | d->interruptDelayedItemsLayout(); | - | ||||||||||||||||||||||||
600 | updateGeometries(); | - | ||||||||||||||||||||||||
601 | d->viewport->update(); | - | ||||||||||||||||||||||||
602 | } never executed: end of block | 0 | ||||||||||||||||||||||||
603 | void QAbstractItemView::setEditTriggers(EditTriggers actions) | - | ||||||||||||||||||||||||
604 | { | - | ||||||||||||||||||||||||
605 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
606 | d->editTriggers = actions; | - | ||||||||||||||||||||||||
607 | } never executed: end of block | 0 | ||||||||||||||||||||||||
608 | - | |||||||||||||||||||||||||
609 | QAbstractItemView::EditTriggers QAbstractItemView::editTriggers() const | - | ||||||||||||||||||||||||
610 | { | - | ||||||||||||||||||||||||
611 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
612 | return never executed: d->editTriggers;return d->editTriggers; never executed: return d->editTriggers; | 0 | ||||||||||||||||||||||||
613 | } | - | ||||||||||||||||||||||||
614 | void QAbstractItemView::setVerticalScrollMode(ScrollMode mode) | - | ||||||||||||||||||||||||
615 | { | - | ||||||||||||||||||||||||
616 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
617 | if (mode == d->verticalScrollMode
| 0 | ||||||||||||||||||||||||
618 | return; never executed: return; | 0 | ||||||||||||||||||||||||
619 | QModelIndex topLeft = indexAt(QPoint(0, 0)); | - | ||||||||||||||||||||||||
620 | d->verticalScrollMode = mode; | - | ||||||||||||||||||||||||
621 | updateGeometries(); | - | ||||||||||||||||||||||||
622 | scrollTo(topLeft, QAbstractItemView::PositionAtTop); | - | ||||||||||||||||||||||||
623 | } never executed: end of block | 0 | ||||||||||||||||||||||||
624 | - | |||||||||||||||||||||||||
625 | QAbstractItemView::ScrollMode QAbstractItemView::verticalScrollMode() const | - | ||||||||||||||||||||||||
626 | { | - | ||||||||||||||||||||||||
627 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
628 | return never executed: d->verticalScrollMode;return d->verticalScrollMode; never executed: return d->verticalScrollMode; | 0 | ||||||||||||||||||||||||
629 | } | - | ||||||||||||||||||||||||
630 | void QAbstractItemView::setHorizontalScrollMode(ScrollMode mode) | - | ||||||||||||||||||||||||
631 | { | - | ||||||||||||||||||||||||
632 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
633 | d->horizontalScrollMode = mode; | - | ||||||||||||||||||||||||
634 | updateGeometries(); | - | ||||||||||||||||||||||||
635 | } never executed: end of block | 0 | ||||||||||||||||||||||||
636 | - | |||||||||||||||||||||||||
637 | QAbstractItemView::ScrollMode QAbstractItemView::horizontalScrollMode() const | - | ||||||||||||||||||||||||
638 | { | - | ||||||||||||||||||||||||
639 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
640 | return never executed: d->horizontalScrollMode;return d->horizontalScrollMode; never executed: return d->horizontalScrollMode; | 0 | ||||||||||||||||||||||||
641 | } | - | ||||||||||||||||||||||||
642 | void QAbstractItemView::setDragDropOverwriteMode(bool overwrite) | - | ||||||||||||||||||||||||
643 | { | - | ||||||||||||||||||||||||
644 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
645 | d->overwrite = overwrite; | - | ||||||||||||||||||||||||
646 | } never executed: end of block | 0 | ||||||||||||||||||||||||
647 | - | |||||||||||||||||||||||||
648 | bool QAbstractItemView::dragDropOverwriteMode() const | - | ||||||||||||||||||||||||
649 | { | - | ||||||||||||||||||||||||
650 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
651 | return never executed: d->overwrite;return d->overwrite; never executed: return d->overwrite; | 0 | ||||||||||||||||||||||||
652 | } | - | ||||||||||||||||||||||||
653 | void QAbstractItemView::setAutoScroll(bool enable) | - | ||||||||||||||||||||||||
654 | { | - | ||||||||||||||||||||||||
655 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
656 | d->autoScroll = enable; | - | ||||||||||||||||||||||||
657 | } never executed: end of block | 0 | ||||||||||||||||||||||||
658 | - | |||||||||||||||||||||||||
659 | bool QAbstractItemView::hasAutoScroll() const | - | ||||||||||||||||||||||||
660 | { | - | ||||||||||||||||||||||||
661 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
662 | return never executed: d->autoScroll;return d->autoScroll; never executed: return d->autoScroll; | 0 | ||||||||||||||||||||||||
663 | } | - | ||||||||||||||||||||||||
664 | void QAbstractItemView::setAutoScrollMargin(int margin) | - | ||||||||||||||||||||||||
665 | { | - | ||||||||||||||||||||||||
666 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
667 | d->autoScrollMargin = margin; | - | ||||||||||||||||||||||||
668 | } never executed: end of block | 0 | ||||||||||||||||||||||||
669 | - | |||||||||||||||||||||||||
670 | int QAbstractItemView::autoScrollMargin() const | - | ||||||||||||||||||||||||
671 | { | - | ||||||||||||||||||||||||
672 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
673 | return never executed: d->autoScrollMargin;return d->autoScrollMargin; never executed: return d->autoScrollMargin; | 0 | ||||||||||||||||||||||||
674 | } | - | ||||||||||||||||||||||||
675 | - | |||||||||||||||||||||||||
676 | - | |||||||||||||||||||||||||
677 | - | |||||||||||||||||||||||||
678 | - | |||||||||||||||||||||||||
679 | - | |||||||||||||||||||||||||
680 | - | |||||||||||||||||||||||||
681 | void QAbstractItemView::setTabKeyNavigation(bool enable) | - | ||||||||||||||||||||||||
682 | { | - | ||||||||||||||||||||||||
683 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
684 | d->tabKeyNavigation = enable; | - | ||||||||||||||||||||||||
685 | } never executed: end of block | 0 | ||||||||||||||||||||||||
686 | - | |||||||||||||||||||||||||
687 | bool QAbstractItemView::tabKeyNavigation() const | - | ||||||||||||||||||||||||
688 | { | - | ||||||||||||||||||||||||
689 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
690 | return never executed: d->tabKeyNavigation;return d->tabKeyNavigation; never executed: return d->tabKeyNavigation; | 0 | ||||||||||||||||||||||||
691 | } | - | ||||||||||||||||||||||||
692 | - | |||||||||||||||||||||||||
693 | - | |||||||||||||||||||||||||
694 | - | |||||||||||||||||||||||||
695 | - | |||||||||||||||||||||||||
696 | - | |||||||||||||||||||||||||
697 | QSize QAbstractItemView::viewportSizeHint() const | - | ||||||||||||||||||||||||
698 | { | - | ||||||||||||||||||||||||
699 | return never executed: QAbstractScrollArea::viewportSizeHint();return QAbstractScrollArea::viewportSizeHint(); never executed: return QAbstractScrollArea::viewportSizeHint(); | 0 | ||||||||||||||||||||||||
700 | } | - | ||||||||||||||||||||||||
701 | void QAbstractItemView::setDropIndicatorShown(bool enable) | - | ||||||||||||||||||||||||
702 | { | - | ||||||||||||||||||||||||
703 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
704 | d->showDropIndicator = enable; | - | ||||||||||||||||||||||||
705 | } never executed: end of block | 0 | ||||||||||||||||||||||||
706 | - | |||||||||||||||||||||||||
707 | bool QAbstractItemView::showDropIndicator() const | - | ||||||||||||||||||||||||
708 | { | - | ||||||||||||||||||||||||
709 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
710 | return never executed: d->showDropIndicator;return d->showDropIndicator; never executed: return d->showDropIndicator; | 0 | ||||||||||||||||||||||||
711 | } | - | ||||||||||||||||||||||||
712 | void QAbstractItemView::setDragEnabled(bool enable) | - | ||||||||||||||||||||||||
713 | { | - | ||||||||||||||||||||||||
714 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
715 | d->dragEnabled = enable; | - | ||||||||||||||||||||||||
716 | } never executed: end of block | 0 | ||||||||||||||||||||||||
717 | - | |||||||||||||||||||||||||
718 | bool QAbstractItemView::dragEnabled() const | - | ||||||||||||||||||||||||
719 | { | - | ||||||||||||||||||||||||
720 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
721 | return never executed: d->dragEnabled;return d->dragEnabled; never executed: return d->dragEnabled; | 0 | ||||||||||||||||||||||||
722 | } | - | ||||||||||||||||||||||||
723 | void QAbstractItemView::setDragDropMode(DragDropMode behavior) | - | ||||||||||||||||||||||||
724 | { | - | ||||||||||||||||||||||||
725 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
726 | d->dragDropMode = behavior; | - | ||||||||||||||||||||||||
727 | setDragEnabled(behavior == DragOnly || behavior == DragDrop || behavior == InternalMove); | - | ||||||||||||||||||||||||
728 | setAcceptDrops(behavior == DropOnly || behavior == DragDrop || behavior == InternalMove); | - | ||||||||||||||||||||||||
729 | } never executed: end of block | 0 | ||||||||||||||||||||||||
730 | - | |||||||||||||||||||||||||
731 | QAbstractItemView::DragDropMode QAbstractItemView::dragDropMode() const | - | ||||||||||||||||||||||||
732 | { | - | ||||||||||||||||||||||||
733 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
734 | DragDropMode setBehavior = d->dragDropMode; | - | ||||||||||||||||||||||||
735 | if (!dragEnabled()
| 0 | ||||||||||||||||||||||||
736 | return never executed: NoDragDrop;return NoDragDrop; never executed: return NoDragDrop; | 0 | ||||||||||||||||||||||||
737 | - | |||||||||||||||||||||||||
738 | if (dragEnabled()
| 0 | ||||||||||||||||||||||||
739 | return never executed: DragOnly;return DragOnly; never executed: return DragOnly; | 0 | ||||||||||||||||||||||||
740 | - | |||||||||||||||||||||||||
741 | if (!dragEnabled()
| 0 | ||||||||||||||||||||||||
742 | return never executed: DropOnly;return DropOnly; never executed: return DropOnly; | 0 | ||||||||||||||||||||||||
743 | - | |||||||||||||||||||||||||
744 | if (dragEnabled()
| 0 | ||||||||||||||||||||||||
745 | if (setBehavior == InternalMove
| 0 | ||||||||||||||||||||||||
746 | return never executed: setBehavior;return setBehavior; never executed: return setBehavior; | 0 | ||||||||||||||||||||||||
747 | else | - | ||||||||||||||||||||||||
748 | return never executed: DragDrop;return DragDrop; never executed: return DragDrop; | 0 | ||||||||||||||||||||||||
749 | } | - | ||||||||||||||||||||||||
750 | - | |||||||||||||||||||||||||
751 | return never executed: NoDragDrop;return NoDragDrop; never executed: return NoDragDrop; | 0 | ||||||||||||||||||||||||
752 | } | - | ||||||||||||||||||||||||
753 | void QAbstractItemView::setDefaultDropAction(Qt::DropAction dropAction) | - | ||||||||||||||||||||||||
754 | { | - | ||||||||||||||||||||||||
755 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
756 | d->defaultDropAction = dropAction; | - | ||||||||||||||||||||||||
757 | } never executed: end of block | 0 | ||||||||||||||||||||||||
758 | - | |||||||||||||||||||||||||
759 | Qt::DropAction QAbstractItemView::defaultDropAction() const | - | ||||||||||||||||||||||||
760 | { | - | ||||||||||||||||||||||||
761 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
762 | return never executed: d->defaultDropAction;return d->defaultDropAction; never executed: return d->defaultDropAction; | 0 | ||||||||||||||||||||||||
763 | } | - | ||||||||||||||||||||||||
764 | void QAbstractItemView::setAlternatingRowColors(bool enable) | - | ||||||||||||||||||||||||
765 | { | - | ||||||||||||||||||||||||
766 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
767 | d->alternatingColors = enable; | - | ||||||||||||||||||||||||
768 | if (isVisible()
| 0 | ||||||||||||||||||||||||
769 | d->viewport->update(); never executed: d->viewport->update(); | 0 | ||||||||||||||||||||||||
770 | } never executed: end of block | 0 | ||||||||||||||||||||||||
771 | - | |||||||||||||||||||||||||
772 | bool QAbstractItemView::alternatingRowColors() const | - | ||||||||||||||||||||||||
773 | { | - | ||||||||||||||||||||||||
774 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
775 | return never executed: d->alternatingColors;return d->alternatingColors; never executed: return d->alternatingColors; | 0 | ||||||||||||||||||||||||
776 | } | - | ||||||||||||||||||||||||
777 | void QAbstractItemView::setIconSize(const QSize &size) | - | ||||||||||||||||||||||||
778 | { | - | ||||||||||||||||||||||||
779 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
780 | if (size == d->iconSize
| 0 | ||||||||||||||||||||||||
781 | return; never executed: return; | 0 | ||||||||||||||||||||||||
782 | d->iconSize = size; | - | ||||||||||||||||||||||||
783 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
784 | iconSizeChanged(size); | - | ||||||||||||||||||||||||
785 | } never executed: end of block | 0 | ||||||||||||||||||||||||
786 | - | |||||||||||||||||||||||||
787 | QSize QAbstractItemView::iconSize() const | - | ||||||||||||||||||||||||
788 | { | - | ||||||||||||||||||||||||
789 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
790 | return never executed: d->iconSize;return d->iconSize; never executed: return d->iconSize; | 0 | ||||||||||||||||||||||||
791 | } | - | ||||||||||||||||||||||||
792 | void QAbstractItemView::setTextElideMode(Qt::TextElideMode mode) | - | ||||||||||||||||||||||||
793 | { | - | ||||||||||||||||||||||||
794 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
795 | d->textElideMode = mode; | - | ||||||||||||||||||||||||
796 | } never executed: end of block | 0 | ||||||||||||||||||||||||
797 | - | |||||||||||||||||||||||||
798 | Qt::TextElideMode QAbstractItemView::textElideMode() const | - | ||||||||||||||||||||||||
799 | { | - | ||||||||||||||||||||||||
800 | return never executed: d_func()->textElideMode;return d_func()->textElideMode; never executed: return d_func()->textElideMode; | 0 | ||||||||||||||||||||||||
801 | } | - | ||||||||||||||||||||||||
802 | - | |||||||||||||||||||||||||
803 | - | |||||||||||||||||||||||||
804 | - | |||||||||||||||||||||||||
805 | - | |||||||||||||||||||||||||
806 | bool QAbstractItemView::focusNextPrevChild(bool next) | - | ||||||||||||||||||||||||
807 | { | - | ||||||||||||||||||||||||
808 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
809 | if (d->tabKeyNavigation
| 0 | ||||||||||||||||||||||||
810 | QKeyEvent event(QEvent::KeyPress, next ? Qt::Key_Tab : Qt::Key_Backtab, Qt::NoModifier); | - | ||||||||||||||||||||||||
811 | keyPressEvent(&event); | - | ||||||||||||||||||||||||
812 | if (event.isAccepted()
| 0 | ||||||||||||||||||||||||
813 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
814 | } never executed: end of block | 0 | ||||||||||||||||||||||||
815 | return never executed: QAbstractScrollArea::focusNextPrevChild(next);return QAbstractScrollArea::focusNextPrevChild(next); never executed: return QAbstractScrollArea::focusNextPrevChild(next); | 0 | ||||||||||||||||||||||||
816 | } | - | ||||||||||||||||||||||||
817 | - | |||||||||||||||||||||||||
818 | - | |||||||||||||||||||||||||
819 | - | |||||||||||||||||||||||||
820 | - | |||||||||||||||||||||||||
821 | bool QAbstractItemView::event(QEvent *event) | - | ||||||||||||||||||||||||
822 | { | - | ||||||||||||||||||||||||
823 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
824 | switch (event->type()) { | - | ||||||||||||||||||||||||
825 | case never executed: QEvent::Paint:case QEvent::Paint: never executed: case QEvent::Paint: | 0 | ||||||||||||||||||||||||
826 | - | |||||||||||||||||||||||||
827 | - | |||||||||||||||||||||||||
828 | d->executePostedLayout(); | - | ||||||||||||||||||||||||
829 | break; never executed: break; | 0 | ||||||||||||||||||||||||
830 | case never executed: QEvent::Show:case QEvent::Show: never executed: case QEvent::Show: | 0 | ||||||||||||||||||||||||
831 | d->executePostedLayout(); | - | ||||||||||||||||||||||||
832 | if (d->shouldScrollToCurrentOnShow
| 0 | ||||||||||||||||||||||||
833 | d->shouldScrollToCurrentOnShow = false; | - | ||||||||||||||||||||||||
834 | const QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||
835 | if (current.isValid()
| 0 | ||||||||||||||||||||||||
836 | scrollTo(current); never executed: scrollTo(current); | 0 | ||||||||||||||||||||||||
837 | } never executed: end of block | 0 | ||||||||||||||||||||||||
838 | break; never executed: break; | 0 | ||||||||||||||||||||||||
839 | case never executed: QEvent::LocaleChange:case QEvent::LocaleChange: never executed: case QEvent::LocaleChange: | 0 | ||||||||||||||||||||||||
840 | viewport()->update(); | - | ||||||||||||||||||||||||
841 | break; never executed: break; | 0 | ||||||||||||||||||||||||
842 | case never executed: QEvent::LayoutDirectionChange:case QEvent::LayoutDirectionChange: never executed: case QEvent::LayoutDirectionChange: | 0 | ||||||||||||||||||||||||
843 | case never executed: QEvent::ApplicationLayoutDirectionChange:case QEvent::ApplicationLayoutDirectionChange: never executed: case QEvent::ApplicationLayoutDirectionChange: | 0 | ||||||||||||||||||||||||
844 | updateGeometries(); | - | ||||||||||||||||||||||||
845 | break; never executed: break; | 0 | ||||||||||||||||||||||||
846 | case never executed: QEvent::StyleChange:case QEvent::StyleChange: never executed: case QEvent::StyleChange: | 0 | ||||||||||||||||||||||||
847 | doItemsLayout(); | - | ||||||||||||||||||||||||
848 | break; never executed: break; | 0 | ||||||||||||||||||||||||
849 | case never executed: QEvent::FocusOut:case QEvent::FocusOut: never executed: case QEvent::FocusOut: | 0 | ||||||||||||||||||||||||
850 | d->checkPersistentEditorFocus(); | - | ||||||||||||||||||||||||
851 | break; never executed: break; | 0 | ||||||||||||||||||||||||
852 | case never executed: QEvent::FontChange:case QEvent::FontChange: never executed: case QEvent::FontChange: | 0 | ||||||||||||||||||||||||
853 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
854 | break; never executed: break; | 0 | ||||||||||||||||||||||||
855 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
856 | break; never executed: break; | 0 | ||||||||||||||||||||||||
857 | } | - | ||||||||||||||||||||||||
858 | return never executed: QAbstractScrollArea::event(event);return QAbstractScrollArea::event(event); never executed: return QAbstractScrollArea::event(event); | 0 | ||||||||||||||||||||||||
859 | } | - | ||||||||||||||||||||||||
860 | bool QAbstractItemView::viewportEvent(QEvent *event) | - | ||||||||||||||||||||||||
861 | { | - | ||||||||||||||||||||||||
862 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
863 | switch (event->type()) { | - | ||||||||||||||||||||||||
864 | case never executed: QEvent::HoverMove:case QEvent::HoverMove: never executed: case QEvent::HoverMove: | 0 | ||||||||||||||||||||||||
865 | case never executed: QEvent::HoverEnter:case QEvent::HoverEnter: never executed: case QEvent::HoverEnter: | 0 | ||||||||||||||||||||||||
866 | d->setHoverIndex(indexAt(static_cast<QHoverEvent*>(event)->pos())); | - | ||||||||||||||||||||||||
867 | break; never executed: break; | 0 | ||||||||||||||||||||||||
868 | case never executed: QEvent::HoverLeave:case QEvent::HoverLeave: never executed: case QEvent::HoverLeave: | 0 | ||||||||||||||||||||||||
869 | d->setHoverIndex(QModelIndex()); | - | ||||||||||||||||||||||||
870 | break; never executed: break; | 0 | ||||||||||||||||||||||||
871 | case never executed: QEvent::Enter:case QEvent::Enter: never executed: case QEvent::Enter: | 0 | ||||||||||||||||||||||||
872 | d->viewportEnteredNeeded = true; | - | ||||||||||||||||||||||||
873 | break; never executed: break; | 0 | ||||||||||||||||||||||||
874 | case never executed: QEvent::Leave:case QEvent::Leave: never executed: case QEvent::Leave: | 0 | ||||||||||||||||||||||||
875 | - | |||||||||||||||||||||||||
876 | if (d->shouldClearStatusTip
| 0 | ||||||||||||||||||||||||
877 | QString empty; | - | ||||||||||||||||||||||||
878 | QStatusTipEvent tip(empty); | - | ||||||||||||||||||||||||
879 | QApplication::sendEvent(d->parent, &tip); | - | ||||||||||||||||||||||||
880 | d->shouldClearStatusTip = false; | - | ||||||||||||||||||||||||
881 | } never executed: end of block | 0 | ||||||||||||||||||||||||
882 | - | |||||||||||||||||||||||||
883 | d->enteredIndex = QModelIndex(); | - | ||||||||||||||||||||||||
884 | break; never executed: break; | 0 | ||||||||||||||||||||||||
885 | case never executed: QEvent::ToolTip:case QEvent::ToolTip: never executed: case QEvent::ToolTip: | 0 | ||||||||||||||||||||||||
886 | case never executed: QEvent::QueryWhatsThis:case QEvent::QueryWhatsThis: never executed: case QEvent::QueryWhatsThis: | 0 | ||||||||||||||||||||||||
887 | case never executed: QEvent::WhatsThis:case QEvent::WhatsThis: never executed: {case QEvent::WhatsThis: | 0 | ||||||||||||||||||||||||
888 | QHelpEvent *he = static_cast<QHelpEvent*>(event); | - | ||||||||||||||||||||||||
889 | const QModelIndex index = indexAt(he->pos()); | - | ||||||||||||||||||||||||
890 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||
891 | option.rect = visualRect(index); | - | ||||||||||||||||||||||||
892 | option.state |= (index == currentIndex()
| 0 | ||||||||||||||||||||||||
893 | - | |||||||||||||||||||||||||
894 | QAbstractItemDelegate *delegate = d->delegateForIndex(index); | - | ||||||||||||||||||||||||
895 | if (!delegate
| 0 | ||||||||||||||||||||||||
896 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
897 | 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 | ||||||||||||||||||||||||
898 | } | - | ||||||||||||||||||||||||
899 | case never executed: QEvent::FontChange:case QEvent::FontChange: never executed: case QEvent::FontChange: | 0 | ||||||||||||||||||||||||
900 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
901 | break; never executed: break; | 0 | ||||||||||||||||||||||||
902 | case never executed: QEvent::WindowActivate:case QEvent::WindowActivate: never executed: case QEvent::WindowActivate: | 0 | ||||||||||||||||||||||||
903 | case never executed: QEvent::WindowDeactivate:case QEvent::WindowDeactivate: never executed: case QEvent::WindowDeactivate: | 0 | ||||||||||||||||||||||||
904 | d->viewport->update(); | - | ||||||||||||||||||||||||
905 | break; never executed: break; | 0 | ||||||||||||||||||||||||
906 | case never executed: QEvent::ScrollPrepare:case QEvent::ScrollPrepare: never executed: case QEvent::ScrollPrepare: | 0 | ||||||||||||||||||||||||
907 | executeDelayedItemsLayout(); | - | ||||||||||||||||||||||||
908 | - | |||||||||||||||||||||||||
909 | connect(QScroller::scroller(d->viewport), qFlagLocation("2""stateChanged(QScroller::State)" "\0" __FILE__ ":" "1689"), this, qFlagLocation("1""_q_scrollerStateChanged()" "\0" __FILE__ ":" "1689"), Qt::UniqueConnection); | - | ||||||||||||||||||||||||
910 | - | |||||||||||||||||||||||||
911 | break; never executed: break; | 0 | ||||||||||||||||||||||||
912 | - | |||||||||||||||||||||||||
913 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
914 | break; never executed: break; | 0 | ||||||||||||||||||||||||
915 | } | - | ||||||||||||||||||||||||
916 | return never executed: QAbstractScrollArea::viewportEvent(event);return QAbstractScrollArea::viewportEvent(event); never executed: return QAbstractScrollArea::viewportEvent(event); | 0 | ||||||||||||||||||||||||
917 | } | - | ||||||||||||||||||||||||
918 | - | |||||||||||||||||||||||||
919 | - | |||||||||||||||||||||||||
920 | - | |||||||||||||||||||||||||
921 | - | |||||||||||||||||||||||||
922 | - | |||||||||||||||||||||||||
923 | - | |||||||||||||||||||||||||
924 | void QAbstractItemView::mousePressEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
925 | { | - | ||||||||||||||||||||||||
926 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
927 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||
928 | QPoint pos = event->pos(); | - | ||||||||||||||||||||||||
929 | QPersistentModelIndex index = indexAt(pos); | - | ||||||||||||||||||||||||
930 | - | |||||||||||||||||||||||||
931 | if (!d->selectionModel
| 0 | ||||||||||||||||||||||||
932 | || (d->state == EditingState
| 0 | ||||||||||||||||||||||||
933 | return; never executed: return; | 0 | ||||||||||||||||||||||||
934 | - | |||||||||||||||||||||||||
935 | d->pressedAlreadySelected = d->selectionModel->isSelected(index); | - | ||||||||||||||||||||||||
936 | d->pressedIndex = index; | - | ||||||||||||||||||||||||
937 | d->pressedModifiers = event->modifiers(); | - | ||||||||||||||||||||||||
938 | QItemSelectionModel::SelectionFlags command = selectionCommand(index, event); | - | ||||||||||||||||||||||||
939 | d->noSelectionOnMousePress = command == QItemSelectionModel::NoUpdate
| 0 | ||||||||||||||||||||||||
940 | QPoint offset = d->offset(); | - | ||||||||||||||||||||||||
941 | if ((
| 0 | ||||||||||||||||||||||||
942 | d->pressedPosition = pos + offset; | - | ||||||||||||||||||||||||
943 | d->currentSelectionStartIndex = index; | - | ||||||||||||||||||||||||
944 | } never executed: end of block | 0 | ||||||||||||||||||||||||
945 | else if (!d->currentSelectionStartIndex.isValid()
| 0 | ||||||||||||||||||||||||
946 | d->currentSelectionStartIndex = currentIndex(); never executed: d->currentSelectionStartIndex = currentIndex(); | 0 | ||||||||||||||||||||||||
947 | - | |||||||||||||||||||||||||
948 | if (edit(index, NoEditTriggers, event)
| 0 | ||||||||||||||||||||||||
949 | return; never executed: return; | 0 | ||||||||||||||||||||||||
950 | - | |||||||||||||||||||||||||
951 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
952 | - | |||||||||||||||||||||||||
953 | - | |||||||||||||||||||||||||
954 | bool autoScroll = d->autoScroll; | - | ||||||||||||||||||||||||
955 | d->autoScroll = false; | - | ||||||||||||||||||||||||
956 | d->selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); | - | ||||||||||||||||||||||||
957 | d->autoScroll = autoScroll; | - | ||||||||||||||||||||||||
958 | if (command.testFlag(QItemSelectionModel::Toggle)
| 0 | ||||||||||||||||||||||||
959 | command &= ~QItemSelectionModel::Toggle; | - | ||||||||||||||||||||||||
960 | d->ctrlDragSelectionFlag = d->selectionModel->isSelected(index)
| 0 | ||||||||||||||||||||||||
961 | command |= d->ctrlDragSelectionFlag; | - | ||||||||||||||||||||||||
962 | } never executed: end of block | 0 | ||||||||||||||||||||||||
963 | - | |||||||||||||||||||||||||
964 | if ((
| 0 | ||||||||||||||||||||||||
965 | setSelection(QRect(pos, QSize(1, 1)), command); | - | ||||||||||||||||||||||||
966 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
967 | QRect rect(visualRect(d->currentSelectionStartIndex).center(), pos); | - | ||||||||||||||||||||||||
968 | setSelection(rect, command); | - | ||||||||||||||||||||||||
969 | } never executed: end of block | 0 | ||||||||||||||||||||||||
970 | - | |||||||||||||||||||||||||
971 | - | |||||||||||||||||||||||||
972 | pressed(index); | - | ||||||||||||||||||||||||
973 | if (d->autoScroll
| 0 | ||||||||||||||||||||||||
974 | - | |||||||||||||||||||||||||
975 | - | |||||||||||||||||||||||||
976 | d->delayedAutoScroll.start(QApplication::doubleClickInterval()+100, this); | - | ||||||||||||||||||||||||
977 | } never executed: end of block | 0 | ||||||||||||||||||||||||
978 | - | |||||||||||||||||||||||||
979 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
980 | - | |||||||||||||||||||||||||
981 | d->selectionModel->select(QModelIndex(), QItemSelectionModel::Select); | - | ||||||||||||||||||||||||
982 | } never executed: end of block | 0 | ||||||||||||||||||||||||
983 | } | - | ||||||||||||||||||||||||
984 | - | |||||||||||||||||||||||||
985 | - | |||||||||||||||||||||||||
986 | - | |||||||||||||||||||||||||
987 | - | |||||||||||||||||||||||||
988 | - | |||||||||||||||||||||||||
989 | - | |||||||||||||||||||||||||
990 | void QAbstractItemView::mouseMoveEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
991 | { | - | ||||||||||||||||||||||||
992 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
993 | QPoint topLeft; | - | ||||||||||||||||||||||||
994 | QPoint bottomRight = event->pos(); | - | ||||||||||||||||||||||||
995 | - | |||||||||||||||||||||||||
996 | if (state() == ExpandingState
| 0 | ||||||||||||||||||||||||
997 | return; never executed: return; | 0 | ||||||||||||||||||||||||
998 | - | |||||||||||||||||||||||||
999 | - | |||||||||||||||||||||||||
1000 | if (state() == DraggingState
| 0 | ||||||||||||||||||||||||
1001 | topLeft = d->pressedPosition - d->offset(); | - | ||||||||||||||||||||||||
1002 | if ((
| 0 | ||||||||||||||||||||||||
1003 | d->pressedIndex = QModelIndex(); | - | ||||||||||||||||||||||||
1004 | startDrag(d->model->supportedDragActions()); | - | ||||||||||||||||||||||||
1005 | setState(NoState); | - | ||||||||||||||||||||||||
1006 | stopAutoScroll(); | - | ||||||||||||||||||||||||
1007 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1008 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1009 | } | - | ||||||||||||||||||||||||
1010 | - | |||||||||||||||||||||||||
1011 | - | |||||||||||||||||||||||||
1012 | QPersistentModelIndex index = indexAt(bottomRight); | - | ||||||||||||||||||||||||
1013 | QModelIndex buddy = d->model->buddy(d->pressedIndex); | - | ||||||||||||||||||||||||
1014 | if ((state() == EditingState
| 0 | ||||||||||||||||||||||||
1015 | || edit(index, NoEditTriggers, event)
| 0 | ||||||||||||||||||||||||
1016 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1017 | - | |||||||||||||||||||||||||
1018 | if (d->selectionMode != SingleSelection
| 0 | ||||||||||||||||||||||||
1019 | topLeft = d->pressedPosition - d->offset(); never executed: topLeft = d->pressedPosition - d->offset(); | 0 | ||||||||||||||||||||||||
1020 | else | - | ||||||||||||||||||||||||
1021 | topLeft = bottomRight; never executed: topLeft = bottomRight; | 0 | ||||||||||||||||||||||||
1022 | - | |||||||||||||||||||||||||
1023 | d->checkMouseMove(index); | - | ||||||||||||||||||||||||
1024 | - | |||||||||||||||||||||||||
1025 | - | |||||||||||||||||||||||||
1026 | if (d->pressedIndex.isValid()
| 0 | ||||||||||||||||||||||||
1027 | && d->dragEnabled
| 0 | ||||||||||||||||||||||||
1028 | && (
| 0 | ||||||||||||||||||||||||
1029 | && (
| 0 | ||||||||||||||||||||||||
1030 | && !d->selectedDraggableIndexes().isEmpty()
| 0 | ||||||||||||||||||||||||
1031 | setState(DraggingState); | - | ||||||||||||||||||||||||
1032 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1033 | } | - | ||||||||||||||||||||||||
1034 | - | |||||||||||||||||||||||||
1035 | - | |||||||||||||||||||||||||
1036 | if ((
| 0 | ||||||||||||||||||||||||
1037 | setState(DragSelectingState); | - | ||||||||||||||||||||||||
1038 | QItemSelectionModel::SelectionFlags command = selectionCommand(index, event); | - | ||||||||||||||||||||||||
1039 | if (d->ctrlDragSelectionFlag != QItemSelectionModel::NoUpdate
| 0 | ||||||||||||||||||||||||
1040 | command &= ~QItemSelectionModel::Toggle; | - | ||||||||||||||||||||||||
1041 | command |= d->ctrlDragSelectionFlag; | - | ||||||||||||||||||||||||
1042 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1043 | - | |||||||||||||||||||||||||
1044 | - | |||||||||||||||||||||||||
1045 | QRect selectionRect = QRect(topLeft, bottomRight); | - | ||||||||||||||||||||||||
1046 | setSelection(selectionRect, command); | - | ||||||||||||||||||||||||
1047 | - | |||||||||||||||||||||||||
1048 | - | |||||||||||||||||||||||||
1049 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
1050 | && (
| 0 | ||||||||||||||||||||||||
1051 | && d->isIndexEnabled(index)
| 0 | ||||||||||||||||||||||||
1052 | d->selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); never executed: d->selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); | 0 | ||||||||||||||||||||||||
1053 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1054 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1055 | void QAbstractItemView::mouseReleaseEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
1056 | { | - | ||||||||||||||||||||||||
1057 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1058 | - | |||||||||||||||||||||||||
1059 | QPoint pos = event->pos(); | - | ||||||||||||||||||||||||
1060 | QPersistentModelIndex index = indexAt(pos); | - | ||||||||||||||||||||||||
1061 | - | |||||||||||||||||||||||||
1062 | if (state() == EditingState
| 0 | ||||||||||||||||||||||||
1063 | if (d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||
1064 | && d->isIndexEnabled(index)
| 0 | ||||||||||||||||||||||||
1065 | && d->sendDelegateEvent(index, event)
| 0 | ||||||||||||||||||||||||
1066 | update(index); never executed: update(index); | 0 | ||||||||||||||||||||||||
1067 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1068 | } | - | ||||||||||||||||||||||||
1069 | - | |||||||||||||||||||||||||
1070 | bool click = (index == d->pressedIndex
| 0 | ||||||||||||||||||||||||
1071 | bool selectedClicked = click
| 0 | ||||||||||||||||||||||||
1072 | EditTrigger trigger = (selectedClicked
| 0 | ||||||||||||||||||||||||
1073 | bool edited = edit(index, trigger, event); | - | ||||||||||||||||||||||||
1074 | - | |||||||||||||||||||||||||
1075 | d->ctrlDragSelectionFlag = QItemSelectionModel::NoUpdate; | - | ||||||||||||||||||||||||
1076 | - | |||||||||||||||||||||||||
1077 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
1078 | d->noSelectionOnMousePress = false; | - | ||||||||||||||||||||||||
1079 | d->selectionModel->select(index, selectionCommand(index, event)); | - | ||||||||||||||||||||||||
1080 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1081 | - | |||||||||||||||||||||||||
1082 | setState(NoState); | - | ||||||||||||||||||||||||
1083 | - | |||||||||||||||||||||||||
1084 | if (click
| 0 | ||||||||||||||||||||||||
1085 | if (event->button() == Qt::LeftButton
| 0 | ||||||||||||||||||||||||
1086 | clicked(index); never executed: clicked(index); | 0 | ||||||||||||||||||||||||
1087 | if (edited
| 0 | ||||||||||||||||||||||||
1088 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1089 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||
1090 | if (d->pressedAlreadySelected
| 0 | ||||||||||||||||||||||||
1091 | option.state |= QStyle::State_Selected; never executed: option.state |= QStyle::State_Selected; | 0 | ||||||||||||||||||||||||
1092 | if ((
| 0 | ||||||||||||||||||||||||
1093 | && style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, &option, this)
| 0 | ||||||||||||||||||||||||
1094 | activated(index); never executed: activated(index); | 0 | ||||||||||||||||||||||||
1095 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1096 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1097 | - | |||||||||||||||||||||||||
1098 | - | |||||||||||||||||||||||||
1099 | - | |||||||||||||||||||||||||
1100 | - | |||||||||||||||||||||||||
1101 | - | |||||||||||||||||||||||||
1102 | - | |||||||||||||||||||||||||
1103 | void QAbstractItemView::mouseDoubleClickEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
1104 | { | - | ||||||||||||||||||||||||
1105 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1106 | - | |||||||||||||||||||||||||
1107 | QModelIndex index = indexAt(event->pos()); | - | ||||||||||||||||||||||||
1108 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
1109 | || !d->isIndexEnabled(index)
| 0 | ||||||||||||||||||||||||
1110 | || (
| 0 | ||||||||||||||||||||||||
1111 | QMouseEvent me(QEvent::MouseButtonPress, | - | ||||||||||||||||||||||||
1112 | event->localPos(), event->windowPos(), event->screenPos(), | - | ||||||||||||||||||||||||
1113 | event->button(), event->buttons(), event->modifiers(), event->source()); | - | ||||||||||||||||||||||||
1114 | mousePressEvent(&me); | - | ||||||||||||||||||||||||
1115 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1116 | } | - | ||||||||||||||||||||||||
1117 | - | |||||||||||||||||||||||||
1118 | QPersistentModelIndex persistent = index; | - | ||||||||||||||||||||||||
1119 | doubleClicked(persistent); | - | ||||||||||||||||||||||||
1120 | if ((
| 0 | ||||||||||||||||||||||||
1121 | && !style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, this)
| 0 | ||||||||||||||||||||||||
1122 | activated(persistent); never executed: activated(persistent); | 0 | ||||||||||||||||||||||||
1123 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1124 | void QAbstractItemView::dragEnterEvent(QDragEnterEvent *event) | - | ||||||||||||||||||||||||
1125 | { | - | ||||||||||||||||||||||||
1126 | if (dragDropMode() == InternalMove
| 0 | ||||||||||||||||||||||||
1127 | && (event->source() != this
| 0 | ||||||||||||||||||||||||
1128 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1129 | - | |||||||||||||||||||||||||
1130 | if (d_func()->canDrop(event)
| 0 | ||||||||||||||||||||||||
1131 | event->accept(); | - | ||||||||||||||||||||||||
1132 | setState(DraggingState); | - | ||||||||||||||||||||||||
1133 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1134 | event->ignore(); | - | ||||||||||||||||||||||||
1135 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1136 | } | - | ||||||||||||||||||||||||
1137 | void QAbstractItemView::dragMoveEvent(QDragMoveEvent *event) | - | ||||||||||||||||||||||||
1138 | { | - | ||||||||||||||||||||||||
1139 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1140 | if (dragDropMode() == InternalMove
| 0 | ||||||||||||||||||||||||
1141 | && (event->source() != this
| 0 | ||||||||||||||||||||||||
1142 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1143 | - | |||||||||||||||||||||||||
1144 | - | |||||||||||||||||||||||||
1145 | event->ignore(); | - | ||||||||||||||||||||||||
1146 | - | |||||||||||||||||||||||||
1147 | QModelIndex index = indexAt(event->pos()); | - | ||||||||||||||||||||||||
1148 | d->hover = index; | - | ||||||||||||||||||||||||
1149 | if (!d->droppingOnItself(event, index)
| 0 | ||||||||||||||||||||||||
1150 | && d->canDrop(event)
| 0 | ||||||||||||||||||||||||
1151 | - | |||||||||||||||||||||||||
1152 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
1153 | QRect rect = visualRect(index); | - | ||||||||||||||||||||||||
1154 | d->dropIndicatorPosition = d->position(event->pos(), rect, index); | - | ||||||||||||||||||||||||
1155 | switch (d->dropIndicatorPosition) { | - | ||||||||||||||||||||||||
1156 | case never executed: AboveItem:case AboveItem: never executed: case AboveItem: | 0 | ||||||||||||||||||||||||
1157 | if (d->isIndexDropEnabled(index.parent())
| 0 | ||||||||||||||||||||||||
1158 | d->dropIndicatorRect = QRect(rect.left(), rect.top(), rect.width(), 0); | - | ||||||||||||||||||||||||
1159 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1160 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1161 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1162 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1163 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1164 | case never executed: BelowItem:case BelowItem: never executed: case BelowItem: | 0 | ||||||||||||||||||||||||
1165 | if (d->isIndexDropEnabled(index.parent())
| 0 | ||||||||||||||||||||||||
1166 | d->dropIndicatorRect = QRect(rect.left(), rect.bottom(), rect.width(), 0); | - | ||||||||||||||||||||||||
1167 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1168 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1169 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1170 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1171 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1172 | case never executed: OnItem:case OnItem: never executed: case OnItem: | 0 | ||||||||||||||||||||||||
1173 | if (d->isIndexDropEnabled(index)
| 0 | ||||||||||||||||||||||||
1174 | d->dropIndicatorRect = rect; | - | ||||||||||||||||||||||||
1175 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1176 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1177 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1178 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1179 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1180 | case never executed: OnViewport:case OnViewport: never executed: case OnViewport: | 0 | ||||||||||||||||||||||||
1181 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1182 | if (d->isIndexDropEnabled(rootIndex())
| 0 | ||||||||||||||||||||||||
1183 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1184 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1185 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1186 | } | - | ||||||||||||||||||||||||
1187 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1188 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
1189 | d->dropIndicatorPosition = OnViewport; | - | ||||||||||||||||||||||||
1190 | if (d->isIndexDropEnabled(rootIndex())
| 0 | ||||||||||||||||||||||||
1191 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1192 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1193 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1194 | d->viewport->update(); | - | ||||||||||||||||||||||||
1195 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1196 | - | |||||||||||||||||||||||||
1197 | if (d->shouldAutoScroll(event->pos())
| 0 | ||||||||||||||||||||||||
1198 | startAutoScroll(); never executed: startAutoScroll(); | 0 | ||||||||||||||||||||||||
1199 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1200 | - | |||||||||||||||||||||||||
1201 | - | |||||||||||||||||||||||||
1202 | - | |||||||||||||||||||||||||
1203 | - | |||||||||||||||||||||||||
1204 | - | |||||||||||||||||||||||||
1205 | - | |||||||||||||||||||||||||
1206 | bool QAbstractItemViewPrivate::droppingOnItself(QDropEvent *event, const QModelIndex &index) | - | ||||||||||||||||||||||||
1207 | { | - | ||||||||||||||||||||||||
1208 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
1209 | Qt::DropAction dropAction = event->dropAction(); | - | ||||||||||||||||||||||||
1210 | if (q->dragDropMode() == QAbstractItemView::InternalMove
| 0 | ||||||||||||||||||||||||
1211 | dropAction = Qt::MoveAction; never executed: dropAction = Qt::MoveAction; | 0 | ||||||||||||||||||||||||
1212 | if (event->source() == q
| 0 | ||||||||||||||||||||||||
1213 | && event->possibleActions() & Qt::MoveAction
| 0 | ||||||||||||||||||||||||
1214 | && dropAction == Qt::MoveAction
| 0 | ||||||||||||||||||||||||
1215 | QModelIndexList selectedIndexes = q->selectedIndexes(); | - | ||||||||||||||||||||||||
1216 | QModelIndex child = index; | - | ||||||||||||||||||||||||
1217 | while (child.isValid()
| 0 | ||||||||||||||||||||||||
1218 | if (selectedIndexes.contains(child)
| 0 | ||||||||||||||||||||||||
1219 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1220 | child = child.parent(); | - | ||||||||||||||||||||||||
1221 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1222 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1223 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1224 | } | - | ||||||||||||||||||||||||
1225 | - | |||||||||||||||||||||||||
1226 | - | |||||||||||||||||||||||||
1227 | - | |||||||||||||||||||||||||
1228 | - | |||||||||||||||||||||||||
1229 | - | |||||||||||||||||||||||||
1230 | - | |||||||||||||||||||||||||
1231 | - | |||||||||||||||||||||||||
1232 | void QAbstractItemView::dragLeaveEvent(QDragLeaveEvent *) | - | ||||||||||||||||||||||||
1233 | { | - | ||||||||||||||||||||||||
1234 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1235 | stopAutoScroll(); | - | ||||||||||||||||||||||||
1236 | setState(NoState); | - | ||||||||||||||||||||||||
1237 | d->hover = QModelIndex(); | - | ||||||||||||||||||||||||
1238 | d->viewport->update(); | - | ||||||||||||||||||||||||
1239 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1240 | void QAbstractItemView::dropEvent(QDropEvent *event) | - | ||||||||||||||||||||||||
1241 | { | - | ||||||||||||||||||||||||
1242 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1243 | if (dragDropMode() == InternalMove
| 0 | ||||||||||||||||||||||||
1244 | if (event->source() != this
| 0 | ||||||||||||||||||||||||
1245 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1246 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1247 | - | |||||||||||||||||||||||||
1248 | QModelIndex index; | - | ||||||||||||||||||||||||
1249 | int col = -1; | - | ||||||||||||||||||||||||
1250 | int row = -1; | - | ||||||||||||||||||||||||
1251 | if (d->dropOn(event, &row, &col, &index)
| 0 | ||||||||||||||||||||||||
1252 | const Qt::DropAction action = dragDropMode() == InternalMove
| 0 | ||||||||||||||||||||||||
1253 | if (d->model->dropMimeData(event->mimeData(), action, row, col, index)
| 0 | ||||||||||||||||||||||||
1254 | if (action != event->dropAction()
| 0 | ||||||||||||||||||||||||
1255 | event->setDropAction(action); | - | ||||||||||||||||||||||||
1256 | event->accept(); | - | ||||||||||||||||||||||||
1257 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1258 | event->acceptProposedAction(); | - | ||||||||||||||||||||||||
1259 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1260 | } | - | ||||||||||||||||||||||||
1261 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1262 | stopAutoScroll(); | - | ||||||||||||||||||||||||
1263 | setState(NoState); | - | ||||||||||||||||||||||||
1264 | d->viewport->update(); | - | ||||||||||||||||||||||||
1265 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1266 | bool QAbstractItemViewPrivate::dropOn(QDropEvent *event, int *dropRow, int *dropCol, QModelIndex *dropIndex) | - | ||||||||||||||||||||||||
1267 | { | - | ||||||||||||||||||||||||
1268 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
1269 | if (event->isAccepted()
| 0 | ||||||||||||||||||||||||
1270 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1271 | - | |||||||||||||||||||||||||
1272 | QModelIndex index; | - | ||||||||||||||||||||||||
1273 | - | |||||||||||||||||||||||||
1274 | if (viewport->rect().contains(event->pos())
| 0 | ||||||||||||||||||||||||
1275 | index = q->indexAt(event->pos()); | - | ||||||||||||||||||||||||
1276 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
1277 | index = root; never executed: index = root; | 0 | ||||||||||||||||||||||||
1278 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1279 | - | |||||||||||||||||||||||||
1280 | - | |||||||||||||||||||||||||
1281 | if (model->supportedDropActions() & event->dropAction()
| 0 | ||||||||||||||||||||||||
1282 | int row = -1; | - | ||||||||||||||||||||||||
1283 | int col = -1; | - | ||||||||||||||||||||||||
1284 | if (index != root
| 0 | ||||||||||||||||||||||||
1285 | dropIndicatorPosition = position(event->pos(), q->visualRect(index), index); | - | ||||||||||||||||||||||||
1286 | switch (dropIndicatorPosition) { | - | ||||||||||||||||||||||||
1287 | case never executed: QAbstractItemView::AboveItem:case QAbstractItemView::AboveItem: never executed: case QAbstractItemView::AboveItem: | 0 | ||||||||||||||||||||||||
1288 | row = index.row(); | - | ||||||||||||||||||||||||
1289 | col = index.column(); | - | ||||||||||||||||||||||||
1290 | index = index.parent(); | - | ||||||||||||||||||||||||
1291 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1292 | case never executed: QAbstractItemView::BelowItem:case QAbstractItemView::BelowItem: never executed: case QAbstractItemView::BelowItem: | 0 | ||||||||||||||||||||||||
1293 | row = index.row() + 1; | - | ||||||||||||||||||||||||
1294 | col = index.column(); | - | ||||||||||||||||||||||||
1295 | index = index.parent(); | - | ||||||||||||||||||||||||
1296 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1297 | case never executed: QAbstractItemView::OnItem:case QAbstractItemView::OnItem: never executed: case QAbstractItemView::OnItem: | 0 | ||||||||||||||||||||||||
1298 | case never executed: QAbstractItemView::OnViewport:case QAbstractItemView::OnViewport: never executed: case QAbstractItemView::OnViewport: | 0 | ||||||||||||||||||||||||
1299 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1300 | } | - | ||||||||||||||||||||||||
1301 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1302 | dropIndicatorPosition = QAbstractItemView::OnViewport; | - | ||||||||||||||||||||||||
1303 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1304 | *dropIndex = index; | - | ||||||||||||||||||||||||
1305 | *dropRow = row; | - | ||||||||||||||||||||||||
1306 | *dropCol = col; | - | ||||||||||||||||||||||||
1307 | if (!droppingOnItself(event, index)
| 0 | ||||||||||||||||||||||||
1308 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1309 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1310 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1311 | } | - | ||||||||||||||||||||||||
1312 | - | |||||||||||||||||||||||||
1313 | QAbstractItemView::DropIndicatorPosition | - | ||||||||||||||||||||||||
1314 | QAbstractItemViewPrivate::position(const QPoint &pos, const QRect &rect, const QModelIndex &index) const | - | ||||||||||||||||||||||||
1315 | { | - | ||||||||||||||||||||||||
1316 | QAbstractItemView::DropIndicatorPosition r = QAbstractItemView::OnViewport; | - | ||||||||||||||||||||||||
1317 | if (!overwrite
| 0 | ||||||||||||||||||||||||
1318 | const int margin = 2; | - | ||||||||||||||||||||||||
1319 | if (pos.y() - rect.top() < margin
| 0 | ||||||||||||||||||||||||
1320 | r = QAbstractItemView::AboveItem; | - | ||||||||||||||||||||||||
1321 | } never executed: else if (rect.bottom() - pos.y() < marginend of block
| 0 | ||||||||||||||||||||||||
1322 | r = QAbstractItemView::BelowItem; | - | ||||||||||||||||||||||||
1323 | } never executed: else if (rect.contains(pos, true)end of block
| 0 | ||||||||||||||||||||||||
1324 | r = QAbstractItemView::OnItem; | - | ||||||||||||||||||||||||
1325 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1326 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1327 | QRect touchingRect = rect; | - | ||||||||||||||||||||||||
1328 | touchingRect.adjust(-1, -1, 1, 1); | - | ||||||||||||||||||||||||
1329 | if (touchingRect.contains(pos, false)
| 0 | ||||||||||||||||||||||||
1330 | r = QAbstractItemView::OnItem; | - | ||||||||||||||||||||||||
1331 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1332 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1333 | - | |||||||||||||||||||||||||
1334 | if (r == QAbstractItemView::OnItem
| 0 | ||||||||||||||||||||||||
1335 | r = pos.y() < rect.center().y()
never executed: r = pos.y() < rect.center().y() ? QAbstractItemView::AboveItem : QAbstractItemView::BelowItem; | 0 | ||||||||||||||||||||||||
1336 | - | |||||||||||||||||||||||||
1337 | return never executed: r;return r; never executed: return r; | 0 | ||||||||||||||||||||||||
1338 | } | - | ||||||||||||||||||||||||
1339 | void QAbstractItemView::focusInEvent(QFocusEvent *event) | - | ||||||||||||||||||||||||
1340 | { | - | ||||||||||||||||||||||||
1341 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1342 | QAbstractScrollArea::focusInEvent(event); | - | ||||||||||||||||||||||||
1343 | - | |||||||||||||||||||||||||
1344 | const QItemSelectionModel* model = selectionModel(); | - | ||||||||||||||||||||||||
1345 | const bool currentIndexValid = currentIndex().isValid(); | - | ||||||||||||||||||||||||
1346 | - | |||||||||||||||||||||||||
1347 | if (model
| 0 | ||||||||||||||||||||||||
1348 | && !d->currentIndexSet
| 0 | ||||||||||||||||||||||||
1349 | && !currentIndexValid
| 0 | ||||||||||||||||||||||||
1350 | bool autoScroll = d->autoScroll; | - | ||||||||||||||||||||||||
1351 | d->autoScroll = false; | - | ||||||||||||||||||||||||
1352 | QModelIndex index = moveCursor(MoveNext, Qt::NoModifier); | - | ||||||||||||||||||||||||
1353 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
1354 | selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate); never executed: selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate); | 0 | ||||||||||||||||||||||||
1355 | d->autoScroll = autoScroll; | - | ||||||||||||||||||||||||
1356 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1357 | - | |||||||||||||||||||||||||
1358 | if (model
| 0 | ||||||||||||||||||||||||
1359 | if (currentIndex().flags() != Qt::ItemIsEditable
| 0 | ||||||||||||||||||||||||
1360 | setAttribute(Qt::WA_InputMethodEnabled, false); never executed: setAttribute(Qt::WA_InputMethodEnabled, false); | 0 | ||||||||||||||||||||||||
1361 | else | - | ||||||||||||||||||||||||
1362 | setAttribute(Qt::WA_InputMethodEnabled); never executed: setAttribute(Qt::WA_InputMethodEnabled); | 0 | ||||||||||||||||||||||||
1363 | } | - | ||||||||||||||||||||||||
1364 | - | |||||||||||||||||||||||||
1365 | if (!currentIndexValid
| 0 | ||||||||||||||||||||||||
1366 | setAttribute(Qt::WA_InputMethodEnabled, false); never executed: setAttribute(Qt::WA_InputMethodEnabled, false); | 0 | ||||||||||||||||||||||||
1367 | - | |||||||||||||||||||||||||
1368 | d->viewport->update(); | - | ||||||||||||||||||||||||
1369 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1370 | - | |||||||||||||||||||||||||
1371 | - | |||||||||||||||||||||||||
1372 | - | |||||||||||||||||||||||||
1373 | - | |||||||||||||||||||||||||
1374 | - | |||||||||||||||||||||||||
1375 | - | |||||||||||||||||||||||||
1376 | - | |||||||||||||||||||||||||
1377 | void QAbstractItemView::focusOutEvent(QFocusEvent *event) | - | ||||||||||||||||||||||||
1378 | { | - | ||||||||||||||||||||||||
1379 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1380 | QAbstractScrollArea::focusOutEvent(event); | - | ||||||||||||||||||||||||
1381 | d->viewport->update(); | - | ||||||||||||||||||||||||
1382 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1383 | void QAbstractItemView::keyPressEvent(QKeyEvent *event) | - | ||||||||||||||||||||||||
1384 | { | - | ||||||||||||||||||||||||
1385 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1386 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||
1387 | if (event == QKeySequence::Copy
| 0 | ||||||||||||||||||||||||
1388 | QVariant variant; | - | ||||||||||||||||||||||||
1389 | if (d->model
| 0 | ||||||||||||||||||||||||
1390 | variant = d->model->data(currentIndex(), Qt::DisplayRole); never executed: variant = d->model->data(currentIndex(), Qt::DisplayRole); | 0 | ||||||||||||||||||||||||
1391 | if (variant.type() == QVariant::String
| 0 | ||||||||||||||||||||||||
1392 | QApplication::clipboard()->setText(variant.toString()); never executed: QApplication::clipboard()->setText(variant.toString()); | 0 | ||||||||||||||||||||||||
1393 | event->accept(); | - | ||||||||||||||||||||||||
1394 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1395 | - | |||||||||||||||||||||||||
1396 | - | |||||||||||||||||||||||||
1397 | QPersistentModelIndex newCurrent; | - | ||||||||||||||||||||||||
1398 | d->moveCursorUpdatedView = false; | - | ||||||||||||||||||||||||
1399 | switch (event->key()) { | - | ||||||||||||||||||||||||
1400 | case never executed: Qt::Key_Down:case Qt::Key_Down: never executed: case Qt::Key_Down: | 0 | ||||||||||||||||||||||||
1401 | newCurrent = moveCursor(MoveDown, event->modifiers()); | - | ||||||||||||||||||||||||
1402 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1403 | case never executed: Qt::Key_Up:case Qt::Key_Up: never executed: case Qt::Key_Up: | 0 | ||||||||||||||||||||||||
1404 | newCurrent = moveCursor(MoveUp, event->modifiers()); | - | ||||||||||||||||||||||||
1405 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1406 | case never executed: Qt::Key_Left:case Qt::Key_Left: never executed: case Qt::Key_Left: | 0 | ||||||||||||||||||||||||
1407 | newCurrent = moveCursor(MoveLeft, event->modifiers()); | - | ||||||||||||||||||||||||
1408 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1409 | case never executed: Qt::Key_Right:case Qt::Key_Right: never executed: case Qt::Key_Right: | 0 | ||||||||||||||||||||||||
1410 | newCurrent = moveCursor(MoveRight, event->modifiers()); | - | ||||||||||||||||||||||||
1411 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1412 | case never executed: Qt::Key_Home:case Qt::Key_Home: never executed: case Qt::Key_Home: | 0 | ||||||||||||||||||||||||
1413 | newCurrent = moveCursor(MoveHome, event->modifiers()); | - | ||||||||||||||||||||||||
1414 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1415 | case never executed: Qt::Key_End:case Qt::Key_End: never executed: case Qt::Key_End: | 0 | ||||||||||||||||||||||||
1416 | newCurrent = moveCursor(MoveEnd, event->modifiers()); | - | ||||||||||||||||||||||||
1417 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1418 | case never executed: Qt::Key_PageUp:case Qt::Key_PageUp: never executed: case Qt::Key_PageUp: | 0 | ||||||||||||||||||||||||
1419 | newCurrent = moveCursor(MovePageUp, event->modifiers()); | - | ||||||||||||||||||||||||
1420 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1421 | case never executed: Qt::Key_PageDown:case Qt::Key_PageDown: never executed: case Qt::Key_PageDown: | 0 | ||||||||||||||||||||||||
1422 | newCurrent = moveCursor(MovePageDown, event->modifiers()); | - | ||||||||||||||||||||||||
1423 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1424 | case never executed: Qt::Key_Tab:case Qt::Key_Tab: never executed: case Qt::Key_Tab: | 0 | ||||||||||||||||||||||||
1425 | if (d->tabKeyNavigation
| 0 | ||||||||||||||||||||||||
1426 | newCurrent = moveCursor(MoveNext, event->modifiers()); never executed: newCurrent = moveCursor(MoveNext, event->modifiers()); | 0 | ||||||||||||||||||||||||
1427 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1428 | case never executed: Qt::Key_Backtab:case Qt::Key_Backtab: never executed: case Qt::Key_Backtab: | 0 | ||||||||||||||||||||||||
1429 | if (d->tabKeyNavigation
| 0 | ||||||||||||||||||||||||
1430 | newCurrent = moveCursor(MovePrevious, event->modifiers()); never executed: newCurrent = moveCursor(MovePrevious, event->modifiers()); | 0 | ||||||||||||||||||||||||
1431 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1432 | } | - | ||||||||||||||||||||||||
1433 | - | |||||||||||||||||||||||||
1434 | QPersistentModelIndex oldCurrent = currentIndex(); | - | ||||||||||||||||||||||||
1435 | if (newCurrent != oldCurrent
| 0 | ||||||||||||||||||||||||
1436 | if (!hasFocus()
| 0 | ||||||||||||||||||||||||
1437 | setFocus(); never executed: setFocus(); | 0 | ||||||||||||||||||||||||
1438 | QItemSelectionModel::SelectionFlags command = selectionCommand(newCurrent, event); | - | ||||||||||||||||||||||||
1439 | if (command != QItemSelectionModel::NoUpdate
| 0 | ||||||||||||||||||||||||
1440 | || style()->styleHint(QStyle::SH_ItemView_MovementWithoutUpdatingSelection, 0, this)
| 0 | ||||||||||||||||||||||||
1441 | - | |||||||||||||||||||||||||
1442 | if (command & QItemSelectionModel::Current
| 0 | ||||||||||||||||||||||||
1443 | d->selectionModel->setCurrentIndex(newCurrent, QItemSelectionModel::NoUpdate); | - | ||||||||||||||||||||||||
1444 | if (!d->currentSelectionStartIndex.isValid()
| 0 | ||||||||||||||||||||||||
1445 | d->currentSelectionStartIndex = oldCurrent; never executed: d->currentSelectionStartIndex = oldCurrent; | 0 | ||||||||||||||||||||||||
1446 | QRect rect(visualRect(d->currentSelectionStartIndex).center(), visualRect(newCurrent).center()); | - | ||||||||||||||||||||||||
1447 | setSelection(rect, command); | - | ||||||||||||||||||||||||
1448 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1449 | d->selectionModel->setCurrentIndex(newCurrent, command); | - | ||||||||||||||||||||||||
1450 | d->currentSelectionStartIndex = newCurrent; | - | ||||||||||||||||||||||||
1451 | if (newCurrent.isValid()
| 0 | ||||||||||||||||||||||||
1452 | - | |||||||||||||||||||||||||
1453 | QRect rect(visualRect(newCurrent).center(), QSize(1, 1)); | - | ||||||||||||||||||||||||
1454 | setSelection(rect, command); | - | ||||||||||||||||||||||||
1455 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1456 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1457 | event->accept(); | - | ||||||||||||||||||||||||
1458 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1459 | } | - | ||||||||||||||||||||||||
1460 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1461 | - | |||||||||||||||||||||||||
1462 | switch (event->key()) { | - | ||||||||||||||||||||||||
1463 | - | |||||||||||||||||||||||||
1464 | case never executed: Qt::Key_Down:case Qt::Key_Down: never executed: case Qt::Key_Down: | 0 | ||||||||||||||||||||||||
1465 | case never executed: Qt::Key_Up:case Qt::Key_Up: never executed: case Qt::Key_Up: | 0 | ||||||||||||||||||||||||
1466 | - | |||||||||||||||||||||||||
1467 | - | |||||||||||||||||||||||||
1468 | - | |||||||||||||||||||||||||
1469 | - | |||||||||||||||||||||||||
1470 | - | |||||||||||||||||||||||||
1471 | - | |||||||||||||||||||||||||
1472 | case never executed: Qt::Key_Left:case Qt::Key_Left: never executed: case Qt::Key_Left: | 0 | ||||||||||||||||||||||||
1473 | case never executed: Qt::Key_Right:case Qt::Key_Right: never executed: case Qt::Key_Right: | 0 | ||||||||||||||||||||||||
1474 | case never executed: Qt::Key_Home:case Qt::Key_Home: never executed: case Qt::Key_Home: | 0 | ||||||||||||||||||||||||
1475 | case never executed: Qt::Key_End:case Qt::Key_End: never executed: case Qt::Key_End: | 0 | ||||||||||||||||||||||||
1476 | case never executed: Qt::Key_PageUp:case Qt::Key_PageUp: never executed: case Qt::Key_PageUp: | 0 | ||||||||||||||||||||||||
1477 | case never executed: Qt::Key_PageDown:case Qt::Key_PageDown: never executed: case Qt::Key_PageDown: | 0 | ||||||||||||||||||||||||
1478 | case never executed: Qt::Key_Escape:case Qt::Key_Escape: never executed: case Qt::Key_Escape: | 0 | ||||||||||||||||||||||||
1479 | case never executed: Qt::Key_Shift:case Qt::Key_Shift: never executed: case Qt::Key_Shift: | 0 | ||||||||||||||||||||||||
1480 | case never executed: Qt::Key_Control:case Qt::Key_Control: never executed: case Qt::Key_Control: | 0 | ||||||||||||||||||||||||
1481 | case never executed: Qt::Key_Delete:case Qt::Key_Delete: never executed: case Qt::Key_Delete: | 0 | ||||||||||||||||||||||||
1482 | case never executed: Qt::Key_Backspace:case Qt::Key_Backspace: never executed: case Qt::Key_Backspace: | 0 | ||||||||||||||||||||||||
1483 | event->ignore(); | - | ||||||||||||||||||||||||
1484 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1485 | case never executed: Qt::Key_Space:case Qt::Key_Space: never executed: case Qt::Key_Space: | 0 | ||||||||||||||||||||||||
1486 | case never executed: Qt::Key_Select:case Qt::Key_Select: never executed: case Qt::Key_Select: | 0 | ||||||||||||||||||||||||
1487 | if (!edit(currentIndex(), AnyKeyPressed, event)
| 0 | ||||||||||||||||||||||||
1488 | d->selectionModel->select(currentIndex(), selectionCommand(currentIndex(), event)); never executed: d->selectionModel->select(currentIndex(), selectionCommand(currentIndex(), event)); | 0 | ||||||||||||||||||||||||
1489 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1490 | case never executed: Qt::Key_F2:case Qt::Key_F2: never executed: case Qt::Key_F2: | 0 | ||||||||||||||||||||||||
1491 | if (!edit(currentIndex(), EditKeyPressed, event)
| 0 | ||||||||||||||||||||||||
1492 | event->ignore(); never executed: event->ignore(); | 0 | ||||||||||||||||||||||||
1493 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1494 | case never executed: Qt::Key_Enter:case Qt::Key_Enter: never executed: case Qt::Key_Enter: | 0 | ||||||||||||||||||||||||
1495 | case never executed: Qt::Key_Return:case Qt::Key_Return: never executed: case Qt::Key_Return: | 0 | ||||||||||||||||||||||||
1496 | - | |||||||||||||||||||||||||
1497 | - | |||||||||||||||||||||||||
1498 | - | |||||||||||||||||||||||||
1499 | if (state() != EditingState
| 0 | ||||||||||||||||||||||||
1500 | if (currentIndex().isValid()
| 0 | ||||||||||||||||||||||||
1501 | activated(currentIndex()); never executed: activated(currentIndex()); | 0 | ||||||||||||||||||||||||
1502 | event->ignore(); | - | ||||||||||||||||||||||||
1503 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1504 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1505 | - | |||||||||||||||||||||||||
1506 | default never executed: :default: never executed: {default: | 0 | ||||||||||||||||||||||||
1507 | if (event == QKeySequence::SelectAll
| 0 | ||||||||||||||||||||||||
1508 | selectAll(); | - | ||||||||||||||||||||||||
1509 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1510 | } | - | ||||||||||||||||||||||||
1511 | - | |||||||||||||||||||||||||
1512 | - | |||||||||||||||||||||||||
1513 | - | |||||||||||||||||||||||||
1514 | - | |||||||||||||||||||||||||
1515 | - | |||||||||||||||||||||||||
1516 | - | |||||||||||||||||||||||||
1517 | bool modified = (event->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier)); | - | ||||||||||||||||||||||||
1518 | if (!event->text().isEmpty()
| 0 | ||||||||||||||||||||||||
1519 | keyboardSearch(event->text()); | - | ||||||||||||||||||||||||
1520 | event->accept(); | - | ||||||||||||||||||||||||
1521 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1522 | event->ignore(); | - | ||||||||||||||||||||||||
1523 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1524 | break; never executed: }break; | 0 | ||||||||||||||||||||||||
1525 | } | - | ||||||||||||||||||||||||
1526 | if (d->moveCursorUpdatedView
| 0 | ||||||||||||||||||||||||
1527 | event->accept(); never executed: event->accept(); | 0 | ||||||||||||||||||||||||
1528 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1529 | - | |||||||||||||||||||||||||
1530 | - | |||||||||||||||||||||||||
1531 | - | |||||||||||||||||||||||||
1532 | - | |||||||||||||||||||||||||
1533 | - | |||||||||||||||||||||||||
1534 | - | |||||||||||||||||||||||||
1535 | - | |||||||||||||||||||||||||
1536 | void QAbstractItemView::resizeEvent(QResizeEvent *event) | - | ||||||||||||||||||||||||
1537 | { | - | ||||||||||||||||||||||||
1538 | QAbstractScrollArea::resizeEvent(event); | - | ||||||||||||||||||||||||
1539 | updateGeometries(); | - | ||||||||||||||||||||||||
1540 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1541 | - | |||||||||||||||||||||||||
1542 | - | |||||||||||||||||||||||||
1543 | - | |||||||||||||||||||||||||
1544 | - | |||||||||||||||||||||||||
1545 | - | |||||||||||||||||||||||||
1546 | - | |||||||||||||||||||||||||
1547 | - | |||||||||||||||||||||||||
1548 | void QAbstractItemView::timerEvent(QTimerEvent *event) | - | ||||||||||||||||||||||||
1549 | { | - | ||||||||||||||||||||||||
1550 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1551 | if (event->timerId() == d->fetchMoreTimer.timerId()
| 0 | ||||||||||||||||||||||||
1552 | d->fetchMore(); never executed: d->fetchMore(); | 0 | ||||||||||||||||||||||||
1553 | else if (event->timerId() == d->delayedReset.timerId()
| 0 | ||||||||||||||||||||||||
1554 | reset(); never executed: reset(); | 0 | ||||||||||||||||||||||||
1555 | else if (event->timerId() == d->autoScrollTimer.timerId()
| 0 | ||||||||||||||||||||||||
1556 | doAutoScroll(); never executed: doAutoScroll(); | 0 | ||||||||||||||||||||||||
1557 | else if (event->timerId() == d->updateTimer.timerId()
| 0 | ||||||||||||||||||||||||
1558 | d->updateDirtyRegion(); never executed: d->updateDirtyRegion(); | 0 | ||||||||||||||||||||||||
1559 | else if (event->timerId() == d->delayedEditing.timerId()
| 0 | ||||||||||||||||||||||||
1560 | d->delayedEditing.stop(); | - | ||||||||||||||||||||||||
1561 | edit(currentIndex()); | - | ||||||||||||||||||||||||
1562 | } never executed: else if (event->timerId() == d->delayedLayout.timerId()end of block
| 0 | ||||||||||||||||||||||||
1563 | d->delayedLayout.stop(); | - | ||||||||||||||||||||||||
1564 | if (isVisible()
| 0 | ||||||||||||||||||||||||
1565 | d->interruptDelayedItemsLayout(); | - | ||||||||||||||||||||||||
1566 | doItemsLayout(); | - | ||||||||||||||||||||||||
1567 | const QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||
1568 | if (current.isValid()
| 0 | ||||||||||||||||||||||||
1569 | scrollTo(current); never executed: scrollTo(current); | 0 | ||||||||||||||||||||||||
1570 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1571 | } never executed: else if (event->timerId() == d->delayedAutoScroll.timerId()end of block
| 0 | ||||||||||||||||||||||||
1572 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||
1573 | - | |||||||||||||||||||||||||
1574 | - | |||||||||||||||||||||||||
1575 | if (d->pressedIndex.isValid()
| 0 | ||||||||||||||||||||||||
1576 | scrollTo(d->pressedIndex); never executed: scrollTo(d->pressedIndex); | 0 | ||||||||||||||||||||||||
1577 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1578 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1579 | - | |||||||||||||||||||||||||
1580 | - | |||||||||||||||||||||||||
1581 | - | |||||||||||||||||||||||||
1582 | - | |||||||||||||||||||||||||
1583 | void QAbstractItemView::inputMethodEvent(QInputMethodEvent *event) | - | ||||||||||||||||||||||||
1584 | { | - | ||||||||||||||||||||||||
1585 | if (event->commitString().isEmpty()
| 0 | ||||||||||||||||||||||||
1586 | event->ignore(); | - | ||||||||||||||||||||||||
1587 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1588 | } | - | ||||||||||||||||||||||||
1589 | if (!edit(currentIndex(), AnyKeyPressed, event)
| 0 | ||||||||||||||||||||||||
1590 | if (!event->commitString().isEmpty()
| 0 | ||||||||||||||||||||||||
1591 | keyboardSearch(event->commitString()); never executed: keyboardSearch(event->commitString()); | 0 | ||||||||||||||||||||||||
1592 | event->ignore(); | - | ||||||||||||||||||||||||
1593 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1594 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1595 | QAbstractItemView::DropIndicatorPosition QAbstractItemView::dropIndicatorPosition() const | - | ||||||||||||||||||||||||
1596 | { | - | ||||||||||||||||||||||||
1597 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1598 | return never executed: d->dropIndicatorPosition;return d->dropIndicatorPosition; never executed: return d->dropIndicatorPosition; | 0 | ||||||||||||||||||||||||
1599 | } | - | ||||||||||||||||||||||||
1600 | QModelIndexList QAbstractItemView::selectedIndexes() const | - | ||||||||||||||||||||||||
1601 | { | - | ||||||||||||||||||||||||
1602 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1603 | QModelIndexList indexes; | - | ||||||||||||||||||||||||
1604 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||
1605 | indexes = d->selectionModel->selectedIndexes(); | - | ||||||||||||||||||||||||
1606 | QList<QModelIndex>::iterator it = indexes.begin(); | - | ||||||||||||||||||||||||
1607 | while (it != indexes.end()
| 0 | ||||||||||||||||||||||||
1608 | if (isIndexHidden(*it)
| 0 | ||||||||||||||||||||||||
1609 | it = indexes.erase(it); never executed: it = indexes.erase(it); | 0 | ||||||||||||||||||||||||
1610 | else | - | ||||||||||||||||||||||||
1611 | ++ never executed: it;++it; never executed: ++it; | 0 | ||||||||||||||||||||||||
1612 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1613 | return never executed: indexes;return indexes; never executed: return indexes; | 0 | ||||||||||||||||||||||||
1614 | } | - | ||||||||||||||||||||||||
1615 | bool QAbstractItemView::edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) | - | ||||||||||||||||||||||||
1616 | { | - | ||||||||||||||||||||||||
1617 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1618 | - | |||||||||||||||||||||||||
1619 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||
1620 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1621 | - | |||||||||||||||||||||||||
1622 | if (QWidget *w = (d->persistent.isEmpty()
| 0 | ||||||||||||||||||||||||
1623 | if (w->focusPolicy() == Qt::NoFocus
| 0 | ||||||||||||||||||||||||
1624 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1625 | w->setFocus(); | - | ||||||||||||||||||||||||
1626 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1627 | } | - | ||||||||||||||||||||||||
1628 | - | |||||||||||||||||||||||||
1629 | if (trigger == DoubleClicked
| 0 | ||||||||||||||||||||||||
1630 | d->delayedEditing.stop(); | - | ||||||||||||||||||||||||
1631 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||
1632 | } never executed: else if (trigger == CurrentChangedend of block
| 0 | ||||||||||||||||||||||||
1633 | d->delayedEditing.stop(); | - | ||||||||||||||||||||||||
1634 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1635 | - | |||||||||||||||||||||||||
1636 | if (d->sendDelegateEvent(index, event)
| 0 | ||||||||||||||||||||||||
1637 | update(index); | - | ||||||||||||||||||||||||
1638 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1639 | } | - | ||||||||||||||||||||||||
1640 | - | |||||||||||||||||||||||||
1641 | - | |||||||||||||||||||||||||
1642 | EditTriggers lastTrigger = d->lastTrigger; | - | ||||||||||||||||||||||||
1643 | d->lastTrigger = trigger; | - | ||||||||||||||||||||||||
1644 | - | |||||||||||||||||||||||||
1645 | if (!d->shouldEdit(trigger, d->model->buddy(index))
| 0 | ||||||||||||||||||||||||
1646 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1647 | - | |||||||||||||||||||||||||
1648 | if (d->delayedEditing.isActive()
| 0 | ||||||||||||||||||||||||
1649 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1650 | - | |||||||||||||||||||||||||
1651 | - | |||||||||||||||||||||||||
1652 | - | |||||||||||||||||||||||||
1653 | if (lastTrigger == DoubleClicked
| 0 | ||||||||||||||||||||||||
1654 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
1655 | - | |||||||||||||||||||||||||
1656 | - | |||||||||||||||||||||||||
1657 | if (trigger == SelectedClicked
| 0 | ||||||||||||||||||||||||
1658 | d->delayedEditing.start(QApplication::doubleClickInterval(), this); never executed: d->delayedEditing.start(QApplication::doubleClickInterval(), this); | 0 | ||||||||||||||||||||||||
1659 | else | - | ||||||||||||||||||||||||
1660 | d->openEditor(index, d->shouldForwardEvent(trigger, event) ? event : 0); never executed: d->openEditor(index, d->shouldForwardEvent(trigger, event) ? event : 0); | 0 | ||||||||||||||||||||||||
1661 | - | |||||||||||||||||||||||||
1662 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
1663 | } | - | ||||||||||||||||||||||||
1664 | - | |||||||||||||||||||||||||
1665 | - | |||||||||||||||||||||||||
1666 | - | |||||||||||||||||||||||||
1667 | - | |||||||||||||||||||||||||
1668 | - | |||||||||||||||||||||||||
1669 | void QAbstractItemView::updateEditorData() | - | ||||||||||||||||||||||||
1670 | { | - | ||||||||||||||||||||||||
1671 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1672 | d->updateEditorData(QModelIndex(), QModelIndex()); | - | ||||||||||||||||||||||||
1673 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1674 | - | |||||||||||||||||||||||||
1675 | - | |||||||||||||||||||||||||
1676 | - | |||||||||||||||||||||||||
1677 | - | |||||||||||||||||||||||||
1678 | - | |||||||||||||||||||||||||
1679 | void QAbstractItemView::updateEditorGeometries() | - | ||||||||||||||||||||||||
1680 | { | - | ||||||||||||||||||||||||
1681 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1682 | if(d->editorIndexHash.isEmpty()
| 0 | ||||||||||||||||||||||||
1683 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1684 | if (d->delayedPendingLayout
| 0 | ||||||||||||||||||||||||
1685 | - | |||||||||||||||||||||||||
1686 | d->executePostedLayout(); | - | ||||||||||||||||||||||||
1687 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1688 | } | - | ||||||||||||||||||||||||
1689 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||
1690 | QEditorIndexHash::iterator it = d->editorIndexHash.begin(); | - | ||||||||||||||||||||||||
1691 | QWidgetList editorsToRelease; | - | ||||||||||||||||||||||||
1692 | QWidgetList editorsToHide; | - | ||||||||||||||||||||||||
1693 | while (it != d->editorIndexHash.end()
| 0 | ||||||||||||||||||||||||
1694 | QModelIndex index = it.value(); | - | ||||||||||||||||||||||||
1695 | QWidget *editor = it.key(); | - | ||||||||||||||||||||||||
1696 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
1697 | option.rect = visualRect(index); | - | ||||||||||||||||||||||||
1698 | if (option.rect.isValid()
| 0 | ||||||||||||||||||||||||
1699 | editor->show(); | - | ||||||||||||||||||||||||
1700 | QAbstractItemDelegate *delegate = d->delegateForIndex(index); | - | ||||||||||||||||||||||||
1701 | if (delegate
| 0 | ||||||||||||||||||||||||
1702 | delegate-> never executed: updateEditorGeometry(editor, option, index);delegate->updateEditorGeometry(editor, option, index); never executed: delegate->updateEditorGeometry(editor, option, index); | 0 | ||||||||||||||||||||||||
1703 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1704 | editorsToHide << editor; | - | ||||||||||||||||||||||||
1705 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1706 | ++it; | - | ||||||||||||||||||||||||
1707 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1708 | d->indexEditorHash.remove(it.value()); | - | ||||||||||||||||||||||||
1709 | it = d->editorIndexHash.erase(it); | - | ||||||||||||||||||||||||
1710 | editorsToRelease << editor; | - | ||||||||||||||||||||||||
1711 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1712 | } | - | ||||||||||||||||||||||||
1713 | - | |||||||||||||||||||||||||
1714 | - | |||||||||||||||||||||||||
1715 | - | |||||||||||||||||||||||||
1716 | for (int i = 0; i < editorsToHide.count()
| 0 | ||||||||||||||||||||||||
1717 | editorsToHide.at(i)->hide(); | - | ||||||||||||||||||||||||
1718 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1719 | for (int i = 0; i < editorsToRelease.count()
| 0 | ||||||||||||||||||||||||
1720 | d->releaseEditor(editorsToRelease.at(i)); | - | ||||||||||||||||||||||||
1721 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1722 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1723 | - | |||||||||||||||||||||||||
1724 | - | |||||||||||||||||||||||||
1725 | - | |||||||||||||||||||||||||
1726 | - | |||||||||||||||||||||||||
1727 | - | |||||||||||||||||||||||||
1728 | - | |||||||||||||||||||||||||
1729 | void QAbstractItemView::updateGeometries() | - | ||||||||||||||||||||||||
1730 | { | - | ||||||||||||||||||||||||
1731 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1732 | updateEditorGeometries(); | - | ||||||||||||||||||||||||
1733 | d->fetchMoreTimer.start(0, this); | - | ||||||||||||||||||||||||
1734 | d->updateGeometry(); | - | ||||||||||||||||||||||||
1735 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1736 | - | |||||||||||||||||||||||||
1737 | - | |||||||||||||||||||||||||
1738 | - | |||||||||||||||||||||||||
1739 | - | |||||||||||||||||||||||||
1740 | void QAbstractItemView::verticalScrollbarValueChanged(int value) | - | ||||||||||||||||||||||||
1741 | { | - | ||||||||||||||||||||||||
1742 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1743 | if (verticalScrollBar()->maximum() == value
| 0 | ||||||||||||||||||||||||
1744 | d->model->fetchMore(d->root); never executed: d->model->fetchMore(d->root); | 0 | ||||||||||||||||||||||||
1745 | QPoint posInVp = viewport()->mapFromGlobal(QCursor::pos()); | - | ||||||||||||||||||||||||
1746 | if (viewport()->rect().contains(posInVp)
| 0 | ||||||||||||||||||||||||
1747 | d->checkMouseMove(posInVp); never executed: d->checkMouseMove(posInVp); | 0 | ||||||||||||||||||||||||
1748 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1749 | - | |||||||||||||||||||||||||
1750 | - | |||||||||||||||||||||||||
1751 | - | |||||||||||||||||||||||||
1752 | - | |||||||||||||||||||||||||
1753 | void QAbstractItemView::horizontalScrollbarValueChanged(int value) | - | ||||||||||||||||||||||||
1754 | { | - | ||||||||||||||||||||||||
1755 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1756 | if (horizontalScrollBar()->maximum() == value
| 0 | ||||||||||||||||||||||||
1757 | d->model->fetchMore(d->root); never executed: d->model->fetchMore(d->root); | 0 | ||||||||||||||||||||||||
1758 | QPoint posInVp = viewport()->mapFromGlobal(QCursor::pos()); | - | ||||||||||||||||||||||||
1759 | if (viewport()->rect().contains(posInVp)
| 0 | ||||||||||||||||||||||||
1760 | d->checkMouseMove(posInVp); never executed: d->checkMouseMove(posInVp); | 0 | ||||||||||||||||||||||||
1761 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1762 | - | |||||||||||||||||||||||||
1763 | - | |||||||||||||||||||||||||
1764 | - | |||||||||||||||||||||||||
1765 | - | |||||||||||||||||||||||||
1766 | void QAbstractItemView::verticalScrollbarAction(int) | - | ||||||||||||||||||||||||
1767 | { | - | ||||||||||||||||||||||||
1768 | - | |||||||||||||||||||||||||
1769 | } | - | ||||||||||||||||||||||||
1770 | - | |||||||||||||||||||||||||
1771 | - | |||||||||||||||||||||||||
1772 | - | |||||||||||||||||||||||||
1773 | - | |||||||||||||||||||||||||
1774 | void QAbstractItemView::horizontalScrollbarAction(int) | - | ||||||||||||||||||||||||
1775 | { | - | ||||||||||||||||||||||||
1776 | - | |||||||||||||||||||||||||
1777 | } | - | ||||||||||||||||||||||||
1778 | void QAbstractItemView::closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint) | - | ||||||||||||||||||||||||
1779 | { | - | ||||||||||||||||||||||||
1780 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1781 | - | |||||||||||||||||||||||||
1782 | - | |||||||||||||||||||||||||
1783 | if (editor
| 0 | ||||||||||||||||||||||||
1784 | bool isPersistent = d->persistent.contains(editor); | - | ||||||||||||||||||||||||
1785 | bool hadFocus = editor->hasFocus(); | - | ||||||||||||||||||||||||
1786 | QModelIndex index = d->indexForEditor(editor); | - | ||||||||||||||||||||||||
1787 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
1788 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1789 | - | |||||||||||||||||||||||||
1790 | if (!isPersistent
| 0 | ||||||||||||||||||||||||
1791 | setState(NoState); | - | ||||||||||||||||||||||||
1792 | QModelIndex index = d->indexForEditor(editor); | - | ||||||||||||||||||||||||
1793 | editor->removeEventFilter(d->delegateForIndex(index)); | - | ||||||||||||||||||||||||
1794 | d->removeEditor(editor); | - | ||||||||||||||||||||||||
1795 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1796 | if (hadFocus
| 0 | ||||||||||||||||||||||||
1797 | if (focusPolicy() != Qt::NoFocus
| 0 | ||||||||||||||||||||||||
1798 | setFocus(); never executed: setFocus(); | 0 | ||||||||||||||||||||||||
1799 | else | - | ||||||||||||||||||||||||
1800 | editor->clearFocus(); never executed: editor->clearFocus(); | 0 | ||||||||||||||||||||||||
1801 | } else { | - | ||||||||||||||||||||||||
1802 | d->checkPersistentEditorFocus(); | - | ||||||||||||||||||||||||
1803 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1804 | - | |||||||||||||||||||||||||
1805 | QPointer<QWidget> ed = editor; | - | ||||||||||||||||||||||||
1806 | QApplication::sendPostedEvents(editor, 0); | - | ||||||||||||||||||||||||
1807 | editor = ed; | - | ||||||||||||||||||||||||
1808 | - | |||||||||||||||||||||||||
1809 | if (!isPersistent
| 0 | ||||||||||||||||||||||||
1810 | d->releaseEditor(editor, index); never executed: d->releaseEditor(editor, index); | 0 | ||||||||||||||||||||||||
1811 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1812 | - | |||||||||||||||||||||||||
1813 | - | |||||||||||||||||||||||||
1814 | QItemSelectionModel::SelectionFlags flags = QItemSelectionModel::NoUpdate; | - | ||||||||||||||||||||||||
1815 | if (d->selectionMode != NoSelection
| 0 | ||||||||||||||||||||||||
1816 | flags = QItemSelectionModel::ClearAndSelect | d->selectionBehaviorFlags(); never executed: flags = QItemSelectionModel::ClearAndSelect | d->selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
1817 | switch (hint) { | - | ||||||||||||||||||||||||
1818 | case never executed: QAbstractItemDelegate::EditNextItem:case QAbstractItemDelegate::EditNextItem: never executed: {case QAbstractItemDelegate::EditNextItem: | 0 | ||||||||||||||||||||||||
1819 | QModelIndex index = moveCursor(MoveNext, Qt::NoModifier); | - | ||||||||||||||||||||||||
1820 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
1821 | QPersistentModelIndex persistent(index); | - | ||||||||||||||||||||||||
1822 | d->selectionModel->setCurrentIndex(persistent, flags); | - | ||||||||||||||||||||||||
1823 | - | |||||||||||||||||||||||||
1824 | if (index.flags() & Qt::ItemIsEditable
| 0 | ||||||||||||||||||||||||
1825 | && (
| 0 | ||||||||||||||||||||||||
1826 | edit(persistent); never executed: edit(persistent); | 0 | ||||||||||||||||||||||||
1827 | } never executed: break;end of block never executed: }break; | 0 | ||||||||||||||||||||||||
1828 | case never executed: QAbstractItemDelegate::EditPreviousItem:case QAbstractItemDelegate::EditPreviousItem: never executed: {case QAbstractItemDelegate::EditPreviousItem: | 0 | ||||||||||||||||||||||||
1829 | QModelIndex index = moveCursor(MovePrevious, Qt::NoModifier); | - | ||||||||||||||||||||||||
1830 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
1831 | QPersistentModelIndex persistent(index); | - | ||||||||||||||||||||||||
1832 | d->selectionModel->setCurrentIndex(persistent, flags); | - | ||||||||||||||||||||||||
1833 | - | |||||||||||||||||||||||||
1834 | if (index.flags() & Qt::ItemIsEditable
| 0 | ||||||||||||||||||||||||
1835 | && (
| 0 | ||||||||||||||||||||||||
1836 | edit(persistent); never executed: edit(persistent); | 0 | ||||||||||||||||||||||||
1837 | } never executed: break;end of block never executed: }break; | 0 | ||||||||||||||||||||||||
1838 | case never executed: QAbstractItemDelegate::SubmitModelCache:case QAbstractItemDelegate::SubmitModelCache: never executed: case QAbstractItemDelegate::SubmitModelCache: | 0 | ||||||||||||||||||||||||
1839 | d->model->submit(); | - | ||||||||||||||||||||||||
1840 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1841 | case never executed: QAbstractItemDelegate::RevertModelCache:case QAbstractItemDelegate::RevertModelCache: never executed: case QAbstractItemDelegate::RevertModelCache: | 0 | ||||||||||||||||||||||||
1842 | d->model->revert(); | - | ||||||||||||||||||||||||
1843 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1844 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
1845 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1846 | } | - | ||||||||||||||||||||||||
1847 | } | - | ||||||||||||||||||||||||
1848 | - | |||||||||||||||||||||||||
1849 | - | |||||||||||||||||||||||||
1850 | - | |||||||||||||||||||||||||
1851 | - | |||||||||||||||||||||||||
1852 | - | |||||||||||||||||||||||||
1853 | - | |||||||||||||||||||||||||
1854 | void QAbstractItemView::commitData(QWidget *editor) | - | ||||||||||||||||||||||||
1855 | { | - | ||||||||||||||||||||||||
1856 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1857 | if (!editor
| 0 | ||||||||||||||||||||||||
1858 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1859 | QModelIndex index = d->indexForEditor(editor); | - | ||||||||||||||||||||||||
1860 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
1861 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1862 | d->currentlyCommittingEditor = editor; | - | ||||||||||||||||||||||||
1863 | QAbstractItemDelegate *delegate = d->delegateForIndex(index); | - | ||||||||||||||||||||||||
1864 | editor->removeEventFilter(delegate); | - | ||||||||||||||||||||||||
1865 | delegate->setModelData(editor, d->model, index); | - | ||||||||||||||||||||||||
1866 | editor->installEventFilter(delegate); | - | ||||||||||||||||||||||||
1867 | d->currentlyCommittingEditor = 0; | - | ||||||||||||||||||||||||
1868 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1869 | - | |||||||||||||||||||||||||
1870 | - | |||||||||||||||||||||||||
1871 | - | |||||||||||||||||||||||||
1872 | - | |||||||||||||||||||||||||
1873 | - | |||||||||||||||||||||||||
1874 | - | |||||||||||||||||||||||||
1875 | void QAbstractItemView::editorDestroyed(QObject *editor) | - | ||||||||||||||||||||||||
1876 | { | - | ||||||||||||||||||||||||
1877 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1878 | QWidget *w = qobject_cast<QWidget*>(editor); | - | ||||||||||||||||||||||||
1879 | d->removeEditor(w); | - | ||||||||||||||||||||||||
1880 | d->persistent.remove(w); | - | ||||||||||||||||||||||||
1881 | if (state() == EditingState
| 0 | ||||||||||||||||||||||||
1882 | setState(NoState); never executed: setState(NoState); | 0 | ||||||||||||||||||||||||
1883 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1884 | void QAbstractItemView::setHorizontalStepsPerItem(int steps) | - | ||||||||||||||||||||||||
1885 | { | - | ||||||||||||||||||||||||
1886 | (void)steps; | - | ||||||||||||||||||||||||
1887 | - | |||||||||||||||||||||||||
1888 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1889 | - | |||||||||||||||||||||||||
1890 | - | |||||||||||||||||||||||||
1891 | - | |||||||||||||||||||||||||
1892 | - | |||||||||||||||||||||||||
1893 | - | |||||||||||||||||||||||||
1894 | - | |||||||||||||||||||||||||
1895 | - | |||||||||||||||||||||||||
1896 | int QAbstractItemView::horizontalStepsPerItem() const | - | ||||||||||||||||||||||||
1897 | { | - | ||||||||||||||||||||||||
1898 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
1899 | } | - | ||||||||||||||||||||||||
1900 | void QAbstractItemView::setVerticalStepsPerItem(int steps) | - | ||||||||||||||||||||||||
1901 | { | - | ||||||||||||||||||||||||
1902 | (void)steps; | - | ||||||||||||||||||||||||
1903 | - | |||||||||||||||||||||||||
1904 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1905 | - | |||||||||||||||||||||||||
1906 | - | |||||||||||||||||||||||||
1907 | - | |||||||||||||||||||||||||
1908 | - | |||||||||||||||||||||||||
1909 | - | |||||||||||||||||||||||||
1910 | - | |||||||||||||||||||||||||
1911 | - | |||||||||||||||||||||||||
1912 | int QAbstractItemView::verticalStepsPerItem() const | - | ||||||||||||||||||||||||
1913 | { | - | ||||||||||||||||||||||||
1914 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||||||||
1915 | } | - | ||||||||||||||||||||||||
1916 | void QAbstractItemView::keyboardSearch(const QString &search) | - | ||||||||||||||||||||||||
1917 | { | - | ||||||||||||||||||||||||
1918 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1919 | if (!d->model->rowCount(d->root)
| 0 | ||||||||||||||||||||||||
1920 | return; never executed: return; | 0 | ||||||||||||||||||||||||
1921 | - | |||||||||||||||||||||||||
1922 | QModelIndex start = currentIndex().isValid()
| 0 | ||||||||||||||||||||||||
1923 | : d->model->index(0, 0, d->root); | - | ||||||||||||||||||||||||
1924 | bool skipRow = false; | - | ||||||||||||||||||||||||
1925 | bool keyboardTimeWasValid = d->keyboardInputTime.isValid(); | - | ||||||||||||||||||||||||
1926 | qint64 keyboardInputTimeElapsed; | - | ||||||||||||||||||||||||
1927 | if (keyboardTimeWasValid
| 0 | ||||||||||||||||||||||||
1928 | keyboardInputTimeElapsed = d->keyboardInputTime.restart(); never executed: keyboardInputTimeElapsed = d->keyboardInputTime.restart(); | 0 | ||||||||||||||||||||||||
1929 | else | - | ||||||||||||||||||||||||
1930 | d->keyboardInputTime.start(); never executed: d->keyboardInputTime.start(); | 0 | ||||||||||||||||||||||||
1931 | if (search.isEmpty()
| 0 | ||||||||||||||||||||||||
1932 | || keyboardInputTimeElapsed > QApplication::keyboardInputInterval()
| 0 | ||||||||||||||||||||||||
1933 | d->keyboardInput = search; | - | ||||||||||||||||||||||||
1934 | skipRow = currentIndex().isValid(); | - | ||||||||||||||||||||||||
1935 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
1936 | d->keyboardInput += search; | - | ||||||||||||||||||||||||
1937 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1938 | - | |||||||||||||||||||||||||
1939 | - | |||||||||||||||||||||||||
1940 | bool sameKey = false; | - | ||||||||||||||||||||||||
1941 | if (d->keyboardInput.length() > 1
| 0 | ||||||||||||||||||||||||
1942 | int c = d->keyboardInput.count(d->keyboardInput.at(d->keyboardInput.length() - 1)); | - | ||||||||||||||||||||||||
1943 | sameKey = (c == d->keyboardInput.length()); | - | ||||||||||||||||||||||||
1944 | if (sameKey
| 0 | ||||||||||||||||||||||||
1945 | skipRow = true; never executed: skipRow = true; | 0 | ||||||||||||||||||||||||
1946 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1947 | - | |||||||||||||||||||||||||
1948 | - | |||||||||||||||||||||||||
1949 | if (skipRow
| 0 | ||||||||||||||||||||||||
1950 | QModelIndex parent = start.parent(); | - | ||||||||||||||||||||||||
1951 | int newRow = (
| 0 | ||||||||||||||||||||||||
1952 | start = d->model->index(newRow, start.column(), parent); | - | ||||||||||||||||||||||||
1953 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1954 | - | |||||||||||||||||||||||||
1955 | - | |||||||||||||||||||||||||
1956 | QModelIndex current = start; | - | ||||||||||||||||||||||||
1957 | QModelIndexList match; | - | ||||||||||||||||||||||||
1958 | QModelIndex firstMatch; | - | ||||||||||||||||||||||||
1959 | QModelIndex startMatch; | - | ||||||||||||||||||||||||
1960 | QModelIndexList previous; | - | ||||||||||||||||||||||||
1961 | do { | - | ||||||||||||||||||||||||
1962 | match = d->model->match(current, Qt::DisplayRole, d->keyboardInput); | - | ||||||||||||||||||||||||
1963 | if (match == previous
| 0 | ||||||||||||||||||||||||
1964 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1965 | firstMatch = match.value(0); | - | ||||||||||||||||||||||||
1966 | previous = match; | - | ||||||||||||||||||||||||
1967 | if (firstMatch.isValid()
| 0 | ||||||||||||||||||||||||
1968 | if (d->isIndexEnabled(firstMatch)
| 0 | ||||||||||||||||||||||||
1969 | setCurrentIndex(firstMatch); | - | ||||||||||||||||||||||||
1970 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1971 | } | - | ||||||||||||||||||||||||
1972 | int row = firstMatch.row() + 1; | - | ||||||||||||||||||||||||
1973 | if (row >= d->model->rowCount(firstMatch.parent())
| 0 | ||||||||||||||||||||||||
1974 | row = 0; never executed: row = 0; | 0 | ||||||||||||||||||||||||
1975 | current = firstMatch.sibling(row, firstMatch.column()); | - | ||||||||||||||||||||||||
1976 | - | |||||||||||||||||||||||||
1977 | - | |||||||||||||||||||||||||
1978 | if (!startMatch.isValid()
| 0 | ||||||||||||||||||||||||
1979 | startMatch = firstMatch; never executed: startMatch = firstMatch; | 0 | ||||||||||||||||||||||||
1980 | else if (startMatch == firstMatch
| 0 | ||||||||||||||||||||||||
1981 | break; never executed: break; | 0 | ||||||||||||||||||||||||
1982 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1983 | } never executed: while (current != startend of block
| 0 | ||||||||||||||||||||||||
1984 | } never executed: end of block | 0 | ||||||||||||||||||||||||
1985 | - | |||||||||||||||||||||||||
1986 | - | |||||||||||||||||||||||||
1987 | - | |||||||||||||||||||||||||
1988 | - | |||||||||||||||||||||||||
1989 | - | |||||||||||||||||||||||||
1990 | - | |||||||||||||||||||||||||
1991 | - | |||||||||||||||||||||||||
1992 | QSize QAbstractItemView::sizeHintForIndex(const QModelIndex &index) const | - | ||||||||||||||||||||||||
1993 | { | - | ||||||||||||||||||||||||
1994 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
1995 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||
1996 | return never executed: QSize();return QSize(); never executed: return QSize(); | 0 | ||||||||||||||||||||||||
1997 | return never executed: d->delegateForIndex(index)->sizeHint(d->viewOptionsV1(), index);return d->delegateForIndex(index)->sizeHint(d->viewOptionsV1(), index); never executed: return d->delegateForIndex(index)->sizeHint(d->viewOptionsV1(), index); | 0 | ||||||||||||||||||||||||
1998 | } | - | ||||||||||||||||||||||||
1999 | int QAbstractItemView::sizeHintForRow(int row) const | - | ||||||||||||||||||||||||
2000 | { | - | ||||||||||||||||||||||||
2001 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2002 | - | |||||||||||||||||||||||||
2003 | if (row < 0
| 0 | ||||||||||||||||||||||||
2004 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
2005 | - | |||||||||||||||||||||||||
2006 | ensurePolished(); | - | ||||||||||||||||||||||||
2007 | - | |||||||||||||||||||||||||
2008 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||
2009 | int height = 0; | - | ||||||||||||||||||||||||
2010 | int colCount = d->model->columnCount(d->root); | - | ||||||||||||||||||||||||
2011 | for (int c = 0; c < colCount
| 0 | ||||||||||||||||||||||||
2012 | const QModelIndex index = d->model->index(row, c, d->root); | - | ||||||||||||||||||||||||
2013 | if (QWidget *editor = d->editorForIndex(index).widget.data()
| 0 | ||||||||||||||||||||||||
2014 | height = qMax(height, editor->height()); never executed: height = qMax(height, editor->height()); | 0 | ||||||||||||||||||||||||
2015 | if (const
| 0 | ||||||||||||||||||||||||
2016 | height = qMax(height, delegate->sizeHint(option, index).height()); never executed: height = qMax(height, delegate->sizeHint(option, index).height()); | 0 | ||||||||||||||||||||||||
2017 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2018 | return never executed: height;return height; never executed: return height; | 0 | ||||||||||||||||||||||||
2019 | } | - | ||||||||||||||||||||||||
2020 | int QAbstractItemView::sizeHintForColumn(int column) const | - | ||||||||||||||||||||||||
2021 | { | - | ||||||||||||||||||||||||
2022 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2023 | - | |||||||||||||||||||||||||
2024 | if (column < 0
| 0 | ||||||||||||||||||||||||
2025 | return never executed: -1;return -1; never executed: return -1; | 0 | ||||||||||||||||||||||||
2026 | - | |||||||||||||||||||||||||
2027 | ensurePolished(); | - | ||||||||||||||||||||||||
2028 | - | |||||||||||||||||||||||||
2029 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||
2030 | int width = 0; | - | ||||||||||||||||||||||||
2031 | int rows = d->model->rowCount(d->root); | - | ||||||||||||||||||||||||
2032 | for (int r = 0; r < rows
| 0 | ||||||||||||||||||||||||
2033 | const QModelIndex index = d->model->index(r, column, d->root); | - | ||||||||||||||||||||||||
2034 | if (QWidget *editor = d->editorForIndex(index).widget.data()
| 0 | ||||||||||||||||||||||||
2035 | width = qMax(width, editor->sizeHint().width()); never executed: width = qMax(width, editor->sizeHint().width()); | 0 | ||||||||||||||||||||||||
2036 | if (const
| 0 | ||||||||||||||||||||||||
2037 | width = qMax(width, delegate->sizeHint(option, index).width()); never executed: width = qMax(width, delegate->sizeHint(option, index).width()); | 0 | ||||||||||||||||||||||||
2038 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2039 | return never executed: width;return width; never executed: return width; | 0 | ||||||||||||||||||||||||
2040 | } | - | ||||||||||||||||||||||||
2041 | - | |||||||||||||||||||||||||
2042 | - | |||||||||||||||||||||||||
2043 | - | |||||||||||||||||||||||||
2044 | - | |||||||||||||||||||||||||
2045 | - | |||||||||||||||||||||||||
2046 | - | |||||||||||||||||||||||||
2047 | - | |||||||||||||||||||||||||
2048 | void QAbstractItemView::openPersistentEditor(const QModelIndex &index) | - | ||||||||||||||||||||||||
2049 | { | - | ||||||||||||||||||||||||
2050 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2051 | QStyleOptionViewItem options = d->viewOptionsV1(); | - | ||||||||||||||||||||||||
2052 | options.rect = visualRect(index); | - | ||||||||||||||||||||||||
2053 | options.state |= (index == currentIndex()
| 0 | ||||||||||||||||||||||||
2054 | - | |||||||||||||||||||||||||
2055 | QWidget *editor = d->editor(index, options); | - | ||||||||||||||||||||||||
2056 | if (editor
| 0 | ||||||||||||||||||||||||
2057 | editor->show(); | - | ||||||||||||||||||||||||
2058 | d->persistent.insert(editor); | - | ||||||||||||||||||||||||
2059 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2060 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2061 | - | |||||||||||||||||||||||||
2062 | - | |||||||||||||||||||||||||
2063 | - | |||||||||||||||||||||||||
2064 | - | |||||||||||||||||||||||||
2065 | - | |||||||||||||||||||||||||
2066 | - | |||||||||||||||||||||||||
2067 | void QAbstractItemView::closePersistentEditor(const QModelIndex &index) | - | ||||||||||||||||||||||||
2068 | { | - | ||||||||||||||||||||||||
2069 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2070 | if (QWidget *editor = d->editorForIndex(index).widget.data()
| 0 | ||||||||||||||||||||||||
2071 | if (index == selectionModel()->currentIndex()
| 0 | ||||||||||||||||||||||||
2072 | closeEditor(editor, QAbstractItemDelegate::RevertModelCache); never executed: closeEditor(editor, QAbstractItemDelegate::RevertModelCache); | 0 | ||||||||||||||||||||||||
2073 | d->persistent.remove(editor); | - | ||||||||||||||||||||||||
2074 | d->removeEditor(editor); | - | ||||||||||||||||||||||||
2075 | d->releaseEditor(editor, index); | - | ||||||||||||||||||||||||
2076 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2077 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2078 | void QAbstractItemView::setIndexWidget(const QModelIndex &index, QWidget *widget) | - | ||||||||||||||||||||||||
2079 | { | - | ||||||||||||||||||||||||
2080 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2081 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||
2082 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2083 | if (indexWidget(index) == widget
| 0 | ||||||||||||||||||||||||
2084 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2085 | if (QWidget *oldWidget = indexWidget(index)
| 0 | ||||||||||||||||||||||||
2086 | d->persistent.remove(oldWidget); | - | ||||||||||||||||||||||||
2087 | d->removeEditor(oldWidget); | - | ||||||||||||||||||||||||
2088 | oldWidget->deleteLater(); | - | ||||||||||||||||||||||||
2089 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2090 | if (widget
| 0 | ||||||||||||||||||||||||
2091 | widget->setParent(viewport()); | - | ||||||||||||||||||||||||
2092 | d->persistent.insert(widget); | - | ||||||||||||||||||||||||
2093 | d->addEditor(index, widget, true); | - | ||||||||||||||||||||||||
2094 | widget->show(); | - | ||||||||||||||||||||||||
2095 | dataChanged(index, index); | - | ||||||||||||||||||||||||
2096 | if (!d->delayedPendingLayout
| 0 | ||||||||||||||||||||||||
2097 | widget->setGeometry(visualRect(index)); never executed: widget->setGeometry(visualRect(index)); | 0 | ||||||||||||||||||||||||
2098 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2099 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2100 | - | |||||||||||||||||||||||||
2101 | - | |||||||||||||||||||||||||
2102 | - | |||||||||||||||||||||||||
2103 | - | |||||||||||||||||||||||||
2104 | - | |||||||||||||||||||||||||
2105 | - | |||||||||||||||||||||||||
2106 | QWidget* QAbstractItemView::indexWidget(const QModelIndex &index) const | - | ||||||||||||||||||||||||
2107 | { | - | ||||||||||||||||||||||||
2108 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2109 | if (d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||
2110 | if (QWidget *editor = d->editorForIndex(index).widget.data()
| 0 | ||||||||||||||||||||||||
2111 | return never executed: editor;return editor; never executed: return editor; | 0 | ||||||||||||||||||||||||
2112 | - | |||||||||||||||||||||||||
2113 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
2114 | } | - | ||||||||||||||||||||||||
2115 | void QAbstractItemView::scrollToTop() | - | ||||||||||||||||||||||||
2116 | { | - | ||||||||||||||||||||||||
2117 | verticalScrollBar()->setValue(verticalScrollBar()->minimum()); | - | ||||||||||||||||||||||||
2118 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2119 | void QAbstractItemView::scrollToBottom() | - | ||||||||||||||||||||||||
2120 | { | - | ||||||||||||||||||||||||
2121 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2122 | if (d->delayedPendingLayout
| 0 | ||||||||||||||||||||||||
2123 | d->executePostedLayout(); | - | ||||||||||||||||||||||||
2124 | updateGeometries(); | - | ||||||||||||||||||||||||
2125 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2126 | verticalScrollBar()->setValue(verticalScrollBar()->maximum()); | - | ||||||||||||||||||||||||
2127 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2128 | - | |||||||||||||||||||||||||
2129 | - | |||||||||||||||||||||||||
2130 | - | |||||||||||||||||||||||||
2131 | - | |||||||||||||||||||||||||
2132 | - | |||||||||||||||||||||||||
2133 | - | |||||||||||||||||||||||||
2134 | - | |||||||||||||||||||||||||
2135 | void QAbstractItemView::update(const QModelIndex &index) | - | ||||||||||||||||||||||||
2136 | { | - | ||||||||||||||||||||||||
2137 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2138 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
2139 | const QRect rect = visualRect(index); | - | ||||||||||||||||||||||||
2140 | - | |||||||||||||||||||||||||
2141 | - | |||||||||||||||||||||||||
2142 | - | |||||||||||||||||||||||||
2143 | if (d->viewport->rect().intersects(rect)
| 0 | ||||||||||||||||||||||||
2144 | d->viewport->update(rect); never executed: d->viewport->update(rect); | 0 | ||||||||||||||||||||||||
2145 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2146 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2147 | void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles) | - | ||||||||||||||||||||||||
2148 | { | - | ||||||||||||||||||||||||
2149 | (void)roles;; | - | ||||||||||||||||||||||||
2150 | - | |||||||||||||||||||||||||
2151 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2152 | if (topLeft == bottomRight
| 0 | ||||||||||||||||||||||||
2153 | const QEditorInfo &editorInfo = d->editorForIndex(topLeft); | - | ||||||||||||||||||||||||
2154 | - | |||||||||||||||||||||||||
2155 | if (!editorInfo.isStatic
| 0 | ||||||||||||||||||||||||
2156 | QAbstractItemDelegate *delegate = d->delegateForIndex(topLeft); | - | ||||||||||||||||||||||||
2157 | if (delegate
| 0 | ||||||||||||||||||||||||
2158 | delegate->setEditorData(editorInfo.widget.data(), topLeft); | - | ||||||||||||||||||||||||
2159 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2160 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2161 | if (isVisible()
| 0 | ||||||||||||||||||||||||
2162 | - | |||||||||||||||||||||||||
2163 | update(topLeft); | - | ||||||||||||||||||||||||
2164 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2165 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2166 | d->updateEditorData(topLeft, bottomRight); | - | ||||||||||||||||||||||||
2167 | if (isVisible()
| 0 | ||||||||||||||||||||||||
2168 | d->viewport->update(); never executed: d->viewport->update(); | 0 | ||||||||||||||||||||||||
2169 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2170 | - | |||||||||||||||||||||||||
2171 | - | |||||||||||||||||||||||||
2172 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||
2173 | QAccessibleTableModelChangeEvent accessibleEvent(this, QAccessibleTableModelChangeEvent::DataChanged); | - | ||||||||||||||||||||||||
2174 | accessibleEvent.setFirstRow(topLeft.row()); | - | ||||||||||||||||||||||||
2175 | accessibleEvent.setFirstColumn(topLeft.column()); | - | ||||||||||||||||||||||||
2176 | accessibleEvent.setLastRow(bottomRight.row()); | - | ||||||||||||||||||||||||
2177 | accessibleEvent.setLastColumn(bottomRight.column()); | - | ||||||||||||||||||||||||
2178 | QAccessible::updateAccessibility(&accessibleEvent); | - | ||||||||||||||||||||||||
2179 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2180 | - | |||||||||||||||||||||||||
2181 | d->updateGeometry(); | - | ||||||||||||||||||||||||
2182 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2183 | void QAbstractItemView::rowsInserted(const QModelIndex &, int, int) | - | ||||||||||||||||||||||||
2184 | { | - | ||||||||||||||||||||||||
2185 | if (!isVisible()
| 0 | ||||||||||||||||||||||||
2186 | d_func()->fetchMoreTimer.start(0, this); never executed: d_func()->fetchMoreTimer.start(0, this); | 0 | ||||||||||||||||||||||||
2187 | else | - | ||||||||||||||||||||||||
2188 | updateEditorGeometries(); never executed: updateEditorGeometries(); | 0 | ||||||||||||||||||||||||
2189 | } | - | ||||||||||||||||||||||||
2190 | - | |||||||||||||||||||||||||
2191 | - | |||||||||||||||||||||||||
2192 | - | |||||||||||||||||||||||||
2193 | - | |||||||||||||||||||||||||
2194 | - | |||||||||||||||||||||||||
2195 | - | |||||||||||||||||||||||||
2196 | - | |||||||||||||||||||||||||
2197 | void QAbstractItemView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||
2198 | { | - | ||||||||||||||||||||||||
2199 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2200 | - | |||||||||||||||||||||||||
2201 | setState(CollapsingState); | - | ||||||||||||||||||||||||
2202 | - | |||||||||||||||||||||||||
2203 | - | |||||||||||||||||||||||||
2204 | QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||
2205 | if (d->selectionMode == SingleSelection
| 0 | ||||||||||||||||||||||||
2206 | && current.isValid()
| 0 | ||||||||||||||||||||||||
2207 | && current.row() >= start
| 0 | ||||||||||||||||||||||||
2208 | && current.row() <= end
| 0 | ||||||||||||||||||||||||
2209 | && current.parent() == parent
| 0 | ||||||||||||||||||||||||
2210 | int totalToRemove = end - start + 1; | - | ||||||||||||||||||||||||
2211 | if (d->model->rowCount(parent) <= totalToRemove
| 0 | ||||||||||||||||||||||||
2212 | QModelIndex index = parent; | - | ||||||||||||||||||||||||
2213 | while (index != d->root
| 0 | ||||||||||||||||||||||||
2214 | index = index.parent(); never executed: index = index.parent(); | 0 | ||||||||||||||||||||||||
2215 | if (index != d->root
| 0 | ||||||||||||||||||||||||
2216 | setCurrentIndex(index); never executed: setCurrentIndex(index); | 0 | ||||||||||||||||||||||||
2217 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2218 | int row = end + 1; | - | ||||||||||||||||||||||||
2219 | QModelIndex next; | - | ||||||||||||||||||||||||
2220 | do { | - | ||||||||||||||||||||||||
2221 | next = d->model->index(row++, current.column(), current.parent()); | - | ||||||||||||||||||||||||
2222 | } never executed: while (next.isValid()end of block
| 0 | ||||||||||||||||||||||||
2223 | if (row > d->model->rowCount(parent)
| 0 | ||||||||||||||||||||||||
2224 | row = start - 1; | - | ||||||||||||||||||||||||
2225 | do { | - | ||||||||||||||||||||||||
2226 | next = d->model->index(row--, current.column(), current.parent()); | - | ||||||||||||||||||||||||
2227 | } never executed: while (next.isValid()end of block
| 0 | ||||||||||||||||||||||||
2228 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2229 | setCurrentIndex(next); | - | ||||||||||||||||||||||||
2230 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2231 | } | - | ||||||||||||||||||||||||
2232 | - | |||||||||||||||||||||||||
2233 | - | |||||||||||||||||||||||||
2234 | QEditorIndexHash::iterator i = d->editorIndexHash.begin(); | - | ||||||||||||||||||||||||
2235 | while (i != d->editorIndexHash.end()
| 0 | ||||||||||||||||||||||||
2236 | const QModelIndex index = i.value(); | - | ||||||||||||||||||||||||
2237 | if (index.row() >= start
| 0 | ||||||||||||||||||||||||
2238 | QWidget *editor = i.key(); | - | ||||||||||||||||||||||||
2239 | QEditorInfo info = d->indexEditorHash.take(index); | - | ||||||||||||||||||||||||
2240 | i = d->editorIndexHash.erase(i); | - | ||||||||||||||||||||||||
2241 | if (info.widget
| 0 | ||||||||||||||||||||||||
2242 | d->releaseEditor(editor, index); never executed: d->releaseEditor(editor, index); | 0 | ||||||||||||||||||||||||
2243 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2244 | ++i; | - | ||||||||||||||||||||||||
2245 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2246 | } | - | ||||||||||||||||||||||||
2247 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2248 | void QAbstractItemViewPrivate::_q_rowsRemoved(const QModelIndex &index, int start, int end) | - | ||||||||||||||||||||||||
2249 | { | - | ||||||||||||||||||||||||
2250 | (void)index; | - | ||||||||||||||||||||||||
2251 | (void)start; | - | ||||||||||||||||||||||||
2252 | (void)end; | - | ||||||||||||||||||||||||
2253 | - | |||||||||||||||||||||||||
2254 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2255 | if (q->isVisible()
| 0 | ||||||||||||||||||||||||
2256 | q->updateEditorGeometries(); never executed: q->updateEditorGeometries(); | 0 | ||||||||||||||||||||||||
2257 | q->setState(QAbstractItemView::NoState); | - | ||||||||||||||||||||||||
2258 | - | |||||||||||||||||||||||||
2259 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||
2260 | QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::RowsRemoved); | - | ||||||||||||||||||||||||
2261 | accessibleEvent.setFirstRow(start); | - | ||||||||||||||||||||||||
2262 | accessibleEvent.setLastRow(end); | - | ||||||||||||||||||||||||
2263 | QAccessible::updateAccessibility(&accessibleEvent); | - | ||||||||||||||||||||||||
2264 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2265 | - | |||||||||||||||||||||||||
2266 | updateGeometry(); | - | ||||||||||||||||||||||||
2267 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2268 | void QAbstractItemViewPrivate::_q_columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||
2269 | { | - | ||||||||||||||||||||||||
2270 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2271 | - | |||||||||||||||||||||||||
2272 | q->setState(QAbstractItemView::CollapsingState); | - | ||||||||||||||||||||||||
2273 | - | |||||||||||||||||||||||||
2274 | - | |||||||||||||||||||||||||
2275 | QModelIndex current = q->currentIndex(); | - | ||||||||||||||||||||||||
2276 | if (current.isValid()
| 0 | ||||||||||||||||||||||||
2277 | && selectionMode == QAbstractItemView::SingleSelection
| 0 | ||||||||||||||||||||||||
2278 | && current.column() >= start
| 0 | ||||||||||||||||||||||||
2279 | && current.column() <= end
| 0 | ||||||||||||||||||||||||
2280 | int totalToRemove = end - start + 1; | - | ||||||||||||||||||||||||
2281 | if (model->columnCount(parent) < totalToRemove
| 0 | ||||||||||||||||||||||||
2282 | QModelIndex index = parent; | - | ||||||||||||||||||||||||
2283 | while (index.isValid()
| 0 | ||||||||||||||||||||||||
2284 | index = index.parent(); never executed: index = index.parent(); | 0 | ||||||||||||||||||||||||
2285 | if (index.isValid()
| 0 | ||||||||||||||||||||||||
2286 | q->setCurrentIndex(index); never executed: q->setCurrentIndex(index); | 0 | ||||||||||||||||||||||||
2287 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2288 | int column = end; | - | ||||||||||||||||||||||||
2289 | QModelIndex next; | - | ||||||||||||||||||||||||
2290 | do { | - | ||||||||||||||||||||||||
2291 | next = model->index(current.row(), column++, current.parent()); | - | ||||||||||||||||||||||||
2292 | } never executed: while (next.isValid()end of block
| 0 | ||||||||||||||||||||||||
2293 | q->setCurrentIndex(next); | - | ||||||||||||||||||||||||
2294 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2295 | } | - | ||||||||||||||||||||||||
2296 | - | |||||||||||||||||||||||||
2297 | - | |||||||||||||||||||||||||
2298 | QEditorIndexHash::iterator it = editorIndexHash.begin(); | - | ||||||||||||||||||||||||
2299 | while (it != editorIndexHash.end()
| 0 | ||||||||||||||||||||||||
2300 | QModelIndex index = it.value(); | - | ||||||||||||||||||||||||
2301 | if (index.column() <= start
| 0 | ||||||||||||||||||||||||
2302 | QWidget *editor = it.key(); | - | ||||||||||||||||||||||||
2303 | QEditorInfo info = indexEditorHash.take(it.value()); | - | ||||||||||||||||||||||||
2304 | it = editorIndexHash.erase(it); | - | ||||||||||||||||||||||||
2305 | if (info.widget
| 0 | ||||||||||||||||||||||||
2306 | releaseEditor(editor, index); never executed: releaseEditor(editor, index); | 0 | ||||||||||||||||||||||||
2307 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2308 | ++it; | - | ||||||||||||||||||||||||
2309 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2310 | } | - | ||||||||||||||||||||||||
2311 | - | |||||||||||||||||||||||||
2312 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2313 | void QAbstractItemViewPrivate::_q_columnsRemoved(const QModelIndex &index, int start, int end) | - | ||||||||||||||||||||||||
2314 | { | - | ||||||||||||||||||||||||
2315 | (void)index; | - | ||||||||||||||||||||||||
2316 | (void)start; | - | ||||||||||||||||||||||||
2317 | (void)end; | - | ||||||||||||||||||||||||
2318 | - | |||||||||||||||||||||||||
2319 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2320 | if (q->isVisible()
| 0 | ||||||||||||||||||||||||
2321 | q->updateEditorGeometries(); never executed: q->updateEditorGeometries(); | 0 | ||||||||||||||||||||||||
2322 | q->setState(QAbstractItemView::NoState); | - | ||||||||||||||||||||||||
2323 | - | |||||||||||||||||||||||||
2324 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||
2325 | QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::ColumnsRemoved); | - | ||||||||||||||||||||||||
2326 | accessibleEvent.setFirstColumn(start); | - | ||||||||||||||||||||||||
2327 | accessibleEvent.setLastColumn(end); | - | ||||||||||||||||||||||||
2328 | QAccessible::updateAccessibility(&accessibleEvent); | - | ||||||||||||||||||||||||
2329 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2330 | - | |||||||||||||||||||||||||
2331 | updateGeometry(); | - | ||||||||||||||||||||||||
2332 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2333 | - | |||||||||||||||||||||||||
2334 | - | |||||||||||||||||||||||||
2335 | - | |||||||||||||||||||||||||
2336 | - | |||||||||||||||||||||||||
2337 | - | |||||||||||||||||||||||||
2338 | - | |||||||||||||||||||||||||
2339 | - | |||||||||||||||||||||||||
2340 | void QAbstractItemViewPrivate::_q_rowsInserted(const QModelIndex &index, int start, int end) | - | ||||||||||||||||||||||||
2341 | { | - | ||||||||||||||||||||||||
2342 | (void)index; | - | ||||||||||||||||||||||||
2343 | (void)start; | - | ||||||||||||||||||||||||
2344 | (void)end; | - | ||||||||||||||||||||||||
2345 | - | |||||||||||||||||||||||||
2346 | - | |||||||||||||||||||||||||
2347 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2348 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||
2349 | QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::RowsInserted); | - | ||||||||||||||||||||||||
2350 | accessibleEvent.setFirstRow(start); | - | ||||||||||||||||||||||||
2351 | accessibleEvent.setLastRow(end); | - | ||||||||||||||||||||||||
2352 | QAccessible::updateAccessibility(&accessibleEvent); | - | ||||||||||||||||||||||||
2353 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2354 | - | |||||||||||||||||||||||||
2355 | updateGeometry(); | - | ||||||||||||||||||||||||
2356 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2357 | - | |||||||||||||||||||||||||
2358 | - | |||||||||||||||||||||||||
2359 | - | |||||||||||||||||||||||||
2360 | - | |||||||||||||||||||||||||
2361 | - | |||||||||||||||||||||||||
2362 | - | |||||||||||||||||||||||||
2363 | void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &index, int start, int end) | - | ||||||||||||||||||||||||
2364 | { | - | ||||||||||||||||||||||||
2365 | (void)index; | - | ||||||||||||||||||||||||
2366 | (void)start; | - | ||||||||||||||||||||||||
2367 | (void)end; | - | ||||||||||||||||||||||||
2368 | - | |||||||||||||||||||||||||
2369 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2370 | if (q->isVisible()
| 0 | ||||||||||||||||||||||||
2371 | q->updateEditorGeometries(); never executed: q->updateEditorGeometries(); | 0 | ||||||||||||||||||||||||
2372 | - | |||||||||||||||||||||||||
2373 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||
2374 | QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::ColumnsInserted); | - | ||||||||||||||||||||||||
2375 | accessibleEvent.setFirstColumn(start); | - | ||||||||||||||||||||||||
2376 | accessibleEvent.setLastColumn(end); | - | ||||||||||||||||||||||||
2377 | QAccessible::updateAccessibility(&accessibleEvent); | - | ||||||||||||||||||||||||
2378 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2379 | - | |||||||||||||||||||||||||
2380 | updateGeometry(); | - | ||||||||||||||||||||||||
2381 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2382 | - | |||||||||||||||||||||||||
2383 | - | |||||||||||||||||||||||||
2384 | - | |||||||||||||||||||||||||
2385 | - | |||||||||||||||||||||||||
2386 | void QAbstractItemViewPrivate::_q_modelDestroyed() | - | ||||||||||||||||||||||||
2387 | { | - | ||||||||||||||||||||||||
2388 | model = QAbstractItemModelPrivate::staticEmptyModel(); | - | ||||||||||||||||||||||||
2389 | doDelayedReset(); | - | ||||||||||||||||||||||||
2390 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2391 | - | |||||||||||||||||||||||||
2392 | - | |||||||||||||||||||||||||
2393 | - | |||||||||||||||||||||||||
2394 | - | |||||||||||||||||||||||||
2395 | - | |||||||||||||||||||||||||
2396 | - | |||||||||||||||||||||||||
2397 | void QAbstractItemViewPrivate::_q_layoutChanged() | - | ||||||||||||||||||||||||
2398 | { | - | ||||||||||||||||||||||||
2399 | doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
2400 | - | |||||||||||||||||||||||||
2401 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2402 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||
2403 | QAccessibleTableModelChangeEvent accessibleEvent(q, QAccessibleTableModelChangeEvent::ModelReset); | - | ||||||||||||||||||||||||
2404 | QAccessible::updateAccessibility(&accessibleEvent); | - | ||||||||||||||||||||||||
2405 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2406 | - | |||||||||||||||||||||||||
2407 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2408 | - | |||||||||||||||||||||||||
2409 | void QAbstractItemViewPrivate::_q_rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int) | - | ||||||||||||||||||||||||
2410 | { | - | ||||||||||||||||||||||||
2411 | _q_layoutChanged(); | - | ||||||||||||||||||||||||
2412 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2413 | - | |||||||||||||||||||||||||
2414 | void QAbstractItemViewPrivate::_q_columnsMoved(const QModelIndex &, int, int, const QModelIndex &, int) | - | ||||||||||||||||||||||||
2415 | { | - | ||||||||||||||||||||||||
2416 | _q_layoutChanged(); | - | ||||||||||||||||||||||||
2417 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2418 | void QAbstractItemView::selectionChanged(const QItemSelection &selected, | - | ||||||||||||||||||||||||
2419 | const QItemSelection &deselected) | - | ||||||||||||||||||||||||
2420 | { | - | ||||||||||||||||||||||||
2421 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2422 | if (isVisible()
| 0 | ||||||||||||||||||||||||
2423 | d->viewport->update(visualRegionForSelection(deselected) | visualRegionForSelection(selected)); | - | ||||||||||||||||||||||||
2424 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2425 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2426 | void QAbstractItemView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) | - | ||||||||||||||||||||||||
2427 | { | - | ||||||||||||||||||||||||
2428 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2429 | ((!(d->model)) ? qt_assert("d->model",__FILE__,3573) : qt_noop()); | - | ||||||||||||||||||||||||
2430 | - | |||||||||||||||||||||||||
2431 | if (previous.isValid()
| 0 | ||||||||||||||||||||||||
2432 | QModelIndex buddy = d->model->buddy(previous); | - | ||||||||||||||||||||||||
2433 | QWidget *editor = d->editorForIndex(buddy).widget.data(); | - | ||||||||||||||||||||||||
2434 | if (editor
| 0 | ||||||||||||||||||||||||
2435 | commitData(editor); | - | ||||||||||||||||||||||||
2436 | if (current.row() != previous.row()
| 0 | ||||||||||||||||||||||||
2437 | closeEditor(editor, QAbstractItemDelegate::SubmitModelCache); never executed: closeEditor(editor, QAbstractItemDelegate::SubmitModelCache); | 0 | ||||||||||||||||||||||||
2438 | else | - | ||||||||||||||||||||||||
2439 | closeEditor(editor, QAbstractItemDelegate::NoHint); never executed: closeEditor(editor, QAbstractItemDelegate::NoHint); | 0 | ||||||||||||||||||||||||
2440 | } | - | ||||||||||||||||||||||||
2441 | if (isVisible()
| 0 | ||||||||||||||||||||||||
2442 | update(previous); | - | ||||||||||||||||||||||||
2443 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2444 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2445 | - | |||||||||||||||||||||||||
2446 | if (current.isValid()
| 0 | ||||||||||||||||||||||||
2447 | if (isVisible()
| 0 | ||||||||||||||||||||||||
2448 | if (d->autoScroll
| 0 | ||||||||||||||||||||||||
2449 | scrollTo(current); never executed: scrollTo(current); | 0 | ||||||||||||||||||||||||
2450 | update(current); | - | ||||||||||||||||||||||||
2451 | edit(current, CurrentChanged, 0); | - | ||||||||||||||||||||||||
2452 | if (current.row() == (d->model->rowCount(d->root) - 1)
| 0 | ||||||||||||||||||||||||
2453 | d->fetchMore(); never executed: d->fetchMore(); | 0 | ||||||||||||||||||||||||
2454 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2455 | d->shouldScrollToCurrentOnShow = d->autoScroll; | - | ||||||||||||||||||||||||
2456 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2457 | } | - | ||||||||||||||||||||||||
2458 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2459 | - | |||||||||||||||||||||||||
2460 | - | |||||||||||||||||||||||||
2461 | - | |||||||||||||||||||||||||
2462 | - | |||||||||||||||||||||||||
2463 | - | |||||||||||||||||||||||||
2464 | void QAbstractItemView::startDrag(Qt::DropActions supportedActions) | - | ||||||||||||||||||||||||
2465 | { | - | ||||||||||||||||||||||||
2466 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2467 | QModelIndexList indexes = d->selectedDraggableIndexes(); | - | ||||||||||||||||||||||||
2468 | if (indexes.count() > 0
| 0 | ||||||||||||||||||||||||
2469 | QMimeData *data = d->model->mimeData(indexes); | - | ||||||||||||||||||||||||
2470 | if (!data
| 0 | ||||||||||||||||||||||||
2471 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2472 | QRect rect; | - | ||||||||||||||||||||||||
2473 | QPixmap pixmap = d->renderToPixmap(indexes, &rect); | - | ||||||||||||||||||||||||
2474 | rect.adjust(horizontalOffset(), verticalOffset(), 0, 0); | - | ||||||||||||||||||||||||
2475 | QDrag *drag = new QDrag(this); | - | ||||||||||||||||||||||||
2476 | drag->setPixmap(pixmap); | - | ||||||||||||||||||||||||
2477 | drag->setMimeData(data); | - | ||||||||||||||||||||||||
2478 | drag->setHotSpot(d->pressedPosition - rect.topLeft()); | - | ||||||||||||||||||||||||
2479 | Qt::DropAction defaultDropAction = Qt::IgnoreAction; | - | ||||||||||||||||||||||||
2480 | if (d->defaultDropAction != Qt::IgnoreAction
| 0 | ||||||||||||||||||||||||
2481 | defaultDropAction = d->defaultDropAction; never executed: defaultDropAction = d->defaultDropAction; | 0 | ||||||||||||||||||||||||
2482 | else if (supportedActions & Qt::CopyAction
| 0 | ||||||||||||||||||||||||
2483 | defaultDropAction = Qt::CopyAction; never executed: defaultDropAction = Qt::CopyAction; | 0 | ||||||||||||||||||||||||
2484 | if (drag->exec(supportedActions, defaultDropAction) == Qt::MoveAction
| 0 | ||||||||||||||||||||||||
2485 | d->clearOrRemove(); never executed: d->clearOrRemove(); | 0 | ||||||||||||||||||||||||
2486 | - | |||||||||||||||||||||||||
2487 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
2488 | d->dropIndicatorPosition = OnItem; | - | ||||||||||||||||||||||||
2489 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2490 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2491 | - | |||||||||||||||||||||||||
2492 | - | |||||||||||||||||||||||||
2493 | - | |||||||||||||||||||||||||
2494 | - | |||||||||||||||||||||||||
2495 | - | |||||||||||||||||||||||||
2496 | - | |||||||||||||||||||||||||
2497 | QStyleOptionViewItem QAbstractItemView::viewOptions() const | - | ||||||||||||||||||||||||
2498 | { | - | ||||||||||||||||||||||||
2499 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2500 | QStyleOptionViewItem option; | - | ||||||||||||||||||||||||
2501 | option.init(this); | - | ||||||||||||||||||||||||
2502 | option.state &= ~QStyle::State_MouseOver; | - | ||||||||||||||||||||||||
2503 | option.font = font(); | - | ||||||||||||||||||||||||
2504 | - | |||||||||||||||||||||||||
2505 | - | |||||||||||||||||||||||||
2506 | - | |||||||||||||||||||||||||
2507 | - | |||||||||||||||||||||||||
2508 | if (!hasFocus()
| 0 | ||||||||||||||||||||||||
2509 | option.state &= ~QStyle::State_Active; never executed: option.state &= ~QStyle::State_Active; | 0 | ||||||||||||||||||||||||
2510 | - | |||||||||||||||||||||||||
2511 | - | |||||||||||||||||||||||||
2512 | option.state &= ~QStyle::State_HasFocus; | - | ||||||||||||||||||||||||
2513 | if (d->iconSize.isValid()
| 0 | ||||||||||||||||||||||||
2514 | option.decorationSize = d->iconSize; | - | ||||||||||||||||||||||||
2515 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2516 | int pm = style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this); | - | ||||||||||||||||||||||||
2517 | option.decorationSize = QSize(pm, pm); | - | ||||||||||||||||||||||||
2518 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2519 | option.decorationPosition = QStyleOptionViewItem::Left; | - | ||||||||||||||||||||||||
2520 | option.decorationAlignment = Qt::AlignCenter; | - | ||||||||||||||||||||||||
2521 | option.displayAlignment = Qt::AlignLeft|Qt::AlignVCenter; | - | ||||||||||||||||||||||||
2522 | option.textElideMode = d->textElideMode; | - | ||||||||||||||||||||||||
2523 | option.rect = QRect(); | - | ||||||||||||||||||||||||
2524 | option.showDecorationSelected = style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, 0, this); | - | ||||||||||||||||||||||||
2525 | if (d->wrapItemText
| 0 | ||||||||||||||||||||||||
2526 | option.features = QStyleOptionViewItem::WrapText; never executed: option.features = QStyleOptionViewItem::WrapText; | 0 | ||||||||||||||||||||||||
2527 | option.locale = locale(); | - | ||||||||||||||||||||||||
2528 | option.locale.setNumberOptions(QLocale::OmitGroupSeparator); | - | ||||||||||||||||||||||||
2529 | option.widget = this; | - | ||||||||||||||||||||||||
2530 | return never executed: option;return option; never executed: return option; | 0 | ||||||||||||||||||||||||
2531 | } | - | ||||||||||||||||||||||||
2532 | - | |||||||||||||||||||||||||
2533 | QStyleOptionViewItem QAbstractItemViewPrivate::viewOptionsV1() const | - | ||||||||||||||||||||||||
2534 | { | - | ||||||||||||||||||||||||
2535 | const QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2536 | return never executed: q->viewOptions();return q->viewOptions(); never executed: return q->viewOptions(); | 0 | ||||||||||||||||||||||||
2537 | } | - | ||||||||||||||||||||||||
2538 | - | |||||||||||||||||||||||||
2539 | - | |||||||||||||||||||||||||
2540 | - | |||||||||||||||||||||||||
2541 | - | |||||||||||||||||||||||||
2542 | - | |||||||||||||||||||||||||
2543 | - | |||||||||||||||||||||||||
2544 | QAbstractItemView::State QAbstractItemView::state() const | - | ||||||||||||||||||||||||
2545 | { | - | ||||||||||||||||||||||||
2546 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2547 | return never executed: d->state;return d->state; never executed: return d->state; | 0 | ||||||||||||||||||||||||
2548 | } | - | ||||||||||||||||||||||||
2549 | - | |||||||||||||||||||||||||
2550 | - | |||||||||||||||||||||||||
2551 | - | |||||||||||||||||||||||||
2552 | - | |||||||||||||||||||||||||
2553 | - | |||||||||||||||||||||||||
2554 | - | |||||||||||||||||||||||||
2555 | void QAbstractItemView::setState(State state) | - | ||||||||||||||||||||||||
2556 | { | - | ||||||||||||||||||||||||
2557 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2558 | d->state = state; | - | ||||||||||||||||||||||||
2559 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2560 | void QAbstractItemView::scheduleDelayedItemsLayout() | - | ||||||||||||||||||||||||
2561 | { | - | ||||||||||||||||||||||||
2562 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2563 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||
2564 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2565 | - | |||||||||||||||||||||||||
2566 | - | |||||||||||||||||||||||||
2567 | - | |||||||||||||||||||||||||
2568 | - | |||||||||||||||||||||||||
2569 | - | |||||||||||||||||||||||||
2570 | - | |||||||||||||||||||||||||
2571 | - | |||||||||||||||||||||||||
2572 | void QAbstractItemView::executeDelayedItemsLayout() | - | ||||||||||||||||||||||||
2573 | { | - | ||||||||||||||||||||||||
2574 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2575 | d->executePostedLayout(); | - | ||||||||||||||||||||||||
2576 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2577 | void QAbstractItemView::setDirtyRegion(const QRegion ®ion) | - | ||||||||||||||||||||||||
2578 | { | - | ||||||||||||||||||||||||
2579 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2580 | d->setDirtyRegion(region); | - | ||||||||||||||||||||||||
2581 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2582 | void QAbstractItemView::scrollDirtyRegion(int dx, int dy) | - | ||||||||||||||||||||||||
2583 | { | - | ||||||||||||||||||||||||
2584 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2585 | d->scrollDirtyRegion(dx, dy); | - | ||||||||||||||||||||||||
2586 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2587 | QPoint QAbstractItemView::dirtyRegionOffset() const | - | ||||||||||||||||||||||||
2588 | { | - | ||||||||||||||||||||||||
2589 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2590 | return never executed: d->scrollDelayOffset;return d->scrollDelayOffset; never executed: return d->scrollDelayOffset; | 0 | ||||||||||||||||||||||||
2591 | } | - | ||||||||||||||||||||||||
2592 | - | |||||||||||||||||||||||||
2593 | - | |||||||||||||||||||||||||
2594 | - | |||||||||||||||||||||||||
2595 | - | |||||||||||||||||||||||||
2596 | void QAbstractItemView::startAutoScroll() | - | ||||||||||||||||||||||||
2597 | { | - | ||||||||||||||||||||||||
2598 | d_func()->startAutoScroll(); | - | ||||||||||||||||||||||||
2599 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2600 | - | |||||||||||||||||||||||||
2601 | - | |||||||||||||||||||||||||
2602 | - | |||||||||||||||||||||||||
2603 | - | |||||||||||||||||||||||||
2604 | void QAbstractItemView::stopAutoScroll() | - | ||||||||||||||||||||||||
2605 | { | - | ||||||||||||||||||||||||
2606 | d_func()->stopAutoScroll(); | - | ||||||||||||||||||||||||
2607 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2608 | - | |||||||||||||||||||||||||
2609 | - | |||||||||||||||||||||||||
2610 | - | |||||||||||||||||||||||||
2611 | - | |||||||||||||||||||||||||
2612 | void QAbstractItemView::doAutoScroll() | - | ||||||||||||||||||||||||
2613 | { | - | ||||||||||||||||||||||||
2614 | - | |||||||||||||||||||||||||
2615 | QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2616 | QScrollBar *verticalScroll = verticalScrollBar(); | - | ||||||||||||||||||||||||
2617 | QScrollBar *horizontalScroll = horizontalScrollBar(); | - | ||||||||||||||||||||||||
2618 | - | |||||||||||||||||||||||||
2619 | - | |||||||||||||||||||||||||
2620 | - | |||||||||||||||||||||||||
2621 | QHeaderView *hv = qobject_cast<QHeaderView*>(this); | - | ||||||||||||||||||||||||
2622 | if (hv
| 0 | ||||||||||||||||||||||||
2623 | QAbstractScrollArea *parent = qobject_cast<QAbstractScrollArea*>(parentWidget()); | - | ||||||||||||||||||||||||
2624 | if (parent
| 0 | ||||||||||||||||||||||||
2625 | if (hv->orientation() == Qt::Horizontal
| 0 | ||||||||||||||||||||||||
2626 | if (!hv->horizontalScrollBar()
| 0 | ||||||||||||||||||||||||
2627 | horizontalScroll = parent->horizontalScrollBar(); never executed: horizontalScroll = parent->horizontalScrollBar(); | 0 | ||||||||||||||||||||||||
2628 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2629 | if (!hv->verticalScrollBar()
| 0 | ||||||||||||||||||||||||
2630 | verticalScroll = parent->verticalScrollBar(); never executed: verticalScroll = parent->verticalScrollBar(); | 0 | ||||||||||||||||||||||||
2631 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2632 | } | - | ||||||||||||||||||||||||
2633 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2634 | - | |||||||||||||||||||||||||
2635 | int verticalStep = verticalScroll->pageStep(); | - | ||||||||||||||||||||||||
2636 | int horizontalStep = horizontalScroll->pageStep(); | - | ||||||||||||||||||||||||
2637 | if (d->autoScrollCount < qMax(verticalStep, horizontalStep)
| 0 | ||||||||||||||||||||||||
2638 | ++ never executed: d->autoScrollCount;++d->autoScrollCount; never executed: ++d->autoScrollCount; | 0 | ||||||||||||||||||||||||
2639 | - | |||||||||||||||||||||||||
2640 | int margin = d->autoScrollMargin; | - | ||||||||||||||||||||||||
2641 | int verticalValue = verticalScroll->value(); | - | ||||||||||||||||||||||||
2642 | int horizontalValue = horizontalScroll->value(); | - | ||||||||||||||||||||||||
2643 | - | |||||||||||||||||||||||||
2644 | QPoint pos = d->viewport->mapFromGlobal(QCursor::pos()); | - | ||||||||||||||||||||||||
2645 | QRect area = QWidgetPrivate::get(d->viewport)->clipRect(); | - | ||||||||||||||||||||||||
2646 | - | |||||||||||||||||||||||||
2647 | - | |||||||||||||||||||||||||
2648 | if (pos.y() - area.top() < margin
| 0 | ||||||||||||||||||||||||
2649 | verticalScroll->setValue(verticalValue - d->autoScrollCount); never executed: verticalScroll->setValue(verticalValue - d->autoScrollCount); | 0 | ||||||||||||||||||||||||
2650 | else if (area.bottom() - pos.y() < margin
| 0 | ||||||||||||||||||||||||
2651 | verticalScroll->setValue(verticalValue + d->autoScrollCount); never executed: verticalScroll->setValue(verticalValue + d->autoScrollCount); | 0 | ||||||||||||||||||||||||
2652 | if (pos.x() - area.left() < margin
| 0 | ||||||||||||||||||||||||
2653 | horizontalScroll->setValue(horizontalValue - d->autoScrollCount); never executed: horizontalScroll->setValue(horizontalValue - d->autoScrollCount); | 0 | ||||||||||||||||||||||||
2654 | else if (area.right() - pos.x() < margin
| 0 | ||||||||||||||||||||||||
2655 | horizontalScroll->setValue(horizontalValue + d->autoScrollCount); never executed: horizontalScroll->setValue(horizontalValue + d->autoScrollCount); | 0 | ||||||||||||||||||||||||
2656 | - | |||||||||||||||||||||||||
2657 | bool verticalUnchanged = (verticalValue == verticalScroll->value()); | - | ||||||||||||||||||||||||
2658 | bool horizontalUnchanged = (horizontalValue == horizontalScroll->value()); | - | ||||||||||||||||||||||||
2659 | if (verticalUnchanged
| 0 | ||||||||||||||||||||||||
2660 | stopAutoScroll(); | - | ||||||||||||||||||||||||
2661 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
2662 | - | |||||||||||||||||||||||||
2663 | d->dropIndicatorRect = QRect(); | - | ||||||||||||||||||||||||
2664 | d->dropIndicatorPosition = QAbstractItemView::OnViewport; | - | ||||||||||||||||||||||||
2665 | - | |||||||||||||||||||||||||
2666 | d->viewport->update(); | - | ||||||||||||||||||||||||
2667 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2668 | } | - | ||||||||||||||||||||||||
2669 | QItemSelectionModel::SelectionFlags QAbstractItemView::selectionCommand(const QModelIndex &index, | - | ||||||||||||||||||||||||
2670 | const QEvent *event) const | - | ||||||||||||||||||||||||
2671 | { | - | ||||||||||||||||||||||||
2672 | const QAbstractItemViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
2673 | Qt::KeyboardModifiers keyModifiers = Qt::NoModifier; | - | ||||||||||||||||||||||||
2674 | if (event
| 0 | ||||||||||||||||||||||||
2675 | switch (event->type()) { | - | ||||||||||||||||||||||||
2676 | case never executed: QEvent::MouseButtonDblClick:case QEvent::MouseButtonDblClick: never executed: case QEvent::MouseButtonDblClick: | 0 | ||||||||||||||||||||||||
2677 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress: never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
2678 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease: never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
2679 | case never executed: QEvent::MouseMove:case QEvent::MouseMove: never executed: case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||
2680 | case never executed: QEvent::KeyPress:case QEvent::KeyPress: never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
2681 | case never executed: QEvent::KeyRelease:case QEvent::KeyRelease: never executed: case QEvent::KeyRelease: | 0 | ||||||||||||||||||||||||
2682 | keyModifiers = (static_cast<const QInputEvent*>(event))->modifiers(); | - | ||||||||||||||||||||||||
2683 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2684 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
2685 | keyModifiers = QApplication::keyboardModifiers(); | - | ||||||||||||||||||||||||
2686 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2687 | } | - | ||||||||||||||||||||||||
2688 | switch (d->selectionMode) { | - | ||||||||||||||||||||||||
2689 | case never executed: NoSelection:case NoSelection: never executed: case NoSelection: | 0 | ||||||||||||||||||||||||
2690 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2691 | case never executed: SingleSelection:case SingleSelection: never executed: case SingleSelection: | 0 | ||||||||||||||||||||||||
2692 | if (event
| 0 | ||||||||||||||||||||||||
2693 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2694 | if ((
| 0 | ||||||||||||||||||||||||
2695 | return never executed: QItemSelectionModel::Deselect | d->selectionBehaviorFlags();return QItemSelectionModel::Deselect | d->selectionBehaviorFlags(); never executed: return QItemSelectionModel::Deselect | d->selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2696 | else | - | ||||||||||||||||||||||||
2697 | return never executed: QItemSelectionModel::ClearAndSelect | d->selectionBehaviorFlags();return QItemSelectionModel::ClearAndSelect | d->selectionBehaviorFlags(); never executed: return QItemSelectionModel::ClearAndSelect | d->selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2698 | case never executed: MultiSelection:case MultiSelection: never executed: case MultiSelection: | 0 | ||||||||||||||||||||||||
2699 | return never executed: d->multiSelectionCommand(index, event);return d->multiSelectionCommand(index, event); never executed: return d->multiSelectionCommand(index, event); | 0 | ||||||||||||||||||||||||
2700 | case never executed: ExtendedSelection:case ExtendedSelection: never executed: case ExtendedSelection: | 0 | ||||||||||||||||||||||||
2701 | return never executed: d->extendedSelectionCommand(index, event);return d->extendedSelectionCommand(index, event); never executed: return d->extendedSelectionCommand(index, event); | 0 | ||||||||||||||||||||||||
2702 | case never executed: ContiguousSelection:case ContiguousSelection: never executed: case ContiguousSelection: | 0 | ||||||||||||||||||||||||
2703 | return never executed: d->contiguousSelectionCommand(index, event);return d->contiguousSelectionCommand(index, event); never executed: return d->contiguousSelectionCommand(index, event); | 0 | ||||||||||||||||||||||||
2704 | } | - | ||||||||||||||||||||||||
2705 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2706 | } | - | ||||||||||||||||||||||||
2707 | - | |||||||||||||||||||||||||
2708 | QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::multiSelectionCommand( | - | ||||||||||||||||||||||||
2709 | const QModelIndex &index, const QEvent *event) const | - | ||||||||||||||||||||||||
2710 | { | - | ||||||||||||||||||||||||
2711 | (void)index; | - | ||||||||||||||||||||||||
2712 | - | |||||||||||||||||||||||||
2713 | if (event
| 0 | ||||||||||||||||||||||||
2714 | switch (event->type()) { | - | ||||||||||||||||||||||||
2715 | case never executed: QEvent::KeyPress:case QEvent::KeyPress: never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
2716 | if (static_cast<const
| 0 | ||||||||||||||||||||||||
2717 | || static_cast<const
| 0 | ||||||||||||||||||||||||
2718 | return never executed: QItemSelectionModel::Toggle|selectionBehaviorFlags();return QItemSelectionModel::Toggle|selectionBehaviorFlags(); never executed: return QItemSelectionModel::Toggle|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2719 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2720 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress: never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
2721 | if (static_cast<const
| 0 | ||||||||||||||||||||||||
2722 | return never executed: QItemSelectionModel::Toggle|selectionBehaviorFlags();return QItemSelectionModel::Toggle|selectionBehaviorFlags(); never executed: return QItemSelectionModel::Toggle|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2723 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2724 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease: never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
2725 | if (static_cast<const
| 0 | ||||||||||||||||||||||||
2726 | return never executed: QItemSelectionModel::NoUpdate|selectionBehaviorFlags();return QItemSelectionModel::NoUpdate|selectionBehaviorFlags(); never executed: return QItemSelectionModel::NoUpdate|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2727 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2728 | case never executed: QEvent::MouseMove:case QEvent::MouseMove: never executed: case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||
2729 | if (static_cast<const
| 0 | ||||||||||||||||||||||||
2730 | return never executed: QItemSelectionModel::ToggleCurrent|selectionBehaviorFlags();return QItemSelectionModel::ToggleCurrent|selectionBehaviorFlags(); never executed: return QItemSelectionModel::ToggleCurrent|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2731 | default never executed: :default: never executed: default: code before this statement never executed: default: | 0 | ||||||||||||||||||||||||
2732 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2733 | } | - | ||||||||||||||||||||||||
2734 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2735 | } | - | ||||||||||||||||||||||||
2736 | - | |||||||||||||||||||||||||
2737 | return never executed: QItemSelectionModel::Toggle|selectionBehaviorFlags();return QItemSelectionModel::Toggle|selectionBehaviorFlags(); never executed: return QItemSelectionModel::Toggle|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2738 | } | - | ||||||||||||||||||||||||
2739 | - | |||||||||||||||||||||||||
2740 | QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionCommand( | - | ||||||||||||||||||||||||
2741 | const QModelIndex &index, const QEvent *event) const | - | ||||||||||||||||||||||||
2742 | { | - | ||||||||||||||||||||||||
2743 | Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers(); | - | ||||||||||||||||||||||||
2744 | if (event
| 0 | ||||||||||||||||||||||||
2745 | switch (event->type()) { | - | ||||||||||||||||||||||||
2746 | case never executed: QEvent::MouseMove:case QEvent::MouseMove: never executed: {case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||
2747 | - | |||||||||||||||||||||||||
2748 | modifiers = static_cast<const QMouseEvent*>(event)->modifiers(); | - | ||||||||||||||||||||||||
2749 | if (modifiers & Qt::ControlModifier
| 0 | ||||||||||||||||||||||||
2750 | return never executed: QItemSelectionModel::ToggleCurrent|selectionBehaviorFlags();return QItemSelectionModel::ToggleCurrent|selectionBehaviorFlags(); never executed: return QItemSelectionModel::ToggleCurrent|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2751 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2752 | } | - | ||||||||||||||||||||||||
2753 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress: never executed: {case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
2754 | modifiers = static_cast<const QMouseEvent*>(event)->modifiers(); | - | ||||||||||||||||||||||||
2755 | const Qt::MouseButton button = static_cast<const QMouseEvent*>(event)->button(); | - | ||||||||||||||||||||||||
2756 | const bool rightButtonPressed = button & Qt::RightButton; | - | ||||||||||||||||||||||||
2757 | const bool shiftKeyPressed = modifiers & Qt::ShiftModifier; | - | ||||||||||||||||||||||||
2758 | const bool controlKeyPressed = modifiers & Qt::ControlModifier; | - | ||||||||||||||||||||||||
2759 | const bool indexIsSelected = selectionModel->isSelected(index); | - | ||||||||||||||||||||||||
2760 | if ((shiftKeyPressed
| 0 | ||||||||||||||||||||||||
2761 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2762 | if (!shiftKeyPressed
| 0 | ||||||||||||||||||||||||
2763 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2764 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
2765 | return never executed: QItemSelectionModel::Clear;return QItemSelectionModel::Clear; never executed: return QItemSelectionModel::Clear; | 0 | ||||||||||||||||||||||||
2766 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
2767 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2768 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2769 | } | - | ||||||||||||||||||||||||
2770 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease: never executed: {case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
2771 | - | |||||||||||||||||||||||||
2772 | modifiers = static_cast<const QMouseEvent*>(event)->modifiers(); | - | ||||||||||||||||||||||||
2773 | const Qt::MouseButton button = static_cast<const QMouseEvent*>(event)->button(); | - | ||||||||||||||||||||||||
2774 | const bool rightButtonPressed = button & Qt::RightButton; | - | ||||||||||||||||||||||||
2775 | const bool shiftKeyPressed = modifiers & Qt::ShiftModifier; | - | ||||||||||||||||||||||||
2776 | const bool controlKeyPressed = modifiers & Qt::ControlModifier; | - | ||||||||||||||||||||||||
2777 | if (((index == pressedIndex
| 0 | ||||||||||||||||||||||||
2778 | || !index.isValid()
| 0 | ||||||||||||||||||||||||
2779 | && !shiftKeyPressed
| 0 | ||||||||||||||||||||||||
2780 | return never executed: QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags();return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags(); never executed: return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2781 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2782 | } | - | ||||||||||||||||||||||||
2783 | case never executed: QEvent::KeyPress:case QEvent::KeyPress: never executed: {case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
2784 | - | |||||||||||||||||||||||||
2785 | modifiers = static_cast<const QKeyEvent*>(event)->modifiers(); | - | ||||||||||||||||||||||||
2786 | switch (static_cast<const QKeyEvent*>(event)->key()) { | - | ||||||||||||||||||||||||
2787 | case never executed: Qt::Key_Backtab:case Qt::Key_Backtab: never executed: case Qt::Key_Backtab: | 0 | ||||||||||||||||||||||||
2788 | modifiers = modifiers & ~Qt::ShiftModifier; | - | ||||||||||||||||||||||||
2789 | case never executed: Qt::Key_Down:case Qt::Key_Down: never executed: case Qt::Key_Down: code before this statement never executed: case Qt::Key_Down: | 0 | ||||||||||||||||||||||||
2790 | case never executed: Qt::Key_Up:case Qt::Key_Up: never executed: case Qt::Key_Up: | 0 | ||||||||||||||||||||||||
2791 | case never executed: Qt::Key_Left:case Qt::Key_Left: never executed: case Qt::Key_Left: | 0 | ||||||||||||||||||||||||
2792 | case never executed: Qt::Key_Right:case Qt::Key_Right: never executed: case Qt::Key_Right: | 0 | ||||||||||||||||||||||||
2793 | case never executed: Qt::Key_Home:case Qt::Key_Home: never executed: case Qt::Key_Home: | 0 | ||||||||||||||||||||||||
2794 | case never executed: Qt::Key_End:case Qt::Key_End: never executed: case Qt::Key_End: | 0 | ||||||||||||||||||||||||
2795 | case never executed: Qt::Key_PageUp:case Qt::Key_PageUp: never executed: case Qt::Key_PageUp: | 0 | ||||||||||||||||||||||||
2796 | case never executed: Qt::Key_PageDown:case Qt::Key_PageDown: never executed: case Qt::Key_PageDown: | 0 | ||||||||||||||||||||||||
2797 | case never executed: Qt::Key_Tab:case Qt::Key_Tab: never executed: case Qt::Key_Tab: | 0 | ||||||||||||||||||||||||
2798 | if (modifiers & Qt::ControlModifier
| 0 | ||||||||||||||||||||||||
2799 | - | |||||||||||||||||||||||||
2800 | - | |||||||||||||||||||||||||
2801 | - | |||||||||||||||||||||||||
2802 | - | |||||||||||||||||||||||||
2803 | ) | - | ||||||||||||||||||||||||
2804 | return never executed: QItemSelectionModel::NoUpdate;return QItemSelectionModel::NoUpdate; never executed: return QItemSelectionModel::NoUpdate; | 0 | ||||||||||||||||||||||||
2805 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2806 | case never executed: Qt::Key_Select:case Qt::Key_Select: never executed: case Qt::Key_Select: | 0 | ||||||||||||||||||||||||
2807 | return never executed: QItemSelectionModel::Toggle|selectionBehaviorFlags();return QItemSelectionModel::Toggle|selectionBehaviorFlags(); never executed: return QItemSelectionModel::Toggle|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2808 | case never executed: Qt::Key_Space:case Qt::Key_Space: never executed: case Qt::Key_Space: | 0 | ||||||||||||||||||||||||
2809 | if (modifiers & Qt::ControlModifier
| 0 | ||||||||||||||||||||||||
2810 | return never executed: QItemSelectionModel::Toggle|selectionBehaviorFlags();return QItemSelectionModel::Toggle|selectionBehaviorFlags(); never executed: return QItemSelectionModel::Toggle|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2811 | return never executed: QItemSelectionModel::Select|selectionBehaviorFlags();return QItemSelectionModel::Select|selectionBehaviorFlags(); never executed: return QItemSelectionModel::Select|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2812 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
2813 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2814 | } | - | ||||||||||||||||||||||||
2815 | } | - | ||||||||||||||||||||||||
2816 | default never executed: :default: never executed: default: code before this statement never executed: default: | 0 | ||||||||||||||||||||||||
2817 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2818 | } | - | ||||||||||||||||||||||||
2819 | } | - | ||||||||||||||||||||||||
2820 | - | |||||||||||||||||||||||||
2821 | if (modifiers & Qt::ShiftModifier
| 0 | ||||||||||||||||||||||||
2822 | return never executed: QItemSelectionModel::SelectCurrent|selectionBehaviorFlags();return QItemSelectionModel::SelectCurrent|selectionBehaviorFlags(); never executed: return QItemSelectionModel::SelectCurrent|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2823 | if (modifiers & Qt::ControlModifier
| 0 | ||||||||||||||||||||||||
2824 | return never executed: QItemSelectionModel::Toggle|selectionBehaviorFlags();return QItemSelectionModel::Toggle|selectionBehaviorFlags(); never executed: return QItemSelectionModel::Toggle|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2825 | if (state == QAbstractItemView::DragSelectingState
| 0 | ||||||||||||||||||||||||
2826 | - | |||||||||||||||||||||||||
2827 | return never executed: QItemSelectionModel::Clear|QItemSelectionModel::SelectCurrent|selectionBehaviorFlags();return QItemSelectionModel::Clear|QItemSelectionModel::SelectCurrent|selectionBehaviorFlags(); never executed: return QItemSelectionModel::Clear|QItemSelectionModel::SelectCurrent|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2828 | } | - | ||||||||||||||||||||||||
2829 | - | |||||||||||||||||||||||||
2830 | return never executed: QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags();return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags(); never executed: return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2831 | } | - | ||||||||||||||||||||||||
2832 | - | |||||||||||||||||||||||||
2833 | QItemSelectionModel::SelectionFlags | - | ||||||||||||||||||||||||
2834 | QAbstractItemViewPrivate::contiguousSelectionCommand(const QModelIndex &index, | - | ||||||||||||||||||||||||
2835 | const QEvent *event) const | - | ||||||||||||||||||||||||
2836 | { | - | ||||||||||||||||||||||||
2837 | QItemSelectionModel::SelectionFlags flags = extendedSelectionCommand(index, event); | - | ||||||||||||||||||||||||
2838 | const int Mask = QItemSelectionModel::Clear | QItemSelectionModel::Select | - | ||||||||||||||||||||||||
2839 | | QItemSelectionModel::Deselect | QItemSelectionModel::Toggle | - | ||||||||||||||||||||||||
2840 | | QItemSelectionModel::Current; | - | ||||||||||||||||||||||||
2841 | - | |||||||||||||||||||||||||
2842 | switch (flags & Mask) { | - | ||||||||||||||||||||||||
2843 | case never executed: QItemSelectionModel::Clear:case QItemSelectionModel::Clear: never executed: case QItemSelectionModel::Clear: | 0 | ||||||||||||||||||||||||
2844 | case never executed: QItemSelectionModel::ClearAndSelect:case QItemSelectionModel::ClearAndSelect: never executed: case QItemSelectionModel::ClearAndSelect: | 0 | ||||||||||||||||||||||||
2845 | case never executed: QItemSelectionModel::SelectCurrent:case QItemSelectionModel::SelectCurrent: never executed: case QItemSelectionModel::SelectCurrent: | 0 | ||||||||||||||||||||||||
2846 | return never executed: flags;return flags; never executed: return flags; | 0 | ||||||||||||||||||||||||
2847 | case never executed: QItemSelectionModel::NoUpdate:case QItemSelectionModel::NoUpdate: never executed: case QItemSelectionModel::NoUpdate: | 0 | ||||||||||||||||||||||||
2848 | if (event
| 0 | ||||||||||||||||||||||||
2849 | (event->type() == QEvent::MouseButtonPress
| 0 | ||||||||||||||||||||||||
2850 | || event->type() == QEvent::MouseButtonRelease
| 0 | ||||||||||||||||||||||||
2851 | return never executed: flags;return flags; never executed: return flags; | 0 | ||||||||||||||||||||||||
2852 | return never executed: QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags();return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags(); never executed: return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2853 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
2854 | return never executed: QItemSelectionModel::SelectCurrent|selectionBehaviorFlags();return QItemSelectionModel::SelectCurrent|selectionBehaviorFlags(); never executed: return QItemSelectionModel::SelectCurrent|selectionBehaviorFlags(); | 0 | ||||||||||||||||||||||||
2855 | } | - | ||||||||||||||||||||||||
2856 | } | - | ||||||||||||||||||||||||
2857 | - | |||||||||||||||||||||||||
2858 | void QAbstractItemViewPrivate::fetchMore() | - | ||||||||||||||||||||||||
2859 | { | - | ||||||||||||||||||||||||
2860 | fetchMoreTimer.stop(); | - | ||||||||||||||||||||||||
2861 | if (!model->canFetchMore(root)
| 0 | ||||||||||||||||||||||||
2862 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2863 | int last = model->rowCount(root) - 1; | - | ||||||||||||||||||||||||
2864 | if (last < 0
| 0 | ||||||||||||||||||||||||
2865 | model->fetchMore(root); | - | ||||||||||||||||||||||||
2866 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2867 | } | - | ||||||||||||||||||||||||
2868 | - | |||||||||||||||||||||||||
2869 | QModelIndex index = model->index(last, 0, root); | - | ||||||||||||||||||||||||
2870 | QRect rect = q_func()->visualRect(index); | - | ||||||||||||||||||||||||
2871 | if (viewport->rect().intersects(rect)
| 0 | ||||||||||||||||||||||||
2872 | model->fetchMore(root); never executed: model->fetchMore(root); | 0 | ||||||||||||||||||||||||
2873 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2874 | - | |||||||||||||||||||||||||
2875 | bool QAbstractItemViewPrivate::shouldEdit(QAbstractItemView::EditTrigger trigger, | - | ||||||||||||||||||||||||
2876 | const QModelIndex &index) const | - | ||||||||||||||||||||||||
2877 | { | - | ||||||||||||||||||||||||
2878 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||
2879 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
2880 | Qt::ItemFlags flags = model->flags(index); | - | ||||||||||||||||||||||||
2881 | if (((
| 0 | ||||||||||||||||||||||||
2882 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
2883 | if (state == QAbstractItemView::EditingState
| 0 | ||||||||||||||||||||||||
2884 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
2885 | if (hasEditor(index)
| 0 | ||||||||||||||||||||||||
2886 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
2887 | if (trigger == QAbstractItemView::AllEditTriggers
| 0 | ||||||||||||||||||||||||
2888 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
2889 | if ((
| 0 | ||||||||||||||||||||||||
2890 | && !selectionModel->isSelected(index)
| 0 | ||||||||||||||||||||||||
2891 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
2892 | return never executed: (trigger & editTriggers);return (trigger & editTriggers); never executed: return (trigger & editTriggers); | 0 | ||||||||||||||||||||||||
2893 | } | - | ||||||||||||||||||||||||
2894 | - | |||||||||||||||||||||||||
2895 | bool QAbstractItemViewPrivate::shouldForwardEvent(QAbstractItemView::EditTrigger trigger, | - | ||||||||||||||||||||||||
2896 | const QEvent *event) const | - | ||||||||||||||||||||||||
2897 | { | - | ||||||||||||||||||||||||
2898 | if (!event
| 0 | ||||||||||||||||||||||||
2899 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
2900 | - | |||||||||||||||||||||||||
2901 | switch (event->type()) { | - | ||||||||||||||||||||||||
2902 | case never executed: QEvent::KeyPress:case QEvent::KeyPress: never executed: case QEvent::KeyPress: | 0 | ||||||||||||||||||||||||
2903 | case never executed: QEvent::MouseButtonDblClick:case QEvent::MouseButtonDblClick: never executed: case QEvent::MouseButtonDblClick: | 0 | ||||||||||||||||||||||||
2904 | case never executed: QEvent::MouseButtonPress:case QEvent::MouseButtonPress: never executed: case QEvent::MouseButtonPress: | 0 | ||||||||||||||||||||||||
2905 | case never executed: QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease: never executed: case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
2906 | case never executed: QEvent::MouseMove:case QEvent::MouseMove: never executed: case QEvent::MouseMove: | 0 | ||||||||||||||||||||||||
2907 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
2908 | default never executed: :default: never executed: default: | 0 | ||||||||||||||||||||||||
2909 | break; never executed: break; | 0 | ||||||||||||||||||||||||
2910 | }; | - | ||||||||||||||||||||||||
2911 | - | |||||||||||||||||||||||||
2912 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
2913 | } | - | ||||||||||||||||||||||||
2914 | - | |||||||||||||||||||||||||
2915 | bool QAbstractItemViewPrivate::shouldAutoScroll(const QPoint &pos) const | - | ||||||||||||||||||||||||
2916 | { | - | ||||||||||||||||||||||||
2917 | if (!autoScroll
| 0 | ||||||||||||||||||||||||
2918 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
2919 | QRect area = static_cast<QAbstractItemView*>(viewport)->d_func()->clipRect(); | - | ||||||||||||||||||||||||
2920 | return never executed: (return (pos.y() - area.top() < autoScrollMargin) || (area.bottom() - pos.y() < autoScrollMargin) || (pos.x() - area.left() < autoScrollMargin) || (area.right() - pos.x() < autoScrollMargin);
never executed: return (pos.y() - area.top() < autoScrollMargin) || (area.bottom() - pos.y() < autoScrollMargin) || (pos.x() - area.left() < autoScrollMargin) || (area.right() - pos.x() < autoScrollMargin); | 0 | ||||||||||||||||||||||||
2921 | || (
never executed: return (pos.y() - area.top() < autoScrollMargin) || (area.bottom() - pos.y() < autoScrollMargin) || (pos.x() - area.left() < autoScrollMargin) || (area.right() - pos.x() < autoScrollMargin); | 0 | ||||||||||||||||||||||||
2922 | || (
never executed: return (pos.y() - area.top() < autoScrollMargin) || (area.bottom() - pos.y() < autoScrollMargin) || (pos.x() - area.left() < autoScrollMargin) || (area.right() - pos.x() < autoScrollMargin); | 0 | ||||||||||||||||||||||||
2923 | || (
never executed: return (pos.y() - area.top() < autoScrollMargin) || (area.bottom() - pos.y() < autoScrollMargin) || (pos.x() - area.left() < autoScrollMargin) || (area.right() - pos.x() < autoScrollMargin); | 0 | ||||||||||||||||||||||||
2924 | } | - | ||||||||||||||||||||||||
2925 | - | |||||||||||||||||||||||||
2926 | void QAbstractItemViewPrivate::doDelayedItemsLayout(int delay) | - | ||||||||||||||||||||||||
2927 | { | - | ||||||||||||||||||||||||
2928 | if (!delayedPendingLayout
| 0 | ||||||||||||||||||||||||
2929 | delayedPendingLayout = true; | - | ||||||||||||||||||||||||
2930 | delayedLayout.start(delay, q_func()); | - | ||||||||||||||||||||||||
2931 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2932 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2933 | - | |||||||||||||||||||||||||
2934 | void QAbstractItemViewPrivate::interruptDelayedItemsLayout() const | - | ||||||||||||||||||||||||
2935 | { | - | ||||||||||||||||||||||||
2936 | delayedLayout.stop(); | - | ||||||||||||||||||||||||
2937 | delayedPendingLayout = false; | - | ||||||||||||||||||||||||
2938 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2939 | - | |||||||||||||||||||||||||
2940 | void QAbstractItemViewPrivate::updateGeometry() | - | ||||||||||||||||||||||||
2941 | { | - | ||||||||||||||||||||||||
2942 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2943 | if (sizeAdjustPolicy == QAbstractScrollArea::AdjustIgnored
| 0 | ||||||||||||||||||||||||
2944 | return; never executed: return; | 0 | ||||||||||||||||||||||||
2945 | if (sizeAdjustPolicy == QAbstractScrollArea::AdjustToContents
| 0 | ||||||||||||||||||||||||
2946 | q->updateGeometry(); never executed: q->updateGeometry(); | 0 | ||||||||||||||||||||||||
2947 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2948 | - | |||||||||||||||||||||||||
2949 | QWidget *QAbstractItemViewPrivate::editor(const QModelIndex &index, | - | ||||||||||||||||||||||||
2950 | const QStyleOptionViewItem &options) | - | ||||||||||||||||||||||||
2951 | { | - | ||||||||||||||||||||||||
2952 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
2953 | QWidget *w = editorForIndex(index).widget.data(); | - | ||||||||||||||||||||||||
2954 | if (!w
| 0 | ||||||||||||||||||||||||
2955 | QAbstractItemDelegate *delegate = delegateForIndex(index); | - | ||||||||||||||||||||||||
2956 | if (!delegate
| 0 | ||||||||||||||||||||||||
2957 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
2958 | w = delegate->createEditor(viewport, options, index); | - | ||||||||||||||||||||||||
2959 | if (w
| 0 | ||||||||||||||||||||||||
2960 | w->installEventFilter(delegate); | - | ||||||||||||||||||||||||
2961 | QObject::connect(w, qFlagLocation("2""destroyed(QObject*)" "\0" __FILE__ ":" "4157"), q, qFlagLocation("1""editorDestroyed(QObject*)" "\0" __FILE__ ":" "4157")); | - | ||||||||||||||||||||||||
2962 | delegate->updateEditorGeometry(w, options, index); | - | ||||||||||||||||||||||||
2963 | delegate->setEditorData(w, index); | - | ||||||||||||||||||||||||
2964 | addEditor(index, w, false); | - | ||||||||||||||||||||||||
2965 | if (w->parent() == viewport
| 0 | ||||||||||||||||||||||||
2966 | QWidget::setTabOrder(q, w); never executed: QWidget::setTabOrder(q, w); | 0 | ||||||||||||||||||||||||
2967 | - | |||||||||||||||||||||||||
2968 | - | |||||||||||||||||||||||||
2969 | QWidget *focusWidget = w; | - | ||||||||||||||||||||||||
2970 | while (QWidget *fp = focusWidget->focusProxy()
| 0 | ||||||||||||||||||||||||
2971 | focusWidget = fp; never executed: focusWidget = fp; | 0 | ||||||||||||||||||||||||
2972 | - | |||||||||||||||||||||||||
2973 | if (QLineEdit *le = qobject_cast<QLineEdit*>(focusWidget)
| 0 | ||||||||||||||||||||||||
2974 | le->selectAll(); never executed: le->selectAll(); | 0 | ||||||||||||||||||||||||
2975 | - | |||||||||||||||||||||||||
2976 | - | |||||||||||||||||||||||||
2977 | if (QSpinBox *sb = qobject_cast<QSpinBox*>(focusWidget)
| 0 | ||||||||||||||||||||||||
2978 | sb->selectAll(); never executed: sb->selectAll(); | 0 | ||||||||||||||||||||||||
2979 | else if (QDoubleSpinBox *dsb = qobject_cast<QDoubleSpinBox*>(focusWidget)
| 0 | ||||||||||||||||||||||||
2980 | dsb->selectAll(); never executed: dsb->selectAll(); | 0 | ||||||||||||||||||||||||
2981 | - | |||||||||||||||||||||||||
2982 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2983 | } never executed: end of block | 0 | ||||||||||||||||||||||||
2984 | - | |||||||||||||||||||||||||
2985 | return never executed: w;return w; never executed: return w; | 0 | ||||||||||||||||||||||||
2986 | } | - | ||||||||||||||||||||||||
2987 | - | |||||||||||||||||||||||||
2988 | void QAbstractItemViewPrivate::updateEditorData(const QModelIndex &tl, const QModelIndex &br) | - | ||||||||||||||||||||||||
2989 | { | - | ||||||||||||||||||||||||
2990 | - | |||||||||||||||||||||||||
2991 | const bool checkIndexes = tl.isValid()
| 0 | ||||||||||||||||||||||||
2992 | const QModelIndex parent = tl.parent(); | - | ||||||||||||||||||||||||
2993 | - | |||||||||||||||||||||||||
2994 | - | |||||||||||||||||||||||||
2995 | - | |||||||||||||||||||||||||
2996 | const QIndexEditorHash indexEditorHashCopy = indexEditorHash; | - | ||||||||||||||||||||||||
2997 | QIndexEditorHash::const_iterator it = indexEditorHashCopy.constBegin(); | - | ||||||||||||||||||||||||
2998 | for (; it != indexEditorHashCopy.constEnd()
| 0 | ||||||||||||||||||||||||
2999 | QWidget *editor = it.value().widget.data(); | - | ||||||||||||||||||||||||
3000 | const QModelIndex index = it.key(); | - | ||||||||||||||||||||||||
3001 | if (it.value().isStatic
| 0 | ||||||||||||||||||||||||
3002 | (checkIndexes
| 0 | ||||||||||||||||||||||||
3003 | && (index.row() < tl.row()
| 0 | ||||||||||||||||||||||||
3004 | || index.column() < tl.column()
| 0 | ||||||||||||||||||||||||
3005 | || index.parent() != parent
| 0 | ||||||||||||||||||||||||
3006 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
3007 | - | |||||||||||||||||||||||||
3008 | QAbstractItemDelegate *delegate = delegateForIndex(index); | - | ||||||||||||||||||||||||
3009 | if (delegate
| 0 | ||||||||||||||||||||||||
3010 | delegate->setEditorData(editor, index); | - | ||||||||||||||||||||||||
3011 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3012 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3013 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3014 | void QAbstractItemViewPrivate::clearOrRemove() | - | ||||||||||||||||||||||||
3015 | { | - | ||||||||||||||||||||||||
3016 | - | |||||||||||||||||||||||||
3017 | const QItemSelection selection = selectionModel->selection(); | - | ||||||||||||||||||||||||
3018 | QList<QItemSelectionRange>::const_iterator it = selection.constBegin(); | - | ||||||||||||||||||||||||
3019 | - | |||||||||||||||||||||||||
3020 | if (!overwrite
| 0 | ||||||||||||||||||||||||
3021 | for (; it != selection.constEnd()
| 0 | ||||||||||||||||||||||||
3022 | QModelIndex parent = (*it).parent(); | - | ||||||||||||||||||||||||
3023 | if ((*
| 0 | ||||||||||||||||||||||||
3024 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
3025 | if ((*
| 0 | ||||||||||||||||||||||||
3026 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
3027 | int count = (*it).bottom() - (*it).top() + 1; | - | ||||||||||||||||||||||||
3028 | model->removeRows((*it).top(), count, parent); | - | ||||||||||||||||||||||||
3029 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3030 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
3031 | - | |||||||||||||||||||||||||
3032 | QModelIndexList list = selection.indexes(); | - | ||||||||||||||||||||||||
3033 | for (int i=0; i < list.size()
| 0 | ||||||||||||||||||||||||
3034 | QModelIndex index = list.at(i); | - | ||||||||||||||||||||||||
3035 | QMap<int, QVariant> roles = model->itemData(index); | - | ||||||||||||||||||||||||
3036 | for (QMap<int, QVariant>::Iterator it = roles.begin(); it != roles.end()
| 0 | ||||||||||||||||||||||||
3037 | it.value() = QVariant(); never executed: it.value() = QVariant(); | 0 | ||||||||||||||||||||||||
3038 | model->setItemData(index, roles); | - | ||||||||||||||||||||||||
3039 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3040 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3041 | - | |||||||||||||||||||||||||
3042 | } | - | ||||||||||||||||||||||||
3043 | - | |||||||||||||||||||||||||
3044 | - | |||||||||||||||||||||||||
3045 | - | |||||||||||||||||||||||||
3046 | - | |||||||||||||||||||||||||
3047 | - | |||||||||||||||||||||||||
3048 | - | |||||||||||||||||||||||||
3049 | - | |||||||||||||||||||||||||
3050 | void QAbstractItemViewPrivate::checkPersistentEditorFocus() | - | ||||||||||||||||||||||||
3051 | { | - | ||||||||||||||||||||||||
3052 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
3053 | if (QWidget *widget = QApplication::focusWidget()
| 0 | ||||||||||||||||||||||||
3054 | if (persistent.contains(widget)
| 0 | ||||||||||||||||||||||||
3055 | - | |||||||||||||||||||||||||
3056 | QModelIndex index = indexForEditor(widget); | - | ||||||||||||||||||||||||
3057 | if (selectionModel->currentIndex() != index
| 0 | ||||||||||||||||||||||||
3058 | q->setCurrentIndex(index); never executed: q->setCurrentIndex(index); | 0 | ||||||||||||||||||||||||
3059 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3060 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3061 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3062 | - | |||||||||||||||||||||||||
3063 | - | |||||||||||||||||||||||||
3064 | const QEditorInfo & QAbstractItemViewPrivate::editorForIndex(const QModelIndex &index) const | - | ||||||||||||||||||||||||
3065 | { | - | ||||||||||||||||||||||||
3066 | static QEditorInfo nullInfo; | - | ||||||||||||||||||||||||
3067 | - | |||||||||||||||||||||||||
3068 | - | |||||||||||||||||||||||||
3069 | if (indexEditorHash.isEmpty()
| 0 | ||||||||||||||||||||||||
3070 | return never executed: nullInfo;return nullInfo; never executed: return nullInfo; | 0 | ||||||||||||||||||||||||
3071 | - | |||||||||||||||||||||||||
3072 | QIndexEditorHash::const_iterator it = indexEditorHash.find(index); | - | ||||||||||||||||||||||||
3073 | if (it == indexEditorHash.end()
| 0 | ||||||||||||||||||||||||
3074 | return never executed: nullInfo;return nullInfo; never executed: return nullInfo; | 0 | ||||||||||||||||||||||||
3075 | - | |||||||||||||||||||||||||
3076 | return never executed: it.value();return it.value(); never executed: return it.value(); | 0 | ||||||||||||||||||||||||
3077 | } | - | ||||||||||||||||||||||||
3078 | - | |||||||||||||||||||||||||
3079 | bool QAbstractItemViewPrivate::hasEditor(const QModelIndex &index) const | - | ||||||||||||||||||||||||
3080 | { | - | ||||||||||||||||||||||||
3081 | return never executed: indexEditorHash.find(index) != indexEditorHash.constEnd();return indexEditorHash.find(index) != indexEditorHash.constEnd(); never executed: return indexEditorHash.find(index) != indexEditorHash.constEnd(); | 0 | ||||||||||||||||||||||||
3082 | } | - | ||||||||||||||||||||||||
3083 | - | |||||||||||||||||||||||||
3084 | QModelIndex QAbstractItemViewPrivate::indexForEditor(QWidget *editor) const | - | ||||||||||||||||||||||||
3085 | { | - | ||||||||||||||||||||||||
3086 | - | |||||||||||||||||||||||||
3087 | if (indexEditorHash.isEmpty()
| 0 | ||||||||||||||||||||||||
3088 | return never executed: QModelIndex();return QModelIndex(); never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||
3089 | - | |||||||||||||||||||||||||
3090 | QEditorIndexHash::const_iterator it = editorIndexHash.find(editor); | - | ||||||||||||||||||||||||
3091 | if (it == editorIndexHash.end()
| 0 | ||||||||||||||||||||||||
3092 | return never executed: QModelIndex();return QModelIndex(); never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||
3093 | - | |||||||||||||||||||||||||
3094 | return never executed: it.value();return it.value(); never executed: return it.value(); | 0 | ||||||||||||||||||||||||
3095 | } | - | ||||||||||||||||||||||||
3096 | - | |||||||||||||||||||||||||
3097 | void QAbstractItemViewPrivate::removeEditor(QWidget *editor) | - | ||||||||||||||||||||||||
3098 | { | - | ||||||||||||||||||||||||
3099 | QEditorIndexHash::iterator it = editorIndexHash.find(editor); | - | ||||||||||||||||||||||||
3100 | if (it != editorIndexHash.end()
| 0 | ||||||||||||||||||||||||
3101 | { | - | ||||||||||||||||||||||||
3102 | indexEditorHash.remove(it.value()); | - | ||||||||||||||||||||||||
3103 | editorIndexHash.erase(it); | - | ||||||||||||||||||||||||
3104 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3105 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3106 | - | |||||||||||||||||||||||||
3107 | void QAbstractItemViewPrivate::addEditor(const QModelIndex &index, QWidget *editor, bool isStatic) | - | ||||||||||||||||||||||||
3108 | { | - | ||||||||||||||||||||||||
3109 | editorIndexHash.insert(editor, index); | - | ||||||||||||||||||||||||
3110 | indexEditorHash.insert(index, QEditorInfo(editor, isStatic)); | - | ||||||||||||||||||||||||
3111 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3112 | - | |||||||||||||||||||||||||
3113 | bool QAbstractItemViewPrivate::sendDelegateEvent(const QModelIndex &index, QEvent *event) const | - | ||||||||||||||||||||||||
3114 | { | - | ||||||||||||||||||||||||
3115 | const QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
3116 | QModelIndex buddy = model->buddy(index); | - | ||||||||||||||||||||||||
3117 | QStyleOptionViewItem options = viewOptionsV1(); | - | ||||||||||||||||||||||||
3118 | options.rect = q->visualRect(buddy); | - | ||||||||||||||||||||||||
3119 | options.state |= (buddy == q->currentIndex()
| 0 | ||||||||||||||||||||||||
3120 | QAbstractItemDelegate *delegate = delegateForIndex(index); | - | ||||||||||||||||||||||||
3121 | return never executed: (eventreturn (event && delegate && delegate->editorEvent(event, model, options, buddy));
never executed: return (event && delegate && delegate->editorEvent(event, model, options, buddy)); | 0 | ||||||||||||||||||||||||
3122 | } | - | ||||||||||||||||||||||||
3123 | - | |||||||||||||||||||||||||
3124 | bool QAbstractItemViewPrivate::openEditor(const QModelIndex &index, QEvent *event) | - | ||||||||||||||||||||||||
3125 | { | - | ||||||||||||||||||||||||
3126 | QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
3127 | - | |||||||||||||||||||||||||
3128 | QModelIndex buddy = model->buddy(index); | - | ||||||||||||||||||||||||
3129 | QStyleOptionViewItem options = viewOptionsV1(); | - | ||||||||||||||||||||||||
3130 | options.rect = q->visualRect(buddy); | - | ||||||||||||||||||||||||
3131 | options.state |= (buddy == q->currentIndex()
| 0 | ||||||||||||||||||||||||
3132 | - | |||||||||||||||||||||||||
3133 | QWidget *w = editor(buddy, options); | - | ||||||||||||||||||||||||
3134 | if (!w
| 0 | ||||||||||||||||||||||||
3135 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||
3136 | - | |||||||||||||||||||||||||
3137 | q->setState(QAbstractItemView::EditingState); | - | ||||||||||||||||||||||||
3138 | w->show(); | - | ||||||||||||||||||||||||
3139 | w->setFocus(); | - | ||||||||||||||||||||||||
3140 | - | |||||||||||||||||||||||||
3141 | if (event
| 0 | ||||||||||||||||||||||||
3142 | QApplication::sendEvent(w->focusProxy() ? w->focusProxy() : w, event); never executed: QApplication::sendEvent(w->focusProxy() ? w->focusProxy() : w, event); | 0 | ||||||||||||||||||||||||
3143 | - | |||||||||||||||||||||||||
3144 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||
3145 | } | - | ||||||||||||||||||||||||
3146 | - | |||||||||||||||||||||||||
3147 | - | |||||||||||||||||||||||||
3148 | - | |||||||||||||||||||||||||
3149 | - | |||||||||||||||||||||||||
3150 | - | |||||||||||||||||||||||||
3151 | - | |||||||||||||||||||||||||
3152 | - | |||||||||||||||||||||||||
3153 | QItemViewPaintPairs QAbstractItemViewPrivate::draggablePaintPairs(const QModelIndexList &indexes, QRect *r) const | - | ||||||||||||||||||||||||
3154 | { | - | ||||||||||||||||||||||||
3155 | ((!(r)) ? qt_assert("r",__FILE__,4361) : qt_noop()); | - | ||||||||||||||||||||||||
3156 | const QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
3157 | QRect &rect = *r; | - | ||||||||||||||||||||||||
3158 | const QRect viewportRect = viewport->rect(); | - | ||||||||||||||||||||||||
3159 | QItemViewPaintPairs ret; | - | ||||||||||||||||||||||||
3160 | for (int i = 0; i < indexes.count()
| 0 | ||||||||||||||||||||||||
3161 | const QModelIndex &index = indexes.at(i); | - | ||||||||||||||||||||||||
3162 | const QRect current = q->visualRect(index); | - | ||||||||||||||||||||||||
3163 | if (current.intersects(viewportRect)
| 0 | ||||||||||||||||||||||||
3164 | ret += qMakePair(current, index); | - | ||||||||||||||||||||||||
3165 | rect |= current; | - | ||||||||||||||||||||||||
3166 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3167 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3168 | rect &= viewportRect; | - | ||||||||||||||||||||||||
3169 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||||||||
3170 | } | - | ||||||||||||||||||||||||
3171 | - | |||||||||||||||||||||||||
3172 | QPixmap QAbstractItemViewPrivate::renderToPixmap(const QModelIndexList &indexes, QRect *r) const | - | ||||||||||||||||||||||||
3173 | { | - | ||||||||||||||||||||||||
3174 | ((!(r)) ? qt_assert("r",__FILE__,4380) : qt_noop()); | - | ||||||||||||||||||||||||
3175 | QItemViewPaintPairs paintPairs = draggablePaintPairs(indexes, r); | - | ||||||||||||||||||||||||
3176 | if (paintPairs.isEmpty()
| 0 | ||||||||||||||||||||||||
3177 | return never executed: QPixmap();return QPixmap(); never executed: return QPixmap(); | 0 | ||||||||||||||||||||||||
3178 | - | |||||||||||||||||||||||||
3179 | qreal scale = 1.0f; | - | ||||||||||||||||||||||||
3180 | - | |||||||||||||||||||||||||
3181 | const QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
3182 | QWidget *window = q->window(); | - | ||||||||||||||||||||||||
3183 | if (window
| 0 | ||||||||||||||||||||||||
3184 | QWindow *windowHandle = window->windowHandle(); | - | ||||||||||||||||||||||||
3185 | if (windowHandle
| 0 | ||||||||||||||||||||||||
3186 | scale = windowHandle->devicePixelRatio(); never executed: scale = windowHandle->devicePixelRatio(); | 0 | ||||||||||||||||||||||||
3187 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3188 | - | |||||||||||||||||||||||||
3189 | QPixmap pixmap(r->size() * scale); | - | ||||||||||||||||||||||||
3190 | pixmap.setDevicePixelRatio(scale); | - | ||||||||||||||||||||||||
3191 | - | |||||||||||||||||||||||||
3192 | pixmap.fill(Qt::transparent); | - | ||||||||||||||||||||||||
3193 | QPainter painter(&pixmap); | - | ||||||||||||||||||||||||
3194 | QStyleOptionViewItem option = viewOptionsV1(); | - | ||||||||||||||||||||||||
3195 | option.state |= QStyle::State_Selected; | - | ||||||||||||||||||||||||
3196 | for (int j = 0; j < paintPairs.count()
| 0 | ||||||||||||||||||||||||
3197 | option.rect = paintPairs.at(j).first.translated(-r->topLeft()); | - | ||||||||||||||||||||||||
3198 | const QModelIndex ¤t = paintPairs.at(j).second; | - | ||||||||||||||||||||||||
3199 | adjustViewOptionsForIndex(&option, current); | - | ||||||||||||||||||||||||
3200 | delegateForIndex(current)->paint(&painter, option, current); | - | ||||||||||||||||||||||||
3201 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3202 | return never executed: pixmap;return pixmap; never executed: return pixmap; | 0 | ||||||||||||||||||||||||
3203 | } | - | ||||||||||||||||||||||||
3204 | - | |||||||||||||||||||||||||
3205 | void QAbstractItemViewPrivate::selectAll(QItemSelectionModel::SelectionFlags command) | - | ||||||||||||||||||||||||
3206 | { | - | ||||||||||||||||||||||||
3207 | if (!selectionModel
| 0 | ||||||||||||||||||||||||
3208 | return; never executed: return; | 0 | ||||||||||||||||||||||||
3209 | - | |||||||||||||||||||||||||
3210 | QItemSelection selection; | - | ||||||||||||||||||||||||
3211 | QModelIndex tl = model->index(0, 0, root); | - | ||||||||||||||||||||||||
3212 | QModelIndex br = model->index(model->rowCount(root) - 1, | - | ||||||||||||||||||||||||
3213 | model->columnCount(root) - 1, | - | ||||||||||||||||||||||||
3214 | root); | - | ||||||||||||||||||||||||
3215 | selection.append(QItemSelectionRange(tl, br)); | - | ||||||||||||||||||||||||
3216 | selectionModel->select(selection, command); | - | ||||||||||||||||||||||||
3217 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3218 | - | |||||||||||||||||||||||||
3219 | QModelIndexList QAbstractItemViewPrivate::selectedDraggableIndexes() const | - | ||||||||||||||||||||||||
3220 | { | - | ||||||||||||||||||||||||
3221 | const QAbstractItemView * const q = q_func(); | - | ||||||||||||||||||||||||
3222 | QModelIndexList indexes = q->selectedIndexes(); | - | ||||||||||||||||||||||||
3223 | for(int i = indexes.count() - 1 ; i >= 0
| 0 | ||||||||||||||||||||||||
3224 | if (!isIndexDragEnabled(indexes.at(i))
| 0 | ||||||||||||||||||||||||
3225 | indexes.removeAt(i); never executed: indexes.removeAt(i); | 0 | ||||||||||||||||||||||||
3226 | } never executed: end of block | 0 | ||||||||||||||||||||||||
3227 | return never executed: indexes;return indexes; never executed: return indexes; | 0 | ||||||||||||||||||||||||
3228 | } | - | ||||||||||||||||||||||||
3229 | - | |||||||||||||||||||||||||
3230 | - | |||||||||||||||||||||||||
3231 | - | |||||||||||||||||||||||||
3232 | - | |||||||||||||||||||||||||
Switch to Source code | Preprocessed file |