Creating a new drawing device based on QPaintEngine + QPaintDevice ...
-
Did you look at the SVG module (the source code, not just the classes and their methods) like @SGaist recommended? That takes an SVG file and ultimately draws it to the screen. I don't know the details of its implementation, it might already do pretty close to what you want.
-
Unfortunately, Qt specialists do not advise on the use of their classes in open source projects (or I am not aware of this)! I would be very grateful if you would recommend a person to whom I could address my questions privately ! Naturally, I am ready to compensate for the time spent on me with payment! :)
Sincerely, Yuri.
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
Unfortunately, Qt specialists do not advise on the use of their classes in open source projects (or I am not aware of this)!
I am not following you on this one. Can you clarify ?
-
Did you look at the SVG module (the source code, not just the classes and their methods) like @SGaist recommended? That takes an SVG file and ultimately draws it to the screen. I don't know the details of its implementation, it might already do pretty close to what you want.
@mchinand said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
Did you look at the SVG module (the source code, not just the classes and their methods) like @SGaist recommended? That takes an SVG file and ultimately draws it to the screen. I don't know the details of its implementation, it might already do pretty close to what you want.
Good day !
Of course I watched and continue to watch , but unfortunately I haven 't found anything that would answer my questions yet !
Sincerely, Yuri.
-
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
Unfortunately, Qt specialists do not advise on the use of their classes in open source projects (or I am not aware of this)!
I am not following you on this one. Can you clarify ?
@SGaist said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
Unfortunately, Qt specialists do not advise on the use of their classes in open source projects (or I am not aware of this)!
I am not following you on this one. Can you clarify ?
Of course!
I meant that I still could not find a high - quality consultation option from Qt ! If I didn 't buy a professional developer license !
My efforts have not yet yielded the necessary result because I do not have enough knowledge in the nuances of working with Qt classes ! In parallel, I continue to try to solve my problem, I try to gain experience in Qt and I am looking for a person who could advise me qualitatively!Sincerely, Yuri.
-
@SGaist said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
Unfortunately, Qt specialists do not advise on the use of their classes in open source projects (or I am not aware of this)!
I am not following you on this one. Can you clarify ?
Of course!
I meant that I still could not find a high - quality consultation option from Qt ! If I didn 't buy a professional developer license !
My efforts have not yet yielded the necessary result because I do not have enough knowledge in the nuances of working with Qt classes ! In parallel, I continue to try to solve my problem, I try to gain experience in Qt and I am looking for a person who could advise me qualitatively!Sincerely, Yuri.
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
high - quality consultation option from Qt
You expect to get this for free?
Here you are in a user forum. Most people here do not work for Qt Company and help others in their own time... -
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
high - quality consultation option from Qt
You expect to get this for free?
Here you are in a user forum. Most people here do not work for Qt Company and help others in their own time...@jsulm said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
You expect to get this for free?
Here you are in a user forum. Most people here do not work for Qt Company and help others in their own time...:) no!
I don't expect to be consulted for free !
Like all open sources , I understand by reading information on this forum and on many other specialized forums ! Through communication and knowledge sharing !
As for the specific problem with solving my task, I am ready to pay (within reasonable limits) for the consultant's efforts!
If my proposal violates the rules of the forum - please forgive me !
I will not make such statements here anymore !Sincerely, Yuri.
-
@jsulm said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
You expect to get this for free?
Here you are in a user forum. Most people here do not work for Qt Company and help others in their own time...:) no!
I don't expect to be consulted for free !
Like all open sources , I understand by reading information on this forum and on many other specialized forums ! Through communication and knowledge sharing !
As for the specific problem with solving my task, I am ready to pay (within reasonable limits) for the consultant's efforts!
If my proposal violates the rules of the forum - please forgive me !
I will not make such statements here anymore !Sincerely, Yuri.
-
@jsulm said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
OK, I understand. It is perfectly fine to ask for paid support here I think.
Ok ! Thanks !
I am glad that we understand each other !But I would also like to sort out my task ! :)
At the moment there are 2 files : piter.svg and rose.svg from my set of files that are somehow converted by my code and there are many other files that I can't convert with the same code! I 'm doing something wrong and I really want to understand what exactly ! :)And that 's not even the most important thing ! I want to figure out in general how to write devices based on QPaintDevice correctly! :)
Sincerely, Yuri.
-
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
At the moment there are 2 files : piter.svg and rose.svg from my set of files that are somehow converted by my code and there are many other files that I can't convert with the same code
I would look at the similarities between your two working files compared to your other SVGs. For example, do the non-working files use an SVG feature (e.g., text) that the working ones do not? Does your program crash with the other files or just not generate the correct output?
-
@jsulm said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
OK, I understand. It is perfectly fine to ask for paid support here I think.
Ok ! Thanks !
I am glad that we understand each other !But I would also like to sort out my task ! :)
At the moment there are 2 files : piter.svg and rose.svg from my set of files that are somehow converted by my code and there are many other files that I can't convert with the same code! I 'm doing something wrong and I really want to understand what exactly ! :)And that 's not even the most important thing ! I want to figure out in general how to write devices based on QPaintDevice correctly! :)
Sincerely, Yuri.
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
I want to figure out in general how to write devices based on QPaintDevice correctly
If this is your goal, that's fine but does not seem like it is something that would be useful for generating g-code.
A QPaintDevice consists of pixelswhereas g-code describes how the tooling (3D printer, CNC, etc. ) should move and is more akin to a vector graphics format. -
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
I want to figure out in general how to write devices based on QPaintDevice correctly
If this is your goal, that's fine but does not seem like it is something that would be useful for generating g-code.
A QPaintDevice consists of pixelswhereas g-code describes how the tooling (3D printer, CNC, etc. ) should move and is more akin to a vector graphics format.@mchinand said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
I want to figure out in general how to write devices based on QPaintDevice correctly
If this is your goal, ...
I will try to answer you on points :
-
Of course! I'm analyzing the target svg files, but I don't understand what exactly is causing the problem yet ! But I 'm still doing it !
No! No critical failure occurs - just the code is not generated and that 's it ! If there was a critical failure , that would be my problem ! :) Although it doesn 't make it any easier ! The problem is still mine - I understand perfectly well that it's my misunderstanding of the nuances of the work of the three classes of Paint System :))) -
I'm sorry! But about QPaintDevice you seem to be mistaken ! This class is quite versatile ! And it allows you to draw on yourself not only pixel graphics , which is directly written in the documentation ! :)
Well , in the end , I still get something ! :)
Sincerely, Yuri.
-
-
Since you have working and non working files you should implement some sort of dump method that is verbose enough to show what happens and where things get wrong.
As for paid support, beside the Qt Company itself, you have enterprises like KDAB and ICS that are known to be very good.
-
Since you have working and non working files you should implement some sort of dump method that is verbose enough to show what happens and where things get wrong.
As for paid support, beside the Qt Company itself, you have enterprises like KDAB and ICS that are known to be very good.
Good day !
Ooo! Thank you so much for the tip on the options for counseling ! I will try ...
As for debugging the code and getting a clearer picture of how Qt classes work - yes , of course ! That 's what I 'm doing ! But so far the results are insignificant ! :)
But in any case - thank you for your advice !!!
Sincerely, Yuri.
-
Good day !
And so ! :)
Part of my weekend was devoted to trying to solve my puzzle ! :)As a result :
-
it is clear that SVG prevents my code from converting files - this is transform="translate(... ...)" ! Files where there are no transformations , as they were the success that I had from the very beginning ! :)
But I am absolutely sure that this is just because I use the methods of the Qt Paint System classes poorly ! Since when working with , for example , QImage , the same files are drawn perfectly !
I became even more convinced that it is necessary to seek competent help from specialists who work with SVG and can advise on the methods of the Qt Paint System classes or understand the source code. :))) -
I looked very carefully at the ICS resource! Judging by the information on their website, they are just VERY competent in Qt (just cool)! And of course I wrote to them ! I even signed up for a free QML course :), but unfortunately I have not yet received an answer both to the desire to learn from them and to the question I asked! I'll be waiting...
-
And finally - special thanks to SGaist - for advising me the ICS resource! And in general for the reaction to my questions ! :)
Sincerely, Yuri.
-
-
Good day !
Can one of my colleagues tell me how to properly overload the methods virtual void QPaintEngine::updateState(const QPaintEngineState &state) and virtual int QPaintDevice::metric(PaintDeviceMetric metric) const ?
Or where can I see examples of their overload ?
Sincerely, Yuri.
-
Good day !
Can one of my colleagues tell me how to properly overload the methods virtual void QPaintEngine::updateState(const QPaintEngineState &state) and virtual int QPaintDevice::metric(PaintDeviceMetric metric) const ?
Or where can I see examples of their overload ?
Sincerely, Yuri.
@Yuri34 said in Creating a new drawing device based on QPaintEngine + QPaintDevice ...:
properly overload the methods
Do you mean overload? Overload means write a new version of the
QPaintEngine::updateState()
method which takes different parameters from the current one. In which case you just write that. Is this what you want?Or did you mean override instead? Override means write your own version of the existing virtual methods with the same parameters as the existing one. Is that actually what you want? In which case:
// in yourclass.h class YourClass : public QPaintEngine { virtual void updateState(const QPaintEngineState &state) override; } // in yourclass.cpp void YourClass::updateState(const QPaintEngineState &state) { ... // and if you need to call the original base class implementation QPaintEngine::updateState(state); ... }
-
Oh, thanks !
Apparently I explained it incorrectly ! :)
What is overloading and how syntactically it is formed in c++/Qt, I perfectly imagine!
I am interested in what and what is initialized in the virtual methods I mentioned ?In order not to insert pieces of code here, I will mention once again the link to the repo-gitlab - https://gitlab.com/z34x/codemaker.git !
- ::metric() at the end of the file - FCPaintDevice
- ::updateState() at the end of the file - FCPaintEngine
I 'm doing exactly wrong !!!
My question is how to properly design these virtual methods so that the svg file is parsed correctly ? :)
Moreover, pay attention to the virtual void QPaintEngine::updateState(const QPaintEngine State &state) = 0 ! abstract method !!!
Sincerely, Yuri.