Solved APPDATA
-
I'm writing an App that'll use a SQLite3 database. I want to programmatically store this db in C:\Users<user>\AppData\Roaming. How can I do this with Qt? What's the Qt way of accessing this path?
Thanks.
-
-
@Christian-Ehrlicher - I believe this sorcery is way above my head. I get nothing.
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); auto addin_path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); qDebug() << addin_path; }
-
Works fine for me with Qt5.12 and 5.15:
int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qDebug() << QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); return a.exec(); }
08:28:41: Starte C:\Qt5\tests\build-tmp-Desktop_Qt_5_15_1_MinGW_64_bit-Debug\debug\tmp.exe ... "C:/Users/Chris/AppData/Roaming/tmp"