Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. qmetatype.h -> error: constexpr variable 'len' must be initialized by a constant expression
Forum Updated to NodeBB v4.3 + New Features

qmetatype.h -> error: constexpr variable 'len' must be initialized by a constant expression

Scheduled Pinned Locked Moved Solved Qt 6
5 Posts 4 Posters 3.9k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lillo
    wrote on 8 Nov 2021, 08:22 last edited by Lillo 11 Aug 2021, 08:23
    #1

    Hello, i have a QT3D project made in QT5.14.2 and i wanted to be able to run it in with Qt6.2, but in the build step i have this error in the qt file qmetatype.h. If someone can help me i would appreciate it very much. I attach a screenshot with the error.
    MicrosoftTeams-image.png

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 8 Nov 2021, 09:07 last edited by
      #2

      Try porting to Qt 5.15 first, it should print you some nice deprecation and porting messages during compilation and at runtime. This will help you fix the issues.

      A wild guess in this case: Qt 6 requires Q_PROPERTY types to be fully qualified (not forward declared). Go through your properties and make sure it's true.

      (Z(:^

      1 Reply Last reply
      0
      • L Lillo has marked this topic as unsolved on 23 Feb 2024, 11:48
      • L Lillo has marked this topic as solved on 23 Feb 2024, 11:48
      • A Offline
        A Offline
        alirezaa
        wrote on 2 Jan 2025, 07:53 last edited by alirezaa 1 Feb 2025, 07:57
        #3

        @Lillo
        I have just faced the same issue, when trying to port my project to Linux and using Qt 6.8.1.
        I noticed, that you have marked this topic as solved; then could you please elaborate on how, you've managed to resolve this issue and what the exact cause was?
        Many thanks, in advance

        J 1 Reply Last reply 2 Jan 2025, 08:02
        0
        • A alirezaa
          2 Jan 2025, 07:53

          @Lillo
          I have just faced the same issue, when trying to port my project to Linux and using Qt 6.8.1.
          I noticed, that you have marked this topic as solved; then could you please elaborate on how, you've managed to resolve this issue and what the exact cause was?
          Many thanks, in advance

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 2 Jan 2025, 08:02 last edited by
          #4

          @alirezaa Did you follow what @sierdzio suggested?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alirezaa
            wrote on 2 Jan 2025, 08:07 last edited by alirezaa 1 Feb 2025, 08:08
            #5

            @jsulm
            I did check all Q_PROPERTY types in my project and didn't detect the possible issue @sierdzio had mentioned in any of them, but haven't tried first porting my project to Qt 5.15 yet, but I will.

            1 Reply Last reply
            0

            1/5

            8 Nov 2021, 08:22

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved