0
    Text {
        id: test1
        anchors.top: test.bottom
        anchors.topMargin: 5
        text: lat
        font.pixelSize: 14
   }

Faulty behaviour qrc:/main.qml:70: ReferenceError: lat is not defined

when there is data in the database display is normal correct behaviour

Timer{
        interval: 3000;
        running: true;
        repeat: true;
        onTriggered: {
            sqlModel.insertHistory(22.58369099635166, 113.94935604230989)
        }
    }

SqlQueryModel {
        id: sqlModel
        query: "select * from history order by rowid desc"
    }
smil lee
  • 1
  • 4
  • How do you end up with the Text if no data is in the table? Aren't you using a Repeater with this Text as delegate? Please show a bit more code – Amfasis Jun 10 '22 at 05:14
  • my code like this https://stackoverflow.com/questions/66242814/i-get-undefined-data-from-qsqlquerymodel-in-my-listview-qml-sqlite-database problem is the same. I use a timer to insert data when i insert a data, I get undefined data – smil lee Jun 10 '22 at 08:10
  • What I do now is to create a Listview after inserting the data, so it is no problem – smil lee Jun 10 '22 at 08:19

0 Answers0