Components

Very basic components used by other widgets.

These are relatively sparsely documented because their operation is mostly self-explanatory

Classes:

DoubleSlider([decimals])

Slider capable of representing floats

KeyPressHandler

Custom key press handler https://gist.github.com/mfessenden/baa2b87b8addb0b60e54a11c1da48046

EditableLabel([parent])

Editable label https://gist.github.com/mfessenden/baa2b87b8addb0b60e54a11c1da48046

QHLine([parent, color])

with respct to https://stackoverflow.com/a/51057516

QVLine([parent, color])

OnOffButton([state_labels, toggled])

Simple extension of toggle button with styling for clearer 'ON' vs 'OFF'

class pvp.gui.widgets.components.DoubleSlider(decimals=1, *args, **kargs)[source]

Slider capable of representing floats

Ripped off from and https://stackoverflow.com/a/50300848 ,

Thank you!!!

Attributes:

doubleValueChanged(*args, **kwargs)

staticMetaObject

Methods:

setDecimals(decimals)

emitDoubleValueChanged()

value()

setMinimum(value)

setMaximum(value)

minimum()

_minimum()

maximum()

_maximum()

setSingleStep(value)

singleStep()

_singleStep()

setValue(value)

doubleValueChanged(*args, **kwargs) = <PySide2.QtCore.Signal object>
setDecimals(decimals)[source]
emitDoubleValueChanged()[source]
value()[source]
setMinimum(value)[source]
setMaximum(value)[source]
minimum()[source]
_minimum()[source]
maximum()[source]
_maximum()[source]
setSingleStep(value)[source]
singleStep()[source]
_singleStep()[source]
setValue(value)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class pvp.gui.widgets.components.KeyPressHandler[source]

Custom key press handler https://gist.github.com/mfessenden/baa2b87b8addb0b60e54a11c1da48046

Attributes:

escapePressed(*args, **kwargs)

returnPressed(*args, **kwargs)

staticMetaObject

Methods:

eventFilter(obj, event)

escapePressed(*args, **kwargs) = <PySide2.QtCore.Signal object>
returnPressed(*args, **kwargs) = <PySide2.QtCore.Signal object>
eventFilter(obj, event)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class pvp.gui.widgets.components.EditableLabel(parent=None, **kwargs)[source]

Editable label https://gist.github.com/mfessenden/baa2b87b8addb0b60e54a11c1da48046

Attributes:

textChanged(*args, **kwargs)

staticMetaObject

Methods:

create_signals()

text()

Standard QLabel text getter

setText(text)

Standard QLabel text setter

labelPressedEvent(event)

Set editable if the left mouse button is clicked

setLabelEditableAction()

Action to make the widget editable

setEditable(editable)

labelUpdatedAction()

Indicates the widget text has been updated

returnPressedAction()

Return/enter event handler

escapePressedAction()

Escape event handler

textChanged(*args, **kwargs) = <PySide2.QtCore.Signal object>
create_signals()[source]
text()[source]

Standard QLabel text getter

setText(text)[source]

Standard QLabel text setter

labelPressedEvent(event)[source]

Set editable if the left mouse button is clicked

setLabelEditableAction()[source]

Action to make the widget editable

setEditable(editable: bool)[source]
labelUpdatedAction()[source]

Indicates the widget text has been updated

returnPressedAction()[source]

Return/enter event handler

escapePressedAction()[source]

Escape event handler

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class pvp.gui.widgets.components.QHLine(parent=None, color='#FFFFFF')[source]

with respct to https://stackoverflow.com/a/51057516

Methods:

setColor(color)

Attributes:

staticMetaObject

setColor(color)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class pvp.gui.widgets.components.QVLine(parent=None, color='#FFFFFF')[source]

Methods:

setColor(color)

Attributes:

staticMetaObject

setColor(color)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class pvp.gui.widgets.components.OnOffButton(state_labels: Tuple[str, str] = ('ON', 'OFF'), toggled: bool = False, *args, **kwargs)[source]

Simple extension of toggle button with styling for clearer ‘ON’ vs ‘OFF’

Parameters
  • state_labels (tuple) – tuple of strings to set when toggled and untoggled

  • toggled (bool) – initialize the button as toggled

  • *args – passed to QPushButton

  • **kwargs – passed to QPushButton

Methods:

__init__([state_labels, toggled])

param state_labels

tuple of strings to set when toggled and untoggled

set_state(state)

Attributes:

staticMetaObject

__init__(state_labels: Tuple[str, str] = ('ON', 'OFF'), toggled: bool = False, *args, **kwargs)[source]
Parameters
  • state_labels (tuple) – tuple of strings to set when toggled and untoggled

  • toggled (bool) – initialize the button as toggled

  • *args – passed to QPushButton

  • **kwargs – passed to QPushButton

set_state(state: bool)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>