Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
Qt Creator 4.10.2
-
None
Description
I'm exposing a strongly typed enum through C++ to QML like so:
class AppSettings : public QObject
{
Q_OBJECT
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
public:
enum class SettingKeys {
FastRender
};
Q_ENUM(SettingKeys)
...
}
AppSettings is registered as:
qmlRegisterType<AppSettings>("myextension", 1, 0, "AppSettings");
In the QML editor if ctrl+space is pressed after "AppSettings." a list of all available enums in the class is shown without their enclosing scope.
Since the class is declared with "RegisterEnumClassesUnscoped" the code that the QML editor suggest will be incorrect (since the scope is needed).
The code will thereafter fail silently which is a bit troublesome to debug since the editor is suggesting the incorrect path to the enum value.
Expected behavior:
Code completion completes to: "AppSettings.SettingKeys.FastRender".
Current behavior:
Code completion completes to: "AppSettings.FastRender".
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-21801 No code completion for C++ scoped enums in QML editor
- Closed