RoomEditorWidget improvements
This commit is contained in:
@@ -273,12 +273,17 @@ Qt::ItemFlags ProjectTreeModel::flags(const QModelIndex &index) const
|
||||
case NodeType::TimeLine:
|
||||
case NodeType::Object:
|
||||
case NodeType::Room:
|
||||
flags |= Qt::ItemIsEditable;
|
||||
flags |= Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
Qt::DropActions ProjectTreeModel::supportedDropActions() const
|
||||
{
|
||||
return QAbstractItemModel::supportedDropActions() | Qt::MoveAction;
|
||||
}
|
||||
|
||||
bool ProjectTreeModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
{
|
||||
switch (const auto nodeType = this->nodeType(index))
|
||||
@@ -314,6 +319,12 @@ bool ProjectTreeModel::insertRows(int row, int count, const QModelIndex &parent)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProjectTreeModel::moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
|
||||
{
|
||||
qDebug() << "called" << sourceParent << sourceRow << count << destinationParent << destinationChild;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ProjectTreeModel::removeRows(int row, int count, const QModelIndex &parent)
|
||||
{
|
||||
if (auto result = removeRowsFor<Sprite>(row, count, parent)) return *result;
|
||||
|
||||
Reference in New Issue
Block a user