Marble/ModelView

From KDE TechBase
Revision as of 10:43, 30 January 2011 by Tgridel (talk | contribs)

ModelView framework in Marble

Marble uses Qt's Model/View framework as a way to signal updates to a model to interested parts. In that respect, a Model class can wrap any possible data.

The Model-View framework is designed to hide the details of the model content, and to present it in a standardised way to views. The advantage of this solution is that the View need not know much about the data it presents.

The multiple models and proxies in Marble each fit the purpose of feeding some GeoData classes to interested widgets. Those models are fed by the Expression error: Unrecognized word "x"..

Here is the list of Model and Proxy classes, and a description of how they are used.

GeoDataTreeModel

The Expression error: Unrecognized word "x". represents the list of all Expression error: Unrecognized word "x". registered through the Expression error: Unrecognized word "x"..

It has signals/slots to react to files being added or removed in the FileManager.

It is used as the base model for GeoDataDocuments.

The Expression error: Unrecognized word "x". renders all Expression error: Unrecognized word "x". related placemarks.

FileViewModel

The Expression error: Unrecognized word "x". represents the list of opened files. The Expression error: Unrecognized word "x". appends the documents it opens. It is used by the Expression error: Unrecognized word "x"..

KDescendantsProxyModel

The Expression error: Unrecognized word "x". is used to flatten the tree of GeoData features. It represents the list of all Placemarks of all opened files.

The Expression error: Unrecognized word "x". uses that proxy model to provide the list of placemarks to search for, and the Expression error: Unrecognized word "x". uses it also to determine layouting on the map.