#ifdef MAC / Win / Linux in QML
-
There are not only trolls here :)
AFAIK it is impossible. But you can set context property with current platform (get it from ifdefs in c++) and work with it. -
There is no built-in support for this in QML. As others pointed out, you can implement it in C++ if necessary.
If you are trying to style the look of a component, you may be interested in http://developer.qt.nokia.com/wiki/QmlStyling.
-
Thanks Guys !
Here is how I did it:
@Rectangle {
width:
{
if (wApplication.osMac) return imageBox.width + 1;
else return imageBox.width;
}
}@wApplication is my context object property.
-
bunjee, maybe be better will be to write
@
Rectangle {
width: imageBox.width + (wApplication.osMac?1:0)
}
@ -
I think the solution here is much more elegant.
http://qt-project.org/forums/viewthread/5862
@if (Qt.platform.os === "linux" || Qt.platform.os === "windows" || Qt.platform.os === "osx" || Qt.platform.os === "unix") {
//..
}@ -
I think the solution here is much more elegant.
http://qt-project.org/forums/viewthread/5862
@if (Qt.platform.os === "linux" || Qt.platform.os === "windows" || Qt.platform.os === "osx" || Qt.platform.os === "unix") {
//..
}@