parley
containermodel.cpp
Go to the documentation of this file.
43 QModelIndex ContainerModel::appendContainer(const QModelIndex& parent, const QString & containerName)
56 parentContainer->appendChildContainer(new KEduVocLesson(containerName, static_cast<KEduVocLesson*>(parentContainer)));
156 return (Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled);
249 bool ContainerModel::dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent)
303 // use index because we sometimes reparent to the root container instead of dropping into nowhere
323 // Create a list of the entries associated with the translations being copied. This prevents duplicates if they highlighted several columns.
333 static_cast<KEduVocLesson*>(parent.internalPointer())->appendEntry(new KEduVocExpression(*entry));
366 // BIG FAT WARNING this code works, but it gets called by the drag and drop implementation automatically, so either this gets used or the other (dropMimeData) to remove the containers. If both are active, containers get deleted without warning or visible signs.
374 kDebug() << "removeRows from " << parentContainer->name() << " row " << row << "count" << count;
Model for the tree of containers (lessons, word types).
Definition: readonlycontainermodel.h:33
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: readonlycontainermodel.cpp:108
virtual Qt::DropActions supportedDropActions() const
Definition: containermodel.cpp:214
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: readonlycontainermodel.cpp:49
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Change the name or checkbox of a lesson.
Definition: containermodel.cpp:112
QList< KEduVocContainer * > containerList() const
Definition: containermimedata.cpp:24
const char * name() const
bool isValid() const
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
Definition: containermodel.cpp:249
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: containermodel.cpp:163
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
void endInsertRows()
void beginRemoveRows(const QModelIndex &parent, int first, int last)
int row() const
void setText(const QString &text)
void * internalPointer() const
virtual QVariant data(const QModelIndex &index, int role) const
Definition: containermodel.cpp:74
void setSupportedDragActions(QFlags< Qt::DropAction > actions)
QModelIndex parent() const
void documentModified()
emitted when the inPractice state or name of a lesson changed.
QModelIndex appendContainer(const QModelIndex &parent, const QString &containerName=QString())
Definition: containermodel.cpp:43
bool contains(const T &value) const
QModelIndex child(int row, int column) const
void beginInsertRows(const QModelIndex &parent, int first, int last)
typedef DropActions
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: containermodel.cpp:187
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Definition: containermodel.cpp:225
int column() const
bool toBool() const
void deleteContainer(const QModelIndex &containerIndex)
Definition: containermodel.cpp:199
void addContainer(KEduVocContainer *container)
Definition: containermimedata.cpp:19
virtual QStringList formats() const
Definition: vocabularymimedata.h:26
virtual KEduVocContainer * rootContainer() const =0
void endRemoveRows()
ContainerModel(KEduVocContainer::EnumContainerType type, QObject *parent=0)
Definition: containermodel.cpp:34
QObject * parent() const
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: containermodel.cpp:144
QList< KEduVocTranslation * > translationList() const
Definition: vocabularymimedata.cpp:67
QString toString() const
KEduVocContainer::EnumContainerType m_type
Definition: readonlycontainermodel.h:61
KEduVocContainer::EnumContainerType containerType()
Definition: readonlycontainermodel.cpp:179
Definition: containermimedata.h:26
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.