mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-10 04:15:51 +00:00
rewrite formtatter* and customkeys* to share their code
This commit is contained in:
@ -22,29 +22,26 @@
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
|
||||
#include "awabstractpairhelper.h"
|
||||
|
||||
class AWCustomKeysHelper : public QObject
|
||||
|
||||
class AWCustomKeysHelper : public QObject, public AWAbstractPairHelper
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AWCustomKeysHelper(QObject *_parent = nullptr);
|
||||
virtual ~AWCustomKeysHelper();
|
||||
// read-write methods
|
||||
void initItems();
|
||||
bool writeItems(const QHash<QString, QString> &_configuration) const;
|
||||
bool removeUnusedKeys(const QStringList &_keys) const;
|
||||
// get
|
||||
QHash<QString, QString> getUserKeys() const;
|
||||
QStringList keys() const;
|
||||
QString source(const QString &_key) const;
|
||||
QStringList sources() const;
|
||||
QStringList refinedSources() const;
|
||||
// configuration related
|
||||
virtual void editPairs(){};
|
||||
virtual QStringList leftKeys();
|
||||
virtual QStringList rightKeys();
|
||||
|
||||
private:
|
||||
// properties
|
||||
QString m_filePath;
|
||||
QHash<QString, QString> m_keys;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user