All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AbstractPropertyItem.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/se/AbstractPropertyItem.cpp
22 
23  \brief A widget used to define the main property items
24  that can be used to describe a se object.
25 */
26 
27 #include "AbstractPropertyItem.h"
28 
30 
31 
32 
33 te::qt::widgets::AbstractPropertyItem::AbstractPropertyItem(QtTreePropertyBrowser* pb, QColor c) :
34  m_propertyBrowser(pb), m_colorParent(c)
35 {
37 
38  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_intManager, SIGNAL(valueChanged(QtProperty *, int)), this, SLOT(valueChanged(QtProperty *, int)));
39  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_intSliderManager, SIGNAL(valueChanged(QtProperty *, int)), this, SLOT(valueChanged(QtProperty *, int)));
40  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_doubleManager, SIGNAL(valueChanged(QtProperty *, double)), this, SLOT(valueChanged(QtProperty *, double)));
41  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_stringManager, SIGNAL(valueChanged(QtProperty *, const QString &)), this, SLOT(valueChanged(QtProperty *, const QString &)));
42  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_colorManager, SIGNAL(valueChanged(QtProperty *, const QColor &)), this, SLOT(valueChanged(QtProperty *, const QColor &)));
43  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_fontManager, SIGNAL(valueChanged(QtProperty *, const QFont &)), this, SLOT(valueChanged(QtProperty *, const QFont &)));
44  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_sizeManager, SIGNAL(valueChanged(QtProperty *, const QSize &)), this, SLOT(valueChanged(QtProperty *, const QSize &)));
45  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_enumManager, SIGNAL(valueChanged(QtProperty *, int)), this, SLOT(valueChanged(QtProperty *, int)));
46  connect(te::qt::widgets::AbstractPropertyManager::getInstance().m_pointFManager, SIGNAL(valueChanged(QtProperty *, const QPointF &)), this, SLOT(valueChanged(QtProperty *, const QPointF &)));
47 }
48 
50 {
51 }
52 
53 void te::qt::widgets::AbstractPropertyItem::addProperty(QtProperty* p, const QString &id, QColor c)
54 {
55  m_propertyToId[p] = id;
56  m_idToProperty[id] = p;
57  QtBrowserItem* item = m_propertyBrowser->addProperty(p);
58 
59  if(m_colorParent.isValid())
60  m_propertyBrowser->setBackgroundColor(item, m_colorParent);
61  else
62  m_propertyBrowser->setBackgroundColor(item, c);
63 
64  m_propertyBrowser->setExpanded(item, true);
65 
66  setExpandedStatus(item, false);
67 
68 }
69 
70 void te::qt::widgets::AbstractPropertyItem::setExpandedStatus(QtBrowserItem* item, bool status)
71 {
72  QList<QtBrowserItem*> list = item->children();
73 
74  for(int i = 0; i < list.size(); ++i)
75  {
76  m_propertyBrowser->setExpanded(list[i], false);
77 
78  setExpandedStatus(list[i], false);
79  }
80 }
81 
83 {
84 }
85 
86 void te::qt::widgets::AbstractPropertyItem::valueChanged(QtProperty *p, double value)
87 {
88 }
89 
90 void te::qt::widgets::AbstractPropertyItem::valueChanged(QtProperty *p, const QString &value)
91 {
92 }
93 
94 void te::qt::widgets::AbstractPropertyItem::valueChanged(QtProperty *p, const QColor &value)
95 {
96 }
97 
98 void te::qt::widgets::AbstractPropertyItem::valueChanged(QtProperty *p, const QFont &value)
99 {
100 }
101 
102 void te::qt::widgets::AbstractPropertyItem::valueChanged(QtProperty *p, const QSize &value)
103 {
104 }
105 
106 void te::qt::widgets::AbstractPropertyItem::valueChanged(QtProperty *p, const QPointF &value)
107 {
108 }
virtual void valueChanged(QtProperty *p, int value)
void setExpandedStatus(QtBrowserItem *item, bool status)
static AbstractPropertyManager & getInstance()
It returns a reference to the singleton instance.
AbstractPropertyItem(QtTreePropertyBrowser *pb, QColor c=QColor())
Constructor.
void addProperty(QtProperty *property, const QString &id, QColor c)