Important: Please read the Qt Code of Conduct -

svg file opened in qt-creator is all dark!

  • I downloaded a svg file , but i find it all dark when it was opened by qt-creator.

    I thought the svg file is wrong in the beginning, so i opened it by Inkscape, but the file is unbroken just like the below picture.


    svg file code:

    <?xml version="1.0" ?>
    <svg data-name="Layer 1" id="Layer_1" viewBox="0 0 48 48" 
        <rect class="cls-1" height="46" rx="4" ry="4" width="46" x="1" y="1"/>
        <line class="cls-1" x1="8" x2="40" y1="24" y2="24"/>

    PS: I restarted the qt-creator, but the problem was still existed.

    Sooooooo, a puzzling problem, someone knows that?

  • Lifetime Qt Champion

    The svg uses something Qt render cannot handle. Qt do not support FULL svg specs.
    This one works

  • @mrjj yes, you are right.

    Can youn tell me how to do that, because I have more than ten svg files, I want to transform them by myself, can you tell me the solution?

    My computer has Inscape and Adobe illustrator.

  • Lifetime Qt Champion

    sadly no magic trick.
    I simply drew the box again.
    alt text

    which fixed it.

    It seems you can just (in inkscape)
    select All
    copy and paste next to original shape.
    Then delete original shape and center the "copy shape"
    and save file.
    That fixes this case.

    To fast center, you can do
    alt text
    alt text

  • @mrjj You are genius! Made it..

Log in to reply