QDeclarativeView Class ReferenceThe QDeclarativeView class provides a widget for displaying a Qt Declarative user interface. Далее... #include <QDeclarativeView> Inherits: QGraphicsView. Этот класс был введён в Qt 4.7. Открытые типы
Свойства
Открытые функции
Сигналы
Дополнительные унаследованные члены
Подробное описаниеThe QDeclarativeView class provides a widget for displaying a Qt Declarative user interface. QDeclarativeItem objects can be placed on a standard QGraphicsScene and displayed with QGraphicsView. QDeclarativeView is a QGraphicsView subclass provided as a convenience for displaying QML files, and connecting between QML and C++ Qt objects. QDeclarativeView provides:
Typical usage: QDeclarativeView *view = new QDeclarativeView; view->setSource(QUrl::fromLocalFile("myqmlfile.qml")); view->show(); Since QDeclarativeView is a QWidget-based class, it can be used to display QML interfaces within QWidget-based GUI applications that do not use the Graphics View framework. To receive errors related to loading and executing QML with QDeclarativeView, you can connect to the statusChanged() signal and monitor for QDeclarativeView::Error. The errors are available via QDeclarativeView::errors(). If you're using your own QGraphicsScene-based scene with QDeclarativeView, remember to enable scene's sticky focus mode and to set itemIndexMethod to QGraphicsScene::NoIndex. See also Integrating QML Code with Existing Qt UI Code and Using QML Bindings in C++ Applications. Описание типов-членовenum QDeclarativeView::ResizeModeThis enum specifies how to resize the view.
enum QDeclarativeView::StatusSpecifies the loading status of the QDeclarativeView.
Описание свойствresizeMode : ResizeModeThis property holds whether the view should resize the canvas contents. If this property is set to SizeViewToRootObject (the default), the view resizes with the root item in the QML. If this property is set to SizeRootObjectToView, the view will automatically resize the root item. Regardless of this property, the sizeHint of the view is the initial size of the root item. Note though that since QML may load dynamically, that size may change. Функции доступа:
source : QUrlThis property holds the URL of the source of the QML component. Changing this property causes the QML component to be reloaded. Ensure that the URL provided is full and correct, in particular, use QUrl::fromLocalFile() when loading a file from the local filesystem. Функции доступа:
See also Loading Resources in QML. status : const StatusThe component's current status. Функции доступа:
Уведомляющий сигнал:
Описание функций-членовQDeclarativeView::QDeclarativeView ( QWidget * parent = 0 )Constructs a QDeclarativeView with the given parent. QDeclarativeView::QDeclarativeView ( const QUrl & source, QWidget * parent = 0 )Constructs a QDeclarativeView with the given QML source and parent. QDeclarativeView::~QDeclarativeView () [virtual]Разрушает представление. QDeclarativeEngine * QDeclarativeView::engine () constReturns a pointer to the QDeclarativeEngine used for instantiating QML Components. QList<QDeclarativeError> QDeclarativeView::errors () constReturn the list of errors that occurred during the last compile or create operation. When the status is not Error, an empty list is returned. QSize QDeclarativeView::initialSize () constReturns the initial size of the root object QDeclarativeContext * QDeclarativeView::rootContext () constThis function returns the root of the context hierarchy. Each QML component is instantiated in a QDeclarativeContext. QDeclarativeContext's are essential for passing data to QML components. In QML, contexts are arranged hierarchically and this hierarchy is managed by the QDeclarativeEngine. QGraphicsObject * QDeclarativeView::rootObject () constReturns the view's root item. void QDeclarativeView::sceneResized ( QSize size ) [signal]This signal is emitted when the view is resized to size. void QDeclarativeView::statusChanged ( QDeclarativeView::Status status ) [signal]This signal is emitted when the component's current status changes. |
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |