Answer the question
In order to leave comments, you need to log in
Qt SQLite C++ encoding problem, Russian letters?
I open the database and display the result in listWidget or textEdit.
// Очистить список строк
ui->listWidget->clear();
//Осуществляем запрос
QSqlQuery query;
query.exec("select name from sqlite_master where type='table'");
//Вывод
while (query.next())
{
QString table = query.value(0).toString();
ui->listWidget->addItem(table);
//Осуществляем запрос
QSqlQuery query;
query.exec("select id,name,comment from `Default`");
//Выводим значения из запроса
while (query.next())
{
QString id = query.value(0).toString();
QString name = query.value(1).toString();
QString comment = query.value(2).toString();
ui->textEdit->insertPlainText(id+" "+name+" "+comment+"\n");
4 none ������ ���� �� �����
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question