DataViewer

class glue.viewers.common.qt.data_viewer.DataViewer(session, parent=None)[source]

Bases: glue.core.application_base.ViewerBase, PyQt4.QtGui.QMainWindow

Base class for all Qt DataViewer widgets.

This defines a minimal interface, and implemlements the following:

* An automatic call to unregister on window close
* Drag and drop support for adding data

Attributes Summary

LABEL
position
viewer_size
window_title

Methods Summary

addToolBar(tb)
apply_roi(*args, **kwargs) Apply an ROI to the client
close([warn])
closeEvent(event) Call unregister on window close
dragEnterEvent(event) Accept the event if it has data layers
dropEvent(event) Add layers to the viewer if contained in mime data
hide_toolbars() Disable all the toolbars in the viewer.
layer_view()
mdi_wrap() Wrap this object in a GlueMdiSubWindow
mousePressEvent(event) Consume mouse press events, and prevent them from propagating
move([x, y]) Move the viewer to a new XY pixel location
options_widget()
remove_layer(layer)
set_focus(state)
show_toolbars() Re-enable any toolbars that were hidden with hide_toolbars()
unregister(hub) Override to perform cleanup operations when disconnecting from hub
update_window_title()

Attributes Documentation

LABEL = 'Override this'
position
viewer_size
window_title

Methods Documentation

addToolBar(tb)[source]
apply_roi(*args, **kwargs)

Apply an ROI to the client

Parameters:

roi : Roi

The ROI to apply.

close(warn=True)[source]
closeEvent(event)[source]

Call unregister on window close

dragEnterEvent(event)[source]

Accept the event if it has data layers

dropEvent(event)[source]

Add layers to the viewer if contained in mime data

hide_toolbars()[source]

Disable all the toolbars in the viewer.

This action can be reversed by calling show_toolbars()

layer_view()[source]
mdi_wrap()[source]

Wrap this object in a GlueMdiSubWindow

mousePressEvent(event)[source]

Consume mouse press events, and prevent them from propagating down to the MDI area

move(x=None, y=None)[source]

Move the viewer to a new XY pixel location

You can also set the position attribute to a new tuple directly.

Parameters:

x : int (optional)

New x position

y : int (optional)

New y position

options_widget()[source]
remove_layer(layer)[source]
set_focus(state)[source]
show_toolbars()[source]

Re-enable any toolbars that were hidden with hide_toolbars()

Does not re-enable toolbars that were hidden by other means

unregister(hub)[source]

Override to perform cleanup operations when disconnecting from hub

update_window_title()[source]