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));
64 dataBuffer.open(QIODevice::ReadWrite);
66 QDataStream propsStream(&dataBuffer);
70 output +=
PvlKeyword(
"Values", QString(dataBuffer.data().toHex()));
102 emit supportAdded(property);
124 (*m_propertyValues)[property] = value;
127 emit propertyChanged(
this);
152 stream.writeStartElement(
"displayProperties");
154 stream.writeAttribute(
"displayName",
displayName());
158 dataBuffer.open(QIODevice::ReadWrite);
159 QDataStream propsStream(&dataBuffer);
163 stream.writeCharacters(dataBuffer.data().toHex());
165 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.
File name manipulation and expansion.
Adds specific functionality to C++ strings.
The main project for ipce.
A single keyword-value pair.
Contains Pvl Groups and Pvl Objects.
This is free and unencumbered software released into the public domain.