Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QtQuick.VectorImage in PySide6
Forum Updated to NodeBB v4.3 + New Features

QtQuick.VectorImage in PySide6

Scheduled Pinned Locked Moved Unsolved Qt for Python
8 Posts 3 Posters 699 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.
  • U Offline
    U Offline
    usymbiote
    wrote on last edited by
    #1

    I have a VectorImage component defined in an external file like this:

    import QtQuick.VectorImage
    
    VectorImage {
      id: background
      anchors.fill: parent
      preferredRendererType: VectorImage.GeometryRenderer
      source: "./images/logo.svg"
    }
    

    This works great in PySide6 6.9.3, but when I upgrade 6.10.0 I get the following error:

    QQmlApplicationEngine failed to load component
    file://<path-to-project>/ui/MainWindow.qml:27:5: Type Logo unavailable
    file://<path-to-project>/ui/common/Logo.qml:1:1: module "QtQuick.VectorImage" version 6.10 cannot be imported because:
    Cannot load library <path-to-project>/venv/lib/python3.13/site-packages/PySide6/Qt/qml/QtQuick/VectorImage/Helpers/libqquickvectorimagehelpersplugin.dylib: dlopen(<path-to-project>/venv/lib/python3.13... ...'/opt/homebrew/lib/QtQuickVectorImageHelpers.framework/Versions/A/QtQuickVectorImageHelpers' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/QtQuickVectorImageHelpers.framework/Versions/A/QtQuickVectorImageHelpers' (no such file)
    

    All I did to install 6.10.0 was call pip install --upgrade pyside6.

    Anyone else having issues with the VectorImage component in 6.10.0 or know how to resolve the error?

    1 Reply Last reply
    0
    • U Offline
      U Offline
      usymbiote
      wrote on last edited by
      #2

      I forgot to mention this is on MacOS Tahoe 26.0.1 running Python 3.13.7 installed via Homebrew.

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

        Hi and welcome to devnet,

        This looks like it could be a packaging issue. Can you provide a minimal project that triggers this ?

        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
        • U Offline
          U Offline
          usymbiote
          wrote on last edited by usymbiote
          #4

          This should work. I had to upload it to Google Drive since I don't have permissions to upload a file here.

          https://drive.google.com/file/d/1ffka0igRea74Z_zluI-DiEPfFP5lEjcL/view?usp=drive_link

          I verified this displays an ApplicationWindow with a VectorImage on a white background in 6.9.3. This fails to load in 6.10.0.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fossilx
            wrote on last edited by
            #5

            I also came across this using QtCreator. I was able to get a file with the corresponding VectorImage import to load, and a single test with a random svg logo seemed to work.

            I'm currently running Fedora 41.

            First, to trigger this error:

            1. File: New Project
              • Application (Qt for Python) > Qt Quick Application - Empty
              • PySide version: PySide 6
              • For kit selection, I'm assuming the version of Qt doesn't actually matter for the purposes of running the python project because PySide6 comes with its own copy of the Qt libraries (or at least I assume). The python version is v3.13.7
            2. Edit main.qml (all I added was the VectorImage import statement)
              import QtQuick
              import QtQuick.Window
              import QtQuick.VectorImage
              
              Window {
                  width: 640
                  height: 480
                  visible: true
                  title: qsTr("Hello World")
              }
              

            That results in the following terminal output:

            19:33:13: Starting /home/tony/cloud/projects/qt-creator/TestVectorImage2/.qtcreator/Python_3_13_7venv/bin/python -u main.py...
            QQmlApplicationEngine failed to load component
            file:///home/tony/cloud/projects/qt-creator/TestVectorImage2/main.qml:3:1: module "QtQuick.VectorImage" version 6.10 cannot be imported because:
            Cannot load library /home/tony/cloud/projects/qt-creator/TestVectorImage2/.qtcreator/Python_3_13_7venv/lib/python3.13/site-packages/PySide6/Qt/qml/QtQuick/VectorImage/Helpers/libqquickvectorimagehelpersplugin.so: libQt6QuickVectorImageHelpers.so.6: cannot open shared object file: No such file or directory
            19:33:13: The command "/home/tony/cloud/projects/qt-creator/TestVectorImage2/.qtcreator/Python_3_13_7venv/bin/python -u main.py" terminated with exit code 255.
            

            To fix the issue...
            Since I have a few versions of Qt installed, I searched them for the desired file - libQt6QuickVectorImageHelpers.so.6. The only version I have is from v6.10.0, so I assume it is new to this version of Qt. The file's exact location:

            ~/Qt/6.10.0/gcc_64/lib/libQt6QuickVectorImageHelpers.so.6
            //and that was just a link to...
            ~/Qt/6.10.0/gcc_64/lib/libQt6QuickVectorImageHelpers.so.6.10.0
            

            I then searched the python venv - specifically PySide6's Qt dir - for libQt6 and found the directory PySide6 uses for similarly named libraries is...

            .../site-packages/PySide6/Qt/lib/
            

            So, in my case, copying:

            ~/Qt/6.10.0/gcc_64/lib/libQt6QuickVectorImageHelpers.so.6.10.0
            

            to....(note the change in file extension)

            .../site-packages/PySide6/Qt/lib/libQt6QuickVectorImageHelpers.so.6
            

            ...seems to have fixed it.

            Hopefully this helps

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

              @fossilx so it seems that's indeed a packaging issue.
              For the file name, usually you have a set of symbolic links that points to the fully specified library:

              libQt6QuickVectorImageHelpers.so.6 -> symlink to libQt6QuickVectorImageHelpers.so.6.10.0
              libQt6QuickVectorImageHelpers.so.6.10 -> symlink to libQt6QuickVectorImageHelpers.so.6.10.0
              libQt6QuickVectorImageHelpers.so.6.10.0
              

              This allows you to have fined grained control on how you want to link to that library.

              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
              1
              • U Offline
                U Offline
                usymbiote
                wrote on last edited by usymbiote
                #7

                I built Qt from source on my Mac since the latest Qt online installer only installs 6.9.3. I found the dylib file after I built from source and copied it to where it was expected. I was able to start my app.

                Is there anything I need to do to raise awareness of this issue so it's fixed in the packing the release next time?

                SGaistS 1 Reply Last reply
                0
                • U usymbiote

                  I built Qt from source on my Mac since the latest Qt online installer only installs 6.9.3. I found the dylib file after I built from source and copied it to where it was expected. I was able to start my app.

                  Is there anything I need to do to raise awareness of this issue so it's fixed in the packing the release next time?

                  SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @usymbiote you can check the bug report system. If there's nothing related yet, please open a new ticket.

                  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

                  • Login

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