It was deprecated for not reporting the actual width but the
horizontal advance. Use the actual bounding width instead and
don't claim to support future deprecations.
Details
- Reviewers
mlaurent - Commits
- R91:adb3fe2f7fb6: Fix build after deprecated QFontMetrics::width()
Diff Detail
- Repository
- R91 PIM: Sieve Handling Library
- Branch
- Applications/17.12
- Lint
No Linters Available - Unit
No Unit Test Coverage
What is the problem here ?
I build all with qt5.11 yesterday and it build fine.
Could you paste error ?
So you changed api between qt5.11beta1 and qt5.11 branch ?
thanks.
No it is just QFontMetrics::width() is marked deprecated, and that doesn't change the Qt API and wouldn't be a problem if it wasn't that you are telling Qt to omit all deprecated API also things deprecated in the future, which is a bad idea.
So there is two solution. Port it to new method with a qt check
or use add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x051000) as it builds fine until qt5.10 I don't want to readd deprecated method now as we know that it compiles fine with qt5.10 and previous
But I prefere first solution so it will avoid to me to port it in the future :)
Why not both? I just did the change to the define because it was less work and still fixing something wrong.