나는 도크 클래스의 메소드를 재정 의하여 분리 할 수있는 능력 드래그 도킹을 해제 할 수 있었다.
독을 드래그하면 다른 위치로 이동합니다. 그래서 나는 모든 '드래그'이벤트 핸들러를 아무 것도 수행하지 않는 메소드 (즉, 아무 작업도하지 않는)로 오버라이드했습니다.
도크의 레이블을 두 번 클릭하면 도크가 분리됩니다. 그래서 나는 도크의 레이블의 두 번 클릭 이벤트 처리기를 아무 작업없이 무효화했습니다.
Dock을 코드에서 MyDock으로 교체하십시오. 업데이트 : DockArea를 계속 드래그 할 수 있었기 때문에 DockArea의 드래그 메서드를 재정의하는 코드를 추가했습니다.
##
# This class is used to eliminate a standard Dock class' ability to detach and
# move (i.e. dragging this Dock will have no effect)
#
class MyDock(Dock):
def __init__(self, name, area=None, size=(10, 10), widget=None, hideTitle=False, autoOrientation=True):
# Initialize the baseclass
#
Dock.__init__(self, name, area, size, widget, hideTitle, autoOrientation)
# Override the label's double click event. Normally double clicking
# the dock's label will cause it to detach into it's own window.
#
self.label.mouseDoubleClickEvent=self.noopEvent
def dragEventEnter(self, ev):
pass
def dragMoveEvent(self, ev):
pass
def dragLeaveEvent(self, ev):
pass
def dragDropEvent(self, ev):
pass
def noopEvent(self,ev):
pass
class MyDockArea(DockArea):
def dragEventEnter(self, ev):
pass
def dragMoveEvent(self, ev):
pass
def dragLeaveEvent(self, ev):
pass
def dragDropEvent(self, ev):
pas
: 여기
코드입니다