-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (39 loc) · 1.47 KB
/
Copy pathmain.cpp
File metadata and controls
39 lines (39 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <QCoreApplication>
#include <QDebug>
#include <QLibraryInfo>
#include <QStandardPaths>
#include <QDir>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QLibraryInfo *info;
QStandardPaths *stdpath;
QString homePath = stdpath->writableLocation(QStandardPaths::HomeLocation);
QString configFilePath = QDir::cleanPath(homePath + QDir::separator() + ".qtlinuxdeployer" + QDir::separator() + ".qtlinuxdeployer.cfg");
QString QtBinarypath = info->location(info->BinariesPath);
QString QmlImportPath = info->location(info->Qml2ImportsPath);
QString pluginPath = info->location(info->PluginsPath);
QString QtLibraryPath = info->location(info->LibrariesPath);
const char *qt_version = qVersion();
QString version;
version.sprintf("%s", qt_version);
QFile file( configFilePath );
if (file.open(QIODevice::ReadWrite))
{
QTextStream stream( &file );
stream << "[paths]" << endl;
stream << "libpath="+ QtLibraryPath << endl;
stream << "binarypath="+ QtBinarypath << endl;
stream << "qmlimportpath="+ QmlImportPath << endl;
stream << "pluginpath="+ pluginPath << endl;
stream << "[general]" << endl;
stream << "qtversion=" + version << endl;
qDebug() << "Configuration Finished - Qt version " << version << endl;
file.close();
}
else
{
qDebug() << "Could not open " << configFilePath << " for writing" << endl;
}
a.exit(1);
}