Hi,

I’m on the way to port my applications (desktop) to mobile phones (android).
I read a lot of times, that it’s strongly recommended to use QML instead of desktop Qt for mobile devices, because it would avoid lots of errors, is that right?

Well, I tried starting a new Qt Quick project by using the Qt Quick tutorial. The example code in the tutorial looks like that:
Qt Code:
  1. import QtQuick 2.3
  2.  
  3. Rectangle {
  4. id: simpleButton
  5. color: "grey"
  6. width: 150; height: 75
  7.  
  8. Text {
  9. id: buttonLabel
  10. anchors.centerIn: parent
  11. text: "button label"
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 
The problem is, they “compile” or “run” the code above using qmlscene without using any other stuff (c++ source files, headers, resource files, pri files and so on…).
In my case, I’d really like to use QtCreator and so, I have to create a project.
When I do that, it creates a lot of files:
1. the .pro file
2. deployment.pri
3. main.cpp
4. main.qml
5. MainForm.ui.qml

When I run that project, everything works fine, but I don’t think I need all those files when Qt Quick tutorial only uses one qml file.

When I remove all those files except the main.cpp (where the main.qml is loaded) and the main.qml and try to run the project, no errors occure, the executable is created and it runs, but nothing happens. There is no UI created…

Does anyone know why? What am I doing wrong?

That is my project:
.pro file:
Qt Code:
  1. TEMPLATE = app
  2.  
  3. QT += qml quick widgets
  4.  
  5. SOURCES += main.cpp
  6.  
  7. DISTFILES += main.qml
To copy to clipboard, switch view to plain text mode 
main.cpp
Qt Code:
  1. #include <QApplication>
  2. #include <QQmlApplicationEngine>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication app(argc, argv);
  7.  
  8. QQmlApplicationEngine engine;
  9. engine.load("main.qml");
  10.  
  11. return app.exec();
  12. }
To copy to clipboard, switch view to plain text mode 
main.qml:
Qt Code:
  1. import QtQuick 2.3
  2.  
  3. Rectangle {
  4. id: simpleButton
  5. color: "grey"
  6. width: 150; height: 75
  7.  
  8. Text {
  9. id: buttonLabel
  10. anchors.centerIn: parent
  11. text: "button label"
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

Can anyone help me with that?
Thank you in anticipation!