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. Disable svg debug message

Disable svg debug message

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 6.6k 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.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    Hi all,
    I have an application that show an svg file in a QWidget (using QSvgRenderer).
    It works fine but for some svg file I get some console debug message:
    @
    Could not add child element to parent element because the types are incorrect.
    @

    This isn't a problem but I'd like to disable the svg warning message (not all the warning message of the application).

    Is it possible?

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      can you attach a sample svg here to try :) I suspect some unsupported svg element could be causing this. Qt only support SVG tiny 1.2 spec if I remember right

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca
        wrote on last edited by
        #3

        The svg is created using inkscape and I know the unsupported element. It is a text element:
        @
        <text
        id="text2473"
        y="269.28799"
        x="587.35712"
        style="font-size:12px;font-style:normal;font-weight:normal;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
        xml:space="preserve"><tspan
        id="tspan2475"
        y="269.28799"
        x="587.35712"
        sodipodi:role="line">PROVA</tspan></text>
        @

        Inkscape add the unwanted "tspan" and Qt doesn't like it. I think this because if I modify the element:
        @
        <text
        id="text2473"
        y="269.28799"
        x="587.35712"
        style="font-size:12px;font-style:normal;font-weight:normal;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
        xml:space="preserve">PROVA</text>
        @

        the warning message disappear.

        I only need to disable the warning message.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          luca
          wrote on last edited by
          #4

          I found this:
          "http://bugreports.qt.nokia.com/browse/QTBUG-11072":http://bugreports.qt.nokia.com/browse/QTBUG-11072

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            That warning comes from qsvghandler.cpp
            @
            qWarning("Could not add child element to parent element because the types are incorrect.");
            @

            You can check the qWarning doc in Assistant for how to supress qWarning output at runtime

            1 Reply Last reply
            0
            • S Offline
              S Offline
              stukdev
              wrote on last edited by
              #6

              Have you try this in your .pro file?

              DEFINES += QT_NO_WARNING_OUTPUT

              1 Reply Last reply
              0
              • L Offline
                L Offline
                luca
                wrote on last edited by
                #7

                [quote author="stuk" date="1287076622"]Have you try this in your .pro file?

                DEFINES += QT_NO_WARNING_OUTPUT
                [/quote]

                I'd like to disable only svg warning output not all application's warnings.

                1 Reply Last reply
                0
                • ? This user is from outside of this forum
                  ? This user is from outside of this forum
                  Guest
                  wrote on last edited by
                  #8

                  then I think you have to comment out that line in qsvghandler.cpp and build your own Qt svg dll :)

                  I'd rather recommend to modify the svg (use some script if too many svgs are there) and use the Qt SVG module to render them

                  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