mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added drag and drop support.
Implemented our own insertRows/deleteRows to avoid bug caused by default drag and drop behaviour of Qt https://bugreports.qt-project.org/browse/QTBUG-26229 https://bugreports.qt-project.org/browse/QTBUG-6679 p4#: 21028
This commit is contained in:
@@ -293,9 +293,9 @@ Qt::ItemFlags UiTreeModelPdm::flags(const QModelIndex &index) const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
/// TO BE DELETED
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool UiTreeModelPdm::insertRows(int position, int rows, const QModelIndex &parent /*= QModelIndex()*/)
|
||||
bool UiTreeModelPdm::insertRows_special(int position, int rows, const QModelIndex &parent /*= QModelIndex()*/)
|
||||
{
|
||||
PdmUiTreeItem* parentItem = getTreeItemFromIndex(parent);
|
||||
|
||||
@@ -311,7 +311,7 @@ bool UiTreeModelPdm::insertRows(int position, int rows, const QModelIndex &paren
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool UiTreeModelPdm::removeRows(int position, int rows, const QModelIndex &parent /*= QModelIndex()*/)
|
||||
bool UiTreeModelPdm::removeRows_special(int position, int rows, const QModelIndex &parent /*= QModelIndex()*/)
|
||||
{
|
||||
if (rows <= 0) return true;
|
||||
|
||||
@@ -344,7 +344,7 @@ void UiTreeModelPdm::rebuildUiSubTree(PdmObject* root)
|
||||
QModelIndex item = getModelIndexFromPdmObject(root);
|
||||
if (item.isValid())
|
||||
{
|
||||
this->removeRows(0, rowCount(item), item);
|
||||
this->removeRows_special(0, rowCount(item), item);
|
||||
PdmUiTreeItem* treeItem = getTreeItemFromIndex(item);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user