Skip to content

Commit 6ca1842

Browse files
committed
doc cleanup
1 parent 8048fe0 commit 6ca1842

File tree

5 files changed

+35
-10
lines changed

5 files changed

+35
-10
lines changed

NodeGraphQt/base/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class NodeGraph(QtCore.QObject):
4141
#: signal for when drop data has been added to the graph.
4242
data_dropped = QtCore.Signal(QtCore.QMimeData, QtCore.QPoint)
4343

44-
def __init__(self, parent=None, tab_search_key='tab'):
44+
def __init__(self, parent=None):
4545
super(NodeGraph, self).__init__(parent)
4646
self.setObjectName('NodeGraphQt')
4747
self._model = NodeGraphModel()
@@ -53,7 +53,7 @@ def __init__(self, parent=None, tab_search_key='tab'):
5353
self._nodes_tree = None
5454

5555
tab = QtWidgets.QAction('Search Nodes', self)
56-
tab.setShortcut(tab_search_key)
56+
tab.setShortcut('tab')
5757
tab.triggered.connect(self._toggle_tab_search)
5858
self._viewer.addAction(tab)
5959

NodeGraphQt/base/node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class NodeObject(object):
3030
base class for all node objects.
3131
3232
Args:
33-
node (AbstractNodeItem): graphic item used for drawing.
33+
qgraphics_item (AbstractNodeItem): graphic item used for drawing.
3434
"""
3535

3636
#: (str) unique node identifier domain.
@@ -39,13 +39,13 @@ class NodeObject(object):
3939
#: (str) base node name.
4040
NODE_NAME = None
4141

42-
def __init__(self, node=None):
43-
assert node, 'node cannot be None.'
42+
def __init__(self, qgraphics_item=None):
43+
assert qgraphics_item, 'qgraphics item cannot be None.'
4444
self._graph = None
4545
self._model = NodeModel()
4646
self._model.type_ = self.type_
4747
self._model.name = self.NODE_NAME
48-
self._view = node
48+
self._view = qgraphics_item
4949
self._view.type_ = self.type_
5050
self._view.name = self.model.name
5151
self._view.id = self._model.id

docs/nodes.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,33 @@ BaseNode
2828

2929
The ``NodeGraphQt.BaseNode`` class is the base class for nodes that allows port connections from one node to another.
3030

31-
3231
.. image:: _images/node.png
3332
:width: 250px
3433

34+
code snippet.
35+
36+
.. code-block:: python
37+
:linenos:
38+
39+
from NodeGraphQt import BaseNode
40+
41+
class FooNode(BaseNode):
42+
43+
# unique node identifier domain.
44+
__identifier__ = 'com.chantasticvfx'
45+
46+
# initial default node name.
47+
NODE_NAME = 'Foo Node'
48+
49+
def __init__(self):
50+
super(FooNode, self).__init__()
51+
52+
# create an input port.
53+
self.add_input('in')
54+
55+
# create an output port.
56+
self.add_output('out')
57+
3558
----
3659

3760
.. autoclass:: NodeGraphQt.BaseNode

docs/overview.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ example code:
4848
import sys
4949
from PySide2 import QtWidgets
5050
51-
from NodeGraphQt import NodeGraph, Node, setup_context_menu
51+
from NodeGraphQt import NodeGraph, BaseNode, setup_context_menu
5252
5353
54-
class FooNode(Node):
54+
class FooNode(BaseNode):
5555
5656
# unique node identifier domain.
5757
__identifier__ = 'com.chantasticvfx'

docs/widgets.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ PropertiesBinWidget
2323

2424
.. autoclass:: NodeGraphQt.widgets.properties_bin.PropertiesBinWidget
2525
:members:
26+
:exclude-members: property_changed
2627

2728
NodeTreeWidget
2829
==============
@@ -44,4 +45,5 @@ NodeTreeWidget
4445
----
4546

4647
.. autoclass:: NodeGraphQt.widgets.node_tree.NodeTreeWidget
47-
:members:
48+
:members:
49+
:exclude-members: mimeData, set_node_factory, property_changed

0 commit comments

Comments
 (0)