|
NorMIT-nav
22.09
An IGT application
|
Go to the documentation of this file.
16 #include <QStringList>
17 #include <QTextStream>
26 mCustomFile = customFile;
52 std::cout <<
"TODO IMPLEMENT: void Presets::remove()" << std::endl;
82 retval = retval.
tryDescend(
"Preset",
"name", presetName);
87 retval = retval.
descend(
"Preset",
"name", presetName);
98 QString presetName = element.attribute(
"name");
99 if(presetName.isEmpty())
103 file = file.
descend(
"Presets");
112 QTextStream stream(stdout);
114 element.save(stream, 4);
Helper class for xml files used to store ssc/cx data.
void addDefaultPreset(QDomElement &element)
Presets(XmlOptionFile presetFile, XmlOptionFile customFile)
Namespace for all CustusX production code.
void save()
save entire document.
XmlOptionFile mPresetFile
< the name of the last custom preset removed
virtual void save()
saves the presets to file
void addCustomPreset(QDomElement &element)
adds a custom preset
XmlOptionFile descend(QString element) const
step one level down in the xml tree
void deleteNode()
Delete the current node.
virtual void deleteCustomPreset(QString name)
deletes the custom preset with the given name if it exists
QStringList getPresetList(IMAGE_MODALITY tag=imUNKNOWN)
returns a list of the preset names for the given tag
XmlOptionFile getCustomFile()
XmlOptionFile root() const
set the current element to root
QString mLastCustomPresetAdded
QString mLastCustomPresetRemoved
< the name of the last custom preset added
QDomElement getElement()
return the current element
void print(QDomElement element)
debugging function for printing xml elements
void addPreset(XmlOptionFile &file, QDomElement &element)
IMAGE_MODALITY getId() const
bool isDefaultPreset(QString presetName)
Check is the preset is one of the "system presets".
XmlOptionFile tryDescend(QString element, QString attributeName, QString attributeValue) const
QDomDocument getDocument()
returns the document
bool isNull() const
checks if this is null
virtual QStringList generatePresetList(IMAGE_MODALITY tag)
internally generate the preset list
XmlOptionFile getPresetNode(const QString &presetName)
Look for a preset with the given name. Create one if not found.
virtual void remove()
removes the presets from file