I am quite new in QML, but I have done first sport tracking app which seems to be working, however I am having multiple warnings on each screen of binding loop... app seems to work quite fine actually.

As soon as I run the app, I have these errors:
Qt Code:
  1. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  2. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  3. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  4. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
  5. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  6. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  7. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
  8. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  9. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
  10. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkout"
  11. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  12. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  13. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
  14. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  15. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
  16. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkout"
  17. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  18. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
  19. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkout"
  20. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkoutInput"
  21. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getProfile"
  22. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getSummaryWorkouts"
  23. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkout"
  24. qrc:/main.qml:7:1: QML ApplicationWindow: Binding loop detected for property "getCurrentWorkoutInput"
To copy to clipboard, switch view to plain text mode 

I am very interesting to learn how to declare and use variables properly!

link to the project: GitHub Project

If there is any tips from you guys how to improve, would be much appreciated.

Here is the relevant code:
Qt Code:
  1. // main.qml:
  2.  
  3. import QtQuick 2.9
  4. import QtQuick.Controls 2.0
  5. import QtQuick.LocalStorage 2.0
  6. import QtPositioning 5.2
  7. import 'DatabaseJS.js' as DatabaseJS
  8.  
  9. ApplicationWindow {
  10. visible: true
  11. width: 400
  12. height: 400
  13. title: qsTr("Sports App")
  14.  
  15.  
  16. // DB Settings
  17. property string dbId: "MyDatabase"
  18. property string dbVersion: "1.0"
  19. property string dbDescription: "Database application"
  20. property int dbSize: 1000000
  21. property var db
  22.  
  23. property var getProfile: DatabaseJS.db_getProfile()
  24. property var getSummaryWorkouts: DatabaseJS.getSummaryWorkouts()
  25. property var getCurrentWorkout: DatabaseJS.workout_getInfo()
  26. property var getCurrentWorkoutInput: DatabaseJS.workout_getInfoFromWorkout(getCurrentWorkout['id'])
  27.  
  28.  
  29. StackView {
  30. id: stackView
  31. anchors.fill: parent
  32.  
  33. initialItem: mainScreen
  34. }
  35.  
  36. Component {
  37. id: mainScreen
  38. MainScreen {}
  39. }
  40. }
  41.  
  42. // MainScreen.qml:
  43.  
  44. import QtQuick 2.9
  45. import QtQuick.Controls 2.0
  46. import QtQuick.LocalStorage 2.0
  47. import QtPositioning 5.2
  48. import 'DatabaseJS.js' as DatabaseJS
  49.  
  50. Item {
  51.  
  52. Rectangle {
  53. id: mainItem
  54. anchors.top: parent.top
  55. anchors.left: parent.left
  56. anchors.right: parent.right
  57. height: 175
  58.  
  59. Column {
  60. id: column2
  61.  
  62. anchors.top: parent.top
  63. anchors.left: column1.right
  64. anchors.bottom: parent.bottom
  65. anchors.right: parent.right
  66. anchors.topMargin: 30
  67. spacing: 2
  68.  
  69. Row {
  70. id: rowId
  71. Text {
  72. font.pointSize: 16
  73. text: '<b>ID:</b> ' + getProfile['id']
  74. }
  75. }
  76. Row {
  77. id: rowGender
  78. Text {
  79. font.pointSize: 16
  80. text: '<b>Gender:</b> ' + getProfile['gender']
  81. }
  82. }
  83. Row {
  84. id: rowAge
  85. Text {
  86. font.pointSize: 16
  87. text: '<b>Age:</b> ' + getProfile['age'] + ' years'
  88. }
  89. }
  90. Row {
  91. id: rowWeight
  92. Text {
  93. font.pointSize: 16
  94. text: '<b>Weight:</b> ' + getProfile['weight'] + ' kg'
  95. }
  96. }
  97. }
  98. }
  99. }
  100.  
  101. // Database.JS (just examnple of getProfile):
  102.  
  103. function db_getProfile() {
  104. // open database connection
  105. db = LocalStorage.openDatabaseSync(dbId, dbVersion, dbDescription, dbSize);
  106. var myVarriable = [];
  107.  
  108. db.transaction(function(tx) {
  109. var rs = tx.executeSql('SELECT id,gender,age,weight FROM `profile`');
  110. var ix;
  111. for (ix = 0; ix < rs.rows.length; ++ix) {
  112. myVarriable = {id: rs.rows.item(ix).id, gender: rs.rows.item(ix).gender, age: rs.rows.item(ix).age, weight: rs.rows.item(ix).weight};
  113. // myVarriable = [rs.rows.item(ix).id, rs.rows.item(ix).gender, rs.rows.item(ix).age, rs.rows.item(ix).weight];
  114. }
  115. });
  116. return myVarriable;
  117. }
To copy to clipboard, switch view to plain text mode 

Thank you