|
Krita Source Code Documentation
|
#include <NodeView.h>
Inheritance diagram for NodeView:Classes | |
| class | PropertyAction |
Public Types | |
| enum | ColumnIndex { DEFAULT_COL = 0 , VISIBILITY_COL = 1 , SELECTED_COL = 2 } |
Public Slots | |
| void | slotConfigurationChanged () |
| void | slotScrollerStateChanged (QScroller::State state) |
| void | slotUpdateIcons () |
| called with a theme change to refresh icon colors | |
Signals | |
| void | contextMenuRequested (const QPoint &globalPos, const QModelIndex &index) |
| void | selectionChanged (const QModelIndexList &) |
Public Member Functions | |
| void | addPropertyActions (QMenu *menu, const QModelIndex &index) |
| void | dragEnterEvent (QDragEnterEvent *e) override |
| void | dragLeaveEvent (QDragLeaveEvent *e) override |
| void | dragMoveEvent (QDragMoveEvent *ev) override |
| void | drawBranches (QPainter *painter, const QRect &rect, const QModelIndex &index) const override |
| void | dropEvent (QDropEvent *ev) override |
| NodeView (QWidget *parent=0) | |
| void | paintEvent (QPaintEvent *event) override |
| Private (NodeView *_q) | |
| void | resizeEvent (QResizeEvent *event) override |
| void | setModel (QAbstractItemModel *model) override |
| void | toggleSolo (const QModelIndex &index) |
| void | updateNode (const QModelIndex &index) |
| ~NodeView () override | |
Public Attributes | |
| NodeDelegate | delegate |
| QPersistentModelIndex | hovered |
| QPoint | lastPos |
Protected Slots | |
| void | currentChanged (const QModelIndex ¤t, const QModelIndex &previous) override |
| void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles=QVector< int >()) override |
| void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override |
Protected Member Functions | |
| void | contextMenuEvent (QContextMenuEvent *event) override |
| QPixmap | createDragPixmap () const |
| int | cursorPageIndex () const |
| QModelIndex | indexAt (const QPoint &point) const override |
| QItemSelectionModel::SelectionFlags | selectionCommand (const QModelIndex &index, const QEvent *event) const override |
| virtual void | showContextMenu (const QPoint &globalPos, const QModelIndex &index) |
| void | startDrag (Qt::DropActions supportedActions) override |
| bool | viewportEvent (QEvent *event) override |
Private Types | |
| typedef KisNodeModel | Model |
Private Slots | |
| void | slotActionToggled (bool on, const QPersistentModelIndex &index, int property) |
Private Member Functions | |
| bool | isDragging () const |
| QStyleOptionViewItem | optionForIndex (const QModelIndex &index) const |
| void | setDraggingFlag (bool flag=true) |
| void | updateSelectedCheckboxColumn () |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Attributes | |
| Private *const | d |
| bool | m_draggingFlag |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
A widget displaying the Krita nodes (layers, masks, local selections, etc.)
This class is designed as a Qt model-view widget.
The Qt documentation explains the design and terminology for these classes: https://doc.qt.io/qt-5/model-view-programming.html
This widget should work correctly in your Qt designer .ui file.
Definition at line 50 of file NodeView.cpp.
|
private |
Definition at line 149 of file NodeView.h.
| Enumerator | |
|---|---|
| DEFAULT_COL | |
| VISIBILITY_COL | |
| SELECTED_COL | |
Definition at line 41 of file NodeView.h.
|
explicit |
Create a new NodeView.
Definition at line 70 of file NodeView.cpp.
References KisKineticScroller::createPreconfiguredScroller(), d, and slotScrollerStateChanged().
|
override |
| void NodeView::addPropertyActions | ( | QMenu * | menu, |
| const QModelIndex & | index ) |
Add toggle actions for all the properties associated with the current document section associated with the model index to the specified menu.
For instance, if a document section can be locked and visible, the menu will be expanded with locked and visible toggle actions.
For instance
| menu | A pointer to the menu that will be expanded with the toggle actions |
| index | The model index associated with the document section that may or may not provide a number of toggle actions. |
Definition at line 129 of file NodeView.cpp.
References KisNodeModel::PropertiesRole, and slotActionToggled().
|
overrideprotected |
Definition at line 250 of file NodeView.cpp.
References indexAt(), and showContextMenu().
|
signal |
Emitted whenever the user clicks with the secondary mouse button on an item. It is up to the application to design the contents of the context menu and show it.
|
protected |
Definition at line 326 of file NodeView.cpp.
References KisNodeModel::BeginThumbnailRole, KisIconUtils::SizeHuge, and KisIconUtils::SizeLarge.
|
overrideprotectedslot |
Definition at line 264 of file NodeView.cpp.
References KisNodeModel::ActiveRole.
|
protected |
Calculates the index of the nearest item to the cursor position
Definition at line 427 of file NodeView.cpp.
|
overrideprotectedslot |
Definition at line 274 of file NodeView.cpp.
References KisNodeModel::ActiveRole.
|
override |
Definition at line 449 of file NodeView.cpp.
References DRAG_WHILE_DRAG_WORKAROUND_START, and KisNodeModel::DropEnabled.
|
override |
Definition at line 466 of file NodeView.cpp.
References DRAG_WHILE_DRAG_WORKAROUND_STOP.
|
override |
Definition at line 460 of file NodeView.cpp.
References DRAG_WHILE_DRAG_WORKAROUND_START.
|
override |
Definition at line 407 of file NodeView.cpp.
References d.
|
override |
Definition at line 421 of file NodeView.cpp.
References DRAG_WHILE_DRAG_WORKAROUND_STOP.
|
overrideprotected |
Definition at line 165 of file NodeView.cpp.
|
private |
Permit to know if a slide is dragging
Definition at line 472 of file NodeView.cpp.
References m_draggingFlag.
|
private |
Definition at line 306 of file NodeView.cpp.
|
override |
Definition at line 401 of file NodeView.cpp.
|
inline |
Definition at line 53 of file NodeView.cpp.
|
override |
Definition at line 382 of file NodeView.cpp.
References DEFAULT_COL, KisNodeViewColorScheme::indentation(), SELECTED_COL, KisNodeViewColorScheme::selectedButtonColumnWidth(), VISIBILITY_COL, and KisNodeViewColorScheme::visibilityColumnWidth().
|
overrideprotectedslot |
Definition at line 292 of file NodeView.cpp.
References selectionChanged().
|
signal |
|
overrideprotected |
Definition at line 151 of file NodeView.cpp.
|
private |
Setter for the dragging flag
| flag | boolean |
Definition at line 477 of file NodeView.cpp.
References m_draggingFlag.
|
override |
Definition at line 104 of file NodeView.cpp.
References KisNodeViewColorScheme::instance(), SELECTED_COL, KisConfig::useLayerSelectionCheckbox(), and VISIBILITY_COL.
|
protectedvirtual |
Definition at line 259 of file NodeView.cpp.
References contextMenuRequested().
|
privateslot |
Definition at line 299 of file NodeView.cpp.
References KisNodeModel::PropertiesRole.
|
slot |
Definition at line 491 of file NodeView.cpp.
References d, KisNodeViewColorScheme::instance(), and updateSelectedCheckboxColumn().
|
slot |
Definition at line 487 of file NodeView.cpp.
References KisKineticScroller::updateCursor().
|
slot |
called with a theme change to refresh icon colors
Definition at line 482 of file NodeView.cpp.
References d.
|
overrideprotected |
Definition at line 320 of file NodeView.cpp.
References DRAG_WHILE_DRAG_WORKAROUND_START.
| void NodeView::toggleSolo | ( | const QModelIndex & | index | ) |
Definition at line 147 of file NodeView.cpp.
References d.
| void NodeView::updateNode | ( | const QModelIndex & | index | ) |
Definition at line 142 of file NodeView.cpp.
References dataChanged().
|
private |
Definition at line 498 of file NodeView.cpp.
References DEFAULT_COL, SELECTED_COL, and KisConfig::useLayerSelectionCheckbox().
|
overrideprotected |
Definition at line 179 of file NodeView.cpp.
References buttons(), d, DRAG_WHILE_DRAG_WORKAROUND_STOP, hovered, indexAt(), and optionForIndex().
|
private |
Definition at line 152 of file NodeView.h.
| NodeDelegate NodeView::delegate |
Definition at line 60 of file NodeView.cpp.
| QPersistentModelIndex NodeView::hovered |
Definition at line 61 of file NodeView.cpp.
| QPoint NodeView::lastPos |
Definition at line 62 of file NodeView.cpp.
|
private |
Definition at line 146 of file NodeView.h.