Package Camelot :: Package camelot :: Package view :: Package controls :: Module tableview :: Class TableView
[frames] | no frames]

Class TableView

source code


A generic tableview widget that puts together some other widgets.  The behaviour of this class and
the resulting interface can be tuned by specifying specific class attributes which define the underlying
widgets used ::

  class MovieRentalTableView(TableView):
    title_format = 'Grand overview of recent movie rentals'

The attributes that can be specified are :

.. attribute:: header_widget

The widget class to be used as a header in the table view::
 
  header_widget = HeaderWidget
  
.. attribute:: table_widget

The widget class used to display a table within the table view ::

table_widget = TableWidget

.. attribute:: title_format

A string used to format the title of the view ::

title_format = '%(verbose_name_plural)s'

.. attribute:: table_model

A class implementing QAbstractTableModel that will be used as a model for the table view ::

  table_model = QueryTableProxy

- emits the row_selected signal when a row has been selected

Nested Classes
  header_widget
HeaderWidget for a tableview, containing the title, the search widget, and the number of rows in the table
  table_widget
A widget displaying a table, to be used within a TableView
  table_model
The QueryTableProxy contains a limited copy of the data in the Elixir model, which is fetched from the database to be used as the model for a QTableView

Inherited from PyQt4.QtGui.QWidget: RenderFlag, RenderFlags

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods
 
__init__(self, admin, search_text=None, parent=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
activate_search(self) source code
 
get_title(*args, **kwargs) source code
 
setSubclassTree(*args, **kwargs) source code
 
sectionClicked(self, section)
emits a row_selected signal
source code
 
copy_selected_rows(self)
Copy the selected rows in this tableview
source code
 
select_all_rows(self) source code
 
create_table_model(self, admin)
Create a table model for the given admin interface
source code
 
get_admin(self) source code
 
get_model(self) source code
 
set_admin(*args, **kwargs)
Switch to a different subclass, where admin is the admin object of the subclass
source code
 
tableLayoutChanged(*args, **kwargs) source code
 
setCharts(*args, **kwargs)
creates and display charts
source code
 
deleteSelectedRows(self)
delete the selected rows in this tableview
source code
 
newRow(*args, **kwargs)
Create a new row in the tableview
source code
 
closeEvent(self, event)
reimplements close event
source code
 
selectTableRow(self, row)
selects the specified row
source code
 
makeImport(self) source code
 
selectedTableIndexes(self)
returns a list of selected rows indexes
source code
 
getColumns(self)
return the columns to be displayed in the table view
source code
 
getData(self)
generator for data queried by table model
source code
 
getTitle(self)
return the name of the entity managed by the admin attribute
source code
 
viewFirst(self)
selects first row
source code
 
viewLast(self)
selects last row
source code
 
viewNext(self)
selects next row
source code
 
viewPrevious(self)
selects previous row
source code
 
rebuildQuery(self)
resets the table model query
source code
 
startSearch(self, text)
rebuilds query based on filtering text
source code
 
cancelSearch(self)
resets search filtering to default
source code
 
get_selection_getter(self)
table
source code
 
set_filters_and_actions(*args, **kwargs)
sets filters for the tableview
source code
 
to_html(self)
generates html of the table
source code
 
importFromFile(self)
"import data : the data will be imported in the activeMdiChild
source code

Inherited from camelot.view.controls.view.AbstractView: change_title, export_to_excel, export_to_mail, export_to_word

Inherited from PyQt4.QtGui.QWidget: acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, contentsMargins, contentsRect, contextMenuEvent, contextMenuPolicy, create, cursor, customContextMenuRequested, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, enabledChange, ensurePolished, enterEvent, event, find, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontChange, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabGesture, grabKeyboard, grabMouse, grabShortcut, graphicsEffect, graphicsProxyWidget, handle, hasFocus, hasMouseTracking, height, heightForWidth, hide, hideEvent, inputContext, inputMethodEvent, inputMethodHints, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isEnabledToTLW, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isTopLevel, isVisible, isVisibleTo, isWindow, isWindowModified, keyPressEvent, keyReleaseEvent, keyboardGrabber, languageChange, layout, layoutDirection, leaveEvent, locale, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, palette, paletteChange, parentWidget, pos, previousInFocusChain, raise_, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, repaint, resetInputContext, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGraphicsEffect, setHidden, setInputContext, setInputMethodHints, setLayout, setLayoutDirection, setLocale, setMask, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setShortcutAutoRepeat, setShortcutEnabled, setShown, setSizeIncrement, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, topLevelWidget, underMouse, ungrabGesture, unsetCursor, unsetLayoutDirection, unsetLocale, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, winId, window, windowActivationChange, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, x, x11Info, x11PictureHandle, y

Inherited from PyQt4.QtCore.QObject: blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, setObjectName, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from PyQt4.QtGui.QPaintDevice: colorCount, depth, heightMM, logicalDpiX, logicalDpiY, numColors, paintingActive, physicalDpiX, physicalDpiY, widthMM

Inherited from sip.simplewrapper: __delattr__, __getattribute__, __new__, __setattr__

Inherited from object: __format__, __hash__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __str__, __subclasshook__

Class Variables
  title_format = '%(verbose_name_plural)s'

Inherited from camelot.view.controls.view.AbstractView: title_changed_signal

Inherited from PyQt4.QtGui.QWidget: DrawChildren, DrawWindowBackground, IgnoreMask

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Inherited from PyQt4.QtGui.QPaintDevice: PdmDepth, PdmDpiX, PdmDpiY, PdmHeight, PdmHeightMM, PdmNumColors, PdmPhysicalDpiX, PdmPhysicalDpiY, PdmWidth, PdmWidthMM

Properties

Inherited from object: __class__

Method Details

__init__(self, admin, search_text=None, parent=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

get_title(*args, **kwargs)

source code 
Decorators:
  • @model_function

setSubclassTree(*args, **kwargs)

source code 
Decorators:
  • @gui_function

set_admin(*args, **kwargs)

source code 
Switch to a different subclass, where admin is the admin object of the subclass
Decorators:
  • @gui_function

tableLayoutChanged(*args, **kwargs)

source code 
Decorators:
  • @gui_function

setCharts(*args, **kwargs)

source code 
creates and display charts
Decorators:
  • @gui_function

newRow(*args, **kwargs)

source code 
Create a new row in the tableview
Decorators:
  • @gui_function

closeEvent(self, event)

source code 
reimplements close event
Overrides: PyQt4.QtGui.QWidget.closeEvent

get_selection_getter(self)

source code 
table
Returns:
a function that returns all the objects corresponging to the selected rows in the

set_filters_and_actions(*args, **kwargs)

source code 
sets filters for the tableview
Decorators:
  • @gui_function

to_html(self)

source code 
generates html of the table
Overrides: camelot.view.controls.view.AbstractView.to_html