Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid double __init__ of DockDrop #2286

Merged
merged 1 commit into from May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions pyqtgraph/dockarea/Dock.py
@@ -1,6 +1,6 @@
import warnings

from ..Qt import QtCore, QtGui, QtWidgets
from ..Qt import QT_LIB, QtCore, QtGui, QtWidgets
from ..widgets.VerticalLabel import VerticalLabel
from .DockDrop import DockDrop

Expand All @@ -11,8 +11,12 @@ class Dock(QtWidgets.QWidget, DockDrop):
sigClosed = QtCore.Signal(object)

def __init__(self, name, area=None, size=(10, 10), widget=None, hideTitle=False, autoOrientation=True, label=None, **kargs):
QtWidgets.QWidget.__init__(self)
DockDrop.__init__(self)
allowedAreas = None
if QT_LIB.startswith('PyQt'):
QtWidgets.QWidget.__init__(self, allowedAreas=allowedAreas)
else:
QtWidgets.QWidget.__init__(self)
DockDrop.__init__(self, allowedAreas=allowedAreas)
self._container = None
self._name = name
self.area = area
Expand Down
10 changes: 7 additions & 3 deletions pyqtgraph/dockarea/DockArea.py
@@ -1,6 +1,6 @@
import weakref

from ..Qt import QtWidgets
from ..Qt import QT_LIB, QtWidgets
from .Container import Container, HContainer, TContainer, VContainer
from .Dock import Dock
from .DockDrop import DockDrop
Expand All @@ -9,8 +9,12 @@
class DockArea(Container, QtWidgets.QWidget, DockDrop):
def __init__(self, parent=None, temporary=False, home=None):
Container.__init__(self, self)
QtWidgets.QWidget.__init__(self, parent=parent)
DockDrop.__init__(self, allowedAreas=['left', 'right', 'top', 'bottom'])
allowedAreas=['left', 'right', 'top', 'bottom']
if QT_LIB.startswith('PyQt'):
QtWidgets.QWidget.__init__(self, parent=parent, allowedAreas=allowedAreas)
else:
QtWidgets.QWidget.__init__(self, parent=parent)
DockDrop.__init__(self, allowedAreas=allowedAreas)
self.layout = QtWidgets.QVBoxLayout()
self.layout.setContentsMargins(0,0,0,0)
self.layout.setSpacing(0)
Expand Down