aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/abstractmetalang.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-10 15:28:55 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-11-11 17:14:14 +0000
commit154ef5831fcae56f9cbf53301b410a21bbdd6265 (patch)
treec8322efaf9dfe208173b769c9106bb968e659a09 /sources/shiboken6/ApiExtractor/abstractmetalang.h
parentc527b0bac89679aa01fbc409077dd5640fc59c9b (diff)
shiboken6: Port QPropertySpec to use QSharedDataPointer
Change the client code to store it by value. Use a std::optional to replace the pointer. Replace the pointer QPropertySpec* stored in AbstractMetaFunction by a the index of the property in the enclosing class. Change-Id: Iffca9e0a6f311534ba001dc2b34bbf5ff7c01813 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/abstractmetalang.h')
-rw-r--r--sources/shiboken6/ApiExtractor/abstractmetalang.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/sources/shiboken6/ApiExtractor/abstractmetalang.h b/sources/shiboken6/ApiExtractor/abstractmetalang.h
index 2087180cd..f07fdb355 100644
--- a/sources/shiboken6/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken6/ApiExtractor/abstractmetalang.h
@@ -271,13 +271,25 @@ public:
bool hasCloneOperator() const;
void setHasCloneOperator(bool on);
- const QVector<QPropertySpec *> &propertySpecs() const;
- void addPropertySpec(QPropertySpec *spec);
+ const QList<QPropertySpec> &propertySpecs() const;
+ void addPropertySpec(const QPropertySpec &spec);
+
+ // Helpers to search whether a functions is a property setter/getter/reset
+ enum class PropertyFunction
+ {
+ Read,
+ Write,
+ Reset
+ };
+ struct PropertyFunctionSearchResult
+ {
+ int index;
+ PropertyFunction function;
+ };
+
+ PropertyFunctionSearchResult searchPropertyFunction(const QString &name) const;
- QPropertySpec *propertySpecByName(const QString &name) const;
- QPropertySpec *propertySpecForRead(const QString &name) const;
- QPropertySpec *propertySpecForWrite(const QString &name) const;
- QPropertySpec *propertySpecForReset(const QString &name) const;
+ std::optional<QPropertySpec> propertySpecByName(const QString &name) const;
/// Returns a list of conversion operators for this class. The conversion
/// operators are defined in other classes of the same module.