Yeah, I can see that you cannot understand what I mean 
Think of myself as a noob with Svg in Qt and a beginner in Qt which tries to explain things with techniques he already learned 
So that means I should use svg-format?
You can use whatever you like.
Well.. that is true, but I wanted to know what kind of format would be the best for using vector graphics in Qt
How do you intend to "use" it?
=>
I want to resize, transform, overlap different images to show some infos on the screen (like rotate an arrow over another background image).
Imagine a class "front" with an arrow.svg (which is an arrow), a class"back" with a circle.svg (which is a circle) and a class "Speed".
Class "Speed" calls "back" and "front". "back" is a background-image and "front" is rotating happily in front of this background image.
Because QGraphicsSVGItem is a QGraphicsItem, I can use the painting methods from before and my Speed class is also not changing so much, right?
I don't understand what you mean.
I have read that QGraphicsSVGItem is derived from a QGraphicsItem. Up to this point "back", "front" and "Speed" were derived from this QGraphicsItem with a reimplemented paint() function to draw a QImage and to draw some other things (like text, and so on..).
My idea now was that I don´t derive "front" from QGraphicsItem, but instead from QGraphicsSvgItem. Then I could (in my theory) reimplement paint() again to draw my text. For the picture (the svg-file "arrow.svg") I was thinking about using
frontV
= new Front
(QString(QCoreApplication::applicationDirPath() + "/pictures/arrow.svg"),back
);
//invoke in Speed.cpp
frontV = new Front(QString(QCoreApplication::applicationDirPath() + "/pictures/arrow.svg"),back); //invoke in Speed.cpp
To copy to clipboard, switch view to plain text mode
insttead of
front = new Front_S(back); //invoke in Speed.cpp
front = new Front_S(back); //invoke in Speed.cpp
To copy to clipboard, switch view to plain text mode
Can you now understand my idea/theory about using svg in qt?
I don't understand what you mean. The two have nothing in common. QImage is for accessing particular pixels of a raster image. Unless you want to change parts of the SVG drawing on the fly I don't see how would you want to "use QGraphicsSVGItem like a QImage".
Yeah I think so too. And my question was misleading..
Until now I loaded a png-picture into a QImage with load() and displayed it inside a QGraphicsItem via drawImage() with a painter. With QImage I could use scaled() to resize the picture.
Now I want to display the SVG-file in my class and do some scaling/resizing.
For this I thought about using it "like QImage". Which meant calling inside my QGraphicsItem derived class "front" a new QGraphicsSvgItem and give this item the picture I desire.
I my opinion this way is similar to how I was using QImage before.
The question now is: Would that be a good way or the other way, where the class "front" is derived from QGraphicsSvgItem?
-> Do I now need an QSVGRenderer too? Documentation said that I can use renderer OR give svgfile to constructor.
How about just try and see for yourself?
Well, thanks for this advice.
I tried it and the program is crashing. So it looks like using QGraphicsSvgItem without QSVGRenderer is a bad idea.
Bookmarks