MAK RTIspy API Documentation for HLA 1.3
propertyListView.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 2012 MaK Technologies, Inc.
3  ** All rights reserved.
4  *********************************************************************/
5 
8 
9 #ifndef propertyList_H_
10 #define propertyList_H_
11 
12 #include "property.h"
13 
14 #include <QtGui/QTreeWidget>
15 #include <QtGui/QColor>
16 
17 
19 class DtPropertyType;
20 
22 {
28 };
29 
30 
37 
39 {
40  Q_OBJECT
41 
42  // QProperty listing for Designer plug-in compatibility
43  Q_PROPERTY( QColor cellBorderColor READ cellBorderColor WRITE setCellBorderColor )
44  Q_PROPERTY( QColor backgroundColor1 READ backgroundColor1 )
45  Q_PROPERTY( QColor backgroundColor2 READ backgroundColor2 )
46  Q_PROPERTY( QColor groupForegroundColor READ groupForegroundColor WRITE setGroupForegroundColor)
47 
48 public:
49 
50  DtPropertyListView(QWidget* parent = 0);
51  DtPropertyListView(QColor, QColor, bool drawBorder = true, QWidget* parent = 0);
53  virtual ~DtPropertyListView();
54 
55  // Expand all the nested properties.
56  virtual void expandAll();
57 
58  // Collapse all the nested properties.
59  virtual void collapseAll();
60 
61  virtual DtPropertyListViewItem* addProperty(const DtProperty&, QTreeWidgetItem* parentTree = 0);
62  virtual DtPropertyListViewItem* addToProperty(const DtProperty&);
63 
64  virtual bool setProperty(QString prop, QVariant value);
65  virtual bool setProperty(QString prop, QString sub, QVariant value);
66  virtual bool setProperty(QString prop, QString sub, QString sub2, QVariant value);
67 
68  // Return the property accessed by key string
69  virtual DtProperty* property(QString prop);
70  virtual DtProperty* property(QString prop, QString sub);
71  virtual DtProperty* property(QString prop, QString sub, QString sub2);
72 
73  // First background color (starts the rows)
74  virtual QColor backgroundColor1() const { return myBackColor1; };
75 
76  // Second background color. Rows alternate between this and backColor1().
77  virtual QColor backgroundColor2() const { return myBackColor2; };
78 
79  // Font color for the group items (items with children)
80  virtual QColor groupForegroundColor() const;
81  virtual void setGroupForegroundColor(const QColor& color);
82 
83  // Background style: Interchangeable stripes or stripes on groups only
84  virtual DtPropertyListViewStyle backgroundStyle() const;
85  virtual void setBackgroundStyle(const DtPropertyListViewStyle& style);
86 
87  // Draw the cell border outline or not
88  virtual bool drawCellBorder() { return myDrawCellBorder; };
89 
90  // Cell border color property
91  virtual QColor cellBorderColor() const;
92  virtual void setCellBorderColor(const QColor& color);
93 
94  virtual QWidget* editorBox() { return myEditorBox; };
95 
96  virtual bool alphaSorted() const;
97 
98  int attributeNameColumn() const;
99  int attributeValueColumn() const;
100 
101 
102  protected slots:
103  virtual void headerClicked(int column);
104  virtual void headerSizeChanged();
105 
106 protected:
107  virtual void init();
108 
109  // Event handler to size columns to full width
110  virtual void resizeEvent(QResizeEvent*);
111 
112  // Resize the value column to fit the view.
113  virtual void resizeValueColumn(QSize size);
114 
115  QColor myBackColor1;
116  QColor myBackColor2;
117  QColor myCellBorder;
119 
122 
125  const QString myAttributeName;
126  const QString myValueName;
127 
130 
132 };
133 
134 #endif

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)