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. Can we read and paint svg image in qt?
Qt 6.11 is out! See what's new in the release blog

Can we read and paint svg image in qt?

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 6.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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I want to paint the svg image on the widget.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Yes, that is possible.
      Did you look at the Svg Viewer Example in the documentation?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        no i haven't seen yet.I will see and let you know if any doubt.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          can we can't use svg directly like png or jpeg files.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Of course you can:

            @
            QPixmap img("/path/to/image.svg");
            label->setPixmap(img);
            @

            Make sure to have installed the imageformats plugins and the QtSvg4 lib on the target machines.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Can you please say. How can i check that?
              I have tried painting widget using pixmap containing svg file it was working but setting stylesheet function on slider groove was not working. what may be the reason behind it?

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                Sorry, I don't understand your question.

                Can you decide yourself whether you want to ask about drawing on widgets or about styling a widget with style sheets.

                Asking "smart questions":http://www.catb.org/~esr/faqs/smart-questions.html is more likely to get you useful answers. Asking incomplete, weird and contradictory questions is likely to get you no answers at all.

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  Actually i want to ask both the things. does that can be done using svg file?

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    Then state so clearly please. You're talking about painting on widgets on the first post. Nobody else than you knows that you're switching topics and talking about style sheets now. It would help if you added something like an "additional question" to one of your answers. A bit more explanation would help avoiding such confusion.

                    Now that things are sorted out: I don't have experiences with styles sheets on widgets, so no statement on that from my side, sorry.

                    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