Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Can we read and paint svg image in qt?

    General and Desktop
    3
    9
    3983
    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.
    • P
      pratik041 last edited by

      I want to paint the svg image on the widget.

      Pratik Agrawal

      1 Reply Last reply Reply Quote 0
      • A
        andre last edited by

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

        1 Reply Last reply Reply Quote 0
        • P
          pratik041 last edited by

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

          Pratik Agrawal

          1 Reply Last reply Reply Quote 0
          • P
            pratik041 last edited by

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

            Pratik Agrawal

            1 Reply Last reply Reply Quote 0
            • G
              goetz last edited by

              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.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply Reply Quote 0
              • P
                pratik041 last edited by

                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?

                Pratik Agrawal

                1 Reply Last reply Reply Quote 0
                • G
                  goetz last edited by

                  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.

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply Reply Quote 0
                  • P
                    pratik041 last edited by

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

                    Pratik Agrawal

                    1 Reply Last reply Reply Quote 0
                    • G
                      goetz last edited by

                      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.

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post