Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.6.3, 6.7.0, 6.8.0 FF
-
None
Description
When QML Type Compiler is used and multiple enumerations with the same value names are defined in the same QML file, an error occurs when compiling the generated C++ code.
Source QML example:
import QtQml QtObject { enum Paddings { S = 24, M = 32, L = 48, XL = 100 } enum Margins { XS = 8, S = 12, M = 16, L = 20, XL = 32 } }
Compilation errors:
C:/Users/Vladimir/Documents/My Qt Projects/build-qmltc_enum_bug-Qt_Dev-Debug/.qmltc/appqmltc_enum_bug/main.h(55): error C2365: 'qmltc_enum_bug::Main::S': redefinition; previous definition was 'enumerator' C:/Users/Vladimir/Documents/My Qt Projects/build-qmltc_enum_bug-Qt_Dev-Debug/.qmltc/appqmltc_enum_bug/main.h(47): note: see declaration of 'qmltc_enum_bug::Main::S' C:/Users/Vladimir/Documents/My Qt Projects/build-qmltc_enum_bug-Qt_Dev-Debug/.qmltc/appqmltc_enum_bug/main.h(56): error C2365: 'qmltc_enum_bug::Main::M': redefinition; previous definition was 'enumerator' C:/Users/Vladimir/Documents/My Qt Projects/build-qmltc_enum_bug-Qt_Dev-Debug/.qmltc/appqmltc_enum_bug/main.h(48): note: see declaration of 'qmltc_enum_bug::Main::M' C:/Users/Vladimir/Documents/My Qt Projects/build-qmltc_enum_bug-Qt_Dev-Debug/.qmltc/appqmltc_enum_bug/main.h(57): error C2365: 'qmltc_enum_bug::Main::L': redefinition; previous definition was 'enumerator' C:/Users/Vladimir/Documents/My Qt Projects/build-qmltc_enum_bug-Qt_Dev-Debug/.qmltc/appqmltc_enum_bug/main.h(49): note: see declaration of 'qmltc_enum_bug::Main::L' C:/Users/Vladimir/Documents/My Qt Projects/build-qmltc_enum_bug-Qt_Dev-Debug/.qmltc/appqmltc_enum_bug/main.h(58): error C2365: 'qmltc_enum_bug::Main::XL': redefinition; previous definition was 'enumerator' C:/Users/Vladimir/Documents/My Qt Projects/build-qmltc_enum_bug-Qt_Dev-Debug/.qmltc/appqmltc_enum_bug/main.h(50): note: see declaration of 'qmltc_enum_bug::Main::XL'
See standalone example qmltc_enum_bug.zip