But I do not need to save geometry of windows, but contens of QTextEdits inside settings page, ie, the contens (mainly text() method) of child objects (QTextEdit, QLabel, ...) of settings page. I've made a QSettings subclassed class named CAppSettings, which header is as follows:
#ifndef CAPPLICATIONSETTINGS_H_
#define CAPPLICATIONSETTINGS_H_
// qt includes
#include <QSettings>
#include <QList>
#include <QApplication>
#include <QObject>
#include <QVariant>
// custom includes
#include "globals.h"
typedef struct
{
} settingsType;
/*!
* class responsible for whole EROSystem Settings
*/
class CApplicationSettings
: public QSettings{
Q_OBJECT
public:
CApplicationSettings
(const QString &strFileName
=strIniFileName,
Format format=IniFormat,
~CApplicationSettings();
private slots:
void saveSettings(); // method for saving settings
void loadSettings(); // method for loading settings
private:
QList<settingsType> m_SettingsValues;
};
#endif /*CAPPLICATIONSETTINGS_H_*/
#ifndef CAPPLICATIONSETTINGS_H_
#define CAPPLICATIONSETTINGS_H_
// qt includes
#include <QSettings>
#include <QList>
#include <QApplication>
#include <QObject>
#include <QVariant>
// custom includes
#include "globals.h"
typedef struct
{
QString strHub;
QString strKey;
QVariant varValue;
} settingsType;
/*!
* class responsible for whole EROSystem Settings
*/
class CApplicationSettings : public QSettings
{
Q_OBJECT
public:
CApplicationSettings(const QString &strFileName=strIniFileName,
Format format=IniFormat,
QObject *pParent=0);
~CApplicationSettings();
private slots:
void saveSettings(); // method for saving settings
void loadSettings(); // method for loading settings
private:
QList<settingsType> m_SettingsValues;
};
#endif /*CAPPLICATIONSETTINGS_H_*/
To copy to clipboard, switch view to plain text mode
Now, how do I extract control widget (QLineEdit, QLabel) pointer from pParent? This is my first question. And then, how do I notify about new settings client application, whose flowchart depends on settings from:
private:
QList<settingsType> m_SettingsValues;
private:
QList<settingsType> m_SettingsValues;
To copy to clipboard, switch view to plain text mode
Bookmarks