Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.5, 6.7.0 RC
-
None
-
-
d75c81639 (dev), ea76ae03f (6.7), ecd5b0edf (6.6), 69d52e41c (tqtc/lts-6.5)
Description
I am exposing MyType to QML via qt_add_qml_module().
I am trying to use const with Q_INVOKABLE like so (this is just a sample code to reproduce the issue):
#ifndef MYTYPE_H #define MYTYPE_H #include <QObject> #include <QQmlEngine> class MyType : public QObject { Q_OBJECT QML_ELEMENT public: explicit MyType(QObject *parent = nullptr) : QObject{parent} {} Q_INVOKABLE const QObject *getObject() const { const QObject *object = nullptr; return object; } }; #endif // MYTYPE_H
I get the following warning at compile time:
Warning: debug\MyApp\appMyAppqmltypes:16:71: Expected only name, type, revision, isPointer, isList, isCloned, isConstructor, and isJavaScriptFunction in script bindings.
[import]
Why isConstant cannot be used Method { } in .qmltypes? Am I missing something or it is a bug?
Attachments
For Gerrit Dashboard: QTBUG-123413 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
548855,4 | QmlCompiler: Correctly read various method attributes in qmltypes | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
549448,2 | QmlCompiler: Correctly read various method attributes in qmltypes | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
549478,3 | QmlCompiler: Correctly read various method attributes in qmltypes | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
549910,3 | QmlCompiler: Correctly read various method attributes in qmltypes | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |