API#

User Interface#

glue_qt.viewers.common.data_viewer Module#

Classes#

DataViewer(*args, **kwargs)

Base class for all Qt DataViewer widgets.

glue_qt.viewers.common.base_widget Module#

glue_qt.viewers.matplotlib.data_viewer Module#

Classes#

MatplotlibDataViewer(*args, **kwargs)

glue_qt.viewers.matplotlib.toolbar_mode Module#

Classes#

ContrastMode(viewer, **kwargs)

Uses right mouse button drags to set bias and contrast, DS9-style.

ColormapMode([viewer])

A tool to change the colormap used in a viewer.

glue_qt.viewers.common.toolbar Module#

glue_qt.viewers.matplotlib.toolbar Module#

Classes#

MatplotlibTool([viewer])

MatplotlibCheckableTool([viewer])

HomeTool([viewer])

SaveTool([viewer])

PanTool([viewer])

ZoomTool([viewer])

glue_qt.viewers.scatter Package#

Functions#

setup()

Classes#

ScatterViewer(*args, **kwargs)

glue_qt.viewers.profile Package#

Functions#

setup()

Classes#

ProfileViewer(*args, **kwargs)

glue_qt.viewers.image Package#

Functions#

setup()

Classes#

ImageViewer(*args, **kwargs)

glue_qt.viewers.histogram Package#

Functions#

setup()

Classes#

HistogramViewer(*args, **kwargs)

glue_qt.viewers.table Package#

Functions#

setup()

Classes#

TableLayerArtist(table_viewer, viewer_state)

Create a new LayerArtist

TableViewer(*args, **kwargs)

type session:

Session

glue_qt.viewers.custom.custom_viewer Module#

This module provides utilities for creating custom data viewers. The goal of this module is to make it easy for users to make new data viewers by focusing on matplotlib visualization logic, and not UI or event processing logic.

The end user typically interacts with this code via glue.custom_viewer()

Classes#

AttributeWithInfo

An array subclass wrapping a Component of a dataset It is an array with the following additional attributes: id contains the ComponentID or string name of the Component, and categories is an array or None.

ViewerUserState()

Empty object for users to store data inside.

UserDefinedFunction(name)

Descriptor to specify a UserDefinedFunction.

CustomViewer(viewer)

Base class for custom data viewers.

CustomViewerMeta(name, bases, attrs)

Metaclass to construct CustomViewer and subclasses

CustomSubsetState(coordinator, roi)

A SubsetState subclass that uses a CustomViewer's "select" function

CustomViewer(viewer)

Base class for custom data viewers.

CustomLayerArtist(coordinator, *args, **kwargs)

LayerArtist for simple custom viewers that use Matplotlib

CustomMatplotlibDataViewer(*args, **kwargs)

Base Qt widget class for simple custom viewers that use Matplotlib

glue_qt.app.application Module#

Classes#

GlueApplication([data_collection, session])

The main GUI application for the Qt frontend

glue_qt Package#

Functions#

qglue(**kwargs)

Quickly send python variables to Glue for visualization.

Utilities#

glue_qt.utils Package#

Functions#

cmap2pixmap(cmap[, steps, size])

Convert a matplotlib colormap into a QPixmap

combo_as_string(combo)

Return the text labels of a combo box as a string to make it easier to check the content of a combo box in tests.

connect_color(client, prop, widget)

fix_tab_widget_fontsize(tab_widget)

Because of a bug in Qt, tab titles on MacOS X don't have the right font size

get_qapp([icon_path])

get_text([title, default])

Prompt the user to enter text using Qt

load_ui(path[, parent, directory])

Load a .ui file

mpl_to_qt_color(color[, alpha])

Convert a matplotlib color string into a Qt QColor object

pick_class(classes[, sort])

Prompt the user to pick from a list of classes using Qt

pick_item(items, labels[, title, label, default])

Prompt the user to choose an item

process_dialog([delay, accept, reject, function])

Context manager to automatically capture the active dialog and carry out certain actions.

process_events([wait])

qt_to_mpl_color(qcolor)

Convert a QColor object into a string that matplotlib understands

qurl_to_path(url)

Convert a local QUrl to a normal path

set_cursor(shape)

Set the Qt cursor for the duration of a function call, and unset

set_cursor_cm(shape)

Context manager equivalent for set_cursor().

tint_pixmap(bm, color)

Re-color a monochrome pixmap object using color

update_combobox(combo, labeldata[, ...])

Redefine the items in a QComboBox

update_global_font_size()

Updates the global font size through the current UI backend

Classes#

CenteredDialog

A dialog that is centered on the screen.

ColorProperty(att[, docstring])

CompletionTextEdit(parent, parent)

GlueItemWidget([parent])

A mixin for QtWidgets.QListWidget/GlueTreeWidget subclasses, that provides drag+drop functionality.

GlueTabBar([parent])

HtmlItemDelegate

An item delegate that can be used for e.g.

PyMimeData([instance])

A custom MimeData object that stores live python objects

PythonListModel(items[, parent])

A Qt Model that wraps a python list, and exposes a list-like interface

QColormapCombo([parent])

die_on_error(msg)

messagebox_on_error(msg[, sep, exit])

glue_qt.utils.widget_properties Module#

The classes in this module provide a property-like interface to widget instance variables in a class. These properties translate essential pieces of widget state into more convenient python objects (for example, the check state of a button to a bool).

Example Use:

class Foo(object):
    bar = ButtonProperty('_button')

    def __init__(self):
        self._button = QtWidgets.QCheckBox()

f = Foo()
f.bar = True  # equivalent to f._button.setChecked(True)
assert f.bar == True

Classes#

WidgetProperty(att[, docstring])

Base class for widget properties

CurrentComboDataProperty(att[, docstring])

Wrapper around the data in QComboBox.

CurrentComboTextProperty(att[, docstring])

Wrapper around the text in QComboBox.

CurrentTabProperty(att[, docstring])

Wrapper around QTabWidget.

TextProperty(att[, docstring])

Wrapper around the text() and setText() methods for QLabel etc

ButtonProperty(att[, docstring])

Wrapper around the check state for QAbstractButton widgets

FloatLineProperty(att[, docstring])

Wrapper around the text state for QLineEdit widgets.

ValueProperty(att[, docstring, value_range, log])

Wrapper around widgets with value() and setValue()

Configuration#

glue_qt.config Module#

Classes#

QtClientRegistry()

Stores QT widgets to visualize data.

LayerActionRegistry()

Stores custom menu actions available when the user select one or more datasets, subset group, or subset in the data collection view.

PreferencePanesRegistry()

Stores preference panes

StartupActionRegistry()

QtFixedLayoutTabRegistry()

Stores Qt pre-defined tabs (non-MDI)

KeyboardShortcut()

Stores keyboard shortcuts.