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. Error while trying to use svg image
Forum Updated to NodeBB v4.3 + New Features

Error while trying to use svg image

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 59 Views
  • 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
    adnan_14
    wrote last edited by
    #1

    Hi,

    We are using qt6.9.1 on windows.
    We are trying to use svg image in our project but we get below error:-

    error: qt.svg: <use> element image0_2845_461 in wrong context!
    

    This is my qml code where i am trying to include the svg file

            Image {
                id: name
                source: "cctv_camera.svg"
                anchors.fill: parent
                fillMode: Image.PreserveAspectFit
            }
    

    Note: We are using SVGs because when the application is scaled, PNG images appear blurry.

    I saw Qt only supports the SVG Tiny format. Is there a way to convert my existing SVGs to this format, or is there an alternative approach to use images that won’t become blurry when the resolution changes?

    Regards,
    Adnan

    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