You can take a look at Qt.application.screens and detect by resolution along with Qt.platforms should be doable but I think the http://doc.qt.io/qt-5/qsysinfo.html QSysInfo will give you a better check and you can expose this to a property or Q_INVOKABLE function. It doesn't seem to have anything to display the phone model. So you can do an .mm obj-c call:
[[UIDevice currentDevice] platformString]
Should do the trick.
Put this into a QString return value function QString::fromNString() and you should be good to go. You might need to stub this on other platform.
From: Interest <email@example.com> On Behalf Of Nuno Santos
Sent: December 3, 2018 7:35 AM
To: ***@qt-project.org Interest <***@qt-project.org>
Subject: [Interest] How to distinguish from iPhone screen type with Qt/Qml
I’m trying to make my iOS apps ready for iPhone X screen as well as the new iPads.
How can I distinguish the screen types? Can I do that directly from Qml? How?
Thanks in advance!
Interest mailing list