How to Install QSparql
-
Don't know if this works for you but I can install QSparql with this command: sudo zypper install libqtsparql libqtsparql-devel.
Or you can check out the code directly from git://gitorious.org/maemo-af/qsparql.git and then build it yourself.
For using QSparql in QML, check it here: http://kdedevelopers.org/node/4340
-
Many Thanks,
one more thing is any idea that how to update the SparqlResultsList in application runtime. For example if there is a Timer and it updates SparqlResultsList in every 5 sec.
So, any method in SparqlResultsList to call to execute the query again. I have some situation that require to update UI when ever some new data arrive.
Another question is in which OS environment did you try this command : sudo zypper install libqtsparql libqtsparql-devel
-
Well, as you can see when looking at the code of QSparqlResultsList, neither setQuery() nor reload() checks for query change, so, I think you can make it query again by setting the same query for every 5 sec. reload() is a public function but since it's not exported to QML then you can't use it inside your QML code.
@
QSparqlResultsList::setQuery(const QString &query)
{
d->query = query;
reload();
}void QSparqlResultsList::reload()
{
if (d->options == 0 || d->query.isEmpty())
return;
if (d->result != 0) {
if (!d->result->isFinished())
return;
else
delete d->result;
}
delete d->connection;
d->connection = new QSparqlConnection(d->options->driverName(), d->options->options());
d->result = d->connection->exec(QSparqlQuery(d->query));
connect(d->result, SIGNAL(finished()), this, SIGNAL(finished()));
connect(d->result, SIGNAL(finished()), this, SLOT(queryFinished()));
connect(d->result, SIGNAL(dataReady(int)), this, SLOT(queryData(int)));
}
@sudo zypper install libqtsparql libqtsparql-devel is for meego sdk.