Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [bug] qmllint doesn't recognize ValueTypeBehavior pragma is Assertable, introduced in Qt 6.8 (Qt Version 6.10.2)

[bug] qmllint doesn't recognize ValueTypeBehavior pragma is Assertable, introduced in Qt 6.8 (Qt Version 6.10.2)

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 63 Views 2 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.
  • S Offline
    S Offline
    shyney7
    wrote last edited by
    #1

    qmllint from Qt Version 6.10.2 doesn't recognize the pragma introduced in 6.8 as of the official docs shown below.

    ❯ where.exe qmllint
    C:\Qt\6.10.2\msvc2022_64\bin\qmllint.exe
    
    Unknown argument "Assertable" to pragma ValueTypeBehavior [syntax]
    pragma ValueTypeBehavior: Addressable, Assertable
    ^^^^^^
    

    Another attribute to the ValueTypeBehavior pragma is Assertable, introduced in Qt 6.8. Due to a mistake in Qt 6.6 and 6.7 the a as rect above not only checks whether a is a rect but also constructs a rect if a is of a compatible type. This is obviously not what a type assertion should do. Specifying Assertable prevents this behavior and restricts type assertions for value types to only check for the type. You should always specify it if you are going to use value types with as. In any case, if the type assertion for a value type fails, the result is undefined.
    valuetypebehavior docs

    JKSHJ 1 Reply Last reply
    2
    • S shyney7

      qmllint from Qt Version 6.10.2 doesn't recognize the pragma introduced in 6.8 as of the official docs shown below.

      ❯ where.exe qmllint
      C:\Qt\6.10.2\msvc2022_64\bin\qmllint.exe
      
      Unknown argument "Assertable" to pragma ValueTypeBehavior [syntax]
      pragma ValueTypeBehavior: Addressable, Assertable
      ^^^^^^
      

      Another attribute to the ValueTypeBehavior pragma is Assertable, introduced in Qt 6.8. Due to a mistake in Qt 6.6 and 6.7 the a as rect above not only checks whether a is a rect but also constructs a rect if a is of a compatible type. This is obviously not what a type assertion should do. Specifying Assertable prevents this behavior and restricts type assertions for value types to only check for the type. You should always specify it if you are going to use value types with as. In any case, if the type assertion for a value type fails, the result is undefined.
      valuetypebehavior docs

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote last edited by
      #2

      @shyney7 Thank you for highlighting this issue. I have created a bug report on your behalf: https://qt-project.atlassian.net/browse/QTBUG-144585

      If you find any other issues, please report it directly to our bug tracker like the link above. You can log in using the same Qt Account that you use to log into this forum.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0

      • Login

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