Skip to content

Commit a2e93c8

Browse files
committed
replace toTuple() with getRgb() method on QColor #262
1 parent 370abf4 commit a2e93c8

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

NodeGraphQt/widgets/actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class BaseMenu(QtWidgets.QMenu):
88

99
def __init__(self, *args, **kwargs):
1010
super(BaseMenu, self).__init__(*args, **kwargs)
11-
text_color = self.palette().text().color().toTuple()
12-
selected_color = self.palette().highlight().color().toTuple()
11+
text_color = self.palette().text().color().getRgb()
12+
selected_color = self.palette().highlight().color().getRgb()
1313
style_dict = {
1414
'QMenu': {
1515
'color': 'rgb({0},{1},{2})'.format(*text_color),

NodeGraphQt/widgets/node_graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ def __init__(self, parent=None):
1313
super(NodeGraphWidget, self).__init__(parent)
1414
self.setTabsClosable(True)
1515
self.setTabBarAutoHide(True)
16-
text_color = self.palette().text().color().toTuple()
16+
text_color = self.palette().text().color().getRgb()
1717
bg_color = QtGui.QColor(
18-
*ViewerEnum.BACKGROUND_COLOR.value).darker(120).toTuple()
18+
*ViewerEnum.BACKGROUND_COLOR.value).darker(120).getRgb()
1919
style_dict = {
2020
'QWidget': {
2121
'background-color': 'rgb({0},{1},{2})'.format(

NodeGraphQt/widgets/node_widgets.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setTitle(self, text):
1919
super(_NodeGroupBox, self).setTitle(text)
2020

2121
def setTitleAlign(self, align='center'):
22-
text_color = self.palette().text().color().toTuple()
22+
text_color = self.palette().text().color().getRgb()
2323
style_dict = {
2424
'QGroupBox': {
2525
'background-color': 'rgba(0, 0, 0, 0)',
@@ -322,9 +322,9 @@ class NodeLineEdit(NodeBaseWidget):
322322
def __init__(self, parent=None, name='', label='', text=''):
323323
super(NodeLineEdit, self).__init__(parent, name, label)
324324
plt = self.palette()
325-
bg_color = plt.alternateBase().color().toTuple()
326-
text_color = plt.text().color().toTuple()
327-
text_sel_color = plt.highlightedText().color().toTuple()
325+
bg_color = plt.alternateBase().color().getRgb()
326+
text_color = plt.text().color().getRgb()
327+
text_sel_color = plt.highlightedText().color().getRgb()
328328
style_dict = {
329329
'QLineEdit': {
330330
'background': 'rgba({0},{1},{2},20)'.format(*bg_color),

NodeGraphQt/widgets/tab_search.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def __init__(self, parent=None):
5757
super(TabSearchLineEditWidget, self).__init__(parent)
5858
self.setAttribute(QtCore.Qt.WA_MacShowFocusRect, 0)
5959
self.setMinimumSize(200, 22)
60-
text_color = self.palette().text().color().toTuple()
61-
selected_color = self.palette().highlight().color().toTuple()
60+
text_color = self.palette().text().color().getRgb()
61+
selected_color = self.palette().highlight().color().getRgb()
6262
style_dict = {
6363
'QLineEdit': {
6464
'color': 'rgb({0},{1},{2})'.format(*text_color),
@@ -108,8 +108,8 @@ def __init__(self, node_dict=None):
108108
search_widget.setDefaultWidget(self.line_edit)
109109
self.addAction(search_widget)
110110

111-
text_color = self.palette().text().color().toTuple()
112-
selected_color = self.palette().highlight().color().toTuple()
111+
text_color = self.palette().text().color().getRgb()
112+
selected_color = self.palette().highlight().color().getRgb()
113113
style_dict = {
114114
'QMenu': {
115115
'color': 'rgb({0},{1},{2})'.format(*text_color),

0 commit comments

Comments
 (0)