Qt Code:
  1. Generator::Generator(const QString &databasePath)
  2. {
  3. QString name = databasePath;
  4. name = name.replace("\\","/");
  5. database = QSqlDatabase::addDatabase("QSQLITE");
  6. database.setDatabaseName(name);
  7. if(database.open())
  8. {
  9. Logger::info("Database " + databasePath + " opened successfuly.");
  10. }
  11. else
  12. {
  13. Logger::error("Couldn't open database " + databasePath + "! Error: " + database.lastError().text() + ". Application aborted.");
  14. exit(-2);
  15. }
  16. }
  17.  
  18. Generator::~Generator()
  19. {
  20. if (database.isOpen())
  21. {
  22. database.close();
  23. }
  24. }
  25.  
  26. void Generator::generateDictionaryFile()
  27. {
  28. QSqlQuery query(database);
  29. query.exec("select distinct ulica from AdresyKody_mid_mif");
  30. Logger::info("Last error: " + query.lastError().text());
  31. while(query.next())
  32. {
  33. Logger::info("Got from database: " + query.value(0).toString());//national characters here
  34. }
  35. }
To copy to clipboard, switch view to plain text mode 

But the issue is solved already.In other place I had code in Logger
Qt Code:
  1. logFile.write(logText.toLatin1());
To copy to clipboard, switch view to plain text mode 
and as it turned out that was the source of my issues.After change to:
Qt Code:
  1. logFile.write(logText.toUtf8());
To copy to clipboard, switch view to plain text mode 
all works fine.

Sorry mates for bothering you for nothing.