Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/kis_node_model.h
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 60 | { | |||
---|---|---|---|---|---|
75 | AlternateActiveRole, | 75 | AlternateActiveRole, | ||
76 | 76 | | |||
77 | // When a layer is not (recursively) visible, then it should be gayed out | 77 | // When a layer is not (recursively) visible, then it should be gayed out | ||
78 | ShouldGrayOutRole, | 78 | ShouldGrayOutRole, | ||
79 | 79 | | |||
80 | // An index of a color label associated with the node | 80 | // An index of a color label associated with the node | ||
81 | ColorLabelIndexRole, | 81 | ColorLabelIndexRole, | ||
82 | 82 | | |||
83 | // Instruct this model to update all its items' Qt::ItemIsDropEnabled flags in order to | ||||
84 | // reflect if the item allows an "onto" drop of the given QMimeData*. | ||||
85 | DropEnabled, | ||||
86 | | ||||
83 | /// This is to ensure that we can extend the data role in the future, since it's not possible to add a role after BeginThumbnailRole (due to "Hack") | 87 | /// This is to ensure that we can extend the data role in the future, since it's not possible to add a role after BeginThumbnailRole (due to "Hack") | ||
84 | ReservedRole = 99, | 88 | ReservedRole = 99, | ||
85 | 89 | | |||
86 | /** | 90 | /** | ||
87 | * For values of BeginThumbnailRole or higher, a thumbnail of the layer of which neither dimension | 91 | * For values of BeginThumbnailRole or higher, a thumbnail of the layer of which neither dimension | ||
88 | * is larger than (int) value - (int) BeginThumbnailRole. | 92 | * is larger than (int) value - (int) BeginThumbnailRole. | ||
89 | * This is a hack to work around the fact that Interview doesn't have a nice way to | 93 | * This is a hack to work around the fact that Interview doesn't have a nice way to | ||
90 | * request thumbnails of arbitrary size. | 94 | * request thumbnails of arbitrary size. | ||
Show All 23 Lines | 114 | public: | |||
114 | QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; | 118 | QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; | ||
115 | QModelIndex parent(const QModelIndex &index) const override; | 119 | QModelIndex parent(const QModelIndex &index) const override; | ||
116 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | 120 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | ||
117 | Qt::ItemFlags flags(const QModelIndex &index) const override; | 121 | Qt::ItemFlags flags(const QModelIndex &index) const override; | ||
118 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; | 122 | bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; | ||
119 | QStringList mimeTypes() const override; | 123 | QStringList mimeTypes() const override; | ||
120 | QMimeData* mimeData(const QModelIndexList & indexes) const override; | 124 | QMimeData* mimeData(const QModelIndexList & indexes) const override; | ||
121 | bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) override; | 125 | bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) override; | ||
126 | bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override; | ||||
122 | Qt::DropActions supportedDragActions() const override; | 127 | Qt::DropActions supportedDragActions() const override; | ||
123 | Qt::DropActions supportedDropActions() const override; | 128 | Qt::DropActions supportedDropActions() const override; | ||
124 | bool hasDummiesFacade(); | 129 | bool hasDummiesFacade(); | ||
125 | 130 | | |||
126 | static bool belongsToIsolatedGroup(KisImageSP image, KisNodeSP node, KisDummiesFacadeBase *dummiesFacade); | 131 | static bool belongsToIsolatedGroup(KisImageSP image, KisNodeSP node, KisDummiesFacadeBase *dummiesFacade); | ||
127 | 132 | | |||
128 | Q_SIGNALS: | 133 | Q_SIGNALS: | ||
129 | 134 | | |||
Show All 24 Lines | 155 | private: | |||
154 | void connectDummy(KisNodeDummy *dummy, bool needConnect); | 159 | void connectDummy(KisNodeDummy *dummy, bool needConnect); | ||
155 | void connectDummies(KisNodeDummy *dummy, bool needConnect); | 160 | void connectDummies(KisNodeDummy *dummy, bool needConnect); | ||
156 | 161 | | |||
157 | void resetIndexConverter(); | 162 | void resetIndexConverter(); | ||
158 | 163 | | |||
159 | void regenerateItems(KisNodeDummy *dummy); | 164 | void regenerateItems(KisNodeDummy *dummy); | ||
160 | bool belongsToIsolatedGroup(KisNodeSP node) const; | 165 | bool belongsToIsolatedGroup(KisNodeSP node) const; | ||
161 | 166 | | |||
167 | void setDropEnabled(const QMimeData *data); | ||||
168 | void updateDropEnabled(const QList<KisNodeSP> &nodes, QModelIndex parent = QModelIndex()); | ||||
169 | | ||||
162 | private: | 170 | private: | ||
163 | 171 | | |||
164 | struct Private; | 172 | struct Private; | ||
165 | Private * const m_d; | 173 | Private * const m_d; | ||
166 | }; | 174 | }; | ||
167 | 175 | | |||
168 | #endif | 176 | #endif |