25 #ifndef DIGIKAM_RG_TAG_MODEL_H
26 #define DIGIKAM_RG_TAG_MODEL_H
30 #include <QAbstractItemModel>
31 #include <QItemSelectionModel>
52 class DIGIKAM_EXPORT
RGTagModel :
public QAbstractItemModel
63 explicit RGTagModel(QAbstractItemModel*
const externalTagModel,
64 QObject*
const parent =
nullptr);
73 int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
74 bool setData(
const QModelIndex& index,
const QVariant&
value,
int role)
override;
75 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
76 QModelIndex index(
int row,
int column,
const QModelIndex& parent = QModelIndex())
const override;
77 QModelIndex parent(
const QModelIndex& index)
const override;
78 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
79 bool setHeaderData(
int section,
Qt::Orientation orientation,
const QVariant&
value,
int role)
override;
80 QVariant headerData(
int section,
Qt::Orientation orientation,
int role)
const override;
81 Qt::ItemFlags flags(
const QModelIndex& index)
const override;
89 QModelIndex fromSourceIndex(
const QModelIndex& externalTagModelIndex)
const;
95 QModelIndex toSourceIndex(
const QModelIndex& tagModelIndex)
const;
102 void addSpacerTag(
const QModelIndex& parent,
const QString& spacerName);
109 QPersistentModelIndex addNewTag(
const QModelIndex& parent,
110 const QString& newTagName,
111 const QString& newElement);
121 QList<QList<TagData> > addNewData(
const QStringList& elements,
const QStringList& resultedData);
133 const QStringList& addressElements,
134 const QStringList& elementsData);
147 void findAndDeleteSpacersOrNewTags(
TreeBranch* currentBranch,
149 Type whatShouldRemove);
156 void deleteAllSpacersOrNewTags(
const QModelIndex& currentIndex,
Type whatShouldRemove);
173 int currentAddressElementIndex);
185 void deleteTag(
const QModelIndex& currentIndex);
197 void climbTreeAndGetSpacers(
const TreeBranch* currentBranch);
211 void addExternalTags(
TreeBranch* parentBranch,
int currentRow);
216 void addAllExternalTagsToTreeView();
221 void addAllSpacersToTag(
const QModelIndex& currentIndex,
222 const QStringList& spacerList,
223 int spacerListIndex);
230 Type getTagType(
const QModelIndex& index)
const;
237 TreeBranch* branchFromIndex(
const QModelIndex& index)
const;
241 void slotSourceDataChanged(
const QModelIndex& topLeft,
const QModelIndex& bottomRight);
242 void slotSourceHeaderDataChanged(
const Qt::Orientation orientation,
int first,
int last);
243 void slotColumnsAboutToBeInserted(
const QModelIndex& parent,
int start,
int end);
244 void slotColumnsAboutToBeMoved(
const QModelIndex& sourceParent,
int sourceStart,
int sourceEnd,
245 const QModelIndex& destinationParent,
int destinationColumn);
246 void slotColumnsAboutToBeRemoved(
const QModelIndex& parent,
int start,
int end);
247 void slotColumnsInserted();
248 void slotColumnsMoved();
249 void slotColumnsRemoved();
250 void slotLayoutAboutToBeChanged();
251 void slotLayoutChanged();
252 void slotModelAboutToBeReset();
253 void slotModelReset();
254 void slotRowsAboutToBeInserted(
const QModelIndex& parent,
int start,
int end);
255 void slotRowsAboutToBeMoved(
const QModelIndex& sourceParent,
int sourceStart,
int sourceEnd,
256 const QModelIndex& destinationParent,
int destinationRow);
257 void slotRowsAboutToBeRemoved(
const QModelIndex& parent,
int start,
int end);
258 void slotRowsInserted();
259 void slotRowsMoved();
260 void slotRowsRemoved();
264 QString translateSpacer(
const QString& text)
const;
The model that holds data for the tag tree displayed in ReverseGeocodingWidget.
Definition: rgtagmodel.h:53
Definition: treebranch.h:41
Definition: piwigotalker.h:48
qulonglong value
Definition: itemviewutilities.cpp:592
@ Orientation
Definition: coredbfields.h:86
Definition: datefolderview.cpp:43
Type
Definition: gpsitemcontainer.h:45