9#include "DisplayProperties.h"
13#include <QXmlStreamWriter>
45 void DisplayProperties::fromPvl(
const PvlObject &pvl) {
48 QByteArray hexValues(pvl[
"Values"][0].toLatin1());
49 QDataStream valuesStream(QByteArray::fromHex(hexValues));
50 valuesStream.setVersion(
int(pvl[
"QtVersion"]));
61 PvlObject output(
"DisplayProperties");
65 dataBuffer.open(QIODevice::ReadWrite);
67 QDataStream propsStream(&dataBuffer);
71 output += PvlKeyword(
"Values", QString(dataBuffer.data().toHex()));
103 emit supportAdded(property);
125 (*m_propertyValues)[property] = value;
128 emit propertyChanged(
this);
152 FileName newProjectRoot)
const {
153 stream.writeStartElement(
"displayProperties");
155 stream.writeAttribute(
"displayName",
displayName());
159 dataBuffer.open(QIODevice::ReadWrite);
160 QDataStream propsStream(&dataBuffer);
164 stream.writeCharacters(dataBuffer.data().toHex());
166 stream.writeEndElement();
QMap< int, QVariant > * m_propertyValues
This is a map from Property to value – the reason I use an int is so Qt knows how to serialize this Q...
QVariant getValue(int property) const
Get a property's associated data.
QString displayName() const
Returns the display name.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Output format:
void setDisplayName(QString displayName)
Sets display name.
void setValue(int prop, QVariant value)
This is the generic mutator for properties.
virtual ~DisplayProperties()
destructor
PvlObject toPvl() const
Convert to Pvl for project files.
QString m_displayName
This is the display name.
DisplayProperties(QString displayName, QObject *parent=NULL)
DisplayProperties constructor.
bool supports(int property)
Support may come later, please make sure you are connected to the supportAdded signal.
void addSupport(int property)
Call this with every property you support, otherwise they will not communicate properly between widge...
int m_propertiesUsed
This indicated whether any widgets with this DisplayProperties is using a particulay property.
The main project for ipce.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.