MAK RTIspy API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
propertyListView.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2017 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include "property.h"
13 
14 #include <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 };
QColor myGroupForeColor
Definition: propertyListView.h:118
A property class.
Definition: property.h:24
Definition: propertyListView.h:26
QColor myBackColor2
Definition: propertyListView.h:116
DtPropertyListViewStyle
Definition: propertyListView.h:21
const QString myAttributeName
Definition: propertyListView.h:125
const QString myValueName
Definition: propertyListView.h:126
virtual bool drawCellBorder()
Definition: propertyListView.h:88
DtPropertyType is the abstract base class for property types.
Definition: propertyType.h:20
Definition: propertyListView.h:23
virtual QColor backgroundColor2() const
Definition: propertyListView.h:77
DtPropertyListViewStyle myBackStyle
Definition: propertyListView.h:131
DtPropertyListViewItem * mySelected
Definition: propertyListView.h:129
QColor myCellBorder
Definition: propertyListView.h:117
A class to draw items in a DtPropertyListView.
Definition: propertyListViewItem.h:36
A class to display a list (properties) alternating the colors of the rows.
Definition: propertyListView.h:38
DtProperty myRoot
Definition: propertyListView.h:128
bool myAlphaSorted
Definition: propertyListView.h:120
virtual QWidget * editorBox()
Definition: propertyListView.h:94
Definition: propertyListView.h:27
#define DT_DLL_ASSISTANTAPP
Definition: rtiMsConfig.h:122
QColor myBackColor1
Definition: propertyListView.h:115
Definition: propertyListView.h:25
QWidget * myEditorBox
Definition: propertyListView.h:124
Definition: propertyListView.h:24
bool myDrawCellBorder
Definition: propertyListView.h:121
bool myEditable
Definition: propertyListView.h:123

Document ID: Generated on Mon Sep 7 15:40:32 EDT 2020 from SVN revision 217499
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)