47 #ifndef _MIRA_PROPERTYEDITOR_H_ 48 #define _MIRA_PROPERTYEDITOR_H_ 51 #include <QModelIndex> 58 #include <QWaitCondition> 72 class PropertyItemEditor;
101 void addProperty(
PropertyNode* property, QVariant user = QVariant());
120 void setHideSingleRootNode(
bool hide =
true);
123 bool getHideSingleRootNode()
const;
127 void installFilterShortCut(QWidget* widget,
const QString& shortcut =
"Ctrl+F");
129 bool getAutoHideFilterBar()
const;
133 void setAutoHideFilterBar(
bool hide =
true);
140 void setColor(
const PropertyNode* property,
const QColor& color);
146 std::string getText(
const PropertyNode* property)
const;
148 QColor getBackgroundColor(
const PropertyNode* property)
const;
149 QWidget* createEditor(
PropertyNode* property, QWidget* parent);
154 void timerEvent(QTimerEvent*);
155 void customEvent(QEvent*);
159 void onDestroyedEditorDelegate(QObject*);
169 virtual void beginAddChildren(
const PropertyNode* node,
int index,
int count);
170 virtual void endAddChildren();
172 virtual void beginRemoveChildren(
const PropertyNode* node,
int index,
int count);
173 virtual void endRemoveChildren();
175 virtual void beginMoveChildren(
const PropertyNode* node,
int index,
int count,
int destination);
176 virtual void endMoveChildren();
181 struct AddRemoveChildEvent :
public QEvent
183 static const QEvent::Type typeID;
194 AddRemoveChildEvent(EventSubType iSubtype,
const PropertyNode* iNode = NULL,
195 int iIndex = 0,
int iCount = 1,
196 bool iFirst =
false,
int iDestination = -1)
197 : QEvent(typeID), subtype(iSubtype), node(iNode),
198 index(iIndex), count(iCount), first(iFirst), destination(iDestination) {}
200 EventSubType subtype;
201 const PropertyNode* node;
218 class DelegateRegistry;
225 friend class TreeView;
226 friend class ItemDelegate;
231 ItemDelegate* mItemDelegate;
235 std::map<const PropertyNode*, QColor> mColorMap;
238 bool mHideSingleRootNode;
242 QMutex mPropertyNodeListenerMutex;
243 QWaitCondition mPropertyNodeListenerCondition;
244 QList<QPersistentModelIndex> mPopulatingIndex;
292 type(iType), flags(iFlags) {}
301 list.push_back(*
this);
306 list.push_back(
type);
311 template <
typename Type>
316 virtual SupportedTypes supportedTypes()
const = 0;
346 bool eventFilter(QObject *obj, QEvent *e);
350 void buttonClicked();
356 QToolButton* mButton;
friend SupportedTypes operator+(SupportedTypes list, const SupportedType &type)
Definition: PropertyEditor.h:305
Abstract base class for all derived property node classes.
Definition: PropertyNode.h:202
static const QColor lightGreen
Definition: PropertyEditor.h:212
static const QColor lightPurple
Definition: PropertyEditor.h:214
Flags flags
Definition: PropertyEditor.h:296
boost::shared_ptr< Delegate > DelegatePtr
Definition: PropertyEditor.h:84
Declaration and implementation of the property node hierarchy.
Macros for generating logical operators for using enum values as flags.
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
std::string Typename
Definition: Typename.h:60
Definition: PropertyNode.h:430
virtual QWidget * createEditor(PropertyNode *property, QWidget *parent)
Definition: PropertyEditor.h:327
Definition: PropertyEditor.h:267
virtual std::string getText(const PropertyNode *property)
Returns text for a text label.
Definition: PropertyEditor.h:321
#define MIRA_ENUM_TO_FLAGS_INCLASS(EnumType)
Macro that can be used with enums that contain flags.
Definition: EnumToFlags.h:143
SupportedType(const Typename &iType, Flags iFlags)
Definition: PropertyEditor.h:291
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
Use this MACRO instead of MIRA_OBJECT to declare the class as abstract.
Definition: FactoryMacros.h:235
virtual QColor getBackgroundColor(const PropertyNode *property)
Definition: PropertyEditor.h:325
virtual QIcon getIcon(const PropertyNode *property)
Definition: PropertyEditor.h:323
PropertyHint type(const std::string &t)
Sets the attribute "type" to the specified value.
Definition: PropertyHint.h:295
Flags
Definition: PropertyEditor.h:269
The object class acts as a generic base class for classes which should be used with the classFactory...
Definition: Object.h:144
Filter widget containing an line edit that filters the elements of an assigned TreeView.
Definition: PropertyEditor.h:336
const PropertyNode * getCurrentEditedProperty() const
Definition: PropertyEditor.h:163
Typename type
Definition: PropertyEditor.h:294
static SupportedType makeSupportedType(SupportedType::Flags flags)
Definition: PropertyEditor.h:312
static const QColor lightBlue
Definition: PropertyEditor.h:210
Provides display and editing facilities for property items in the editor.
Definition: PropertyEditor.h:74
static const QColor lightRed
Definition: PropertyEditor.h:211
virtual std::string getName(const PropertyNode *property)
Definition: PropertyEditor.h:331
std::list< SupportedType > SupportedTypes
Definition: PropertyEditor.h:264
static const QColor lightYellow
Definition: PropertyEditor.h:213
Definition: TreeViewFilter.h:64
virtual bool execDialog(PropertyNode *property, QWidget *parent)
Definition: PropertyEditor.h:329