qdatawidgetmapper.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/itemviews/qdatawidgetmapper.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9class QDataWidgetMapperPrivate: public QObjectPrivate-
10{-
11public:-
12 inline QDataWidgetMapper* q_func() { return static_cast<QDataWidgetMapper *>(q_ptr); } inline const QDataWidgetMapper* q_func() const { return static_cast<const QDataWidgetMapper *>(q_ptr); } friend class QDataWidgetMapper;-
13-
14 QDataWidgetMapperPrivate()-
15 : model(QAbstractItemModelPrivate::staticEmptyModel()), delegate(0),-
16 orientation(Qt::Horizontal), submitPolicy(QDataWidgetMapper::AutoSubmit)-
17 {-
18 }
never executed: end of block
0
19-
20 QAbstractItemModel *model;-
21 QAbstractItemDelegate *delegate;-
22 Qt::Orientation orientation;-
23 QDataWidgetMapper::SubmitPolicy submitPolicy;-
24 QPersistentModelIndex rootIndex;-
25 QPersistentModelIndex currentTopLeft;-
26-
27 inline int itemCount()-
28 {-
29 return
never executed: return orientation == Qt::Horizontal ? model->rowCount(rootIndex) : model->columnCount(rootIndex);
orientation == Qt::Horizontal
never executed: return orientation == Qt::Horizontal ? model->rowCount(rootIndex) : model->columnCount(rootIndex);
0
30 ? model->rowCount(rootIndex)
never executed: return orientation == Qt::Horizontal ? model->rowCount(rootIndex) : model->columnCount(rootIndex);
0
31 : model->columnCount(rootIndex);
never executed: return orientation == Qt::Horizontal ? model->rowCount(rootIndex) : model->columnCount(rootIndex);
0
32 }-
33-
34 inline int currentIdx() const-
35 {-
36 return
never executed: return orientation == Qt::Horizontal ? currentTopLeft.row() : currentTopLeft.column();
orientation == Qt::Horizontal ? currentTopLeft.row() : currentTopLeft.column();
never executed: return orientation == Qt::Horizontal ? currentTopLeft.row() : currentTopLeft.column();
0
37 }-
38-
39 inline QModelIndex indexAt(int itemPos)-
40 {-
41 return
never executed: return orientation == Qt::Horizontal ? model->index(currentIdx(), itemPos, rootIndex) : model->index(itemPos, currentIdx(), rootIndex);
orientation == Qt::Horizontal
never executed: return orientation == Qt::Horizontal ? model->index(currentIdx(), itemPos, rootIndex) : model->index(itemPos, currentIdx(), rootIndex);
0
42 ? model->index(currentIdx(), itemPos, rootIndex)
never executed: return orientation == Qt::Horizontal ? model->index(currentIdx(), itemPos, rootIndex) : model->index(itemPos, currentIdx(), rootIndex);
0
43 : model->index(itemPos, currentIdx(), rootIndex);
never executed: return orientation == Qt::Horizontal ? model->index(currentIdx(), itemPos, rootIndex) : model->index(itemPos, currentIdx(), rootIndex);
0
44 }-
45-
46 inline void flipEventFilters(QAbstractItemDelegate *oldDelegate,-
47 QAbstractItemDelegate *newDelegate)-
48 {-
49 for (QList<WidgetMapper>::const_iterator it = widgetMap.cbegin(), end = widgetMap.cend(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
50 QWidget *w = it->widget;-
51 if (!w
!wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
52 continue;
never executed: continue;
0
53 w->removeEventFilter(oldDelegate);-
54 w->installEventFilter(newDelegate);-
55 }
never executed: end of block
0
56 }
never executed: end of block
0
57-
58 void populate();-
59-
60-
61 void _q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &);-
62 void _q_commitData(QWidget *);-
63 void _q_closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint);-
64 void _q_modelDestroyed();-
65-
66 struct WidgetMapper-
67 {-
68 inline WidgetMapper(QWidget *w = 0, int c = 0, const QModelIndex &i = QModelIndex())-
69 : widget(w), section(c), currentIndex(i) {}
never executed: end of block
0
70 inline WidgetMapper(QWidget *w, int c, const QModelIndex &i, const QByteArray &p)-
71 : widget(w), section(c), currentIndex(i), property(p) {}
never executed: end of block
0
72-
73 QPointer<QWidget> widget;-
74 int section;-
75 QPersistentModelIndex currentIndex;-
76 QByteArray property;-
77 };-
78-
79 void populate(WidgetMapper &m);-
80 int findWidget(QWidget *w) const;-
81-
82 bool commit(const WidgetMapper &m);-
83-
84 QList<WidgetMapper> widgetMap;-
85};-
86-
87int QDataWidgetMapperPrivate::findWidget(QWidget *w) const-
88{-
89 for (QList<WidgetMapper>::const_iterator it = widgetMap.cbegin(), end = widgetMap.cend(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
90 if (it->widget == w
it->widget == wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
91 return
never executed: return int(std::distance(widgetMap.cbegin(), it));
int(std::distance(widgetMap.cbegin(), it));
never executed: return int(std::distance(widgetMap.cbegin(), it));
0
92 }
never executed: end of block
0
93 return
never executed: return -1;
-1;
never executed: return -1;
0
94}-
95-
96bool QDataWidgetMapperPrivate::commit(const WidgetMapper &m)-
97{-
98 if (m.widget.isNull()
m.widget.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
99 return
never executed: return true;
true;
never executed: return true;
0
100-
101 if (!m.currentIndex.isValid()
!m.currentIndex.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
102 return
never executed: return false;
false;
never executed: return false;
0
103-
104-
105 QModelIndex idx = m.currentIndex;-
106 if (m.property.isEmpty()
m.property.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
107 delegate->
never executed: delegate->setModelData(m.widget, model, idx);
setModelData(m.widget, model, idx);
never executed: delegate->setModelData(m.widget, model, idx);
0
108 else-
109 model->setData(idx, m.widget->property(m.property), Qt::EditRole);
never executed: model->setData(idx, m.widget->property(m.property), Qt::EditRole);
0
110-
111 return
never executed: return true;
true;
never executed: return true;
0
112}-
113-
114void QDataWidgetMapperPrivate::populate(WidgetMapper &m)-
115{-
116 if (m.widget.isNull()
m.widget.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
117 return;
never executed: return;
0
118-
119 m.currentIndex = indexAt(m.section);-
120 if (m.property.isEmpty()
m.property.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
121 delegate->
never executed: delegate->setEditorData(m.widget, m.currentIndex);
setEditorData(m.widget, m.currentIndex);
never executed: delegate->setEditorData(m.widget, m.currentIndex);
0
122 else-
123 m.widget->setProperty(m.property, m.currentIndex.data(Qt::EditRole));
never executed: m.widget->setProperty(m.property, m.currentIndex.data(Qt::EditRole));
0
124}-
125-
126void QDataWidgetMapperPrivate::populate()-
127{-
128 for (QList<WidgetMapper>::iterator it = widgetMap.begin(), end = widgetMap.end(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it)
0
129 populate(*it);
never executed: populate(*it);
0
130}
never executed: end of block
0
131-
132static bool qContainsIndex(const QModelIndex &idx, const QModelIndex &topLeft,-
133 const QModelIndex &bottomRight)-
134{-
135 return
never executed: return idx.row() >= topLeft.row() && idx.row() <= bottomRight.row() && idx.column() >= topLeft.column() && idx.column() <= bottomRight.column();
idx.row() >= topLeft.row() && idx.row() <= bottomRight.row()
never executed: return idx.row() >= topLeft.row() && idx.row() <= bottomRight.row() && idx.column() >= topLeft.column() && idx.column() <= bottomRight.column();
0
136 && idx.column() >= topLeft.column() && idx.column() <= bottomRight.column();
never executed: return idx.row() >= topLeft.row() && idx.row() <= bottomRight.row() && idx.column() >= topLeft.column() && idx.column() <= bottomRight.column();
0
137}-
138-
139void QDataWidgetMapperPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &)-
140{-
141 if (topLeft.parent() != rootIndex
topLeft.parent() != rootIndexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
142 return;
never executed: return;
0
143-
144 for (QList<WidgetMapper>::iterator it = widgetMap.begin(), end = widgetMap.end(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
145 if (qContainsIndex(it->currentIndex, topLeft, bottomRight)
qContainsIndex..., bottomRight)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
146 populate(*it);
never executed: populate(*it);
0
147 }
never executed: end of block
0
148}
never executed: end of block
0
149-
150void QDataWidgetMapperPrivate::_q_commitData(QWidget *w)-
151{-
152 if (submitPolicy == QDataWidgetMapper::ManualSubmit
submitPolicy =...::ManualSubmitDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
153 return;
never executed: return;
0
154-
155 int idx = findWidget(w);-
156 if (idx == -1
idx == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
157 return;
never executed: return;
0
158-
159 commit(widgetMap.at(idx));-
160}
never executed: end of block
0
161-
162void QDataWidgetMapperPrivate::_q_closeEditor(QWidget *w, QAbstractItemDelegate::EndEditHint hint)-
163{-
164 int idx = findWidget(w);-
165 if (idx == -1
idx == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
166 return;
never executed: return;
0
167-
168 switch (hint) {-
169 case
never executed: case QAbstractItemDelegate::RevertModelCache:
QAbstractItemDelegate::RevertModelCache:
never executed: case QAbstractItemDelegate::RevertModelCache:
{
0
170 populate(widgetMap[idx]);-
171 break;
never executed: break;
}
0
172 case
never executed: case QAbstractItemDelegate::EditNextItem:
QAbstractItemDelegate::EditNextItem:
never executed: case QAbstractItemDelegate::EditNextItem:
0
173 w->focusNextChild();-
174 break;
never executed: break;
0
175 case
never executed: case QAbstractItemDelegate::EditPreviousItem:
QAbstractItemDelegate::EditPreviousItem:
never executed: case QAbstractItemDelegate::EditPreviousItem:
0
176 w->focusPreviousChild();-
177 break;
never executed: break;
0
178 case
never executed: case QAbstractItemDelegate::SubmitModelCache:
QAbstractItemDelegate::SubmitModelCache:
never executed: case QAbstractItemDelegate::SubmitModelCache:
0
179 case
never executed: case QAbstractItemDelegate::NoHint:
QAbstractItemDelegate::NoHint:
never executed: case QAbstractItemDelegate::NoHint:
0
180-
181 break;
never executed: break;
0
182 }-
183}
never executed: end of block
0
184-
185void QDataWidgetMapperPrivate::_q_modelDestroyed()-
186{-
187 QDataWidgetMapper * const q = q_func();-
188-
189 model = 0;-
190 q->setModel(QAbstractItemModelPrivate::staticEmptyModel());-
191}
never executed: end of block
0
192QDataWidgetMapper::QDataWidgetMapper(QObject *parent)-
193 : QObject(*new QDataWidgetMapperPrivate, parent)-
194{-
195 setItemDelegate(new QItemDelegate(this));-
196}
never executed: end of block
0
197-
198-
199-
200-
201QDataWidgetMapper::~QDataWidgetMapper()-
202{-
203}-
204-
205-
206-
207-
208-
209-
210-
211void QDataWidgetMapper::setModel(QAbstractItemModel *model)-
212{-
213 QDataWidgetMapperPrivate * const d = d_func();-
214-
215 if (d->model == model
d->model == modelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
216 return;
never executed: return;
0
217-
218 if (d->model
d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
219 disconnect(d->model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "357"), this,-
220 qFlagLocation("1""_q_dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "358"));-
221 disconnect(d->model, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "359"), this,-
222 qFlagLocation("1""_q_modelDestroyed()" "\0" __FILE__ ":" "360"));-
223 }
never executed: end of block
0
224 clearMapping();-
225 d->rootIndex = QModelIndex();-
226 d->currentTopLeft = QModelIndex();-
227-
228 d->model = model;-
229-
230 connect(model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "368"),-
231 qFlagLocation("1""_q_dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "369"));-
232 connect(model, qFlagLocation("2""destroyed()" "\0" __FILE__ ":" "370"), qFlagLocation("1""_q_modelDestroyed()" "\0" __FILE__ ":" "370"));-
233}
never executed: end of block
0
234-
235-
236-
237-
238-
239-
240QAbstractItemModel *QDataWidgetMapper::model() const-
241{-
242 const QDataWidgetMapperPrivate * const d = d_func();-
243 return
never executed: return d->model == QAbstractItemModelPrivate::staticEmptyModel() ? static_cast<QAbstractItemModel *>(0) : d->model;
d->model == QAbstractItemModelPrivate::staticEmptyModel()
never executed: return d->model == QAbstractItemModelPrivate::staticEmptyModel() ? static_cast<QAbstractItemModel *>(0) : d->model;
0
244 ? static_cast<QAbstractItemModel *>(0)
never executed: return d->model == QAbstractItemModelPrivate::staticEmptyModel() ? static_cast<QAbstractItemModel *>(0) : d->model;
0
245 : d->model;
never executed: return d->model == QAbstractItemModelPrivate::staticEmptyModel() ? static_cast<QAbstractItemModel *>(0) : d->model;
0
246}-
247void QDataWidgetMapper::setItemDelegate(QAbstractItemDelegate *delegate)-
248{-
249 QDataWidgetMapperPrivate * const d = d_func();-
250 QAbstractItemDelegate *oldDelegate = d->delegate;-
251 if (oldDelegate
oldDelegateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
252 disconnect(oldDelegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "404"), this, qFlagLocation("1""_q_commitData(QWidget*)" "\0" __FILE__ ":" "404"));-
253 disconnect(oldDelegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "405"),-
254 this, qFlagLocation("1""_q_closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "406"));-
255 }
never executed: end of block
0
256-
257 d->delegate = delegate;-
258-
259 if (delegate
delegateDescription
TRUEnever evaluated
FALSEnever evaluated
)
{
0
260 connect(delegate, qFlagLocation("2""commitData(QWidget*)" "\0" __FILE__ ":" "412"), qFlagLocation("1""_q_commitData(QWidget*)" "\0" __FILE__ ":" "412"));-
261 connect(delegate, qFlagLocation("2""closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "413"),-
262 qFlagLocation("1""_q_closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)" "\0" __FILE__ ":" "414"));-
263 }
never executed: end of block
0
264-
265 d->flipEventFilters(oldDelegate, delegate);-
266}
never executed: end of block
0
267-
268-
269-
270-
271QAbstractItemDelegate *QDataWidgetMapper::itemDelegate() const-
272{-
273 const QDataWidgetMapperPrivate * const d = d_func();-
274 return
never executed: return d->delegate;
d->delegate;
never executed: return d->delegate;
0
275}-
276void QDataWidgetMapper::setRootIndex(const QModelIndex &index)-
277{-
278 QDataWidgetMapperPrivate * const d = d_func();-
279 d->rootIndex = index;-
280}
never executed: end of block
0
281-
282-
283-
284-
285-
286-
287QModelIndex QDataWidgetMapper::rootIndex() const-
288{-
289 const QDataWidgetMapperPrivate * const d = d_func();-
290 return
never executed: return QModelIndex(d->rootIndex);
QModelIndex(d->rootIndex);
never executed: return QModelIndex(d->rootIndex);
0
291}-
292void QDataWidgetMapper::addMapping(QWidget *widget, int section)-
293{-
294 QDataWidgetMapperPrivate * const d = d_func();-
295-
296 removeMapping(widget);-
297 d->widgetMap.append(QDataWidgetMapperPrivate::WidgetMapper(widget, section, d->indexAt(section)));-
298 widget->installEventFilter(d->delegate);-
299}
never executed: end of block
0
300void QDataWidgetMapper::addMapping(QWidget *widget, int section, const QByteArray &propertyName)-
301{-
302 QDataWidgetMapperPrivate * const d = d_func();-
303-
304 removeMapping(widget);-
305 d->widgetMap.append(QDataWidgetMapperPrivate::WidgetMapper(widget, section, d->indexAt(section), propertyName));-
306 widget->installEventFilter(d->delegate);-
307}
never executed: end of block
0
308-
309-
310-
311-
312-
313-
314void QDataWidgetMapper::removeMapping(QWidget *widget)-
315{-
316 QDataWidgetMapperPrivate * const d = d_func();-
317-
318 int idx = d->findWidget(widget);-
319 if (idx == -1
idx == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
320 return;
never executed: return;
0
321-
322 d->widgetMap.removeAt(idx);-
323 widget->removeEventFilter(d->delegate);-
324}
never executed: end of block
0
325-
326-
327-
328-
329-
330-
331-
332int QDataWidgetMapper::mappedSection(QWidget *widget) const-
333{-
334 const QDataWidgetMapperPrivate * const d = d_func();-
335-
336 int idx = d->findWidget(widget);-
337 if (idx == -1
idx == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
338 return
never executed: return -1;
-1;
never executed: return -1;
0
339-
340 return
never executed: return d->widgetMap.at(idx).section;
d->widgetMap.at(idx).section;
never executed: return d->widgetMap.at(idx).section;
0
341}-
342QByteArray QDataWidgetMapper::mappedPropertyName(QWidget *widget) const-
343{-
344 const QDataWidgetMapperPrivate * const d = d_func();-
345-
346 int idx = d->findWidget(widget);-
347 if (idx == -1
idx == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
348 return
never executed: return QByteArray();
QByteArray();
never executed: return QByteArray();
0
349 const QDataWidgetMapperPrivate::WidgetMapper &m = d->widgetMap.at(idx);-
350 if (m.property.isEmpty()
m.property.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
351 return
never executed: return m.widget->metaObject()->userProperty().name();
m.widget->metaObject()->userProperty().name();
never executed: return m.widget->metaObject()->userProperty().name();
0
352 else-
353 return
never executed: return m.property;
m.property;
never executed: return m.property;
0
354}-
355-
356-
357-
358-
359-
360-
361-
362QWidget *QDataWidgetMapper::mappedWidgetAt(int section) const-
363{-
364 const QDataWidgetMapperPrivate * const d = d_func();-
365-
366 for (QList<QDataWidgetMapperPrivate::WidgetMapper>::const_iterator it = d->widgetMap.cbegin(), end = d->widgetMap.cend(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
367 if (it->section == section
it->section == sectionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
368 return
never executed: return it->widget;
it->widget;
never executed: return it->widget;
0
369 }
never executed: end of block
0
370-
371 return
never executed: return 0;
0;
never executed: return 0;
0
372}-
373-
374-
375-
376-
377-
378-
379-
380void QDataWidgetMapper::revert()-
381{-
382 QDataWidgetMapperPrivate * const d = d_func();-
383-
384 d->populate();-
385}
never executed: end of block
0
386bool QDataWidgetMapper::submit()-
387{-
388 QDataWidgetMapperPrivate * const d = d_func();-
389-
390 for (QList<QDataWidgetMapperPrivate::WidgetMapper>::const_iterator it = d->widgetMap.cbegin(), end = d->widgetMap.cend(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
391 if (!d->commit(*it)
!d->commit(*it)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
392 return
never executed: return false;
false;
never executed: return false;
0
393 }
never executed: end of block
0
394-
395 return
never executed: return d->model->submit();
d->model->submit();
never executed: return d->model->submit();
0
396}-
397void QDataWidgetMapper::toFirst()-
398{-
399 setCurrentIndex(0);-
400}
never executed: end of block
0
401void QDataWidgetMapper::toLast()-
402{-
403 QDataWidgetMapperPrivate * const d = d_func();-
404 setCurrentIndex(d->itemCount() - 1);-
405}
never executed: end of block
0
406void QDataWidgetMapper::toNext()-
407{-
408 QDataWidgetMapperPrivate * const d = d_func();-
409 setCurrentIndex(d->currentIdx() + 1);-
410}
never executed: end of block
0
411void QDataWidgetMapper::toPrevious()-
412{-
413 QDataWidgetMapperPrivate * const d = d_func();-
414 setCurrentIndex(d->currentIdx() - 1);-
415}
never executed: end of block
0
416void QDataWidgetMapper::setCurrentIndex(int index)-
417{-
418 QDataWidgetMapperPrivate * const d = d_func();-
419-
420 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| index >= d->itemCount()
index >= d->itemCount()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
421 return;
never executed: return;
0
422 d->currentTopLeft = d->orientation == Qt::Horizontal
d->orientation...Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
0
423 ? d->model->index(index, 0, d->rootIndex)-
424 : d->model->index(0, index, d->rootIndex);-
425 d->populate();-
426-
427 currentIndexChanged(index);-
428}
never executed: end of block
0
429-
430int QDataWidgetMapper::currentIndex() const-
431{-
432 const QDataWidgetMapperPrivate * const d = d_func();-
433 return
never executed: return d->currentIdx();
d->currentIdx();
never executed: return d->currentIdx();
0
434}-
435void QDataWidgetMapper::setCurrentModelIndex(const QModelIndex &index)-
436{-
437 QDataWidgetMapperPrivate * const d = d_func();-
438-
439 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
440 || index.model() != d->model
index.model() != d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
0
441 || index.parent() != d->rootIndex
index.parent() != d->rootIndexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
442 return;
never executed: return;
0
443-
444 setCurrentIndex(d->orientation == Qt::Horizontal ? index.row() : index.column());-
445}
never executed: end of block
0
446-
447-
448-
449-
450-
451-
452void QDataWidgetMapper::clearMapping()-
453{-
454 QDataWidgetMapperPrivate * const d = d_func();-
455-
456 QList<QDataWidgetMapperPrivate::WidgetMapper> copy;-
457 d->widgetMap.swap(copy);-
458 for (QList<QDataWidgetMapperPrivate::WidgetMapper>::const_reverse_iterator it = copy.crbegin(), end = copy.crend(); it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
459 if (it->widget
it->widgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
460 it->widget->removeEventFilter(d->delegate);
never executed: it->widget->removeEventFilter(d->delegate);
0
461 }
never executed: end of block
0
462}
never executed: end of block
0
463void QDataWidgetMapper::setOrientation(Qt::Orientation orientation)-
464{-
465 QDataWidgetMapperPrivate * const d = d_func();-
466-
467 if (d->orientation == orientation
d->orientation == orientationDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
468 return;
never executed: return;
0
469-
470 clearMapping();-
471 d->orientation = orientation;-
472}
never executed: end of block
0
473-
474Qt::Orientation QDataWidgetMapper::orientation() const-
475{-
476 const QDataWidgetMapperPrivate * const d = d_func();-
477 return
never executed: return d->orientation;
d->orientation;
never executed: return d->orientation;
0
478}-
479void QDataWidgetMapper::setSubmitPolicy(SubmitPolicy policy)-
480{-
481 QDataWidgetMapperPrivate * const d = d_func();-
482 if (policy == d->submitPolicy
policy == d->submitPolicyDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
483 return;
never executed: return;
0
484-
485 revert();-
486 d->submitPolicy = policy;-
487}
never executed: end of block
0
488-
489QDataWidgetMapper::SubmitPolicy QDataWidgetMapper::submitPolicy() const-
490{-
491 const QDataWidgetMapperPrivate * const d = d_func();-
492 return
never executed: return d->submitPolicy;
d->submitPolicy;
never executed: return d->submitPolicy;
0
493}-
494-
495-
496-
Switch to Source codePreprocessed file

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