VR-Exchange 2.4 API Documentation
 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) 2015 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 DtPropertyType;
21  class DtPropertyListViewItem;
22 
24  {
30  };
31 
32 
41  { Q_OBJECT;
42  private:
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  virtual DtPropertyListViewItem* addProperty( const DtProperty&,
66  QTreeWidgetItem* parentTree = 0 );
67  virtual DtPropertyListViewItem* addToProperty( const DtProperty& );
68 
69  virtual bool setProperty( QString prop, QVariant value );
70  virtual bool setProperty( QString prop, QString sub, QVariant value );
71  virtual bool setProperty( QString prop, QString sub, QString sub2, QVariant value );
72 
73  // Return the property accessed by key string
74  virtual DtProperty* property( QString prop ) const;
75  virtual DtProperty* property( QString prop, QString sub ) const;
76  virtual DtProperty* property( QString prop, QString sub, QString sub2 ) const;
77 
78  // First background color (starts the rows)
79  virtual QColor backgroundColor1() const { return myBackColor1; };
80 
81  // Second background color. Rows alternate between this and backColor1().
82  virtual QColor backgroundColor2() const { return myBackColor2; };
83 
84  // Font color for the group items (items with children)
85  virtual QColor groupForegroundColor() const;
86  virtual void setGroupForegroundColor( const QColor& color );
87 
88  // Background style: Interchangeable stripes or stripes on groups only
89  virtual DtPropertyListViewStyle backgroundStyle() const;
90  virtual void setBackgroundStyle( const DtPropertyListViewStyle& style );
91 
92  // Draw the cell border outline or not
93  virtual bool drawCellBorder() { return myDrawCellBorder; };
94 
95  // Cell border color property
96  virtual QColor cellBorderColor() const;
97  virtual void setCellBorderColor( const QColor& color );
98 
99  virtual bool alphaSorted() const;
100 
101  protected slots:
102 
103  virtual void headerClicked( int column );
104 
105  protected:
106 
107  virtual void init();
108 
109  virtual bool eventFilter( QObject* obj, QEvent* event );
110 
111  virtual void contextMenuRequested( QTreeWidgetItem* item,
112  const QPoint& pos );
113 
114  protected:
115 
116  QColor myBackColor1;
117  QColor myBackColor2;
118  QColor myCellBorder;
120 
123 
127 
129 
131 
132  };
133 
134 }

Document ID: Generated on Thu Jul 23 10:25:22 EDT 2015 from SVN revision 155065
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)