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

Document ID: Generated on Tue Aug 7 22:07:13 EDT 2012 from SVN revision 117874
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)