2023-12-22 10:16 AM
Hello all,
I just updated my project to Version 4.23.0 and now get a compiler error for the creation of a canvas.
The update info tells, that there has been done a change, but there is no example and I don't know how to fix this.
Original code for the construction:
Canvas canvas(this, invalidatedArea);
But now the parameters have changed:
Canvas | ( | const AbstractPainter *const | painter , | ||
const Rect & | canvasAreaAbs , | ||||
const Rect & | invalidatedAreaRel , | ||||
uint8_t | globalAlpha | ||||
) |
Can anybody tell, how to set correct parameters and what they represent?
The code for the canvas was taken from github for a graphics canvas "abstractgraph.cpp", therefore I am lost and don't know what these parameters will do.
Any help is very much appreciated.
Thank you and have a Merry Christmas!!!
BR GS
Solved! Go to Solution.
2023-12-22 10:23 PM
Hello
If you look code generated by 4.23.0, you see that for example AbstractShape.cpp uses canvas constructor like this:
Canvas canvas(getPainter(), getAbsoluteRect(), invalidatedArea, getAlpha());
instead of older versions
Canvas canvas(this, invalidatedArea);
If this doesn't help, please tell more about your project, which exact file gives the error and from which version your are updating from.
With quick test, automatically generated files are properly update automatically when open older project in 4.23 (at least from 4.21.4 and 4.22.0 projects).
Br JTP
2023-12-22 10:23 PM
Hello
If you look code generated by 4.23.0, you see that for example AbstractShape.cpp uses canvas constructor like this:
Canvas canvas(getPainter(), getAbsoluteRect(), invalidatedArea, getAlpha());
instead of older versions
Canvas canvas(this, invalidatedArea);
If this doesn't help, please tell more about your project, which exact file gives the error and from which version your are updating from.
With quick test, automatically generated files are properly update automatically when open older project in 4.23 (at least from 4.21.4 and 4.22.0 projects).
Br JTP
2023-12-23 03:08 AM
Thank you for this quick solution!!!