Results 1 to 12 of 12

Thread: setting an image backround(using qwt multi-axis)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,313
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: setting an image backround(using qwt multi-axis)

    The SVG item tries to scale the content of the image according to its view box. When looking at the SVG it looks like the viewBox is a ~QRect( 9, 45, 9, 6 ), while I can see that other SVGs, that work as expected have a viewBox starting at 0, 0. So that might be a bug, that is related to this - I will have a look at it.

    But a SVG can be translated easily into a QwtGraphic, so it makes sense to have a QwtPlotGraphicItem, that covers a lot more use cases and QwtPlotSvgItem could be removed then. Guess I will do this next time I'm working on the code.

    As a side note: if your SVG image consists of these borders only it makes more sense to use one or several QPainterPaths instead of the SVG. A QPainterPath can be displayed as a QwtPlotShapeItem. The advantage of using a QPainterPath is, that you can set the colors, pen widths and filling, so that they fit to the background. When the boundaries are split into several painter paths you can also show/hide them Individually.

    Uwe

  2. The following user says thank you to Uwe for this useful post:

    QJak (11th February 2019)

Similar Threads

  1. Problems setting a background image
    By franco.amato in forum Qt Programming
    Replies: 10
    Last Post: 28th January 2011, 22:33
  2. setting an image on the form
    By Yayati.Ekbote in forum Newbie
    Replies: 6
    Last Post: 15th March 2010, 11:39
  3. Replies: 0
    Last Post: 25th February 2009, 07:15
  4. setting an image.jpg in a QWidget
    By impeteperry in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2009, 19:00
  5. Setting background image of QFrame
    By Claymore in forum Qt Programming
    Replies: 2
    Last Post: 12th February 2007, 19:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.