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. svg file opened in qt-creator is all dark!

svg file opened in qt-creator is all dark!

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.4k 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.
  • LimerL Offline
    LimerL Offline
    Limer
    wrote on last edited by Limer
    #1

    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.

    0_1542467682751_20181117_231339.png

    svg file code:

    <?xml version="1.0" ?>
    <svg data-name="Layer 1" id="Layer_1" viewBox="0 0 48 48" 
        xmlns="http://www.w3.org/2000/svg">
        <defs>
            <style>.cls-1{fill:none;stroke:#1d1d1b;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}</style>
        </defs>
        <title/>
        <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"/>
    </svg>
    

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

    Sooooooo, a puzzling problem, someone knows that?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      The svg uses something Qt render cannot handle. Qt do not support FULL svg specs.
      This one works
      https://www.dropbox.com/s/ln3c7iu3j43iv4x/test.svg?dl=0

      LimerL 1 Reply Last reply
      3
      • mrjjM mrjj

        Hi
        The svg uses something Qt render cannot handle. Qt do not support FULL svg specs.
        This one works
        https://www.dropbox.com/s/ln3c7iu3j43iv4x/test.svg?dl=0

        LimerL Offline
        LimerL Offline
        Limer
        wrote on last edited by
        #3

        @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.

        mrjjM 1 Reply Last reply
        0
        • LimerL Limer

          @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.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

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

          which fixed it.

          Update:
          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
          (shift+ctrl+d)
          then
          alt text

          LimerL 1 Reply Last reply
          2
          • mrjjM mrjj

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

            which fixed it.

            Update:
            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
            (shift+ctrl+d)
            then
            alt text

            LimerL Offline
            LimerL Offline
            Limer
            wrote on last edited by
            #5

            @mrjj You are genius! Made it..

            1 Reply Last reply
            1

            • Login

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