Text generated by Qt 5.15 and Qt4.8 is not same usign QPainter.
-
Hello,
We have test environment which detects image and compare it with the database.
Initially we created a database using Qt4.8.
Now while porting the application to 5.15 the image generator for buttons or labels are differing in fonts.Please help us with the appropriate solution.
-
Hello,
We have test environment which detects image and compare it with the database.
Initially we created a database using Qt4.8.
Now while porting the application to 5.15 the image generator for buttons or labels are differing in fonts.Please help us with the appropriate solution.
@karan26 said in Text generated by Qt 5.15 and Qt4.8 is not same usign QPainter.:
Please help us with the appropriate solution.
Update your screenshot database with what you get with Qt 5.15.
-
If you will not update the images and continue to ask for exact equality you not going anywhere.
The difference could arise because of a difference in Qt4->5 itself, a library it depends on, a change from using a bundled library to a system library, a change in what is handed off to the operating system, how font kerning and hints are implemented, antialiasing changes, helpful "features" like Windows "High-DPI scaling"...
(You may be able to code to eliminate the last two, but I would still not expect exact equality)You could try an image similarity algorithm
https://stackoverflow.com/questions/25977/how-can-i-measure-the-similarity-between-two-images
https://stackoverflow.com/questions/75891/algorithm-for-finding-similar-images
https://stackoverflow.com/questions/189943/how-can-i-quantify-difference-between-two-images