Skip to main content
`Ctrl`+`K`

# `FrameBrowser`

## API

class HorizontalSliderWithBrowser(parent=None)

  Slider widget combining a `QSlider` and a `FrameBrowser`.

  The data model is an integer within a range.

  The default value is the default `QSlider` value (0), and the default range is the default QSlider range (0 – 99)

  The signal emitted when the value is changed is the usual QAbstractSlider signal `valueChanged`. The signal carries the value (as an integer).

  Parameters:

    parent (QWidget) – Optional parent widget

  lineEdit()

    Returns the line edit provided by this widget.

    Return type:

      qt.QLineEdit

  limitWidget()

    Returns the widget displaying axes limits.

    Return type:

      qt.QLabel

  setMinimum(value)

    Set minimum value

    Parameters:

      value (int) – Minimum value

  setMaximum(value)

    Set maximum value

    Parameters:

      value (int) – Maximum value

  setRange(first, last)

    Set minimum/maximum values

    Parameters:

      - first (int) – Minimum value

      - last (int) – Maximum value

  setValue(value)

    Set value

    Parameters:

      value (int) – value

  value()

    Get selected value

  setFrameRate(value)

    Set the frame rate at which images are displayed

    Parameters:

      value (`int`)

  getFrameRate()

    Get the frame rate at which images are displayed

    Return type:

      `int`

  setPlayImageStep(value)

    Set the step between displayed images when playing

    Parameters:

      value (`int`)

  getPlayImageStep()

    Returns the step between displayed images

    Return type:

      `int`

class FrameBrowser(parent=None, n=None)

  Frame browser widget, with 4 buttons/icons and a line edit to provide a way of selecting a frame index in a stack of images.

  It can be used in more generic case to select an integer within a range.

  Parameters:

    - parent (QWidget) – Parent widget

    - n (int) – Number of frames. This will set the range of frame indices to 0–n-1. If None, the range is initialized to the default QSlider range (0–99).

  lineEdit()

    Returns the line edit provided by this widget.

    Return type:

      qt.QLineEdit

  limitWidget()

    Returns the widget displaying axes limits.

    Return type:

      qt.QLabel

  getRange()

    Returns frame range

    Returns:

      (first_index, last_index)

  setRange(first, last)

    Set minimum and maximum frame indices.

    Initialize the frame index to first. Update the label text to “ limits: first, last”

    Parameters:

      - first (int) – Minimum frame index

      - last (int) – Maximum frame index

  setNFrames(nframes)

    Set minimum=0 and maximum=nframes-1 frame numbers.

    Initialize the frame index to 0. Update the label text to “1 of nframes”

    Parameters:

      nframes (int) – Number of frames

  getValue()

    Return current frame index

  setValue(value)

    Set 0-based frame index

    Value is clipped to current range.

    Parameters:

      value (int) – Frame number