Table

GalleryView

class datavis.views.GalleryView(model, **kwargs)

The GalleryView class provides some functionality for show large numbers of items with simple paginate elements in gallery view.

__init__(model, **kwargs)

Constructs an GalleryView.

Parameters

modelTableModel instance that will be used to fetch the data.

Keyword Arguments
  • parent – The parent widget

  • displayConfigTableConfig instance TableConfig TableModel that will control how the data fetched from the TableModel will be displayed. displayConfig can be None, in which case createDefaultConfig method will be called and taken as displayConfig.

  • selectionMode – (int) SINGLE_SELECTION(default), EXTENDED_SELECTION, MULTI_SELECTION or NO_SELECTION

  • cellSpacing – (int) The cell spacing

  • iconSize – (tuple) The icon size (width, height). Default value: (100, 100)

changeSelection(selection)

Invoked when the selection is changed. Sets the given selection as the current and updates the view

clear()

Clear the view, setting an empty table model

getCurrentRow()

Returns the current selected row

getDisplayConfig()

Returns the display configuration

getImageItemDelegate()

Return the ImageItemDelegate

getModel()

Returns the current model

getModelColumn()

Returns the column in the model that is visible

getPreferredSize()

Returns a tuple (width, height), which represents the preferred dimensions to contain all the data.

getViewDims()

Returns a tuple (rows, columns) with the data size

getViewType()

Returns the view type

modelChanged()

Slot for model data changed notification. Informs about external changes to the data model. Updates the view.

resetView()

Reset the internal state of the view.

selectRow(row)

Selects the given row. Change the current page to the page of the given row.

setIconSize(size)

Sets the icon size.

Parameters

size – (width, height), QSize or int in % units

setImageItemDelegate(delegate)

Set the ImageItemDelegate, responsible for rendering each cell

setModel(model, displayConfig=None, minMax=None)

Sets the model for this view.

Parameters
  • model – TableModel <datavis.models.TableModel> instance

  • displayConfigTableConfig instance that will control how the data fetched from the TableModel will be displayed.

Raises

Exception if the model is None

setModelColumn(column)

Holds the column in the model that is visible. :param column: (int) Column index. 0 is the first index.

setSelectionBehavior(selectionBehavior)

This property holds which selection behavior the view uses. This property holds whether selections are done in terms of single items, rows or columns.

Possible values:

SELECT_ITEMS, SELECT_ROWS, SELECT_COLUMNS

setSelectionMode(selectionMode)

Indicates how the view responds to user selections: SINGLE_SELECTION, EXTENDED_SELECTION, MULTI_SELECTION

ColumnsView

class datavis.views.ColumnsView(model, **kwargs)

The ColumnsView class provides some functionality for show large numbers of items with simple paginate elements in columns view.

__init__(model, **kwargs)

Creates a ColumnsView object.

Parameters

modelTableModel instance that will be used to fetch the data.

Keyword Arguments
  • parent – Parent widget

  • displayConfigTableConfig instance that will control how the data fetched from the TableModel will be displayed. displayConfig can be None, in which case createDefaultConfig method will be called and taken as displayConfig.

  • selectionMode – (int) SINGLE_SELECTION(default), EXTENDED_SELECTION, MULTI_SELECTION or NO_SELECTION

changeSelection(selection)

Invoked when the selection is changed. Sets the given selection as the current and updates the view

clear()

Clear the view setting an empty table model

getColumnWidth(column)

Returns the width for the given column.

Parameters

column – (int) The column index. First index is 0.

getCurrentRow()

Returns the current selected row

getDisplayConfig()

Returns the display configuration

getHeaderSize(columnIndex=None)

Returns the header size in pixels for the given column. If columnIndex is None, then returns the entire header size. 0 is the first index.

getHorizontalHeader()

Returns the table view’s horizontal header.

getPageSize()

Return the number of elements for page

getPreferredSize()

Returns a tuple (width, height), which represents the preferred dimensions to contain all the data.

getViewDims()

Returns a tuple (rows, columns) with the data size

getViewType()

Returns the view type

modelChanged()

Slot for model data changed notification. Informs about external changes to the data model. Updates the view.

resetView()

Reset the internal state of the view.

resizeColumnToContents(col=-1)

Resizes the given column based on the size hints of the delegate used to render each item in the row.

selectRow(row)

Selects the given row. Change the current page to the page of the given row.

setColumnWidth(column, width)

Sets the width for the given column.

Parameters
  • column – (int) The column index. First index is 0.

  • width – (int) The column width

setIconSize(size)

Sets the icon size for renderable columns.

Parameters

size – (width, height) or QSize

setModel(model, displayConfig=None)

Sets the model for this view.

Parameters
  • model – TableModel <datavis.models.TableModel> instance

  • displayConfigTableConfig instance that will control how the data fetched from the TableModel will be displayed.

Raises

Exception if the model is None

setRowHeight(height)

Sets the height for all rows

Parameters

height – (int) The row height in pixels

setSelectionBehavior(selectionBehavior)

This property holds which selection behavior the view uses. Holds whether selections are done in terms of single items, rows or columns.

Possible values:

SELECT_ITEMS, SELECT_ROWS, SELECT_COLUMNS

setSelectionMode(selectionMode)

Indicates how the view responds to user selections: SINGLE_SELECTION, EXTENDED_SELECTION, MULTI_SELECTION

setupColumnsWidth()

Setups the width for all columns in the view. Resizes all columns according to the content

setupVisibleColumns()

Hide the columns with visible property=False and show the columns with visible property=True

updatePage()

Updates the visualization of the current page

updateViewConfiguration()

Reimplementing from PagingView. Updates the columns configuration. Causes the visual update of the view

ItemsView

class datavis.views.ItemsView(model, **kwargs)

The Items class provides functionality for show large numbers of items with simple paginate elements in items view

__init__(model, **kwargs)

Constructs an ItemsView

Parameters

modelTableModel instance that will be used to fetch the data.

Keyword Arguments
  • parent – The parent widget

  • displayConfig – Input TableConfig instance TableConfig TableModel that will control how the data fetched from the TableModel will be displayed. displayConfig can be None, in which case createDefaultConfig method will be called and taken as displayConfig.

  • selectionMode – (int) SINGLE_SELECTION(default), EXTENDED_SELECTION, MULTI_SELECTION or NO_SELECTION

  • imageViewKwargsImageView initialization parameters.

changeSelection(selection)

Invoked when the selection is changed. Sets the given selection as the current and updates the view

clear()

Clear the view setting an empty table model

currentRow()

Returns the current selected row

getDisplayConfig()

Returns the display configuration

getPreferredSize()

Returns a tuple (width, height), which represents the preferred dimensions to contain all the data

getViewDims()

Returns a tuple (rows, columns) with the data size

getViewType()

Returns the view type

modelChanged()

Slot for model data changed notification. Informs about external changes to the data model. Updates the view.

selectRow(row)

Selects the given row. Change the current page to the page of the given row.

setModel(model, displayConfig=None)

Sets the model for this view.

Parameters
  • model – TableModel <datavis.models.TableModel> instance

  • displayConfigTableConfig instance that will control how the data fetched from the TableModel will be displayed.

Raises

Exception if the model is None

setModelColumn(column)

Holds the column in the model that is visible.

Parameters

column – (int) Column index. 0 is the first index.

sigCurrentRowChanged

Signal for size changed

updateViewConfiguration()

Reimplemented from PagingView. Show or hide the Image Area depending of renderable columns

DataView

class datavis.views.DataView(model, **kwargs)

Widget used for display large numbers of items in three basic view types: COLUMNS, GALLERY and ITEMS

__init__(model, **kwargs)

Constructs a DataView. :param model: TableModel

instance

Keyword Arguments
  • parent – The parent widget

  • selectionMode – (int) SINGLE_SELECTION(default),EXTENDED_SELECTION, MULTI_SELECTION or NO_SELECTION

  • views – (dict) Specify the views that will be available. Default: {COLUMNS: {}, GALLERY: {}, ITEMS: {}}

  • view – (int) The default view to be set

  • size – (int) The row height for ColumnsView and icon size for GalleryView. Default value: 64

  • maxCellSize – (int) The maximum value for row height in ColumnsView and icon size in GalleryView. Default value: 300

  • minCellSize – (int) The minimum value for row height in ColumnsView and icon size in GalleryView. Default value: 20

getAllViews()

Returns a list with the current view widgets

getAvailableViews()

Return the available views

getCurrentRow()

Returns the current row

getModel()

Return the current TableModel

getPage()

Return the current page for current view or -1 if current table model is None

getPageCount()

Return the page count for the current view or -1 if current model is None

getPreferredSize()

Returns a tuple (width, height), which represents the preferred dimensions to contain all the data.

getSelectedViewMode()

Return the selected mode. Possible values are: COLUMNS, GALLERY, ITEMS

getView(viewType=None)

If the given viewType is present in the available views then return the view. if viewType=None then return the current view. viewType that can be used: COLUMNS, GALLERY, ITEMS

getViewKey()

Returns the current view type

hasView(viewKey)

Return True if the given viewKey is present in the DataView.

selectRow(row)

Sets the given row as the current row for all views. Change the current page to the page of the given row. 0 will be considered as the first row.

setModel(model, config=None)

Set the table model for display.

Parameters
  • modelTableModel instance

  • will be used to fetch the data. (that) –

  • configTableConfig instance that will control how the data fetched from the TableModel will be displayed. config can be None, in which case createDefaultConfig method will be called and taken as config.

setPage(page)

Change the current view to the given page

setSelectionBehavior(selectionBehavior)

This property holds which selection behavior the view uses. This property holds whether selections are done in terms of single items, rows or columns.

Possible values: SELECT_ITEMS, SELECT_ROWS, SELECT_COLUMNS

setSelectionMode(selectionMode)

Indicates how the view responds to user selections: SINGLE_SELECTION, EXTENDED_SELECTION, MULTI_SELECTION.

setSortRole(role)

Set the item role that is used to query the source model’s data when sorting items :param role: Possible values: Qt.DisplayRole, Qt.DecorationRole, :param Qt.EditRole, Qt.ToolTipRole, Qt.StatusTipRole, Qt.WhatsThisRole,: :param Qt.SizeHintRole:

setView(viewKey)

Sets view as current view

showPageBar(visible)

Show or hide the page bar

showStatusBar(visible)

Show or hide the status bar

showToolBar(visible)

Show or hide the toolbar

sigCurrentItemChanged

This signal is emitted when the current table is changed

sigCurrentTableChanged

This signal is emitted when the current row is changed