• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • graphics API Reference
  • KDE Home
  • Contact Us
 

digikam

  • extragear
  • graphics
  • digikam
  • core
  • utilities
  • geolocation
  • geoiface
  • items
gpsitemsortproxymodel.cpp
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2010-03-21
7  * Description : A model to hold GPS information about items.
8  *
9  * Copyright (C) 2010-2019 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2010 by Michael G. Hansen <mike at mghansen dot de>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #include "gpsitemsortproxymodel.h"
26 
27 // Qt includes
28 
29 #include <QPointer>
30 
31 // Local includes
32 
33 #include "digikam_debug.h"
34 
35 namespace Digikam
36 {
37 
38 class Q_DECL_HIDDEN GPSItemSortProxyModel::Private
39 {
40 public:
41 
42  explicit Private()
43  {
44  imageModel = nullptr;
45  sourceSelectionModel = nullptr;
46  linkItemSelectionModel = nullptr;
47  }
48 
49  GPSItemModel* imageModel;
50  QItemSelectionModel* sourceSelectionModel;
51  GPSLinkItemSelectionModel* linkItemSelectionModel;
52 };
53 
54 GPSItemSortProxyModel::GPSItemSortProxyModel(GPSItemModel* const imageModel,
55  QItemSelectionModel* const sourceSelectionModel)
56  : QSortFilterProxyModel(imageModel),
57  d(new Private())
58 {
59  d->imageModel = imageModel;
60  d->sourceSelectionModel = sourceSelectionModel;
61  setSourceModel(imageModel);
62  d->linkItemSelectionModel = new GPSLinkItemSelectionModel(this, d->sourceSelectionModel);
63 }
64 
65 GPSItemSortProxyModel::~GPSItemSortProxyModel()
66 {
67  delete d;
68 }
69 
70 bool GPSItemSortProxyModel::lessThan(const QModelIndex& left, const QModelIndex& right) const
71 {
72  if ((!left.isValid())||(!right.isValid()))
73  {
74 // qCDebug(DIGIKAM_GENERAL_LOG) << "INVALID INDICES" << left << right;
75  return false;
76  }
77 
78  const int column = left.column();
79  const GPSItemContainer* const itemLeft = d->imageModel->itemFromIndex(left);
80  const GPSItemContainer* const itemRight = d->imageModel->itemFromIndex(right);
81 
82 // qCDebug(DIGIKAM_GENERAL_LOG) << itemLeft << itemRight << column << rowCount() << d->imageModel->rowCount();
83  return itemLeft->lessThan(itemRight, column);
84 }
85 
86 QItemSelectionModel* GPSItemSortProxyModel::mappedSelectionModel() const
87 {
88  return d->linkItemSelectionModel;
89 }
90 
91 // --------------------------------------------------------------------------------------
92 
93 class Q_DECL_HIDDEN GPSLinkItemSelectionModelPrivate
94 {
95 public:
96 
97  explicit GPSLinkItemSelectionModelPrivate(GPSLinkItemSelectionModel* const proxySelectionModel)
98  : q_ptr(proxySelectionModel),
99  m_linkedItemSelectionModel(nullptr),
100  m_ignoreCurrentChanged(false),
101  m_indexMapper(nullptr)
102  {
103  QObject::connect(q_ptr, &QItemSelectionModel::currentChanged, q_ptr,
104  [this](const QModelIndex& idx) { slotCurrentChanged(idx); } );
105 
106  QObject::connect(q_ptr, &QItemSelectionModel::modelChanged, q_ptr,
107  [this]{ reinitializeIndexMapper(); } );
108  }
109 
110 public:
111 
112  Q_DECLARE_PUBLIC(GPSLinkItemSelectionModel)
113  GPSLinkItemSelectionModel* const q_ptr;
114 
115 public:
116 
117  bool assertSelectionValid(const QItemSelection& selection) const
118  {
119  foreach (const QItemSelectionRange& range, selection)
120  {
121  if (!range.isValid())
122  {
123  qCDebug(DIGIKAM_GENERAL_LOG) << selection;
124  }
125 
126  Q_ASSERT(range.isValid());
127  }
128 
129  return true;
130  }
131 
132  void reinitializeIndexMapper()
133  {
134  delete m_indexMapper;
135  m_indexMapper = nullptr;
136 
137  if (!q_ptr->model() || !m_linkedItemSelectionModel || !m_linkedItemSelectionModel->model())
138  {
139  return;
140  }
141 
142  m_indexMapper = new GPSModelIndexProxyMapper(q_ptr->model(), m_linkedItemSelectionModel->model(), q_ptr);
143  const QItemSelection mappedSelection = m_indexMapper->mapSelectionRightToLeft(m_linkedItemSelectionModel->selection());
144  q_ptr->QItemSelectionModel::select(mappedSelection, QItemSelectionModel::ClearAndSelect);
145  }
146 
147  void sourceSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
148  void sourceCurrentChanged(const QModelIndex& current);
149  void slotCurrentChanged(const QModelIndex& current);
150 
151 public:
152 
153  QItemSelectionModel* m_linkedItemSelectionModel;
154  bool m_ignoreCurrentChanged;
155  GPSModelIndexProxyMapper* m_indexMapper;
156 };
157 
158 GPSLinkItemSelectionModel::GPSLinkItemSelectionModel(QAbstractItemModel* const model,
159  QItemSelectionModel* const proxySelector,
160  QObject* const parent)
161  : QItemSelectionModel(model, parent),
162  d_ptr(new GPSLinkItemSelectionModelPrivate(this))
163 {
164  setLinkedItemSelectionModel(proxySelector);
165 }
166 
167 GPSLinkItemSelectionModel::GPSLinkItemSelectionModel(QObject* const parent)
168  : QItemSelectionModel(nullptr, parent),
169  d_ptr(new GPSLinkItemSelectionModelPrivate(this))
170 {
171 }
172 
173 GPSLinkItemSelectionModel::~GPSLinkItemSelectionModel()
174 {
175  delete d_ptr;
176 }
177 
178 QItemSelectionModel* GPSLinkItemSelectionModel::linkedItemSelectionModel() const
179 {
180  Q_D(const GPSLinkItemSelectionModel);
181 
182  return d->m_linkedItemSelectionModel;
183 }
184 
185 void GPSLinkItemSelectionModel::setLinkedItemSelectionModel(QItemSelectionModel* const selectionModel)
186 {
187  Q_D(GPSLinkItemSelectionModel);
188 
189  if (d->m_linkedItemSelectionModel != selectionModel)
190  {
191  if (d->m_linkedItemSelectionModel)
192  {
193  disconnect(d->m_linkedItemSelectionModel);
194  }
195 
196  d->m_linkedItemSelectionModel = selectionModel;
197 
198  if (d->m_linkedItemSelectionModel)
199  {
200  connect(d->m_linkedItemSelectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
201  this, SLOT(sourceSelectionChanged(QItemSelection,QItemSelection)));
202 
203  connect(d->m_linkedItemSelectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)),
204  this, SLOT(sourceCurrentChanged(QModelIndex)));
205 
206  connect(d->m_linkedItemSelectionModel, &QItemSelectionModel::modelChanged,
207  this, [this] { d_ptr->reinitializeIndexMapper(); });
208  }
209 
210  d->reinitializeIndexMapper();
211  emit linkedItemSelectionModelChanged();
212  }
213 }
214 
215 void GPSLinkItemSelectionModel::select(const QModelIndex& index, QItemSelectionModel::SelectionFlags command)
216 {
217  Q_D(GPSLinkItemSelectionModel);
218 
219  // When an item is removed, the current index is set to the top index in the model.
220  // That causes a selectionChanged signal with a selection which we do not want.
221  if (d->m_ignoreCurrentChanged)
222  {
223  return;
224  }
225 
226  // Do *not* replace next line with: QItemSelectionModel::select(index, command)
227  //
228  // Doing so would end up calling GPSLinkItemSelectionModel::select(QItemSelection, QItemSelectionModel::SelectionFlags)
229  //
230  // This is because the code for QItemSelectionModel::select(QModelIndex, QItemSelectionModel::SelectionFlags) looks like this:
231  // {
232  // QItemSelection selection(index, index);
233  // select(selection, command);
234  // }
235  // So it calls GPSLinkItemSelectionModel overload of
236  // select(QItemSelection, QItemSelectionModel::SelectionFlags)
237  //
238  // When this happens and the selection flags include Toggle, it causes the
239  // selection to be toggled twice.
240 
241  QItemSelectionModel::select(QItemSelection(index, index), command);
242 
243  if (index.isValid())
244  {
245  d->m_linkedItemSelectionModel->select(d->m_indexMapper->mapSelectionLeftToRight(QItemSelection(index, index)), command);
246  }
247  else
248  {
249  d->m_linkedItemSelectionModel->clearSelection();
250  }
251 }
252 
253 void GPSLinkItemSelectionModel::select(const QItemSelection& selection, QItemSelectionModel::SelectionFlags command)
254 {
255  Q_D(GPSLinkItemSelectionModel);
256  d->m_ignoreCurrentChanged = true;
257  QItemSelection _selection = selection;
258  QItemSelectionModel::select(_selection, command);
259  Q_ASSERT(d->assertSelectionValid(_selection));
260  QItemSelection mappedSelection = d->m_indexMapper->mapSelectionLeftToRight(_selection);
261  Q_ASSERT(d->assertSelectionValid(mappedSelection));
262  d->m_linkedItemSelectionModel->select(mappedSelection, command);
263  d->m_ignoreCurrentChanged = false;
264 }
265 
266 void GPSLinkItemSelectionModelPrivate::slotCurrentChanged(const QModelIndex& current)
267 {
268  const QModelIndex mappedCurrent = m_indexMapper->mapLeftToRight(current);
269 
270  if (!mappedCurrent.isValid())
271  {
272  return;
273  }
274 
275  m_linkedItemSelectionModel->setCurrentIndex(mappedCurrent, QItemSelectionModel::NoUpdate);
276 }
277 
278 void GPSLinkItemSelectionModelPrivate::sourceSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected)
279 {
280  Q_Q(GPSLinkItemSelectionModel);
281  QItemSelection _selected = selected;
282  QItemSelection _deselected = deselected;
283  Q_ASSERT(assertSelectionValid(_selected));
284  Q_ASSERT(assertSelectionValid(_deselected));
285  const QItemSelection mappedDeselection = m_indexMapper->mapSelectionRightToLeft(_deselected);
286  const QItemSelection mappedSelection = m_indexMapper->mapSelectionRightToLeft(_selected);
287 
288  q->QItemSelectionModel::select(mappedDeselection, QItemSelectionModel::Deselect);
289  q->QItemSelectionModel::select(mappedSelection, QItemSelectionModel::Select);
290 }
291 
292 void GPSLinkItemSelectionModelPrivate::sourceCurrentChanged(const QModelIndex& current)
293 {
294  Q_Q(GPSLinkItemSelectionModel);
295  const QModelIndex mappedCurrent = m_indexMapper->mapRightToLeft(current);
296 
297  if (!mappedCurrent.isValid())
298  {
299  return;
300  }
301 
302  q->setCurrentIndex(mappedCurrent, QItemSelectionModel::NoUpdate);
303 }
304 
305 // --------------------------------------------------------------------------------------
306 
307 class Q_DECL_HIDDEN GPSModelIndexProxyMapperPrivate
308 {
309 public:
310 
311  explicit GPSModelIndexProxyMapperPrivate(const QAbstractItemModel* const leftModel,
312  const QAbstractItemModel* const rightModel,
313  GPSModelIndexProxyMapper* const qq)
314  : q_ptr(qq),
315  m_leftModel(leftModel),
316  m_rightModel(rightModel),
317  mConnected(false)
318  {
319  createProxyChain();
320  }
321 
322  void createProxyChain();
323  void checkConnected();
324  void setConnected(bool connected);
325 
326  // cppcheck-suppress unusedPrivateFunction
327  bool assertSelectionValid(const QItemSelection& selection) const
328  {
329  foreach (const QItemSelectionRange& range, selection)
330  {
331  if (!range.isValid())
332  {
333  qCDebug(DIGIKAM_GENERAL_LOG) << selection << m_leftModel << m_rightModel << m_proxyChainDown << m_proxyChainUp;
334  }
335 
336  Q_ASSERT(range.isValid());
337  }
338 
339  return true;
340  }
341 
342 public:
343 
344  Q_DECLARE_PUBLIC(GPSModelIndexProxyMapper)
345  GPSModelIndexProxyMapper* const q_ptr;
346 
347  QList<QPointer<const QAbstractProxyModel> > m_proxyChainUp;
348  QList<QPointer<const QAbstractProxyModel> > m_proxyChainDown;
349 
350  QPointer<const QAbstractItemModel> m_leftModel;
351  QPointer<const QAbstractItemModel> m_rightModel;
352 
353  bool mConnected;
354 };
355 
363 void GPSModelIndexProxyMapperPrivate::createProxyChain()
364 {
365  foreach (auto p, m_proxyChainUp)
366  {
367  p->disconnect(q_ptr);
368  }
369 
370  foreach (auto p, m_proxyChainDown)
371  {
372  p->disconnect(q_ptr);
373  }
374 
375  m_proxyChainUp.clear();
376  m_proxyChainDown.clear();
377  QPointer<const QAbstractItemModel> targetModel = m_rightModel;
378 
379  QList<QPointer<const QAbstractProxyModel> > proxyChainDown;
380  QPointer<const QAbstractProxyModel> selectionTargetProxyModel = qobject_cast<const QAbstractProxyModel *>(targetModel);
381 
382  while (selectionTargetProxyModel)
383  {
384  proxyChainDown.prepend(selectionTargetProxyModel);
385 
386  QObject::connect(selectionTargetProxyModel.data(), &QAbstractProxyModel::sourceModelChanged,
387  q_ptr, [this]
388  {
389  createProxyChain();
390  }
391  );
392 
393  selectionTargetProxyModel = qobject_cast<const QAbstractProxyModel*>(selectionTargetProxyModel->sourceModel());
394 
395  if (selectionTargetProxyModel == m_leftModel)
396  {
397  m_proxyChainDown = proxyChainDown;
398  checkConnected();
399  return;
400  }
401  }
402 
403  QPointer<const QAbstractItemModel> sourceModel = m_leftModel;
404  QPointer<const QAbstractProxyModel> sourceProxyModel = qobject_cast<const QAbstractProxyModel *>(sourceModel);
405 
406  while (sourceProxyModel)
407  {
408  m_proxyChainUp.append(sourceProxyModel);
409 
410  QObject::connect(sourceProxyModel.data(), &QAbstractProxyModel::sourceModelChanged,
411  q_ptr, [this]
412  {
413  createProxyChain();
414  }
415  );
416 
417  sourceProxyModel = qobject_cast<const QAbstractProxyModel *>(sourceProxyModel->sourceModel());
418  const int targetIndex = proxyChainDown.indexOf(sourceProxyModel);
419 
420  if (targetIndex != -1)
421  {
422  m_proxyChainDown = proxyChainDown.mid(targetIndex + 1, proxyChainDown.size());
423  checkConnected();
424  return;
425  }
426  }
427  m_proxyChainDown = proxyChainDown;
428  checkConnected();
429 }
430 
431 void GPSModelIndexProxyMapperPrivate::checkConnected()
432 {
433  auto konamiRight = m_proxyChainUp.isEmpty() ? m_leftModel : m_proxyChainUp.last()->sourceModel();
434  auto konamiLeft = m_proxyChainDown.isEmpty() ? m_rightModel : m_proxyChainDown.first()->sourceModel();
435  setConnected(konamiLeft && (konamiLeft == konamiRight));
436 }
437 
438 void GPSModelIndexProxyMapperPrivate::setConnected(bool connected)
439 {
440  if (mConnected != connected)
441  {
442  Q_Q(GPSModelIndexProxyMapper);
443  mConnected = connected;
444  emit q->isConnectedChanged();
445  }
446 }
447 
448 GPSModelIndexProxyMapper::GPSModelIndexProxyMapper(const QAbstractItemModel* const leftModel,
449  const QAbstractItemModel* const rightModel,
450  QObject* const parent)
451  : QObject(parent),
452  d_ptr(new GPSModelIndexProxyMapperPrivate(leftModel, rightModel, this))
453 {
454 }
455 
456 GPSModelIndexProxyMapper::~GPSModelIndexProxyMapper()
457 {
458  delete d_ptr;
459 }
460 
461 QModelIndex GPSModelIndexProxyMapper::mapLeftToRight(const QModelIndex& index) const
462 {
463  const QItemSelection selection = mapSelectionLeftToRight(QItemSelection(index, index));
464 
465  if (selection.isEmpty())
466  {
467  return QModelIndex();
468  }
469 
470  return selection.indexes().first();
471 }
472 
473 QModelIndex GPSModelIndexProxyMapper::mapRightToLeft(const QModelIndex& index) const
474 {
475  const QItemSelection selection = mapSelectionRightToLeft(QItemSelection(index, index));
476 
477  if (selection.isEmpty())
478  {
479  return QModelIndex();
480  }
481 
482  return selection.indexes().first();
483 }
484 
485 QItemSelection GPSModelIndexProxyMapper::mapSelectionLeftToRight(const QItemSelection& selection) const
486 {
487  Q_D(const GPSModelIndexProxyMapper);
488 
489  if (selection.isEmpty() || !d->mConnected)
490  {
491  return QItemSelection();
492  }
493 
494  if (selection.first().model() != d->m_leftModel)
495  {
496  qCDebug(DIGIKAM_GENERAL_LOG) << "FAIL" << selection.first().model() << d->m_leftModel << d->m_rightModel;
497  }
498 
499  Q_ASSERT(selection.first().model() == d->m_leftModel);
500 
501  QItemSelection seekSelection = selection;
502  Q_ASSERT(d->assertSelectionValid(seekSelection));
503  QListIterator<QPointer<const QAbstractProxyModel> > iUp(d->m_proxyChainUp);
504 
505  while (iUp.hasNext())
506  {
507  const QPointer<const QAbstractProxyModel> proxy = iUp.next();
508 
509  if (!proxy)
510  {
511  return QItemSelection();
512  }
513 
514  Q_ASSERT(seekSelection.isEmpty() || seekSelection.first().model() == proxy);
515  seekSelection = proxy->mapSelectionToSource(seekSelection);
516  Q_ASSERT(seekSelection.isEmpty() || seekSelection.first().model() == proxy->sourceModel());
517 
518  Q_ASSERT(d->assertSelectionValid(seekSelection));
519  }
520 
521  QListIterator<QPointer<const QAbstractProxyModel> > iDown(d->m_proxyChainDown);
522 
523  while (iDown.hasNext())
524  {
525  const QPointer<const QAbstractProxyModel> proxy = iDown.next();
526 
527  if (!proxy)
528  {
529  return QItemSelection();
530  }
531 
532  Q_ASSERT(seekSelection.isEmpty() || seekSelection.first().model() == proxy->sourceModel());
533  seekSelection = proxy->mapSelectionFromSource(seekSelection);
534  Q_ASSERT(seekSelection.isEmpty() || seekSelection.first().model() == proxy);
535 
536  Q_ASSERT(d->assertSelectionValid(seekSelection));
537  }
538 
539  Q_ASSERT((!seekSelection.isEmpty() && seekSelection.first().model() == d->m_rightModel) || true);
540  return seekSelection;
541 }
542 
543 QItemSelection GPSModelIndexProxyMapper::mapSelectionRightToLeft(const QItemSelection& selection) const
544 {
545  Q_D(const GPSModelIndexProxyMapper);
546 
547  if (selection.isEmpty() || !d->mConnected)
548  {
549  return QItemSelection();
550  }
551 
552  if (selection.first().model() != d->m_rightModel)
553  {
554  qCDebug(DIGIKAM_GENERAL_LOG) << "FAIL" << selection.first().model() << d->m_leftModel << d->m_rightModel;
555  }
556 
557  Q_ASSERT(selection.first().model() == d->m_rightModel);
558 
559  QItemSelection seekSelection = selection;
560  Q_ASSERT(d->assertSelectionValid(seekSelection));
561  QListIterator<QPointer<const QAbstractProxyModel> > iDown(d->m_proxyChainDown);
562 
563  iDown.toBack();
564 
565  while (iDown.hasPrevious())
566  {
567  const QPointer<const QAbstractProxyModel> proxy = iDown.previous();
568 
569  if (!proxy)
570  {
571  return QItemSelection();
572  }
573 
574  seekSelection = proxy->mapSelectionToSource(seekSelection);
575 
576  Q_ASSERT(d->assertSelectionValid(seekSelection));
577  }
578 
579  QListIterator<QPointer<const QAbstractProxyModel> > iUp(d->m_proxyChainUp);
580 
581  iUp.toBack();
582 
583  while (iUp.hasPrevious())
584  {
585  const QPointer<const QAbstractProxyModel> proxy = iUp.previous();
586 
587  if (!proxy)
588  {
589  return QItemSelection();
590  }
591 
592  seekSelection = proxy->mapSelectionFromSource(seekSelection);
593 
594  Q_ASSERT(d->assertSelectionValid(seekSelection));
595  }
596 
597  Q_ASSERT((!seekSelection.isEmpty() && seekSelection.first().model() == d->m_leftModel) || true);
598  return seekSelection;
599 }
600 
601 bool GPSModelIndexProxyMapper::isConnected() const
602 {
603  Q_D(const GPSModelIndexProxyMapper);
604  return d->mConnected;
605 }
606 
607 } // namespace Digikam
608 
609 #include "moc_gpsitemsortproxymodel.cpp"
QItemSelection::indexes
QModelIndexList indexes() const
QModelIndex
QItemSelectionModel::selectionChanged
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
Digikam::GPSModelIndexProxyMapper::mapLeftToRight
QModelIndex mapLeftToRight(const QModelIndex &index) const
Maps the index from the left model to the right model.
Definition: gpsitemsortproxymodel.cpp:461
QPointer::data
T * data() const
QItemSelectionRange
QListIterator::next
const T & next()
Digikam::GPSModelIndexProxyMapper::isConnected
bool isConnected() const
QAbstractProxyModel
QListIterator::previous
const T & previous()
Digikam::GPSLinkItemSelectionModel::linkedItemSelectionModelChanged
void linkedItemSelectionModelChanged()
QItemSelection::select
void select(const QModelIndex &topLeft, const QModelIndex &bottomRight)
QPointer
Digikam::GPSLinkItemSelectionModel
Makes it possible to share a selection in multiple views which do not have the same source model...
Definition: gpsitemsortproxymodel.h:77
QObject::disconnect
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
QList::size
int size() const
Digikam::GPSLinkItemSelectionModel::linkedItemSelectionModel
QItemSelectionModel * linkedItemSelectionModel() const
QList::indexOf
int indexOf(const T &value, int from) const
Digikam::GPSLinkItemSelectionModel::setLinkedItemSelectionModel
void setLinkedItemSelectionModel(QItemSelectionModel *const selectionModel)
Definition: gpsitemsortproxymodel.cpp:185
Digikam::GPSLinkItemSelectionModel::select
void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) override
Definition: gpsitemsortproxymodel.cpp:215
Digikam::GPSLinkItemSelectionModel::d_ptr
GPSLinkItemSelectionModelPrivate *const d_ptr
Definition: gpsitemsortproxymodel.h:105
QModelIndex::isValid
bool isValid() const
QObject
Digikam::GPSLinkItemSelectionModel::GPSLinkItemSelectionModel
GPSLinkItemSelectionModel(QAbstractItemModel *const targetModel, QItemSelectionModel *const linkedItemSelectionModel, QObject *const parent=nullptr)
Definition: gpsitemsortproxymodel.cpp:158
QItemSelectionModel::selection
const QItemSelection selection() const
gpsitemsortproxymodel.h
QList::isEmpty
bool isEmpty() const
QItemSelectionModel::select
virtual void select(const QModelIndex &index, QFlags< QItemSelectionModel::SelectionFlag > command)
Digikam::GPSLinkItemSelectionModel::~GPSLinkItemSelectionModel
~GPSLinkItemSelectionModel()
Definition: gpsitemsortproxymodel.cpp:173
Digikam::GPSModelIndexProxyMapper::mapRightToLeft
QModelIndex mapRightToLeft(const QModelIndex &index) const
Maps the index from the right model to the left model.
Definition: gpsitemsortproxymodel.cpp:473
QListIterator::toBack
void toBack()
QList::first
T & first()
QList
Definition: piwigotalker.h:47
model
#define model
Definition: var_defines.h:25
QSortFilterProxyModel
Digikam::GPSModelIndexProxyMapper::mapSelectionRightToLeft
QItemSelection mapSelectionRightToLeft(const QItemSelection &selection) const
Maps the selection from the right model to the left model.
Definition: gpsitemsortproxymodel.cpp:543
QItemSelection
QItemSelectionModel::currentChanged
void currentChanged(const QModelIndex &current, const QModelIndex &previous)
QListIterator::hasPrevious
bool hasPrevious() const
p
#define p
Digikam::GPSModelIndexProxyMapper::mapSelectionLeftToRight
QItemSelection mapSelectionLeftToRight(const QItemSelection &selection) const
Maps the selection from the left model to the right model.
Definition: gpsitemsortproxymodel.cpp:485
Digikam::GPSModelIndexProxyMapper
This class facilitates easy mapping of indexes and selections through proxy models.
Definition: gpsitemsortproxymodel.h:136
Digikam::GPSModelIndexProxyMapper::GPSModelIndexProxyMapper
GPSModelIndexProxyMapper(const QAbstractItemModel *const leftModel, const QAbstractItemModel *const rightModel, QObject *const parent=nullptr)
Definition: gpsitemsortproxymodel.cpp:448
Digikam::GPSModelIndexProxyMapper::~GPSModelIndexProxyMapper
~GPSModelIndexProxyMapper()
Definition: gpsitemsortproxymodel.cpp:456
QList::mid
QList< T > mid(int pos, int length) const
digikam_debug.h
QModelIndex::column
int column() const
QAbstractItemModel
QList::prepend
void prepend(const T &value)
QListIterator
const
#define const
Definition: zlib-1.2.3/zconf.h:124
QItemSelectionRange::isValid
bool isValid() const
QItemSelectionModel
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QItemSelectionModel::SelectionFlags
typedef SelectionFlags
q
#define q
QListIterator::hasNext
bool hasNext() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Wed Dec 11 2019 07:34:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

digikam

Skip menu "digikam"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages
-->

graphics API Reference

Skip menu "graphics API Reference"
  • digikam
  • KDiagram
  •     KChart
  •     KGantt
  • KPhotoAlbum
  •   AndroidRemoteControl
  • Krita
  •   libs
  •     KritaBasicFlakes
  •     brush
  •     KritaUndo2
  •     KritaFlake
  •     image
  •     KritaPlugin
  •     Krita
  •     KritaOdf
  •     KritaPigment
  •     KritaStore
  •     ui
  •     KritaWidgets
  •     KritaWidgetUtils
  •   plugins
  •     Assitants
  •     Extensions
  •     Filters
  •         KritaText
  •         KritaTextLayout
  •     Generators
  •     Formats
  •             src
  •     PaintOps
  •       libpaintop
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal