1 #ifndef QSETTINGSCONTAINER_H 2 #define QSETTINGSCONTAINER_H 4 #include "qsettingsdialog_global.h" 6 #include <QScopedPointer> 7 #include "qsettingsentry.h" 8 #include "exceptions.h" 21 virtual QString containerPath()
const = 0;
24 virtual int elementCount()
const = 0;
26 virtual bool isEntry(
int index)
const = 0;
28 virtual int getEntryIndex(
int id)
const = 0;
30 virtual int getEntryId(
int index)
const = 0;
37 virtual bool transferElement(
int indexFrom,
QSettingsContainer *targetContainer,
int indexTo) = 0;
50 virtual bool removeEntry(
int id) = 0;
52 virtual bool removeElementFromIndex(
int index) = 0;
54 virtual void moveElement(
int indexFrom,
int indexTo) = 0;
71 class QGroupSettingsContainerPrivate;
89 bool isEntry(
int index)
const override;
110 void moveElement(
int indexFrom,
int indexTo)
override;
119 class QSectionSettingsContainerPrivate;
137 bool isEntry(
int index)
const override;
141 int getGroupIndex(
const QString &
id)
const;
144 QVariant getElementId(
int index)
const;
147 QString getGrouptId(
int index)
const;
170 void appendGroup(
const QString &
id,
173 bool optional =
false,
176 void prependGroup(
const QString &
id,
179 bool optional =
false,
182 void insertGroup(
int index,
186 bool optional =
false,
191 bool removeGroup(
const QString &
id);
193 void moveElement(
int indexFrom,
int indexTo)
override;
202 #endif // QSETTINGSCONTAINER_H virtual void moveElement(int indexFrom, int indexTo)=0
Moves the element from the old to the new index.
virtual QSharedPointer< QSettingsEntry > getEntryFromIndex(int index) const =0
Returns the entry at the given index.
virtual bool transferElement(int indexFrom, QSettingsContainer *targetContainer, int indexTo)=0
Tries to transfer the element at index to the target container.
virtual int getEntryId(int index) const =0
Returns the id for the entry at the index.
virtual int appendEntry(QSettingsEntry *entry)=0
Appends the entry to the containers children.
bool doAccept(QSettingsContainer *target, int index, int id, QSharedPointer< QSettingsEntry > entry)
[INTERNAL USE] Helper function
Definition: qsettingscontainer.h:65
virtual QSharedPointer< QSettingsEntry > getEntry(int id) const =0
Returns the entry with the given id.
virtual bool removeEntry(int id)=0
Removes the entry with the given id.
virtual int insertEntry(int index, QSettingsEntry *entry)=0
Inserts the entry to the containers children at the given index.
A settings container for groups.
Definition: qsettingscontainer.h:73
virtual int elementCount() const =0
Returns the number of elements in this container.
A generic class the defines methods for settings containers.
Definition: qsettingscontainer.h:13
virtual QSettingsDialog * dialog() const =0
Returns the dialog this container belongs to.
A settings container for sections.
Definition: qsettingscontainer.h:121
QSettingsContainer(QObject *parent=nullptr)
Protected constructor.
Definition: qsettingscontainer.h:58
virtual bool isEntry(int index) const =0
Checks whether the element at the given index is an entry or not.
Represents one settings entry within the settings dialog.
Definition: qsettingsentry.h:11
virtual int getEntryIndex(int id) const =0
Searches for entries index.
virtual QString containerPath() const =0
Returns the container path this container has.
virtual bool acceptEntry(int index, int id, QSharedPointer< QSettingsEntry > entry)=0
Will be called to insert the given entry from a transfer.
A general class to modifiy the appereance of elements of a settings dialog.
Definition: qsettingslayout.h:15
virtual bool removeElementFromIndex(int index)=0
Removes the element at the given index.
The main class that represents the dialog itself.
Definition: qsettingsdialog.h:16
virtual int prependEntry(QSettingsEntry *entry)=0
Prepends the entry to the containers children.