forked from qt-creator/qt-creator
Utils: Rework aspect implementation
This avoids some repetition and could be a step towards having type storage in (or rather accessible from) the base, so we can have aspects for more complex data (treemodels...) that are not easily converted to QVariant. Change-Id: I9797b3d5646195705212db1830d2b415291ac651 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -21,7 +21,7 @@ class SourcePathMapAspectPrivate;
|
||||
// Syntax: (/home/.*)/KnownSubdir -> /home/my/project
|
||||
using SourcePathMap = QMap<QString, QString>;
|
||||
|
||||
class SourcePathMapAspect : public Utils::BaseAspect
|
||||
class SourcePathMapAspect : public Utils::TypedAspect<SourcePathMap>
|
||||
{
|
||||
public:
|
||||
SourcePathMapAspect();
|
||||
@@ -32,15 +32,13 @@ public:
|
||||
|
||||
void addToLayout(Layouting::LayoutItem &parent) override;
|
||||
|
||||
QVariant volatileValue() const override;
|
||||
void setVolatileValue(const QVariant &val) override;
|
||||
|
||||
void readSettings(const QSettings *settings) override;
|
||||
void writeSettings(QSettings *settings) const override;
|
||||
|
||||
SourcePathMap value() const;
|
||||
|
||||
private:
|
||||
void guiToInternal() override;
|
||||
void internalToGui() override;
|
||||
|
||||
SourcePathMapAspectPrivate *d = nullptr;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user