QT for Various Platforms.



  • Hi All,
    I am planning to develop and mobile app which target andorid/iOS/Windows mobile/tablet devices.
    I am planning to use QT as IDE.
    I need some clarifications in this regard. According to my understanding, Qml will be the Front-end and C++ [.cpp.h] will be the Business Logic layer.

    Queries:

    1. Is different qml has to be developed for iOS and Android, Since .pro structure shows separate folder for iOS and separate folder for Android.
      2.I was thinking write once and deploy it in multiple devices. But the structure seems to be, Qml has to be design for android say LoginAndroid.qml or LoginiOS.qml or LoginWindows.qml. Am I wrong in this concept.

  • Moderators

    "Write once, deploy everywhere" is correct. But you can of course have platform specific parts in your code if you want. And in seldom, unfortunate cases, e.g. when there is a platform specific bug in Qt, you might even have to maintain a platform specific workaround in your code.



  • Hello Moderator,

    Thanks for the reply.

    Scenario 1:
    Lets say If I am creating LoginPage then Do I need to write LoginAndroid.qml/LoginiOS.qml/LoginWindows.qml and logic will be written in common .cpp/.h files.

    Scenario 2:
    Platform specific functionalities like sensors, code has to written like Sensorsandroid.qml/SensorsiOS.qml as well as
    SensorsAndroid.Cpp and SensorsiOS.Cpp. The folder structure and logic separation will based on the platform specific?

    Thanks in advance.


  • Moderators

    @Mathan-M said:

    Lets say If I am creating LoginPage then Do I need to write LoginAndroid.qml/LoginiOS.qml/LoginWindows.qml and logic will be written in common .cpp/.h files.

    You can do this if you want, but you don't have to. A single Login.qml for all platforms is enough.

    The folder structure and logic separation will based on the platform specific?

    Yes, you can organize you folders / files in that way, but again you don't have to. The build process is controlled by your project file (*.pro). A program named "qmake" takes that project file and then generates the neccessary make files etc. You can read more about folder structures and source file organization in the qmake Manual.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.