Class: QgsFloatingWidget

class qgis.gui.QgsFloatingWidget

Bases: PyQt5.QtWidgets.QWidget

A QWidget subclass for creating widgets which float outside of the normal Qt layout system. Floating widgets use an “anchor widget” to determine how they are anchored within their parent widget.

New in version 3.0.

QgsFloatingWidget(parent: QWidget = None) Constructor for QgsFloatingWidget.

Parameters:

parent

parent widget

Methods

actionEvent

anchorPoint

Returns the floating widget's anchor point, which corresponds to the point on the widget which should remain fixed in the same relative position whenever the widget's parent is resized or moved.

anchorWidget

Returns the widget that the floating widget is "anchored" tto.

anchorWidgetPoint

Returns the anchor widget's anchor point, which corresponds to the point on the anchor widget which the floating widget should "attach" to.

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

param e:

receivers

resizeEvent

param e:

sender

senderSignalIndex

setAnchorPoint

Sets the floating widget's anchor point, which corresponds to the point on the widget which should remain fixed in the same relative position whenever the widget's parent is resized or moved.

setAnchorWidget

Sets the widget to "anchor" the floating widget to.

setAnchorWidgetPoint

Returns the anchor widget's anchor point, which corresponds to the point on the anchor widget which the floating widget should "attach" to.

sharedPainter

showEvent

param e:

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

Signals

anchorPointChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

anchorWidgetChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

anchorWidgetPointChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

Attributes

BottomLeft

BottomMiddle

BottomRight

Middle

MiddleLeft

MiddleRight

TopLeft

TopMiddle

TopRight

class AnchorPoint

Bases: int

baseClass

alias of QgsFloatingWidget

BottomLeft = 6
BottomMiddle = 7
BottomRight = 8
Middle = 4
MiddleLeft = 3
MiddleRight = 5
TopLeft = 0
TopMiddle = 1
TopRight = 2
actionEvent(self, QActionEvent)
anchorPoint(self) QgsFloatingWidget.AnchorPoint

Returns the floating widget’s anchor point, which corresponds to the point on the widget which should remain fixed in the same relative position whenever the widget’s parent is resized or moved.

See also

setAnchorPoint()

Return type:

QgsFloatingWidget.AnchorPoint

anchorPointChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

anchorWidget(self) QWidget

Returns the widget that the floating widget is “anchored” tto. The floating widget will be repositioned whenever the anchor widget moves or is resized so that it maintains the same relative position to the anchor widget.

Return type:

QWidget

anchorWidgetChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

anchorWidgetPoint(self) QgsFloatingWidget.AnchorPoint

Returns the anchor widget’s anchor point, which corresponds to the point on the anchor widget which the floating widget should “attach” to. The floating widget should remain fixed in the same relative position to this anchor widget whenever the widget’s parent is resized or moved.

Return type:

QgsFloatingWidget.AnchorPoint

anchorWidgetPointChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusNextPrevChild(self, bool) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hideEvent(self, QHideEvent)
initPainter(self, QPainter)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int]
paintEvent(self, e: QPaintEvent)
Parameters:

e (QPaintEvent) –

receivers(self, PYQT_SIGNAL) int
resizeEvent(self, e: QResizeEvent)
Parameters:

e (QResizeEvent) –

sender(self) QObject
senderSignalIndex(self) int
setAnchorPoint(self, point: QgsFloatingWidget.AnchorPoint)

Sets the floating widget’s anchor point, which corresponds to the point on the widget which should remain fixed in the same relative position whenever the widget’s parent is resized or moved.

Parameters:

point (QgsFloatingWidget.AnchorPoint) – anchor point

See also

anchorPoint()

setAnchorWidget(self, widget: QWidget)

Sets the widget to “anchor” the floating widget to. The floating widget will be repositioned whenever the anchor widget moves or is resized so that it maintains the same relative position to the anchor widget.

Parameters:

widget (QWidget) – anchor widget. Both the floating widget and the anchor widget must share some common parent.

See also

anchorWidget()

setAnchorWidgetPoint(self, point: QgsFloatingWidget.AnchorPoint)

Returns the anchor widget’s anchor point, which corresponds to the point on the anchor widget which the floating widget should “attach” to. The floating widget should remain fixed in the same relative position to this anchor widget whenever the widget’s parent is resized or moved.

Parameters:

point (QgsFloatingWidget.AnchorPoint) –

sharedPainter(self) QPainter
showEvent(self, e: QShowEvent)
Parameters:

e (QShowEvent) –

tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)