Skip to content

Commit 06fd395

Browse files
committed
args fix
1 parent 8cc6086 commit 06fd395

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

NodeGraphQt/qgraphics/node_base.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/python
2-
32
from collections import OrderedDict
3+
4+
from Qt import QtGui, QtCore, QtWidgets
5+
46
from .node_abstract import AbstractNodeItem
57
from .node_text_item import NodeTextItem
68
from .port import PortItem, CustomPortItem
7-
from .. import QtGui, QtCore, QtWidgets
89
from ..constants import (IN_PORT, OUT_PORT,
910
NODE_WIDTH, NODE_HEIGHT,
1011
NODE_ICON_SIZE, ICON_NODE_BASE,
@@ -609,7 +610,7 @@ def height(self, height=0.0):
609610
def disabled(self, state=False):
610611
AbstractNodeItem.disabled.fset(self, state)
611612
for n, w in self._widgets.items():
612-
w.get_custom_widget().setDisabled(state)
613+
w.widget().setDisabled(state)
613614
self._tooltip_disable(state)
614615
self._x_item.setVisible(state)
615616

@@ -1037,37 +1038,39 @@ def calc_size(self, add_w=0.0, add_h=0.0):
10371038
return width, height
10381039

10391040
def add_input(self, name='input', multi_port=False, display_name=True,
1040-
painter_func=None):
1041+
locked=False, painter_func=None):
10411042
"""
10421043
Adds a port qgraphics item into the node with the "port_type" set as
10431044
IN_PORT
10441045
10451046
Args:
10461047
name (str): name for the port.
10471048
multi_port (bool): allow multiple connections.
1048-
display_name (bool): (not used)
1049+
display_name (bool): (not used).
1050+
locked (bool): locked state.
10491051
painter_func (function): custom paint function.
10501052
10511053
Returns:
10521054
PortItem: port qgraphics item.
10531055
"""
10541056
return super(NodeItemVertical, self).add_input(
1055-
name, multi_port, False, painter_func)
1057+
name, multi_port, False, locked, painter_func)
10561058

1057-
def add_output(self, name='output', multi_port=False, display_name=False,
1058-
painter_func=None):
1059+
def add_output(self, name='output', multi_port=False, display_name=True,
1060+
locked=False, painter_func=None):
10591061
"""
10601062
Adds a port qgraphics item into the node with the "port_type" set as
10611063
OUT_PORT
10621064
10631065
Args:
10641066
name (str): name for the port.
10651067
multi_port (bool): allow multiple connections.
1066-
display_name (bool): (not used)
1068+
display_name (bool): (not used).
1069+
locked (bool): locked state.
10671070
painter_func (function): custom paint function.
10681071
10691072
Returns:
10701073
PortItem: port qgraphics item.
10711074
"""
10721075
return super(NodeItemVertical, self).add_output(
1073-
name, multi_port, False, painter_func)
1076+
name, multi_port, False, locked, painter_func)

0 commit comments

Comments
 (0)