Skip to content

Commit

Permalink
Prevent init methods of our abstract classes from being run twice (nbt
Browse files Browse the repository at this point in the history
  • Loading branch information
joepal1976 committed Mar 7, 2018
1 parent a5b4e3f commit 9e334c4
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions makehuman/lib/qtgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def onTabSelected(self, event):
class Tabs(QtWidgets.QTabWidget, TabsBase):
def __init__(self, parent = None):
QtWidgets.QTabWidget.__init__(self, parent)
TabsBase.__init__(self)
#TabsBase.__init__(self)

def _makeTab(self, tab, idx=None):
tab.child = TabBar(self)
Expand All @@ -177,7 +177,7 @@ def tabChanged(self, idx):
class TabBar(QtWidgets.QTabBar, TabsBase):
def __init__(self, parent = None):
QtWidgets.QTabBar.__init__(self, parent)
TabsBase.__init__(self)
#TabsBase.__init__(self)
self.setDrawBase(False)

def tabBar(self):
Expand All @@ -198,7 +198,7 @@ class GroupBox(QtWidgets.QGroupBox, Widget):
def __init__(self, label = ''):
label = getLanguageString(label) if label else ''
QtWidgets.QGroupBox.__init__(self, label)
Widget.__init__(self)
#Widget.__init__(self)
self.layout = QtWidgets.QGridLayout(self)

def __str__(self):
Expand Down Expand Up @@ -333,7 +333,7 @@ def _getImage(cls, path):

def __init__(self, value=0.0, min=0.0, max=1.0, label=None, vertical=False, valueConverter=None, image=None, scale=1000):
super(Slider, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)
self.text = getLanguageString(label) or ''
self.valueConverter = valueConverter

Expand Down Expand Up @@ -557,13 +557,13 @@ class Button(QtWidgets.QPushButton, ButtonBase):
def __init__(self, label=None, selected=False):
label = getLanguageString(label)
super(Button, self).__init__(label)
ButtonBase.__init__(self)
#ButtonBase.__init__(self)

class CheckBox(QtWidgets.QCheckBox, ButtonBase):
def __init__(self, label=None, selected=False):
label = getLanguageString(label)
super(CheckBox, self).__init__(label)
ButtonBase.__init__(self)
#ButtonBase.__init__(self)
self.setChecked(selected)

class RadioButton(QtWidgets.QRadioButton, ButtonBase):
Expand All @@ -572,7 +572,7 @@ class RadioButton(QtWidgets.QRadioButton, ButtonBase):
def __init__(self, group, label=None, selected=False):
label = getLanguageString(label)
super(RadioButton, self).__init__(label)
ButtonBase.__init__(self)
#ButtonBase.__init__(self)
self.group = group
self.group.append(self)
self.setChecked(selected)
Expand Down Expand Up @@ -689,7 +689,7 @@ def _clicked(self):
class ListView(QtWidgets.QListWidget, Widget):
def __init__(self):
super(ListView, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)
self._vertical_scrolling = True
self.itemActivated[QtWidgets.QListWidgetItem].connect(self._activate)
self.itemClicked[QtWidgets.QListWidgetItem].connect(self._clicked)
Expand Down Expand Up @@ -815,7 +815,7 @@ class TextView(QtWidgets.QLabel, Widget):
def __init__(self, label = ''):
label = getLanguageString(label)
super(TextView, self).__init__(label)
Widget.__init__(self)
#Widget.__init__(self)

def setText(self, text):
text = getLanguageString(text)
Expand All @@ -840,7 +840,7 @@ def filenameValidator(text):
class TextEdit(QtWidgets.QLineEdit, Widget):
def __init__(self, text='', validator = None):
super(TextEdit, self).__init__(text)
Widget.__init__(self)
#Widget.__init__(self)
self.setValidator(validator)
self.textEdited['QString'].connect(self._textChanged)
self.returnPressed.connect(self._enter)
Expand Down Expand Up @@ -937,7 +937,7 @@ class DocumentEdit(QtWidgets.QTextEdit, Widget):

def __init__(self, text=''):
super(DocumentEdit, self).__init__(text)
Widget.__init__(self)
#Widget.__init__(self)
self.setAcceptRichText(False)

@property
Expand All @@ -957,7 +957,7 @@ def getText(self):
class ProgressBar(QtWidgets.QProgressBar, Widget):
def __init__(self, visible=True):
super(ProgressBar, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)
self.setVisible(visible)

def setProgress(self, progress):
Expand Down Expand Up @@ -1060,7 +1060,7 @@ def onChanged(self, shortcut):
class StackedBox(QtWidgets.QStackedWidget, Widget):
def __init__(self):
super(StackedBox, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)
self.layout().setAlignment(QtCore.Qt.AlignTop)
self.autoResize = False
self.currentChanged[int].connect(self.widgetChanged)
Expand Down Expand Up @@ -1348,7 +1348,7 @@ def __init__(self, buttonLabel, mode='open'):
"""

super(FileEntryView, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)

# Declare data

Expand Down Expand Up @@ -1556,7 +1556,7 @@ def drawContents(self, painter):
class StatusBar(QtWidgets.QStatusBar, Widget):
def __init__(self):
super(StatusBar, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)
self._perm = QtWidgets.QLabel()
self.addWidget(self._perm, 1)
self.duration = 2000
Expand Down Expand Up @@ -1713,7 +1713,7 @@ def setPosition(self, value):
class VScrollArea(QtWidgets.QWidget, Widget):
def __init__(self):
super(VScrollArea, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)

self._viewport = Viewport()
self._scrollbar = QtWidgets.QScrollBar(QtCore.Qt.Vertical)
Expand Down Expand Up @@ -1803,7 +1803,7 @@ class TreeView(QtWidgets.QTreeWidget, Widget):

def __init__(self, parent = None):
super(TreeView, self).__init__(parent)
Widget.__init__(self)
#Widget.__init__(self)
self.itemActivated[QtWidgets.QTreeWidgetItem, int].connect(self._activate)
self.itemExpanded[QtWidgets.QTreeWidgetItem].connect(self._expand)
if TreeView._dirIcon is None:
Expand All @@ -1827,7 +1827,7 @@ def _expand(self, item):
class SpinBox(QtWidgets.QSpinBox, Widget):
def __init__(self, value, parent = None):
super(SpinBox, self).__init__(parent)
Widget.__init__(self)
#Widget.__init__(self)
self.setRange(0, 99999)
self.setValue(value)
self.valueChanged[int].connect(self._changed)
Expand Down Expand Up @@ -2079,7 +2079,7 @@ def text(self):
class TableView(QtWidgets.QTableWidget, Widget):
def __init__(self):
super(TableView, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)

def setItem(self, row, col, text, data = None):
item = TableItem(text)
Expand All @@ -2093,7 +2093,7 @@ def getItemData(self, row, col):
class ImageView(QtWidgets.QLabel, QtWidgets.QScrollArea, Widget):
def __init__(self):
super(ImageView, self).__init__()
Widget.__init__(self)
#Widget.__init__(self)
self.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop)
self.setMinimumSize(50,50)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Preferred)
Expand Down Expand Up @@ -2152,7 +2152,7 @@ def save(self, fname):
class ZoomableImageView(QtWidgets.QScrollArea, Widget):
def __init__(self):
QtWidgets.QScrollArea.__init__(self)
Widget.__init__(self)
#Widget.__init__(self)
self.imageLabel = QtWidgets.QLabel()
self.imageLabel.setBackgroundRole(QtGui.QPalette.Base)
self.imageLabel.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop)
Expand Down

0 comments on commit 9e334c4

Please sign in to comment.