Версия для печати темы

Нажмите сюда для просмотра этой темы в обычном формате

Форум на CrossPlatform.RU _ Переводы _ An Introduction to Model/View Programming

Автор: Admin 10.12.2007, 13:05

An Introduction to Model/View Programming
http://crossplatform.ru/documentation/qtdoc4.3/model-view-introduction.php#sorting

Сделано, кроме:

Цитата
There are two ways of approaching sorting in the model/view architecture; which approach to choose depends on your underlying model.

If your model is sortable, i.e, if it reimplements the QAbstractItemModel::sort() function, both QTableView and QTreeView provide an API that allows you to sort your model data programmatically. In addition, you can enable interactive sorting (i.e. allowing the users to sort the data by clicking the view's headers), by connecting the QHeaderView::sectionClicked() signal to the QTableView::sortByColumn() slot or the QTreeView::sortByColumn() slot, respectively.

The alternative approach, if your model do not have the required interface or if you want to use a list view to present your data, is to use a proxy model to transform the structure of your model before presenting the data in the view. This is covered in detail in the section on Proxy Models.

и
Цитата
If you wish to take advantage of the features provided by the model/view approach while still using an item-based interface, consider using view classes, such as QListView, QTableView, and QTreeView with QStandardItemModel.

Автор: nick shaforostoff 12.12.2007, 0:43

определяет рекцию -> определяет эрекцию

If you wish to take advantage of the features provided by the model/view approach while still using an item-based interface, consider using view classes, such as QListView, QTableView, and QTreeView with QStandardItemModel. ->
Если же вы хотите воспользоваться достоинствами разделения данных и представление не отказываясь от схемы явного предварительного заполнения данных, используйте QListView, QTableView и QTreeView со специальной моделью QStandardItemModel.

Удобство классов -> лучше уже Традиционные классы

предназначенных для отображения основанных на элементах представлений и таблиц->работающих по старой схеме, когда все данные копируются в виджет предварительно.

существуют просто для предоставления знакомого интерфейса для эквивалентных классов Qt 3.->существуют просто как эквивалент классов Qt3 работающих по старой схеме.

Автор: Admin 12.12.2007, 9:45

Сделано.

Форум Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)