54 return QVariant::fromValue(
58 if (role != Qt::DisplayRole)
86 if (
index.parent().isValid())
88 return Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | defaultFlags;
99 return Qt::CopyAction;
106 types <<
"application/pointer";
113 QMimeData*
mimeData =
new QMimeData();
114 QByteArray encodedData;
116 QDataStream stream(&encodedData, QIODevice::WriteOnly);
118 foreach (
const QModelIndex&
index, indexes)
126 stream << reinterpret_cast<quint64>(item.get());
127 stream << QString(
"");
132 mimeData->setData(
"application/pointer", encodedData);
139 QModelIndex topLeft =
index(0, 0);
142 emit dataChanged(topLeft, bottomRight);
This class represents an item in the ApplicationDatabaseView.
ScenarioManager::Data_Structure::ApplicationPtr getApplication()
Returns the Application displayed in this item.
QStringList mimeTypes() const override
Returns supported MIME-types.
ApplicationDatabaseItem * getRootItem()
ApplicationDatabaseModel()
Constructor that sets up the first item contained by this model.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns the behavioural flags of the object at the specified index.
Qt::DropActions supportedDragActions() const override
Returns the supported drag action.
void update()
Updates the model.
QVariant data(const QModelIndex &index, int role) const override
Returns the data at the specified index, depending on the specified role.
void clear() override
Clears and resets this model as if it was newly constructed.
QMimeData * mimeData(const QModelIndexList &indexes) const override
Returns the mimedata of the objects at the specified indexes.
virtual QVariant data(int column) const
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
std::shared_ptr< Application > ApplicationPtr