Qt4 dialog style set to default after UWP conversion
-
Hi mrjj,
Thanks for your reply.I tried the qDebug() and here is the result:
Win32:
UWP:
Does it mean Win10 UWP Environment is a specialized unsupported version?The custom style works fine in our application in UWP environment, like this:
I didn't try the "qtwidgets-painting-affine-example" cause we are using Qt4 and don't have a Qt5 environment at hand. Thought the application screen short might be suffice to clear the point. So the Qt style is still working.What can I infer from the debug message? What further investigation can I take?
Thank you. -
@Stak1945
HI
Sadly the forum eats the pictures so i cannot see them. ( you can )
Could you please upload to say postimage.org and post the links here. -
Hi mrjj,
Here are the pictures.
Win32 Debug:
UWP Debug:
Custom Style of Our Application in UWP Environment:
Thank you:)
-
@Stak1945
Thank you.
Are they ment to be so small? ( even when clicked) -
Hi
I don't know enough about modern apps and UWP to guess at this
but it seems to me that Qt4 seems to think its run in good old win32 and as far as
I understand what the converter does
then its running inside a legacy "wrapper"
So I would go and play with QStyle
http://doc.qt.io/qt-4.8/qstyle.html
and see if it changes anything.Did you try a normal application ? does it also change look when converted ?
-
Strange. Didn't mean to be small. Sorry for that.
The debug message in Win32 is"Windows WindowsXP WindowsVista Motif CDE Plastique Cleanlooks".
The debug message in UWP is
Qt: Untested Windows version 10.0 detected! "Windows Motif CDE Plastique Cleanlooks"
What do you mean by normal application?
Our application is kind of big with probably hundred of dialogs in it, it there a way to fix them all in one place?Thank you.
-
@Stak1945
Hi, np.Ok so it seems related to Qt4 not knowing win 8+ and never seen the UWP
runtime environment.-
What do you mean by normal application?
As far as I understand, you can convert a desktop app to run in the modern runtime.
So I was wondering if you took a non Qt app and converted it and ran it , if it
would change the look too. -
Our application is kind of big with probably hundred of dialogs in it, it there a way to fix them all in one place?
if you set the QStyle then it will apply to all.
QApplication::setStyle();Also, you can do
./myapplication -style motif
but not sure its possible in UWPSo it seems that Qt4 is too old for the "modern" runtime and only style available
is "Windows" which might look like what u see.I dont know what the fix is. :(
-
-
@mrjj
Hi mrjj,My colleague has figured out how to fix this:D
As it concerns with not recognizing Windows Version, adding corresponding windows version number to corelib/global/qglobal.h and .cpp fixed this issue.Add Win10 support in
enum WinVersion
,enum MacVersion
of qglobal.h andQSysInfo::windowsVersion()
of qglobal.cpp.Thanks for your help:)
-
@Stak1945
Super.
So app was confused what windows a modern universal app wrapper was actually running in :)
Thank you for reporting back. It will come up again :)Oh, can I ask why Q4.8 ?
You already tons of code and porting it to Qt5.X is simply not
an option ? :) -
@mrjj
Why Qt4? :)
It's because our application is 28 years old and during the latest refactoring about 5 or 4 years ago we introduced Qt4, really tons of code intertwined with customized Qt4 library. Porting to Qt5 may concern so much code to change and features to test so the plan has been postponed.
Guess a change to Qt5 will have to wait for another refactoring :D -
Ah, yes. in 28 years, one can get quite the amount of code. :)
Well Qt4.8 should be good for years and besides you just ran it
in something really new and it worked. \o/