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
21ML_START_NAMESPACE
22
23//===========================================================================
24
26{
27public:
28 ItemModelProxy(AbstractItemModelPtr sourceModel);
29 ~ItemModelProxy() override;
30
31 AbstractItemModelPtr sourceModel() const { return _sourceModel; }
32
33protected:
36
38 void incItemRefCount(void* p) override;
39 void decItemRefCount(void* p) override;
41
42private:
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
63ML_END_NAMESPACE
64
65#endif // __mlItemModelProxy_H
#define MLITEMMODEL_EXPORT
defined Header file mlItemModelSystem.h
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.
#define ML_ABSTRACT_CLASS_HEADER(className)
#define ML_REFCOUNTED_PTR(CLASSNAME)
Macro that defines convenience Ptr/ConstPtr typedefs to be used instead of intrusive_ptr templates.