Walls And Holes  1
savabletiletemplateset.h
Go to the documentation of this file.
1 #ifndef SAVABLETILETEMPLATESET_H
2 #define SAVABLETILETEMPLATESET_H
3 
4 #include "tiletemplateset.h"
5 
13 {
14  Q_OBJECT
15 
16 public:
17  explicit SavableTileTemplateSet(QString savePath,
18  QString name = "New Tile Template Set",
19  bool loadedFromFile = false,
20  QObject *parent = nullptr);
21 
22  const QString savePath() const { return mSavePath; }
23  void setSavePath(QString path){ mSavePath = path; }
24 
25  void save();
26  bool isSaved() const { return mSaved; }
27 
28 signals:
29  void saveStateChanged(bool state);
30 
31 protected:
32  void changed() override;
33 
34 private:
35  //default save path of this tileTempalteSet object
36  QString mSavePath;
37 
38  //whether or not the current state of this is saved. (made false when this is changed)
39  bool mSaved;
40 };
41 
42 #endif // SAVABLETILETEMPLATESET_H
QModelIndex parent(const QModelIndex &) const override
Definition: tiletemplateset.cpp:51
The TileTemplateSet class Stores a list of tile templates. Also implements the item model for them...
Definition: tiletemplateset.h:14
void setSavePath(QString path)
Definition: savabletiletemplateset.h:23
void save()
Definition: savabletiletemplateset.cpp:13
void saveStateChanged(bool state)
void changed() override
Definition: savabletiletemplateset.cpp:23
const QString savePath() const
Definition: savabletiletemplateset.h:22
QString name() const
Definition: tiletemplateset.h:34
bool isSaved() const
Definition: savabletiletemplateset.h:26
The SavableTileTemplateSet class A TileTemplateSet which is tightly bound to a file. Needs to be used with any custom TileTemplateSet (anything other that default map tileTemplates).
Definition: savabletiletemplateset.h:12
SavableTileTemplateSet(QString savePath, QString name="New Tile Template Set", bool loadedFromFile=false, QObject *parent=nullptr)
Definition: savabletiletemplateset.cpp:5