You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
840 B
C++
28 lines
840 B
C++
#include "mainwindow.h"
|
|
|
|
#include <QApplication>
|
|
#include <QDir>
|
|
#include <QSettings>
|
|
#include <QStandardPaths>
|
|
|
|
// dieser unique Pointer ist absolut genial, weil er mir erlaubt, die User-spezifischen Einstellungen zu Farben und Grid-Größe
|
|
// an das Mainwindow weiter zu reichen, noch *bevor* das Mainwindow überhaupt initialisiert ist!
|
|
std::unique_ptr<QSettings> settings;
|
|
|
|
// funktioniert komplett plattformunabhängig!
|
|
// sogar auf Android, wenn man wahnsinnig sein sollte!
|
|
void initialise_settings() {
|
|
QString config_string = QStandardPaths::locate( QStandardPaths::ConfigLocation, "ThinkPink.ini");
|
|
settings.reset( new QSettings( config_string, QSettings::IniFormat ) );
|
|
}
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
initialise_settings();
|
|
QApplication a(argc, argv);
|
|
MainWindow w;
|
|
w.show();
|
|
return a.exec();
|
|
}
|