Skip to content

Commit e07bc64

Browse files
committed
updated node widget docs
1 parent a4bf3b9 commit e07bc64

File tree

3 files changed

+37
-20
lines changed

3 files changed

+37
-20
lines changed

NodeGraphQt/widgets/node_widgets.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def add_node_widget(self, widget):
2828

2929
class NodeBaseWidget(QtWidgets.QGraphicsProxyWidget):
3030
"""
31-
Base Node Widget.
31+
NodeBaseWidget is the main base class for all node widgets that is
32+
embedded in a :class:`NodeGraphQt.BaseNode` object.
3233
"""
3334

3435
value_changed = QtCore.Signal(str, object)
@@ -136,8 +137,12 @@ def name(self):
136137

137138
class NodeComboBox(NodeBaseWidget):
138139
"""
139-
ComboBox Node Widget inherits from:
140-
:class:`NodeGraphQt.widgets.node_widgets.NodeBaseWidget`
140+
NodeComboBox widget is subclassed from :class:`NodeBaseWidget`,
141+
this widget is displayed as a ``QComboBox`` embedded in a node.
142+
143+
.. note::
144+
`To embed a ``QComboBox`` in a node see func:`
145+
:meth:`NodeGraphQt.BaseNode.add_combo_menu`
141146
"""
142147

143148
def __init__(self, parent=None, name='', label='', items=None):
@@ -167,10 +172,10 @@ def widget(self):
167172
@property
168173
def value(self):
169174
"""
170-
Returns the QComboBox current text.
175+
Returns the widget current text.
171176
172177
Returns:
173-
str: current property value.
178+
str: current text.
174179
"""
175180
return str(self._combo.currentText())
176181

@@ -201,8 +206,12 @@ def clear(self):
201206

202207
class NodeLineEdit(NodeBaseWidget):
203208
"""
204-
LineEdit Node Widget inherits from:
205-
:class:`NodeGraphQt.widgets.node_widgets.NodeBaseWidget`
209+
NodeLineEdit widget is subclassed from :class:`NodeBaseWidget`,
210+
this widget is displayed as a ``QLineEdit`` embedded in a node.
211+
212+
.. note::
213+
`To embed a ``QLineEdit`` in a node see func:`
214+
:meth:`NodeGraphQt.BaseNode.add_text_input`
206215
"""
207216

208217
def __init__(self, parent=None, name='', label='', text=''):
@@ -229,10 +238,10 @@ def widget(self):
229238
@property
230239
def value(self):
231240
"""
232-
Returns the QLineEdit current text.
241+
Returns the widgets current text.
233242
234243
Returns:
235-
str: current property value.
244+
str: current text.
236245
"""
237246
return str(self._ledit.text())
238247

@@ -245,8 +254,12 @@ def value(self, text=''):
245254

246255
class NodeCheckBox(NodeBaseWidget):
247256
"""
248-
CheckBox Node Widget inherits from:
249-
:class:`NodeGraphQt.widgets.node_widgets.NodeBaseWidget`
257+
NodeCheckBox widget is subclassed from :class:`NodeBaseWidget`,
258+
this widget is displayed as a ``QCheckBox`` embedded in a node.
259+
260+
.. note::
261+
`To embed a ``QCheckBox`` in a node see func:`
262+
:meth:`NodeGraphQt.BaseNode.add_checkbox`
250263
"""
251264

252265
def __init__(self, parent=None, name='', label='', text='', state=False):
@@ -279,10 +292,10 @@ def widget(self):
279292
@property
280293
def value(self):
281294
"""
282-
Returns the QCheckBox checked state.
295+
Returns the widget checked state.
283296
284297
Returns:
285-
bool: current property value.
298+
bool: checked state.
286299
"""
287300
return self._cbox.isChecked()
288301

docs/node_widgets.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
Node Widgets
22
############
33

4-
Node widgets are widgets that are embedded in the :class:`NodeGraphQt.BaseNode` class.
4+
Node widgets are widgets that are embedded in a :class:`NodeGraphQt.BaseNode`
5+
object displayed in the node graph.
56

67
NodeBaseWidget
78
**************
89

910
.. autoclass:: NodeGraphQt.widgets.node_widgets.NodeBaseWidget
1011
:members:
11-
:exclude-members: node, setToolTip, value, widget
12+
:exclude-members: node, setToolTip, type_, value, widget
1213

1314
NodeComboBox
1415
************

docs/widgets.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
Widgets
22
#######
33

4+
Custom widgets included in the NodeGraphQt module.
5+
46

57
Properties Bin
68
**************
79

8-
The ``PropertiesBinWidget`` is a list widget for displaying and editing a
9-
nodes properties.
10+
The :class:`NodeGraphQt.PropertiesBinWidget` is a list widget for displaying
11+
and editing a nodes properties.
1012

1113
.. image:: _images/prop_bin.png
1214
:width: 950px
@@ -34,8 +36,9 @@ example
3436
Nodes Tree
3537
**********
3638

37-
The ``NodeTreeWidget`` is a widget for displaying all registered nodes from the
38-
node graph with this widget a user can create nodes by dragging and dropping.
39+
The :class:`NodeGraphQt.NodeTreeWidget` is a widget for displaying all
40+
registered nodes from the node graph with this widget a user can create nodes
41+
by dragging and dropping.
3942

4043
.. image:: _images/nodes_tree.png
4144
:width: 300px
@@ -56,6 +59,6 @@ example
5659
5760
----
5861

59-
.. autoclass:: NodeGraphQt.widgets.node_tree.NodeTreeWidget
62+
.. autoclass:: NodeGraphQt.NodeTreeWidget
6063
:members:
6164
:exclude-members: mimeData, set_node_factory, property_changed

0 commit comments

Comments
 (0)