* * *

Author Topic: multiplatform developing using QT/QML  (Read 2494 times)

cgf

  • Newbie
  • Posts: 4
multiplatform developing using QT/QML
« on: February 19, 2018, 09:10:46 pm »
Hello,
I'm a developer, designer, analyst, project manager, entrepreneur, CSR manager in Italy.

I'm considering the introduction of Free Pascal to develop multiplatform projects (commercial, CSR, training) to create native apps on Windows, Mac OS, web, iOS, Android.
One of the objectives is to enable young people to work first on CSR and training projects and then evolve them as professionals to commercial projects, avoiding them having to invest money in expensive software suites.

The UI should be based on QT / QML and adapt to the guidelines set by the manufacturers (Apple Human Interface Guidelines, Apple Style Guide, Google Material Design, ...): the use of QT / QML is necessary in order to guarantee an any low-cost porting of projects to standard customer platforms (editor's note: if the customers themselves need porting due to their standards such as GDPR, Cloud standardized resources, etc).
The reference databases should be SQLITE (for mobile apps without server connections), MySql and Oracle.
The other salient features of the apps are strong use of JSON-based services, massive use of sockets for communications between different devices, GDPR compliance (encrypting data on mobile devices, encrypting databases, etc).

My request to the Forum is if the above hypothesis is feasible with success (ease of development, performance, stability, security, little or no need to specialize the source code for different platforms, no QT/QML limits, etc) also identifying the best/good practices to improve this general scheme.

Thank you and good luck!
cgf
We can only see a short distance ahead, but we can see plenty there that needs to be done.
(Alan Turing)

Phil

  • Hero Member
  • *****
  • Posts: 2653
Re: multiplatform developing using QT/QML
« Reply #1 on: February 19, 2018, 09:31:12 pm »
My request to the Forum is if the above hypothesis is feasible with success (ease of development, performance, stability, security, little or no need to specialize the source code for different platforms, no QT/QML limits, etc) also identifying the best/good practices to improve this general scheme.

The Lazarus LCL can optionally work with Qt on Linux, Windows and even macOS, but not iOS, Android or Web.

Have you actually used Qt on all those platforms in the way you describe?

Sounds like you've made a decision about Qt and now you're looking around for supporting statements.


cgf

  • Newbie
  • Posts: 4
Re: multiplatform developing using QT/QML
« Reply #2 on: February 20, 2018, 03:05:07 am »
My request to the Forum is if the above hypothesis is feasible with success (ease of development, performance, stability, security, little or no need to specialize the source code for different platforms, no QT/QML limits, etc) also identifying the best/good practices to improve this general scheme.

The Lazarus LCL can optionally work with Qt on Linux, Windows and even macOS, but not iOS, Android or Web.

Have you actually used Qt on all those platforms in the way you describe?

Sounds like you've made a decision about Qt and now you're looking around for supporting statements.



Thank you, Phil!  :)

Our choice - Free Pascal with QT/QML -  decouples the use of Free Pascal from the user interface allowing to carry out porting with reduced costs: the difficulties and costs of QT are acceptable in the face of this decoupling (the use of Free Pascal should allow us to use the same skills both for beginners, both for professionals, ensuring that both can work indifferently both on projects expended by customers, and on unpaid voluntary projects).

Our experiences on QT/QML are exclusively exploratory and experimental, but it seems to us that QT/QML could be a good compromise to ensure the creation of web apps, mobile apps, desktop apps at acceptable costs without decoder (recoding for each platform has too high costs, especially for non-profit projects).

Our first choice is focused on FireMonkey, but we would prefer to first explore the possibility of using Free Pascal so as to give the opportunity to many people to collaborate on non-profit projects in a context where they can refer to professionals (for example , to reuse the source code).

We, having to make an investment at company level, are trying to do so in order to favor non-profit projects (CSR, training).

I thank you again for your precious information  :)
We can only see a short distance ahead, but we can see plenty there that needs to be done.
(Alan Turing)

Phil

  • Hero Member
  • *****
  • Posts: 2653
Re: multiplatform developing using QT/QML
« Reply #3 on: February 20, 2018, 03:22:45 am »
Our choice - Free Pascal with QT/QML -  decouples the use of Free Pascal from the user interface allowing to carry out porting with reduced costs: the difficulties and costs of QT are acceptable in the face of this decoupling (the use of Free Pascal should allow us to use the same skills both for beginners, both for professionals, ensuring that both can work indifferently both on projects expended by customers, and on unpaid voluntary projects).

How are you planning to communicate with the Qt UI from Pascal? In the Lazarus LCL's Qt widgetset, they use an intermediate library that "flattens" the C++ classes to C functions that Pascal can call. Qt's libraries are for C++ and Pascal cannot call C++ directly.

Note that there is no similar intermediate library for iOS or Android.

Let me suggest another approach: Try out Lazarus and use the win32 widgetset when building for Windows, gtk2 widgetset when building for Linux, and carbon widgset when building for macOS, and forget about Qt for now. You make claims about Qt's benefits that a lawyer might say this about: "Assumes facts not in evidence."

For iOS, use Xcode to build the UI in Swift against native Cocoa Touch, rather than use Qt's painted controls. Put common Pascal non-UI code in a dynamic library and call it from Swift code. For Android, use Android Studio to build the UI, again putting common Pascal non-UI code in a dynamic library (.so) and call it from Java code.

This approach will allow you to share quite a bit of code and means you don't have to worry about deploying gigantic Qt libraries on the various platforms. Plus, you'll probably have better results satisfying user interface design requirements on iOS and Android.

If you find Lazarus unsuitable, then go to Plan B and resume your hunt for the Qt Grail.

https://macpgmr.github.io


Julius7

  • New member
  • *
  • Posts: 19
Re: multiplatform developing using QT/QML
« Reply #4 on: February 20, 2018, 08:18:29 am »
I see Qt (software) - Wikipedia says
 ...
Written in‎: ‎C++
 ( so there is the problem of "multiplatform or cross platform issues of libraries in C++ not fitting easily together)

https://en.wikipedia.org/wiki/QML
...
QML elements can be augmented by standard JavaScript both inline and via included .js files. Elements can also be seamlessly integrated and extended by C++ components using the Qt framework.
...

see or search for these related topics


Topic: Your thoughts on cross platform coding ie pascal, python and javascript

if you want to read more about javascript see
topic How to build pas2js

thks


cgf

  • Newbie
  • Posts: 4
Re: multiplatform developing using QT/QML
« Reply #5 on: February 21, 2018, 07:15:15 pm »
Our choice - Free Pascal with QT/QML -  decouples the use of Free Pascal from the user interface allowing to carry out porting with reduced costs: the difficulties and costs of QT are acceptable in the face of this decoupling (the use of Free Pascal should allow us to use the same skills both for beginners, both for professionals, ensuring that both can work indifferently both on projects expended by customers, and on unpaid voluntary projects).

Let me suggest another approach: Try out Lazarus and use the win32 widgetset when building for Windows, gtk2 widgetset when building for Linux, and carbon widgset when building for macOS, and forget about Qt for now. You make claims about Qt's benefits that a lawyer might say this about: "Assumes facts not in evidence."

For iOS, use Xcode to build the UI in Swift against native Cocoa Touch, rather than use Qt's painted controls. Put common Pascal non-UI code in a dynamic library and call it from Swift code. For Android, use Android Studio to build the UI, again putting common Pascal non-UI code in a dynamic library (.so) and call it from Java code.

This approach will allow you to share quite a bit of code and means you don't have to worry about deploying gigantic Qt libraries on the various platforms. Plus, you'll probably have better results satisfying user interface design requirements on iOS and Android.

If you find Lazarus unsuitable, then go to Plan B and resume your hunt for the Qt Grail.


 :) Thank You, Phil: very helpful info!

We have carefully assessed the scenarios and the variations you have brilliantly outlined and, unfortunately, we have had to note the impossibility of doing so.

A typical situation that we will have to manage is the situation in which we help a group of volunteers to develop the first versions of software for disabled and / or elderly people: the following evolutions, the customizations to adapt the software to the residual capacities of the single people, the fixes, etc. of the software are to be paid by the volunteer group. It becomes very difficult then for them to have all the skills to operate on Free Pascal, Swift, Cocoa Touch, Java, win32 widgetset, gtk2 widgetset, carbon widgetset and the different tools in these software to use RDBMS, file system, etc. (editor's note: many volunteers are not IT professionals, but only programming enthusiasts and / or even people who learn to program just to help disabled and / or elderly people).

Another example is that a customer asks us to rewrite the application logic of a software using a language different from the language initially used (we have had to manage the rewriting in C # of a software we developed previously in Java as , when the customer was purchased by another company, the purchasing company has imposed a standardization towards C # with consequent progressive abandonment of Java).

We are therefore considering expanding our search for suitable solutions.

Thank You! :)
« Last Edit: February 21, 2018, 07:34:47 pm by cgf »
We can only see a short distance ahead, but we can see plenty there that needs to be done.
(Alan Turing)

Phil

  • Hero Member
  • *****
  • Posts: 2653
Re: multiplatform developing using QT/QML
« Reply #6 on: February 21, 2018, 07:32:57 pm »
It becomes very difficult then for them to have all the skills to operate on Free Pascal, Swift, Cocoa Touch, Java, win32 widgetset, gtk2 widgetset, carbon widgetset and the different tools in these software to use RDBMS, file system, etc.

No, no, no, no, no. These are the tools for doing the _user interface_ of the apps on the various platforms. The underlying _non-user interface_ code can be written in Pascal, for example, and should be usable on multiple, if not all, platforms. The Free Pascal RTL and packages hide many of the differences between file systems, etc.

"Swift, Cocoa Touch, Java" - for doing UI for mobile only.

"win32 widgetset, gtk2 widgetset, carbon widgetset" - Lazarus LCL hides most of the differences between these, meaning the developer doesn't have to be an expert in them.

Using the right UI technology is particularly important if you want to incorporate assistive or accessibility capabilities into your software. In that case, I would recommend using the platform's native capabilities as much as possible. For example, Apple is second to no-one in this area. See https://www.apple.com/accessibility/.

Again, this is mostly just the UI code here. The underlying DB or data file or whatever technology underneath can be written in Pascal and doesn't really "know" anything about the UI. So you could put the code in a dynamic library and then use the resulting library on any platform (just recompile for the target platform), whether desktop, mobile or Web.

More on dynamic libraries here:

https://macpgmr.github.io/

cgf

  • Newbie
  • Posts: 4
Re: multiplatform developing using QT/QML
« Reply #7 on: February 21, 2018, 07:34:12 pm »
I see Qt (software) - Wikipedia says
 ...
Written in‎: ‎C++
 ( so there is the problem of "multiplatform or cross platform issues of libraries in C++ not fitting easily together)

https://en.wikipedia.org/wiki/QML
...
QML elements can be augmented by standard JavaScript both inline and via included .js files. Elements can also be seamlessly integrated and extended by C++ components using the Qt framework.
...

see or search for these related topics


Topic: Your thoughts on cross platform coding ie pascal, python and javascript

if you want to read more about javascript see
topic How to build pas2js

thks

Thank You, Julius: your point of view is very stimulating for the reflections we are doing these days.  :)

We usually use Javascript frameworks and unfortunately they have a fairly steep learning curve and a particular syntax that has very little of Pascal's elegance, readability and comprehension speed (and in Javascript we often find ourselves being damned in callback hell ...).

We are considering extending the use of Javascript to our R & D, CSR and training projects even though we know that many of the volunteers we want to help will not be able to customize, evolve, etc. the software we have developed and donated to them.

Thank you!
We can only see a short distance ahead, but we can see plenty there that needs to be done.
(Alan Turing)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus