Package client :: Package Dock :: Module Widget :: Class DockWidget
[hide private]
[frames] | no frames]

Class DockWidget

source code


This class provides an interface for DockWidgets in an effort to make their appearance consistent.

Overview

This is the only class within the DockWidget submodule. It provides an interface for all Dock Widgets with default implementations. The private methods provided all create different sections of the layout. They are intended to give a consistent feel to all Dock Widgets. Currently there are two categories of private methods for this class:

Implemented

These methods will have a default behavior that will generally assume that the instance of DockWidget (or any inherited classes) has certain private variables instantiated. If such private variables are not found, then a blank implementation is assumed. These methods are not intended to be overridden as they provide a common feel among all Dock Widgets. See specific private methods for what variables they require.

Unimplemented

These methods are unimplemented for one of two reasons:

  1. They were optional sections
  2. They are meant to be very specific for the particular Dock Widget

That being said, you never have to implement them, in which case the space they would have taken will be filled by the other sections.

Important

These private methods are for internal use only. You should only ever override their implementations, never explicity call them. They are called in the constructor once for a reason.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
__init__(self, parent, bridge)
This constructor for a DockWidget will create a consistent look and feel for the entire DockWidget.
source code
 
_addCommands(self)
The purpose of this method is to create a consistent look and feel for a DockWidget's command buttons.
source code
 
_addDataSelection(self)
The purpose of the method is to create a place for any DockWidget to place the guts of the function.
source code
 
_addDescription(self)
This method provides the DockWidget with a consistent look for the function description
source code
 
_addHeader(self)
This method provides the DockWidget a consistent look for a header.
source code
 
_addModes(self)
The purpose of this method is to create a consistent look and feel for DockWidgets who need modes.
source code
 
_addOptions(self)
The purpose of this method is to create a consistent look and feel for options contained in DockWidgets.
source code

Inherited from PyQt4.QtGui.QWidget: acceptDrops, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childEvent, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, connectNotify, contentsRect, contextMenuEvent, contextMenuPolicy, create, cursor, customEvent, destroy, devType, disconnectNotify, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, enabledChange, ensurePolished, enterEvent, event, find, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontChange, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabShortcut, handle, hasFocus, hasMouseTracking, height, heightForWidth, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isEnabledToTLW, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isTopLevel, isVisible, isVisibleTo, isWindow, isWindowModified, keyPressEvent, keyReleaseEvent, keyboardGrabber, languageChange, layout, layoutDirection, leaveEvent, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, moveEvent, nextInFocusChain, normalGeometry, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, palette, paletteChange, parentWidget, pos, raise_, receivers, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, repaint, resetInputContext, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, sender, setAcceptDrops, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setMask, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setShortcutAutoRepeat, setShortcutEnabled, setShown, setSizeIncrement, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, timerEvent, toolTip, topLevelWidget, underMouse, unsetCursor, unsetLayoutDirection, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, winId, window, windowActivationChange, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, x, x11Info, x11PictureHandle, y

Inherited from PyQt4.QtCore.QObject: blockSignals, children, connect, deleteLater, disconnect, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setProperty, signalsBlocked, startTimer, thread, tr, trUtf8

Inherited from PyQt4.QtGui.QPaintDevice: depth, heightMM, logicalDpiX, logicalDpiY, numColors, paintingActive, physicalDpiX, physicalDpiY, widthMM

Inherited from sip.wrapper: __delattr__, __getattribute__, __new__, __setattr__

Inherited from object: __hash__, __reduce__, __reduce_ex__, __repr__, __str__

Class Variables [hide private]

Inherited from PyQt4.QtGui.QPaintDevice: PdmDepth, PdmDpiX, PdmDpiY, PdmHeight, PdmHeightMM, PdmNumColors, PdmPhysicalDpiX, PdmPhysicalDpiY, PdmWidth, PdmWidthMM

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, bridge)
(Constructor)

source code 

This constructor for a DockWidget will create a consistent look and feel for the entire DockWidget.

The constructor will create the following sections of a DockWidget based on

  1. Pre-existing Private Variables
  2. Reimplementation of _add* methods

These are the sections of a DockWidget. Please note that they are all optional, and if you don't want them to appear, overload the corresponding _add* methods to return None.

  • Header
  • Description
  • Commands
  • Modes
  • Options
  • Data Selection
Overrides: object.__init__

_addCommands(self)

source code 

The purpose of this method is to create a consistent look and feel for a DockWidget's command buttons.

Overview

This method has no default implementation since the commands vary between DockWidgets. While you are able to put anything into this reimplementation, it is recommended that it remains consistent with the rest of the Basin Client. Generally speaking, commands are buttons that will execute the function belonging to the DockWidget. Please note that this simply sets up the buttons and their actions, it does not perform the action of the commands.

Returns:
This function may return 1 of 2 things:
  1. QWidget
  2. None

_addDataSelection(self)

source code 

The purpose of the method is to create a place for any DockWidget to place the guts of the function.

Overview

This method has no default implementation since it would be unique for any DockWidget. There is no real default layout for any function's data selection. Bearing that in mind, this is the place where the actual data that the function intends to utilize should go. Utilize the Holders submodule for this.

Returns:
This function may return 1 of 2 things:
  1. QWidget
  2. None

_addDescription(self)

source code 

This method provides the DockWidget with a consistent look for the function description

Overview

This method will provide a description for the DockWidget contingent on it finding the single required variable. In the event that the variable is not found, the constructor calling the method will ignore making a description.

Pre-existing Private Variable

  • self._description = string (verbose description of the function)
Returns:
This function may return 1 of 2 things:
  1. QWidget
  2. None

_addHeader(self)

source code 

This method provides the DockWidget a consistent look for a header.

Overview

This method will provide the consistent header of a DockWidget. If any of the three required variables do not appear, the constructor will ignore making the header.

Pre-existing Private Variables

  • self._displayIcon = QIcon (icon of the function)
  • self._displayName = string (name of the function)
  • self._type = string (name of the package)
Returns:
This function may return 1 of 2 things:
  1. QLayout
  2. None

_addModes(self)

source code 

The purpose of this method is to create a consistent look and feel for DockWidgets who need modes.

Overview

This method has no default implementation since not all DockWidgets will require a mode. While you are able to put anything into the reimplementation of this method, it is recommended that they remain consistent with the rest of the Basin Client. Generally speaking, modes are drawn up as a horizontal layout of QRadioButtons. Again, while not required, the point of the modes is to swap out the Data Selection for a different mode.

Returns:
This function may return 1 of 2 things:
  1. QWidget
  2. None

_addOptions(self)

source code 

The purpose of this method is to create a consistent look and feel for options contained in DockWidgets.

Overview

This method has no default implementation since not all DockWidgets will require options. While you are able to put anything into the reimplementation of this method, it is recommended that tehy remain consistent wit hthe rest of the Basin Client. Generally speaking, options are drawn up as a vertical layout of QCheckBoxes. Options are considered to be minor changes to the overall purpose of the function.

Returns:
This function may return 1 of 2 things:
  1. QWidget
  2. None