Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Obsolete Members for QAbstractItemModel

The following members of class QAbstractItemModel are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Functions

(obsolete) void setSupportedDragActions(Qt::DropActions actions)
  • 2 public functions inherited from QObject

Protected Functions

(obsolete) void reset()
(obsolete) void setRoleNames(const QHash<int, QByteArray> &roleNames)

Member Function Documentation

[protected] void QAbstractItemModel::reset()

Resets the model to its original state in any attached views.

This function emits the signals modelAboutToBeReset() and modelReset().

Note: Use beginResetModel() and endResetModel() instead whenever possible. Use this method only if there is no way to call beginResetModel() before invalidating the model. Otherwise it could lead to unexpected behaviour, especially when used with proxy models.

For example, in this code both signals modelAboutToBeReset() and modelReset() are emitted after the data changes:


Instead you should use:


[protected] void QAbstractItemModel::setRoleNames(const QHash<int, QByteArray> &roleNames)

This function is obsolete. Reimplement roleNames() instead.

Sets the model's role names to roleNames.

This function allows mapping of role identifiers to role property names in scripting languages.

This function was introduced in Qt 4.6.

See also roleNames().

void QAbstractItemModel::setSupportedDragActions(Qt::DropActions actions)

This function is obsolete. Reimplement supportedDragActions() instead.

Sets the supported drag actions for the items in the model.

This function was introduced in Qt 4.2.

See also supportedDragActions() and Using drag and drop with item views.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded