Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. svg
    Log in to post

    • UNSOLVED Svg Rendering Perspective Transform on QGraphicsView Viewport
      General and Desktop • qgraphicsview svg transform qgraphicssvgite qsvgrenderer • • RobotMaker  

      2
      0
      Votes
      2
      Posts
      66
      Views

      @RobotMaker said in Svg Rendering Perspective Transform on QGraphicsView Viewport: Some code will be helpful. And how you update it? try to call this after your change to update it. I use it to toggle svg pics display. update(const QRectF &) ==>update( boundingRect() ); I assume you overrides boundingRect();
    • UNSOLVED How to use SVG
      General and Desktop • widget svg icon • • Saviz  

      32
      0
      Votes
      32
      Posts
      1644
      Views

      So i am using Qt 6.2.2 & ran into the same problem the solution was : in the .pro file its QT+= svg svgwidgets now you can #include <QSvgWidgets> found it in the included svgviewer example in QT qtsvg-svgviewer-example hope i helped
    • UNSOLVED Svg files does not appear on the screen
      General and Desktop • qt5 svg qgraphics • • deleted286  

      4
      0
      Votes
      4
      Posts
      114
      Views

      @suslucoder said in Svg files does not appear on the screen: There is no error code, i debug it but i cannot find any error also Please simplify your code. Just write a small program that displays 1 PNG image and does nothing else. When that works, replace the PNG image with an SVG image.
    • UNSOLVED Interessed to use Qt Lottie Animation renderer, but somewhat limited...
      QML and Qt Quick • animation svg module lottie • • jeanmilost  

      1
      1
      Votes
      1
      Posts
      238
      Views

      No one has replied

    • UNSOLVED SVG generator - precision / size
      General and Desktop • qpainter svg precision • • vania2020  

      1
      0
      Votes
      1
      Posts
      109
      Views

      No one has replied

    • SOLVED Getting double precision floating point accuracy out of QSvgGenerator?
      General and Desktop • qpainter svg • • RobbieP  

      2
      0
      Votes
      2
      Posts
      133
      Views

      Solved it by changing my drawline to: painter.drawLine(QPointF(pX1, pY1), QPointF(pX2, pY2));
    • UNSOLVED Modify the qsvg plugin to support animation with AnimatedImage - Possible?
      QML and Qt Quick • plugin image animation svg qt quick 2.0 • • jeanmilost  

      1
      1
      Votes
      1
      Posts
      150
      Views

      No one has replied

    • UNSOLVED WebEngine - How to draw an animated SVG above a transparent web view?
      QtWebEngine • webengine svg background transparency • • jeanmilost  

      1
      1
      Votes
      1
      Posts
      229
      Views

      No one has replied

    • UNSOLVED HTML - SVG images inserted in a text document show ugly
      QML and Qt Quick • image text html svg stretch • • jeanmilost  

      5
      0
      Votes
      5
      Posts
      481
      Views

      Is it possible to to extend QLabel and implement my own paintEvent() that draws the text and draws the svg image? It seems to work, but would problaby take alot of effort to get it right (i.e. to get the image in the right location everytime). void MypLabel::paintEvent(QPaintEvent* event) { QPainter painter(this); const auto pos = QPoint(0, 16); painter.drawText(pos, this->text()); const auto posPixMap = QPoint(30, 0); auto size = QSize(16, 16); auto pixMap = QIcon(":/Resources/smiley.svg").pixmap(size); painter.drawPixmap(posPixMap, pixMap); }
    • UNSOLVED QGraphicsSvgItem control size
      General and Desktop • svg qgraphicssvgite • • Joel Bodenmann  

      5
      0
      Votes
      5
      Posts
      475
      Views

      Hi If you open the SVG in say inkscape and change its page size (ViewBox) does it then work as expected in your app ? Im not sure i understand what the goal since QSvgRenderer::setViewBox() did change the rendered size for me with QIcon so are we looking for something else ?
    • SOLVED HiDPI and SVG icon resolution
      General and Desktop • svg icons resolution hidpi • • cle1109  

      24
      0
      Votes
      24
      Posts
      3819
      Views

      Turns out there is a simple solution: app.setAttribute(Qt.AA_UseHighDpiPixmaps)
    • UNSOLVED Saving the contents of a Qwt widget as SVG
      3rd Party Software • svg qwt plot qtsvg vector graphics • • onat  

      1
      0
      Votes
      1
      Posts
      484
      Views

      No one has replied

    • SOLVED QGraphicsSvgItem problem with margins
      General and Desktop • svg positioning margins qgraphicssvgite • • kjnm  

      9
      1
      Votes
      9
      Posts
      904
      Views

      Hi Seem you just want to paint it using a border. Not having a border inside image. That you can easy do when painting it. Like void MiniSVG::paintEvent(QPaintEvent* ) { QPainter p(this); QSvgRenderer r; // this would normally be a member.. r.load(QString(":/7XB_smaller.svg")); r.render(&p, rect().adjusted(64, 64, -64, -64)); } sample to play with https://www.dropbox.com/s/7a9t5ywrpmagxjd/drawsvg.zip?dl=0 if its only this image u need this for, you can also just change page size. ( view box) that should work too.
    • UNSOLVED [qtwebkit 5.4.2 - WEC7-x86] Unable to load svg image from file (*.svg)
      Qt WebKit • qtwebkit svg qt 5.4.2 msvc2008 wec7 • • VinayVerma  

      6
      0
      Votes
      6
      Posts
      1417
      Views

      @VinayVerma Were you able to find a solution to the above problem? I am facing the exact same issue.
    • SOLVED Requirements for svg icons? Changed in Qt 5.10.1?
      QML and Qt Quick • svg icons • • markugra  

      12
      0
      Votes
      12
      Posts
      9417
      Views

      Necro-threading this because this is still a problem, at least where it would work fine in macOS, but not when deployed to iOS. I solved it by adding QT += svg xml to the .pro file AND #include <QtSvg> to main.cpp. I haven't looked to see which one was minimum solution. Since this was an intermittent problem (why?), I didn't want to take any chances so just shotgunned it.
    • UNSOLVED Sketch SVGs in QML
      QML and Qt Quick • qml qtquick qt quick svg qt 5.10 • • stefanl  

      2
      0
      Votes
      2
      Posts
      811
      Views

      I've had problems with the way Sketch exports SVGs. Text drifts (as you have seen), and items that were rotated in Sketch unrotate themselves when exported. I'd suggest that you export as a PNG, rather than SVG.
    • SOLVED How to correctly deploy a modular Qt-Application on windows? (Contains: can not display svg-files in qml)
      Installation and Deployment • windows deployment dll svg windeployqt • • fer-rum  

      3
      0
      Votes
      3
      Posts
      2060
      Views

      @hskoglund said in How to correctly deploy a modular Qt-Application on windows? (Contains: can not display svg-files in qml): You could check the list of directories from where Qt tries to load its plugins by calling QCoreApplication::libraryPaths() That looks like a cunning plan :) <insert Blackadder reference here> I played around with this information a bit and made the following observations: Dumping the library paths in the constructor of my module indeed lists only the module directory, but not the application directory. So I guess you mean the relative path when you say Your module_ui.dll inherits the search path from the .exe for .dlls Adding the application folder to the library search path within the module constructor solves the issue without the need for double-deployment Thanks a lot, you brought me on the right track.
    • SVG in QML-app for iOS
      Mobile and Embedded • qml qtquick ios svg qtquick control • • randsfjorden  

      3
      0
      Votes
      3
      Posts
      2020
      Views

      I think then I need to use png-files instead. Even though that is exhausting - as the app works on other platforms. So I need to create png's just for iOS. But that's the way it goes... Thank you very much for helping me! If anyone has an idea on how to use the svg's I'll be happy to hear about it :).
    • why Qt4android can not show images has format SVG??
      Mobile and Embedded • qml android svg show • • stackprogramer  

      7
      0
      Votes
      7
      Posts
      2138
      Views

      @SGaist @vlada thanks finally i built for apk android it works..... it's image goodluck
    • SOLVED Setting QIcon with svg file as a QAction icon problem
      General and Desktop • qt5 qaction svg macosx qicon • • rzhurov  

      7
      0
      Votes
      7
      Posts
      13310
      Views

      I saw that this bug has been reported.
    • UNSOLVED QImage in QGraphicsScene is pixelated when zooming in
      General and Desktop • qgraphicsscene qpixmap svg pixelated • • alogim  

      2
      0
      Votes
      2
      Posts
      1692
      Views

      hi As far as I know there is no build in raster to vector conversion. Also many images are not really good for it. Im wonder if QGraphicsScene is scaling images with best quality. http://stackoverflow.com/questions/22652491/qt-resize-image-with-best-quality
    • UNSOLVED How do I scale .svg within html tags in QML
      QML and Qt Quick • qml svg • • CarlStayBack  

      1
      0
      Votes
      1
      Posts
      532
      Views

      No one has replied

    • SOLVED Rendering .svg image using QSS
      General and Desktop • stylesheet svg qtoolbutton • • Sergobot  

      2
      0
      Votes
      2
      Posts
      2435
      Views

      Hi QToolButton wants border to display on some platforms. QToolButton { border: 2px; image: url(:/border.svg); } works for me. example: https://www.dropbox.com/s/z0oqrco7tfs4qm8/svgtest.zip?dl=0
    • [solved] Qml and svg assets - multi-platform compability ?
      QML and Qt Quick • qt quick svg • • Kernelcoffee  

      6
      0
      Votes
      6
      Posts
      1757
      Views

      You're welcome ! If that answers your question, please update the thread title prepending [solved] so other forum members may know a solution has been found :)
    • QDomElements by ID
      General and Desktop • svg qdomdocument qdom element qtxml • • M.A.Z.  

      1
      0
      Votes
      1
      Posts
      656
      Views

      No one has replied

    • Svg to Qml or QGraphicsItem
      General and Desktop • qml svg • • John1  

      5
      0
      Votes
      5
      Posts
      1697
      Views

      Thank you
    • SVG: Fill color and mouseover
      General and Desktop • svg hover fill mouseover • • qtacc32  

      3
      0
      Votes
      3
      Posts
      2125
      Views

      Hi As far as i know there is no better way than to parse and handle the svg yourself. maybe parse once, create hover pixmap version and use that.
    • SOLVED Properly scaling SVG Images
      QML and Qt Quick • qml svg scaling • • swegmann  

      6
      1
      Votes
      6
      Posts
      8457
      Views

      @A-Former-User said in Properly scaling SVG Images: Hi swegmann! The following code is more an ugly trick than a solution, but at least it does what it's supposed to do and you get rid of the binding loop: Image { source: "file:///home/pw/Downloads/SVG_logo.svg" sourceSize: Qt.size( img.sourceSize.width*2, img.sourceSize.height*2 ) Image { id: img source: parent.source width: 0 height: 0 } } (Funny. When I clicked "reply" the forum wanted to caution me that this thread is quite old. And yet... I arrived here because I still needed to learn the sourceSize hack this many years later.) The code snippet above demonstrating how to fix SVG blur using sourceSize is great. I'm surely not the first to notice, but you can also then go "one small step further" and make a reusable custom element that will be well-behaved for scaling factors other than "2". Indeed, it should be generalized/reusable for an SVG of any size (any "native" or "starting" size) and any target size or any stretch-due-to-anchoring. It would look like this: import QtQuick 2.12 import QtQuick.Controls 2.12 Image { // Thanks to this hack, qml can now only DOWN-SCALE/SHRINK the SVG, which won't cause blurriness/pixelation sourceSize: Qt.size( // first "trick" qml that the SVG is larger than we EVER NEED Math.max(hiddenImg.sourceSize.width, 250), // change 250 to a per-project "biggest icon in project" value Math.max(hiddenImg.sourceSize.height, 250)) Image { id: hiddenImg source: parent.source width: 0 height: 0 } } You can build-and-run a full working sample here. (It can also be launched simply with qmlscene).