Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Lots of TypeErrors in console when migrating to Qt6
Forum Updated to NodeBB v4.3 + New Features

Lots of TypeErrors in console when migrating to Qt6

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 1.2k Views 1 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.
  • A Offline
    A Offline
    Adam M
    wrote on last edited by
    #1

    Hello,

    I'm making a post here because I can't find any information on these lines anywhere and looking up Qt source showing nothing at the lines mentioned.

    Basically I'm upgrading from 5.15.2 to 6.2.1. The biggest issue is there are tons of controls that are printing TypeErrors. For example:

    15:34:49.842  qrc:/qt-project.org/imports/QtQuick/Controls/macOS/TextField.qml:43: TypeError: Property 'styleFont' of object QQuickRectangle(0x7fd7a97e1c00) is not a function (unknown-qrc:/qt-project.org/imports/QtQuick/Controls/macOS/TextField.qml:43)
    15:34:49.842  qrc:/qt-project.org/imports/QtQuick/Controls/macOS/Button.qml:44: TypeError: Type error (unknown-qrc:/qt-project.org/imports/QtQuick/Controls/macOS/Button.qml:44)
    15:34:50.124  qrc:/qt-project.org/imports/QtQuick/Controls/macOS/CheckBox.qml:45: TypeError: Type error (unknown-qrc:/qt-project.org/imports/QtQuick/Controls/macOS/CheckBox.qml:45)
    

    For the CheckBox example I've narrowed it down to the indicator property. If I set the indicator at all, I get the errors. If I remove it entirely, they are gone. The minimum reproduction in this case is:

    indicator: Rectangle { } // Comment to remove error
    

    I'm unsure how to debug this further. Is there some new syntax/way to style that I've missed?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Adam M
      wrote on last edited by
      #2

      I dug into this and I found out how to access the sources. The issue seems to be that internal Qt QML files are accessing properties that don't exist. I'm still not sure if this is because I'm missing some new styling syntax or not, but the current Qt 6 custom styling docs seem to be doing what I'm doing (e.g., making a Rectangle for indicator).

      Specifically, the issues seem to be:

      CheckBox.qml:
      Accesses indicator.styleFont when setting font.pixelSize which does not exist on Rectangle

      Button.qml, ProgressBar.qml, Slider.qml, and TextField.qml:
      Accesses background.styleFont when setting font.pixelSize which still does not exist on Rectangle

      If I set font.pixelSize manually then I don't get the errors, but I do not want to be setting pixelSize like this since I've have to redo a lot of font sizes everywhere.

      Does anyone know if this is a bug/issue, or if I'm just doing it wrong?

      1 Reply Last reply
      0
      • MarkkyboyM Offline
        MarkkyboyM Offline
        Markkyboy
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • A Offline
          A Offline
          Adam M
          wrote on last edited by
          #4

          For anyone who comes to this in the future, I found the issue in the Qt bug tracker: https://bugreports.qt.io/browse/QTBUG-98098

          Hopefully it'll get handled soon.

          1 Reply Last reply
          1
          • TassosT Offline
            TassosT Offline
            Tassos
            wrote on last edited by Tassos
            #5

            I am facing the same issue.
            It seems that the macOS style is broken.
            The workaround to get rid of these warnings is to force the Basic style via:

            QQuickStyle::setStyle("Basic");
            
            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