Skip to content

Commit 44cbcd3

Browse files
committed
reorganised some docs.
1 parent 54c596b commit 44cbcd3

File tree

16 files changed

+125
-92
lines changed

16 files changed

+125
-92
lines changed

NodeGraphQt/base/graph.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class NodeGraph(QtCore.QObject):
4242
.. inheritance-diagram:: NodeGraphQt.NodeGraph
4343
:top-classes: PySide2.QtCore.QObject
4444
45-
.. image:: _images/graph.png
45+
.. image:: ../_images/graph.png
4646
:width: 60%
4747
"""
4848

@@ -980,7 +980,7 @@ def set_pipe_slicing(self, mode=True):
980980
When set to true holding down ``Alt + Shift + LMB Drag`` will allow node
981981
pipe connections to be sliced.
982982
983-
.. image:: _images/slicer.png
983+
.. image:: ../_images/slicer.png
984984
:width: 400px
985985
986986
See Also:
@@ -1016,7 +1016,7 @@ def set_pipe_style(self, style=PipeLayoutEnum.CURVED.value):
10161016
10171017
See: :attr:`NodeGraphQt.constants.PipeLayoutEnum`
10181018
1019-
.. image:: _images/pipe_layout_types.gif
1019+
.. image:: ../_images/pipe_layout_types.gif
10201020
:width: 80%
10211021
10221022
@@ -1057,7 +1057,7 @@ def set_layout_direction(self, direction):
10571057
- :attr:`NodeGraphQt.constants.LayoutDirectionEnum.HORIZONTAL`
10581058
- :attr:`NodeGraphQt.constants.LayoutDirectionEnum.VERTICAL`
10591059
1060-
.. image:: _images/layout_direction_switch.gif
1060+
.. image:: ../_images/layout_direction_switch.gif
10611061
:width: 300px
10621062
10631063
Warnings:
@@ -2468,7 +2468,7 @@ class SubGraph(NodeGraph):
24682468
.. inheritance-diagram:: NodeGraphQt.SubGraph
24692469
:top-classes: PySide2.QtCore.QObject
24702470
2471-
.. image:: _images/sub_graph.png
2471+
.. image:: ../_images/sub_graph.png
24722472
:width: 70%
24732473
24742474
-
@@ -2806,7 +2806,7 @@ def node(self):
28062806
"""
28072807
Returns the parent node to the sub graph.
28082808
2809-
.. image:: _images/group_node.png
2809+
.. image:: ../_images/group_node.png
28102810
:width: 250px
28112811
28122812
Returns:
@@ -2969,7 +2969,7 @@ def get_input_port_nodes(self):
29692969
"""
29702970
Return all the port nodes related to the group node input ports.
29712971
2972-
.. image:: _images/port_in_node.png
2972+
.. image:: ../_images/port_in_node.png
29732973
:width: 150px
29742974
29752975
-
@@ -2987,7 +2987,7 @@ def get_output_port_nodes(self):
29872987
"""
29882988
Return all the port nodes related to the group node output ports.
29892989
2990-
.. image:: _images/port_out_node.png
2990+
.. image:: ../_images/port_out_node.png
29912991
:width: 150px
29922992
29932993
-

NodeGraphQt/custom_widgets/nodes_palette.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from NodeGraphQt.constants import URN_SCHEME
88

99

10-
class NodesGridDelagate(QtWidgets.QStyledItemDelegate):
10+
class _NodesGridDelegate(QtWidgets.QStyledItemDelegate):
1111

1212
def paint(self, painter, option, index):
1313
"""
@@ -17,7 +17,7 @@ def paint(self, painter, option, index):
1717
index (QtCore.QModelIndex):
1818
"""
1919
if index.column() != 0:
20-
super(NodesGridDelagate, self).paint(painter, option, index)
20+
super(_NodesGridDelegate, self).paint(painter, option, index)
2121
return
2222

2323
model = index.model().sourceModel()
@@ -116,16 +116,16 @@ def paint(self, painter, option, index):
116116
painter.restore()
117117

118118

119-
class NodesGridProxyModel(QtCore.QSortFilterProxyModel):
119+
class _NodesGridProxyModel(QtCore.QSortFilterProxyModel):
120120

121121
def __init__(self, parent=None):
122-
super(NodesGridProxyModel, self).__init__(parent)
122+
super(_NodesGridProxyModel, self).__init__(parent)
123123

124-
def mimeData(self, indexes):
124+
def mimeData(self, indexes, p_int=None):
125125
node_ids = ['node:{}'.format(i.data(QtCore.Qt.ToolTipRole))
126126
for i in indexes]
127127
node_urn = URN_SCHEME + ';'.join(node_ids)
128-
mime_data = super(NodesGridProxyModel, self).mimeData(indexes)
128+
mime_data = super(_NodesGridProxyModel, self).mimeData(indexes, p_int)
129129
mime_data.setUrls([node_urn])
130130
return mime_data
131131

@@ -144,10 +144,10 @@ def __init__(self, parent=None):
144144
self.setSpacing(4)
145145

146146
model = QtGui.QStandardItemModel()
147-
proxy_model = NodesGridProxyModel()
147+
proxy_model = _NodesGridProxyModel()
148148
proxy_model.setSourceModel(model)
149149
self.setModel(proxy_model)
150-
self.setItemDelegate(NodesGridDelagate(self))
150+
self.setItemDelegate(_NodesGridDelegate(self))
151151

152152
def clear(self):
153153
self.model().sourceModel().clear()
@@ -171,7 +171,7 @@ class NodesPaletteWidget(QtWidgets.QWidget):
171171
.. inheritance-diagram:: NodeGraphQt.NodesPaletteWidget
172172
:parts: 1
173173
174-
.. image:: _images/nodes_palette.png
174+
.. image:: ../_images/nodes_palette.png
175175
:width: 400px
176176
177177
.. code-block:: python

NodeGraphQt/custom_widgets/nodes_tree.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
TYPE_CATEGORY = QtWidgets.QTreeWidgetItem.UserType + 2
99

1010

11-
class BaseNodeTreeItem(QtWidgets.QTreeWidgetItem):
11+
class _BaseNodeTreeItem(QtWidgets.QTreeWidgetItem):
1212

1313
def __eq__(self, other):
1414
"""
@@ -28,7 +28,7 @@ class NodesTreeWidget(QtWidgets.QTreeWidget):
2828
:parts: 1
2929
:top-classes: PySide2.QtWidgets.QWidget
3030
31-
.. image:: _images/nodes_tree.png
31+
.. image:: ../_images/nodes_tree.png
3232
:width: 300px
3333
3434
.. code-block:: python
@@ -92,7 +92,7 @@ def _build_tree(self):
9292
label = self._custom_labels[category]
9393
else:
9494
label = '{}'.format(category)
95-
cat_item = BaseNodeTreeItem(self, [label], type=TYPE_CATEGORY)
95+
cat_item = _BaseNodeTreeItem(self, [label], type=TYPE_CATEGORY)
9696
cat_item.setFirstColumnSpanned(True)
9797
cat_item.setFlags(QtCore.Qt.ItemIsEnabled)
9898
cat_item.setBackground(0, QtGui.QBrush(palette.midlight().color()))
@@ -105,7 +105,7 @@ def _build_tree(self):
105105
category = '.'.join(node_id.split('.')[:-1])
106106
category_item = self._category_items[category]
107107

108-
item = BaseNodeTreeItem(category_item, [node_name], type=TYPE_NODE)
108+
item = _BaseNodeTreeItem(category_item, [node_name], type=TYPE_NODE)
109109
item.setToolTip(0, node_id)
110110
item.setSizeHint(0, QtCore.QSize(100, 26))
111111

@@ -124,7 +124,7 @@ def set_category_label(self, category, label):
124124
"""
125125
Override the label for a node category root item.
126126
127-
.. image:: _images/nodes_tree_category_label.png
127+
.. image:: ../_images/nodes_tree_category_label.png
128128
:width: 70%
129129
130130
Args:

NodeGraphQt/custom_widgets/properties_bin/custom_widget_value_edit.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,15 @@ def set_data_type(self, data_type):
195195
regexp = QtCore.QRegExp(r'\d+')
196196
validator = QtGui.QRegExpValidator(regexp, self)
197197
steps = [1, 10, 100, 1000]
198+
self._min = None if self._min is None else int(self._min)
199+
self._max = None if self._max is None else int(self._max)
198200
elif data_type is float:
199201
regexp = QtCore.QRegExp(r'\d+[\.,]\d+(?:[eE](?:[\-\+]|)\d+)*')
200202
validator = QtGui.QRegExpValidator(regexp, self)
201203
steps = [0.001, 0.01, 0.1, 1]
204+
self._min = None if self._min is None else float(self._min)
205+
self._max = None if self._max is None else float(self._max)
206+
202207
self.setValidator(validator)
203208
if not self._menu.steps:
204209
self._menu.set_steps(steps)

NodeGraphQt/custom_widgets/properties_bin/node_property_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class PropertiesBinWidget(QtWidgets.QWidget):
553553
.. inheritance-diagram:: NodeGraphQt.PropertiesBinWidget
554554
:parts: 1
555555
556-
.. image:: _images/prop_bin.png
556+
.. image:: ../_images/prop_bin.png
557557
:width: 950px
558558
559559
.. code-block:: python
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:hide-rtoc:
2+
3+
NodesPaletteWidget
4+
##################
5+
6+
.. autosummary::
7+
NodeGraphQt.NodesPaletteWidget
8+
9+
.. autoclass:: NodeGraphQt.NodesPaletteWidget
10+
:members:
11+
:exclude-members: mimeData, staticMetaObject
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:hide-rtoc:
2+
3+
NodesTreeWidget
4+
###############
5+
6+
.. autosummary::
7+
NodeGraphQt.NodesTreeWidget
8+
9+
.. autoclass:: NodeGraphQt.NodesTreeWidget
10+
:members:
11+
:exclude-members: mimeData, staticMetaObject
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:hide-rtoc:
2+
3+
PropertiesBinWidget
4+
###################
5+
6+
.. autosummary::
7+
NodeGraphQt.PropertiesBinWidget
8+
9+
.. autoclass:: NodeGraphQt.PropertiesBinWidget
10+
:members:
11+
:exclude-members: staticMetaObject

docs/custom_widgets.rst

Lines changed: 0 additions & 34 deletions
This file was deleted.

docs/examples/ex_node.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ To you update the widget you can call the
7979
- ``QCheckBox``: :meth:`NodeGraphQt.BaseNode.add_checkbox`
8080
- ``QLineEdit``: :meth:`NodeGraphQt.BaseNode.add_text_input`
8181

82-
See: :ref:`Node Widgets` for more node widget types.
82+
See: :ref:`Embedded Node Widgets` for more node widget types.
8383

8484
|
8585

0 commit comments

Comments
 (0)