11#include <QXmlStreamWriter>
85 emit supportAdded(prop);
123 while(red + green + blue < 300) {
125 green = rand() % 256;
129 return QColor(red, green, blue, 60);
141 stream.writeStartElement(
"displayProperties");
143 stream.writeAttribute(
"displayName",
displayName());
147 dataBuffer.open(QIODevice::ReadWrite);
148 QDataStream propsStream(&dataBuffer);
152 stream.writeCharacters(dataBuffer.data().toHex());
154 stream.writeEndElement();
191 QList<GuiCameraDisplayProperties *> displays =
senderToData(sender());
197 foreach(display, displays) {
213 (*m_propertyValues)[prop] = value;
216 emit propertyChanged(
this);
229 QList<GuiCameraDisplayProperties *> data;
233 QVariant callerData = caller->data();
235 if (callerData.canConvert< QList<GuiCameraDisplayProperties *> >() ) {
236 data = callerData.value< QList<GuiCameraDisplayProperties *> >();
This class is designed to serialize QColor in a human-readable form.
QString displayName() const
Returns the display name.
File name manipulation and expansion.
The GUI communication mechanism for target body objects.
static QColor randomColor()
Creates and returns a random color for the intial color of the footprint polygon.
void setColor(QColor newColor)
Change the color associated with this target.
void setValue(Property prop, QVariant value)
This is the generic mutator for properties.
void toggleShowLabel()
Change the visibility of the display name.
Property
This is a list of properties and actions that are possible.
@ None
Null display property for bit-flag purposes.
@ ShowLabel
True if the control net should show its display name (bool)
@ Selected
The selection state of this control net (bool)
void setSelected(bool)
Change the selected state associated with this target.
bool supports(Property prop)
Support may come later, please make sure you are connected to the supportAdded signal.
static QList< GuiCameraDisplayProperties * > senderToData(QObject *sender)
This is for the slots that have a list of display properties as associated data.
Property m_propertiesUsed
This indicates whether any widgets with this DisplayProperties is using a particular property.
void addSupport(Property prop)
Call this with every property you support, otherwise they will not communicate properly between widge...
void setShowLabel(bool)
Change the visibility of the display name associated with this target.
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...
virtual ~GuiCameraDisplayProperties()
destructor
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Write the Gui Camera Display Properties out to an XML file.
GuiCameraDisplayProperties(QString displayName, QObject *parent=NULL)
GuiCameraDisplayProperties constructor.
QVariant getValue(Property prop) const
Get a property's associated data.
The main project for ipce.
This is free and unencumbered software released into the public domain.