Qt World Summit: Submit your Presentation

Question about QML import

  • Hi everyone!

    I have a small question about QML import directive. I have a QML file with header:

    import QtQuick 2.5
    import QtQuick.Controls 1.4
    import QtQuick.Controls.Styles 1.4
    import QtQuick.Dialogs 1.2
    import QtQuick.Window 2.2
    import com.consultica.nestlean 1.0

    My application will work on OS X and iOS. But for iOS I don't need module:

    import com.consultica.nestlean 1.0

    How I can disable it for iOS platform but enable for OSX? I know only one way to do this. It's create a separate QML file for iOS. But I don't like this way.

    Thanks for the any help!

  • @shav said:

    import com.consultica.nestlean 1.0

    If you import that module probably your code uses some resources (Objects, functions, ..) and then you have to manage the 2 platforms.

    I don't think is so bad having different files for different platform

  • @mcosta Thanks for the reply. If I will not find any other ways I'll use different files.

Log in to reply