Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Disable svg debug message

    General and Desktop
    2
    8
    6120
    Loading More Posts
    • 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
      luca last edited by

      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 Reply Quote 0
      • ?
        Guest last edited by

        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 Reply Quote 0
        • L
          luca last edited by

          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 Reply Quote 0
          • L
            luca last edited by

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

            1 Reply Last reply Reply Quote 0
            • ?
              Guest last edited by

              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 Reply Quote 0
              • S
                stukdev last edited by

                Have you try this in your .pro file?

                DEFINES += QT_NO_WARNING_OUTPUT

                1 Reply Last reply Reply Quote 0
                • L
                  luca last edited by

                  [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 Reply Quote 0
                  • ?
                    Guest last edited by

                    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 Reply Quote 0
                    • First post
                      Last post