Unsolved Different of deviceWidth() between QScreen in Qt4 and Qt5
-
I have an example that using function "deviceWidth".
This example is develop on qt4.
But now i'm using qt5 to develop it.
And i got some problem!
I didn't know is there any similar function which is in qt5 and same as the function "deviceWidth()" at qt4.
Please help! -
I'll be as vague in my answer as you are in your error description and answer:
Yes
@victor-wang said in the different of deviceWidth() between Qscreen in qt5 and in qt4:
And i got some problem!
That is not much to go by, I could guess... but that that doesn't help me nor you.
-
@victor-wang "And i got some problem!", "Please help!" - I would like to help you, but I can't as you did not say what the problem is ("And i got some problem" - is not a problem description).
-
@victor-wang
Hi, as you can see from the other responses
the wording of the post is not optimal :)I assume you mean.
In the Qt4 sample, the function deviceWidth() is used.
What function can i use instead in Qt5 ?To that, i think , this will give the same info
QScreen *screen = QGuiApplication::primaryScreen(); QRect screenGeometry = screen->geometry(); int height = screenGeometry.height(); int width = screenGeometry.width();