Isis 3.0 Programmer Reference
Back | Home
DisplayProperties.h
1 #ifndef DisplayProperties_H
2 #define DisplayProperties_H
3 
4 #include <QObject>
5 
6 // This is required since QColor is in a slot
7 #include <QColor>
8 
9 #include "XmlStackedHandler.h"
10 
11 class QAction;
12 class QBitArray;
13 class QXmlStreamWriter;
14 
15 namespace Isis {
16  class FileName;
17  class Project;
18  class Pvl;
19  class PvlObject;
20 
26  class DisplayProperties : public QObject {
27  Q_OBJECT
28  public:
29  DisplayProperties(QString displayName, QObject *parent = NULL);
30  DisplayProperties(XmlStackedHandlerReader *xmlReader, QObject *parent = NULL);
31  virtual ~DisplayProperties();
32 
33  void fromPvl(const PvlObject &pvl);
34  void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;
35  PvlObject toPvl() const;
36 
37  void addSupport(int property);
38  bool supports(int property);
39 
40 // void setValue(int property, QVariant value);
41  QVariant getValue(int property) const;
42 
43  void setDisplayName(QString displayName);
44  QString displayName() const;
45 
46  static QColor randomColor();
47 
48  signals:
49  void propertyChanged(DisplayProperties *);
50  void supportAdded(int);
51 
52  protected:
53  void setValue(int prop, QVariant value);
54 
55  private:
56  Q_DISABLE_COPY(DisplayProperties);
57 
63  class XmlHandler : public XmlStackedHandler {
64  public:
65  XmlHandler(DisplayProperties *displayProperties);
66 
67  virtual bool startElement(const QString &namespaceURI, const QString &localName,
68  const QString &qName, const QXmlAttributes &atts);
69 
70  virtual bool characters(const QString &ch);
71 
72  virtual bool endElement(const QString &namespaceURI, const QString &localName,
73  const QString &qName);
74 
75  private:
76  Q_DISABLE_COPY(XmlHandler);
77 
78  DisplayProperties *m_displayProperties;
79  QString m_hexData;
80  };
81 
82 
83  private:
84 
88  QString m_displayName;
89 
96 
102  };
103 }
104 
105 #endif
106 
QVariant getValue(int property) const
Get a property&#39;s associated data.
bool supports(int property)
Support may come later, please make sure you are connected to the supportAdded signal.
PvlObject toPvl() const
Convert to Pvl for project files.
The main project for cnetsuite.
Definition: Project.h:105
File name manipulation and expansion.
Definition: FileName.h:111
QString m_displayName
This is the display name.
void setDisplayName(QString displayName)
Sets display name.
virtual ~DisplayProperties()
destructor
QString displayName() const
Returns the display name.
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...
XML Handler that parses XMLs in a stack-oriented way.
void setValue(int prop, QVariant value)
This is the generic mutator for properties.
DisplayProperties(QString displayName, QObject *parent=NULL)
DisplayProperties constructor.
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...
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Output format:
his enables stack-based XML parsing of XML files.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:17:38