[Qt-qml] Detecting platform in QML

minjung.shin at nokia.com minjung.shin at nokia.com
Fri Jun 24 02:35:03 CEST 2011


Hi,

There is a function in Mobility System Information that does this.
Please take a look at QSystemInfo. http://doc.qt.nokia.com/qtmobility-1.2/qsysteminfo.html#Version-enum
QML bindings also exist even though the doc is not listing all the features. http://doc.qt.nokia.com/qtmobility-1.2/qml-generalinfo.html

The format of returned string is platform specific.

Regards,
Min

From: qt-qml-bounces+minjung.shin=nokia.com at qt.nokia.com [mailto:qt-qml-bounces+minjung.shin=nokia.com at qt.nokia.com] On Behalf Of ext Pelle Johnsen
Sent: Friday, 24 June 2011 4:49 AM
To: Artem Marchenko
Cc: qt-qml at qt.nokia.com
Subject: Re: [Qt-qml] Detecting platform in QML

Thanks,

I know it's not too difficult to do in C++ (I have lots of other C++ in the project). Just found it a bit odd that  these system things aren't available in QML yet, as most other languages have this.

 -Pelle
On Thu, Jun 23, 2011 at 7:03 PM, Artem Marchenko <artem.marchenko at gmail.com<mailto:artem.marchenko at gmail.com>> wrote:
Hi Pelle

It is unfortunately impossible. However it is pretty easy to add platform detection in just a few lines of C++. If your project is pure qml, you can do it even in the wrapping cpp using e.g. preprocessor macros - http://developer.qt.nokia.com/forums/viewthread/5862/#38285

Best regards,
Artem.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110624/bcbc4d51/attachment.html 


More information about the Qt-qml mailing list