diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-09-24 15:26:10 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-09-24 15:26:10 (GMT) |
commit | 270c374c178ec5a532d37168b018cd7ebc844558 (patch) | |
tree | a1f3b19daae4a40c296f127b0f8af64107c2c29a /src/gui/itemviews | |
parent | 4d593220a8521c75821609560a3f7e09e28988c5 (diff) | |
parent | 9e4f5f2133b542cdf6f32f2fc96dccd864e68420 (diff) | |
download | Qt-270c374c178ec5a532d37168b018cd7ebc844558.zip Qt-270c374c178ec5a532d37168b018cd7ebc844558.tar.gz Qt-270c374c178ec5a532d37168b018cd7ebc844558.tar.bz2 |
Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt into 4.6
Conflicts:
examples/webkit/formextractor/formextractor.pro
mkspecs/features/qt.prf
src/gui/painting/qpaintengineex.cpp
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qstandarditemmodel.cpp | 9 | ||||
-rw-r--r-- | src/gui/itemviews/qstandarditemmodel_p.h | 2 |
2 files changed, 7 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); diff --git a/src/gui/itemviews/qstandarditemmodel_p.h b/src/gui/itemviews/qstandarditemmodel_p.h index 53ee6e3..3f6e0ca 100644 --- a/src/gui/itemviews/qstandarditemmodel_p.h +++ b/src/gui/itemviews/qstandarditemmodel_p.h @@ -176,6 +176,8 @@ public: void _q_emitItemChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void decodeDataRecursive(QDataStream &stream, QStandardItem *item); + QVector<QStandardItem*> columnHeaderItems; QVector<QStandardItem*> rowHeaderItems; QScopedPointer<QStandardItem> root; |