Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Could not add child element to parent element because the types are incorrect.
Qt 6.11 is out! See what's new in the release blog

Could not add child element to parent element because the types are incorrect.

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 2.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.
  • D Offline
    D Offline
    Donald Duck
    wrote on last edited by
    #1

    I'm making a Qt program where I use an SVG image using a code similar to this:

    QLabel myLabel;
    myLabel.setPixmap(QPixmap(":/path/to/image.svg"));
    

    The program works fine, except that I get the following warning in the console:

    qt.svg: :\path\to\image.svg:112:20: Could not add child element to parent element because the types are incorrect.
    

    Other than this warning, everything works as it should. The SVG file shows correctly in my Qt program and everything. Also, the SVG file opens correctly in any browser (Chrome, Firefox, Edge) and in Qt Web Engine without any warning.

    I searched the web for this warning and couldn't find anything about what it means.

    What does this warning mean? Is it anything to worry about?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Looks like something fishy in your svg file, try uploading it to https://validator.w3.org/#validate-by-upload and select svg as document type to see if it's valid

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      3

      • Login

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