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. Sudden QML system issues not solved by reinstall
Forum Updated to NodeBB v4.3 + New Features

Sudden QML system issues not solved by reinstall

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 3 Posters 148 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
    SanderVc
    wrote last edited by SanderVc
    #1

    Hi all,

    I am developing a QML application on Arch Linux, using the system-provided qt6 packages.

    During development, at some point, after a crash of my application, I was suddenly unable to start it correctly anymore due to what seems like QML system issues (described below). Interestingly, this was not caused by any code change nor any change to the Qt installation itself.

    The issues I am seeing since then:

    • "QtObject is not a type", referring to the QtObject object type which I thought was pretty fundamental to Qt Quick;
    • "Non-existent attached object", referring to a qml line using "Component.onCompleted:" - suggesting the "Component" attached object does not exist.

    Yes, I did properly import QtQuick in each QML file.

    Interestingly, the exact same codebase runs fine when built:

    • in a docker container with its own Qt library installation;
    • in another Arch Linux system which has the exact same Qt packages installed.

    Even previous versions of my application, which worked fine before, now run into these issues on the affected system.

    I tried:

    • reinstalling qt packages
    • deleting "~/.cache/(my app)" to clear QML cache
    • rebooting
    • running with QML_DISK_CACHE=""

    I tried reducing to a minimal example, but unfortunately, simple minimal QML apps seem to work fine.

    Does anyone have any suggestion about any "stateful" aspects of the Qt / QtQuick installation which may be needing to be cleared in order to solve this issue?

    Thanks and kind regards,

    Sander

    JKSHJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by
      #2

      Hi,

      I haven't used Arch yet so it might be a silly question but are you sure your reinstalled all Qt packages ? i.e. libs + development packages ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        I haven't used Arch yet so it might be a silly question but are you sure your reinstalled all Qt packages ? i.e. libs + development packages ?

        S Offline
        S Offline
        SanderVc
        wrote last edited by
        #3

        @SGaist Thanks for your response! I reinstalled any and every "qt6-*" package on my system:

        qt6-5compat 6.9.1-1
        qt6-base 6.9.1-5
        qt6-charts 6.9.1-1
        qt6-declarative 6.9.1-2
        qt6-graphs 6.9.1-1
        qt6-imageformats 6.9.1-1
        qt6-location 6.9.1-1
        qt6-multimedia 6.9.1-1
        qt6-multimedia-ffmpeg 6.9.1-1
        qt6-networkauth 6.9.1-1
        qt6-positioning 6.9.1-1
        qt6-quick3d 6.9.1-2
        qt6-quicktimeline 6.9.1-1
        qt6-scxml 6.9.1-1
        qt6-sensors 6.9.1-1
        qt6-serialport 6.9.1-1
        qt6-shadertools 6.9.1-1
        qt6-speech 6.9.1-1
        qt6-svg 6.9.1-1
        qt6-tools 6.9.1-2
        qt6-translations 6.9.1-1
        qt6-virtualkeyboard 6.9.1-1
        qt6-wayland 6.9.1-1
        qt6-webchannel 6.9.1-1
        qt6-webengine 6.9.1-2
        qt6-websockets 6.9.1-1
        qt6-webview 6.9.1-1

        In practice, I would expect the most important one for this issue to be qt6-declarative (QML + Quick).

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote last edited by
          #4

          The list looks good... Can you check if there are versions that differs from the other computer you tested ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SanderVc
            wrote last edited by
            #5

            The versions are equal on the other system. And, as I originally posted, the issue appeared suddenly - not after an upgrade of any of these packages.

            I would be thinking about a uninstall -> reinstall instead of reinstalling "in-place" - but that is a bit tricky as the entire KDE desktop depends on these packages.

            Next test I will try is to install the Qt packages into a non-standard directory and try to load them from there, using the same project workdir.

            1 Reply Last reply
            0
            • S SanderVc

              Hi all,

              I am developing a QML application on Arch Linux, using the system-provided qt6 packages.

              During development, at some point, after a crash of my application, I was suddenly unable to start it correctly anymore due to what seems like QML system issues (described below). Interestingly, this was not caused by any code change nor any change to the Qt installation itself.

              The issues I am seeing since then:

              • "QtObject is not a type", referring to the QtObject object type which I thought was pretty fundamental to Qt Quick;
              • "Non-existent attached object", referring to a qml line using "Component.onCompleted:" - suggesting the "Component" attached object does not exist.

              Yes, I did properly import QtQuick in each QML file.

              Interestingly, the exact same codebase runs fine when built:

              • in a docker container with its own Qt library installation;
              • in another Arch Linux system which has the exact same Qt packages installed.

              Even previous versions of my application, which worked fine before, now run into these issues on the affected system.

              I tried:

              • reinstalling qt packages
              • deleting "~/.cache/(my app)" to clear QML cache
              • rebooting
              • running with QML_DISK_CACHE=""

              I tried reducing to a minimal example, but unfortunately, simple minimal QML apps seem to work fine.

              Does anyone have any suggestion about any "stateful" aspects of the Qt / QtQuick installation which may be needing to be cleared in order to solve this issue?

              Thanks and kind regards,

              Sander

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

              @SanderVc said in Sudden QML system issues not solved by reinstall:

              The issues I am seeing since then:

              "QtObject is not a type", referring to the QtObject object type which I thought was pretty fundamental to Qt Quick;
              "Non-existent attached object", referring to a qml line using "Component.onCompleted:" - suggesting the "Component" attached object does not exist.
              

              Do you see those when trying to run your application? Or when trying to edit your application in Qt Creator? (Knowing the difference is important, because they have very different root causes)

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

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SanderVc
                wrote last edited by
                #7

                Hello @JKSH, thank you for chiming in. I see them when trying to run the application. I don't use QtCreator to develop it.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SanderVc
                  wrote last edited by SanderVc
                  #8

                  To add some extra information, this is the full stack of where the Component-related error happens:

                  QQmlApplicationEngine failed to load component
                  file:///home/sander/dev/shoopdaloop/src/qml/applications/shoopdaloop_main.qml:17:5: Type Session unavailable
                  file:///home/sander/dev/shoopdaloop/src/qml/Session.qml:474:9: Type AppControls unavailable
                  file:///home/sander/dev/shoopdaloop/src/qml/AppControls.qml:187:13: Type ProfilingWindow unavailable
                  file:///home/sander/dev/shoopdaloop/src/qml/ProfilingWindow.qml:120:19: Type TreeViewDelegate unavailable
                  qrc:/qt-project.org/imports/QtQuick/Controls/Material/TreeViewDelegate.qml:101:9: Non-existent attached object
                  [Frontend.Application] [WARN] Created invalid object
                  [Frontend.QmlEngine] [WARN] Could not find top-level QQuickWindow to connect back-end refresh to GUI refresh
                  

                  And when I remove the "ProfilingWindow" completely, instead this is the full stack of where the QtObject-related error happens:

                  file:///home/sander/dev/shoopdaloop/src/qml/TrackWidget.qml:141: Error: TrackWidget: Failed to load loop factory: file:///home/sander/dev/shoopdaloop/src/qml/LoopWidget.qml:1687 Type DynamicToolTip unavailable
                  file:///home/sander/dev/shoopdaloop/src/qml/DynamicToolTip.qml:11 Type ToolTip unavailable
                  qrc:/qt/qml/org/kde/breeze/ToolTip.qml:112 Type Impl.StandardRectangle unavailable
                  qrc:/qt/qml/org/kde/breeze/impl/StandardRectangle.qml:-1 Type Theme unavailable
                  qrc:/qt/qml/org/kde/breeze/impl/Theme.qml:10 QtObject is not a type
                  

                  Interestingly, in the first error the culprit is inside TreeViewDelegate which is a built-in QML type. And in the second error it seems at least suspicious that the ToolTip type is for some reason taken from a KDE-specific library instead of a regular QtQuick Controls item.

                  Maybe there is some conflict happening with Qt libraries and/or QML types coming from KDE? Note that I don't explicitly load KDE libraries anywhere in the app.

                  The second error (QtObject) goes away when I run the app in weston instead of in KDE. But the first one persists.
                  EDIT: the second error is completely gone when explicitly importing QtQuick.Controls.Material. Apparently using the Material style in the top-level application window was not enough to force Material throughout the window.
                  The first error still persists though.

                  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