2022-03-15 22:27:36 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
|
|
|
|
ListModel {
|
2022-08-31 17:09:07 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property var words: []
|
|
|
|
|
2022-03-15 22:27:36 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
xhr.open("GET", "english.txt");
|
|
|
|
xhr.onreadystatechange = function () {
|
|
|
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
2022-08-31 17:09:07 +00:00
|
|
|
root.words = xhr.responseText.split('\n');
|
|
|
|
for (var i = 0; i < root.words.length; i++) {
|
|
|
|
if (root.words[i] !== "") {
|
|
|
|
insert(count, {"seedWord": root.words[i]});
|
2022-03-15 22:27:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xhr.send();
|
|
|
|
}
|
|
|
|
}
|