napari_bigfish.qtutil module

class napari_bigfish.qtutil.TableView(data, *args)[source]

Bases: PyQt5.QtWidgets.QTableWidget

A table that allows to copy the selected cells to the system-clipboard.

copyDataToClipboard()[source]

Copy the data in the selected table-cells into the system clipboard.

getSelectedDataAsString()[source]

Get the data in the selected cells as a string. Columns are separated by tabs and lines by newlines”.

keyPressEvent(event)[source]

Copy the selected table data to the system clipboard if the key-event is ctrl+C.

Parameters

event – The received key-pressed event.

class napari_bigfish.qtutil.WidgetTool[source]

Bases: object

Utility methods for working with qt-widgets.

static getComboInput(parent, labelText, values)[source]

Returns a label displaying the given text and a combo-box with the given values.

Parameters
  • parent – The parent widget of the label and the input field

  • labelText – The text of the label

  • values – The values in the list of the combo-box

Returns

A tupel of the label and the input field

Return type

(QLabel, QComboBox)

static getLineInput(parent, labelText, defaultValue, fieldWidth, callback)[source]

Returns a label displaying the given text and an input field with the given default value.

Parameters
  • parent – The parent widget of the label and the input field

  • labelText – The text of the label

  • defaultValue – The value initailly displayed in the input field

  • fieldWidth – The width of the input field

  • callback – A callback function with a parameter text. The function is called with the new text when the content of the input field changes

Returns

A tupel of the label and the input field

Return type

(QLabel, QLineEdit)

static replaceItemsInComboBox(comboBox, newItems)[source]

Replace the items in the combo-box with newItems

Parameters
  • comboBox – The combo-box in which the items will be replaced

  • newItems – The new items that will replace the current items in the combo-box.