MeVisLab Toolbox Reference
mlItemModelProxy.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2014, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_ITEM_MODEL_PROXY_H
14 #define ML_ITEM_MODEL_PROXY_H
15 
16 
18 
19 #include <mlAbstractItemModel.h>
20 
21 ML_START_NAMESPACE
22 
23 //===========================================================================
24 
26 {
27 public:
28  ItemModelProxy(AbstractItemModelPtr sourceModel);
29  ~ItemModelProxy() override;
30 
31  AbstractItemModelPtr sourceModel() const { return _sourceModel; }
32 
33 protected:
36 
38  void incItemRefCount(void* p) override;
39  void decItemRefCount(void* p) override;
41 
42 private:
44  static void sourceEventCB(void* userData, ml::BaseEvent* ev);
45 
47  virtual void sourceItemsInserted(ml::ItemsInsertedEvent* ev);
48  virtual void sourceItemsRemoved(ml::ItemsRemovedEvent* ev);
49  virtual void sourceItemsDataChanged(ml::ItemsDataChangedEvent* evt);
50  virtual void sourceItemChanged(ml::ItemChangedEvent* ev);
52 
54  AbstractItemModelPtr _sourceModel;
55 
57 };
58 
60 
61 //===========================================================================
62 
63 ML_END_NAMESPACE
64 
65 #endif // __mlItemModelProxy_H
#define MLITEMMODEL_EXPORT
defined Header file mlItemModelSystem.h
This class represents an abstract hierarchical item model where the items have named attributes which...
BaseEvent is the base class for all events emitted from EventSourceBase.
Definition: mlEventSource.h:86
This event tells us that the children of the item have changed completely (for an invalid ModelIndex ...
ModelIndex convertToSource(const ModelIndex &index)
~ItemModelProxy() override
void incItemRefCount(void *p) override
propagate to source model:
AbstractItemModelPtr sourceModel() const
void decItemRefCount(void *p) override
ModelIndex convertFromSource(const ModelIndex &index)
ItemModelProxy(AbstractItemModelPtr sourceModel)
This event informs about attributes that have changed their values.
This event informs about inserted items.
This event informs about removed items.
This class serves as an index into an AbstractItemModel.
#define ML_ABSTRACT_CLASS_HEADER(className)
Same like ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non existing export symbol.
#define ML_REFCOUNTED_PTR(CLASSNAME)
Macro that defines convenience Ptr/ConstPtr typedefs to be used instead of intrusive_ptr templates.