blob: 1b0c69efaa17afde42914930a8125b38d41c85ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef TYPEWITHREQUIREDPROPERTY_H_
#define TYPEWITHREQUIREDPROPERTY_H_
#include <QtCore/qobject.h>
#include <QtCore/qproperty.h>
#include <QtQml/qqmlregistration.h>
class TypeWithRequiredProperty : public QObject
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(QString requiredProperty READ requiredProperty WRITE setRequiredProperty REQUIRED)
QProperty<QString> m_requiredProperty;
public:
TypeWithRequiredProperty(QObject *parent = nullptr) : QObject(parent) { }
QString requiredProperty() const { return m_requiredProperty; }
void setRequiredProperty(const QString &s) { m_requiredProperty = s; }
};
#endif // TYPEWITHREQUIREDPROPERTY_H_
|