OpenCoverage

qquickwidget.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quickwidgets/qquickwidget.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQuick module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#ifndef QQUICKWIDGET_H-
41#define QQUICKWIDGET_H-
42-
43#include <QtWidgets/qwidget.h>-
44#include <QtQuick/qquickwindow.h>-
45#include <QtCore/qurl.h>-
46#include <QtQuickWidgets/qtquickwidgetsglobal.h>-
47#include <QtGui/qimage.h>-
48-
49QT_BEGIN_NAMESPACE-
50-
51class QQmlEngine;-
52class QQmlContext;-
53class QQmlError;-
54class QQuickItem;-
55class QQmlComponent;-
56-
57class QQuickWidgetPrivate;-
58class Q_QUICKWIDGETS_EXPORT QQuickWidget : public QWidget-
59{-
60 Q_OBJECT-
61 Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode)-
62 Q_PROPERTY(Status status READ status NOTIFY statusChanged)-
63 Q_PROPERTY(QUrl source READ source WRITE setSource DESIGNABLE true)-
64-
65public:-
66 explicit QQuickWidget(QWidget *parent = nullptr);-
67 QQuickWidget(QQmlEngine* engine, QWidget *parent);-
68 explicit QQuickWidget(const QUrl &source, QWidget *parent = nullptr);-
69 ~QQuickWidget() override;-
70-
71 QUrl source() const;-
72-
73 QQmlEngine* engine() const;-
74 QQmlContext* rootContext() const;-
75-
76 QQuickItem *rootObject() const;-
77-
78 enum ResizeMode { SizeViewToRootObject, SizeRootObjectToView };-
79 Q_ENUM(ResizeMode)-
80 ResizeMode resizeMode() const;-
81 void setResizeMode(ResizeMode);-
82-
83 enum Status { Null, Ready, Loading, Error };-
84 Q_ENUM(Status)-
85 Status status() const;-
86-
87 QList<QQmlError> errors() const;-
88-
89 QSize sizeHint() const override;-
90 QSize initialSize() const;-
91-
92 void setFormat(const QSurfaceFormat &format);-
93 QSurfaceFormat format() const;-
94-
95 QImage grabFramebuffer() const;-
96-
97 void setClearColor(const QColor &color);-
98-
99 QQuickWindow *quickWindow() const;-
100-
101public Q_SLOTS:-
102 void setSource(const QUrl&);-
103 void setContent(const QUrl& url, QQmlComponent *component, QObject *item);-
104-
105Q_SIGNALS:-
106 void statusChanged(QQuickWidget::Status);-
107 void sceneGraphError(QQuickWindow::SceneGraphError error, const QString &message);-
108-
109private Q_SLOTS:-
110 // ### Qt 6: make these truly private slots through Q_PRIVATE_SLOT-
111 void continueExecute();-
112 void createFramebufferObject();-
113 void destroyFramebufferObject();-
114 void triggerUpdate();-
115-
116protected:-
117 void resizeEvent(QResizeEvent *) override;-
118 void timerEvent(QTimerEvent*) override;-
119-
120 void keyPressEvent(QKeyEvent *) override;-
121 void keyReleaseEvent(QKeyEvent *) override;-
122 void mousePressEvent(QMouseEvent *) override;-
123 void mouseReleaseEvent(QMouseEvent *) override;-
124 void mouseMoveEvent(QMouseEvent *) override;-
125 void mouseDoubleClickEvent(QMouseEvent *) override;-
126-
127 void showEvent(QShowEvent *) override;-
128 void hideEvent(QHideEvent *) override;-
129-
130 void focusInEvent(QFocusEvent * event) override;-
131 void focusOutEvent(QFocusEvent * event) override;-
132-
133#if QT_CONFIG(wheelevent)-
134 void wheelEvent(QWheelEvent *) override;-
135#endif-
136-
137#if QT_CONFIG(draganddrop)-
138 void dragEnterEvent(QDragEnterEvent *) override;-
139 void dragMoveEvent(QDragMoveEvent *) override;-
140 void dragLeaveEvent(QDragLeaveEvent *) override;-
141 void dropEvent(QDropEvent *) override;-
142#endif-
143-
144 bool event(QEvent *) override;-
145 void paintEvent(QPaintEvent *event) override;-
146 bool focusNextPrevChild(bool next) override;-
147-
148private:-
149 Q_DISABLE_COPY(QQuickWidget)-
150 Q_DECLARE_PRIVATE(QQuickWidget)
executed 4266 times by 2 tests: return reinterpret_cast<QQuickWidgetPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_qquickshortcut
  • tst_qquickwidget
executed 198 times by 2 tests: return reinterpret_cast<const QQuickWidgetPrivate *>(qGetPtrHelper(d_ptr));
Executed by:
  • tst_qquickshortcut
  • tst_qquickwidget
198-4266
151};-
152-
153QT_END_NAMESPACE-
154-
155#endif // QQuickWidget_H-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0