[Development] QString and related changes for Qt 6

Henry Skoglund henry at tungware.se
Tue May 12 13:50:16 CEST 2020

On 2020-05-12 12:36, Lars Knoll wrote:
> Leaving things behind simplifies our lives and in the longer term also 
> our users life. And yes, non unicode encodings are legacy in todays 
> world. They need to disappear, and most people are working towards 
> that goal. We can and should do our part.
> Lars

I still have some .exe files around I wrote for WIndows 3.0 in 1991, 
while they run nicely today (GDI graphics) on my Windows 10 PC, the 
Swedish characters display wrong, because somewhere along the way 
Microsoft decided that the kosher codepage for Windows programs would 
cease to be 850 and instead be 1251. Yes in 1991 CP 850 was hot, today 
not so much. So I'd prefer if Qt would require UTF-8 even on Windows.

P.S. Consider a similar type of "technical debt" being settled by Qt: 
I'm thinking of the "DPI awareness" setting in 5.14, i.e. for a default 
widgets program, Qt nowadays tells WIndows that it's "DPI aware" and 
wants the truth about screen coordinates, even on those portable PCs 
with high DPIs that have Scale set to 125% or 150%.  On the Qt forum 
I've seen lot of heat/complaints about QLabels being shoehorned in with 
the QLineEdits because the fonts are too big for those 125% or 150% 
screens, I'd answer: create a qt.conf file with the contents:
WindowsArguments = dpiawareness=0

and your legacy widgets program will go back to display fine, albeit a 
bit blurry and bloated.
But! If you're asking (with that qt.conf file present) what the screen 
size is (e.g. QGuiApplication::screens(0)->geometry() etc.) Windows will 
lie to you and scale "backwards" so that a normal 2560x1440 screen is 
reported as "QRect(0,0,1707,960)". So using dpiawareness=0 is a bad 
long-term solution :-(

More information about the Development mailing list