Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-14684

Property '__timer' is a reserved C++ word, consider renaming [compiler]

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • QDS 4.6.2
    • Qt 6 support
    • None

    Description

      minimal reproduction project: https://git.qt.io/mikio_hirai/reserved_words_qds_qmltc#

      Branch is master and the commit is 454e492d814f644c1fa78e1991765fcee1c63d33. If you want to quickly see the error, configure and build the project with Desktop Qt 6.8.1 MSVC2022 64-bit kit.

      <Issue>
      QDS-generated EventListSimulator.qml contains "_timer" and "_timerChanged" which are reserved C++ words, causing QMLTC errors below while app compilation:

      Error: C:/Users/81808/Downloads/ReservedWordsInEventSimulator/ReservedWordsInEventSimulator/EventListSimulator.qml:8:1: Property '__timer' is a reserved C++ word, consider renaming [compiler]
      Error: C:/Users/81808/Downloads/ReservedWordsInEventSimulator/ReservedWordsInEventSimulator/EventListSimulator.qml:8:1: Method '__timerChanged' is a reserved C++ word, consider renaming [compiler] 

      <How to reproduce>
      1. Create a project in QDS 4.6.2.

      2. Export the project by File > Export Project > Enable CMake Generator

      3. Open the exported project with Qt Creator

      4. Add ENABLE_TYPE_COMPILER to qt6_add_qml_module() in https://git.qt.io/mikio_hirai/reserved_words_qds_qmltc/-/blob/master/ReservedWordsInEventSimulator/CMakeLists.txt?ref_type=heads#L20.

      5. Configure and build the project

      <Fix>
      Rename them to non-reserved words in C++.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thohartm Thomas Hartmann
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes