summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qstandarditemmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemviews/qstandarditemmodel.cpp')
-rw-r--r--src/gui/itemviews/qstandarditemmodel.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp
index e8b7d08..3924a41 100644
--- a/src/gui/itemviews/qstandarditemmodel.cpp
+++ b/src/gui/itemviews/qstandarditemmodel.cpp
@@ -2971,7 +2971,7 @@ QMimeData *QStandardItemModel::mimeData(const QModelIndexList &indexes) const
Used by QStandardItemModel::dropMimeData
stream out an item and his children
*/
-static void decodeDataRecursive(QDataStream &stream, QStandardItem *item)
+void QStandardItemModelPrivate::decodeDataRecursive(QDataStream &stream, QStandardItem *item)
{
int colCount, childCount;
stream >> *item;
@@ -2982,7 +2982,7 @@ static void decodeDataRecursive(QDataStream &stream, QStandardItem *item)
while(childPos > 0) {
childPos--;
- QStandardItem *child = new QStandardItem;
+ QStandardItem *child = createItem();
decodeDataRecursive(stream, child);
item->setChild( childPos / colCount, childPos % colCount, child);
}
@@ -2995,6 +2995,7 @@ static void decodeDataRecursive(QDataStream &stream, QStandardItem *item)
bool QStandardItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action,
int row, int column, const QModelIndex &parent)
{
+ Q_D(QStandardItemModel);
// check if the action is supported
if (!data || !(action == Qt::CopyAction || action == Qt::MoveAction))
return false;
@@ -3026,9 +3027,9 @@ bool QStandardItemModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
while (!stream.atEnd()) {
int r, c;
- QStandardItem *item = new QStandardItem;
+ QStandardItem *item = d->createItem();
stream >> r >> c;
- decodeDataRecursive(stream, item);
+ d->decodeDataRecursive(stream, item);
rows.append(r);
columns.append(c);