47 #ifndef _MIRA_PROPERTYEDITOR_H_ 48 #define _MIRA_PROPERTYEDITOR_H_ 51 #include <QModelIndex> 58 #include <QWaitCondition> 71 class PropertyItemEditor;
158 void onDestroyedEditorDelegate(QObject*);
180 struct AddRemoveChildEvent :
public QEvent
182 static const QEvent::Type typeID;
193 AddRemoveChildEvent(EventSubType iSubtype,
const PropertyNode* iNode = NULL,
194 int iIndex = 0,
int iCount = 1,
195 bool iFirst =
false,
int iDestination = -1)
196 : QEvent(typeID), subtype(iSubtype), node(iNode),
197 index(iIndex), count(iCount), first(iFirst), destination(iDestination) {}
199 EventSubType subtype;
200 const PropertyNode* node;
217 class DelegateRegistry;
234 std::map<const PropertyNode*, QColor> mColorMap;
237 bool mHideSingleRootNode;
241 QMutex mPropertyNodeListenerMutex;
242 QWaitCondition mPropertyNodeListenerCondition;
243 QList<QPersistentModelIndex> mPopulatingIndex;
300 list.push_back(*
this);
305 list.push_back(
type);
310 template <
typename Type>
349 void buttonClicked();
355 QToolButton* mButton;
friend class ItemDelegate
Definition: PropertyEditor.h:225
virtual QWidget * createEditor(PropertyNode *property, QWidget *parent)
Definition: PropertyEditor.h:326
Abstract base class for all derived property node classes.
Definition: PropertyNode.h:202
set if the Delegate provides at least a text for a label
Definition: PropertyEditor.h:270
static const QColor lightGreen
Definition: PropertyEditor.h:211
static const QColor lightPurple
Definition: PropertyEditor.h:213
void moveUpProperty(PropertyNode *property)
Moves the property node up in the editor's property node list.
virtual std::string getText(const PropertyNode *property)
Returns text for a text label.
Definition: PropertyEditor.h:320
PropertyNode * currentProperty()
Returns the current selected property node, or NULL if nothing is selected.
QIcon getIcon(const PropertyNode *property) const
set if the Delegate can provide an editor for the data
Definition: PropertyEditor.h:279
boost::shared_ptr< Delegate > DelegatePtr
Definition: PropertyEditor.h:83
Declaration and implementation of the property node hierarchy.
Macros for generating logical operators for using enum values as flags.
friend class TreeView
Definition: PropertyEditor.h:224
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
QColor getBackgroundColor(const PropertyNode *property) const
std::string Typename
Definition: Typename.h:60
void timerEvent(QTimerEvent *)
static SupportedType makeSupportedType(SupportedType::Flags flags)
Definition: PropertyEditor.h:311
set if the Delegate provides an background color
Definition: PropertyEditor.h:276
Definition: PropertyNode.h:430
virtual std::string getName(const PropertyNode *property)
Definition: PropertyEditor.h:330
set if the Delegate provides an icon
Definition: PropertyEditor.h:273
std::list< SupportedType > SupportedTypes
Definition: PropertyEditor.h:263
void clear()
Removes all property nodes that were set and therefore clears the whole editor content (without delet...
virtual void endAddChildren()
bool getHideSingleRootNode() const
Returns the set mode, whether a single root node should be hidden or not.
void setHideSingleRootNode(bool hide=true)
If hiding of the single root node is enabled, a single top level node will not be shown explicitly...
PropertyItemEditor(PropertyEditor *editor, QWidget *parent, PropertyNode *property, PropertyEditor::DelegatePtr editorDelegate, PropertyEditor::DelegatePtr dialogDelegate)
#define MIRA_ABSTRACT_OBJECT(classIdentifier)
Use this MACRO instead of MIRA_OBJECT to declare the class as abstract.
Definition: FactoryMacros.h:235
Definition: PropertyEditor.h:266
MIRA_ENUM_TO_FLAGS_INCLASS(Flags)
virtual SupportedTypes supportedTypes() const =0
Typename type
Definition: PropertyEditor.h:293
virtual void beginMoveChildren(const PropertyNode *node, int index, int count, int destination)
The object class acts as a generic base class for classes which should be used with the classFactory...
Definition: Object.h:144
bool eventFilter(QObject *obj, QEvent *e)
QVariant getUser(PropertyNode *property)
set if the Delegate can provide a dialog for editing the data
Definition: PropertyEditor.h:282
Filter widget containing an line edit that filters the elements of an assigned TreeView.
void setAutoHideFilterBar(bool hide=true)
virtual void endMoveChildren()
PropertyEditor(QWidget *parent=0)
virtual QIcon getIcon(const PropertyNode *property)
Definition: PropertyEditor.h:322
virtual void beginAddChildren(const PropertyNode *node, int index, int count)
virtual QColor getBackgroundColor(const PropertyNode *property)
Definition: PropertyEditor.h:324
void removeProperty(PropertyNode *property)
Remove the specified property node from the editor.
Definition: PropertyEditor.h:335
virtual void endRemoveChildren()
void setColor(const PropertyNode *property, const QColor &color)
Sets the background color for the specified property.
const PropertyNode * getCurrentEditedProperty() const
Definition: PropertyEditor.h:162
bool getAutoHideFilterBar() const
friend class Model
Definition: PropertyEditor.h:220
SupportedType(const Typename &iType, Flags iFlags)
Definition: PropertyEditor.h:290
Flags flags
Definition: PropertyEditor.h:295
std::string getName(const PropertyNode *property)
virtual void beginRemoveChildren(const PropertyNode *node, int index, int count)
QWidget * createEditor(PropertyNode *property, QWidget *parent)
void installFilterShortCut(QWidget *widget, const QString &shortcut="Ctrl+F")
static const QColor lightBlue
Definition: PropertyEditor.h:209
Definition: PropertyEditor.h:73
static const QColor lightRed
Definition: PropertyEditor.h:210
std::string getText(const PropertyNode *property) const
void customEvent(QEvent *)
set if the Delegate provides a (dynamic) name
Definition: PropertyEditor.h:285
virtual ~PropertyEditor()
Flags
Definition: PropertyEditor.h:268
Provides display and editing facilities for property items in the editor.
Definition: PropertyEditor.h:258
static const QColor lightYellow
Definition: PropertyEditor.h:212
void moveDownProperty(PropertyNode *property)
Moves the property node down in the editor's property node list.
void addProperty(PropertyNode *property, QVariant user=QVariant())
Adds the specified property node as top level node to the editor.
QColor getColor(const PropertyNode *property) const
friend SupportedTypes operator+(SupportedTypes list, const SupportedType &type)
Definition: PropertyEditor.h:304
Definition: TreeViewFilter.h:62
virtual bool execDialog(PropertyNode *property, QWidget *parent)
Definition: PropertyEditor.h:328