Package QML Element

Package provides a collection of named items. 更多...

附加特性

详细描述

The Package class is used in conjunction with VisualDataModel to enable delegates with a shared context to be provided to multiple views.

Any item within a Package may be assigned a name via the Package.name 附加特性。

The example below creates a Package containing two named items; list and grid . The third element in the package (the Rectangle ) is parented to whichever delegate it should appear in. This allows an item to move between views.


					

These named items are used as the delegates by the two views who reference the special VisualDataModel::parts property to select a model which provides the chosen delegate.


					

另请参阅 Package example , Photo Viewer demo ,和 QtDeclarative .

附加特性文档编制

Package.name : string

This attached property holds the name of an item within a Package.