1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5 \page qtquickwidgets-index.html
6 \title Qt Quick Widgets
7 \brief Provides a C++ widget class for displaying a Qt Quick user interface.
9 The Qt Quick Widgets module is a convenience wrapper for QQuickWindow.
10 It will automatically load and display a QML scene when given the URL of
11 the main \c qml file. Alternatively, you can instantiate QML objects using
12 QQmlComponent and place them in a manually set-up QQuickWidget.
17 QQuickWidget *view = new QQuickWidget;
18 view->setSource(QUrl::fromLocalFile("myqmlfile.qml"));
22 QQuickWidget also manages resizing the view and the root item. By default,
23 the \l {QQuickWidget::} {resizeMode} is set to
24 \l {QQuickWidget::} {SizeViewToRootObject}, which will
25 load the component and resize it to fit the view. Alternatively,
26 you can set \l {QQuickWidget::} {resizeMode} to
27 \l {QQuickWidget::SizeViewToRootObject} {SizeViewToRootObject}, which will
28 resize the view to the root item.
30 \section1 Using the Module
32 \include {module-use.qdocinc} {using the c++ api}
34 \section2 Building with CMake
36 \include {module-use.qdocinc} {building with cmake} {QuickWidgets}
38 \section2 Building with qmake quickwidgets
40 \include {module-use.qdocinc} {building_with_qmake} {quickwidgets}
45 \li \l {Qt Quick Widgets C++ Classes}
48 \section1 Licenses and Attributions
50 Qt Quick Widget is available under commercial licenses from
51 \l{The Qt Company}. In addition, it is available under free software
52 licenses. Since Qt 5.4, these free software licenses are
53 \l{GNU Lesser General Public License, version 3}, or the
54 \l{GNU General Public License, version 2}. See
55 \l{Qt Licensing} for more details.