Just in case, attached is the relevant code:
main.cpp
int main(int argc, char ** argv)
{
...
...
return app.exec();
}
int main(int argc, char ** argv)
{
...
QCoreApplication::setOrganizationName("app");
QCoreApplication::setApplicationName("appmakers");
QCoreApplication::setOrganizationDomain("app.com");
...
return app.exec();
}
To copy to clipboard, switch view to plain text mode
settings.cpp
#include <QtCore>
#include "settings.h"
}
...
return internalAppSettings->value("main/info", "default").toString();
}
#include <QtCore>
#include "settings.h"
settings::settings(QWidget * parent) : QWidget(parent) {
internalAppSettings = new QSettings(this);
}
...
QString settings::getSomeInfo() {
return internalAppSettings->value("main/info", "default").toString();
}
To copy to clipboard, switch view to plain text mode
settings.h
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QWidget>
#include <QSettings>
{
Q_OBJECT
public:
...
...
private:
//Internal QSettings declaration
};
#endif
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QWidget>
#include <QSettings>
class settings : public QWidget
{
Q_OBJECT
public:
settings(QWidget * parent = 0);
...
QString getSomeInfo();
...
private:
//Internal QSettings declaration
QSettings *internalAppSettings;
};
#endif
To copy to clipboard, switch view to plain text mode
Personally I don't see anything wrong with this... Yet I still get a segfault:
Symbol this is a variable with complex or multiple locations (DWARF2), length 4.
Symbol this is a variable with complex or multiple locations (DWARF2), length 4.
To copy to clipboard, switch view to plain text mode
This is really weird Any hints?
Bookmarks