querywindow¶
Module that contains the QueryDockWidget
- class tuiview.querywindow.ContinuousTableModel(*args: Any, **kwargs: Any)[source]¶
This class is the ‘model’ that drives the continuous table. QTableView asks it for the data etc
- data(index, role)[source]¶
Gets the actual data. A variety of Qt.ItemDataRole’s are passed, but we only use DisplayRole for the text and Qt.BackgroundRole for the highlight role
- doUpdate(updateHorizHeader=False)[source]¶
Called by the parent window when the data has changed. Emits the appropriate signal.
- class tuiview.querywindow.QueryDockWidget(*args: Any, **kwargs: Any)[source]¶
Dock widget that contains the query window. Follows query tool clicks (can be disabled) and can change query point color. Image values for point are displayed thanks to locationSelected signal from ViewerWidget.
- activeToolChanged(obj)[source]¶
Called in response to the activeToolChanged signal from the widget. If it wasn’t called by us, unset our tools
- getColorIcon(color)[source]¶
Returns the icon for the change color tool which is based on the current color
- highlight(state)[source]¶
Highlight the currently selected rows on the map state contains whether we are enabling this or not
- keyPressEvent(event)[source]¶
User has pressed a key. See if we are recording keystrokes and updating attribute columns
- layersChanged()[source]¶
Called in response to layersChanged signal from viewerlayers. We check to see if our lastLayer has been removed and if so, close.
- locationSelected(qi)[source]¶
The ViewerWidget has told us it has a new coordinate from the query tool.
- newEditUserExpression(expression, col)[source]¶
Called in reponse to signal from UserExpressionDialog for editing
- newLineGeogSelect(lineInfo)[source]¶
New polyline just been selected as part of a geographical select
- newPolyGeogSelect(polyInfo)[source]¶
New polygon just been selected as part of a geographical select
- newSelectUserExpression(expression)[source]¶
Called in reponse to signal from UserExpressionDialog for selection
- savePlot()[source]¶
Save the plot as a file. Either .pdf or .ps QPrinter chooses format based on extension.
- setColumnAsLookup(colName)[source]¶
Allows the user to specify a column to be used to lookup the color table
- setColumnDecimalPlaces(colName)[source]¶
Allows the user to set the number of decimal places for float columns
- setColumnKeyboardEdit(colName)[source]¶
set column to receive keyboard events if col already sets, toggles off
- setToolBarState(thematic)[source]¶
Set tool bar state to either thematic (True) or continuous (False). This enables/disables some of the toolbar buttons and the table header contect menu
- setUIUpdateState(state)[source]¶
Update the bits of the UI that change when the update state changes.
- setupTableContinuous(data, layer)[source]¶
setup the table for displaying Continuous data. This is a row per band with the pixel values for each band shown The current red, green and blue bands have an icon
- setupTableThematic(data, layer)[source]¶
For a single band dataset with attributes. Displays the attributes as a table and highlights the current value in the table.
- updateColorTableInWidget()[source]¶
Call this when the color table changed and the LUT will be reloaded and redisplayed
- updateToolTip()[source]¶
When in thematic mode we set a toolip over the attributes that tells the user how many items selected
- userNewCoord()[source]¶
User has pressed enter on one of the coord boxes Tell widget we want to move
- queryClosed¶
emitted when window closed
- class tuiview.querywindow.QueryTableView(*args: Any, **kwargs: Any)[source]¶
A hack to ensure all keypresses are redirected to the parent window for processing by the keyboard input handler rather than the default which tries to do some searching thing.
- class tuiview.querywindow.ThematicHorizontalHeader(*args: Any, **kwargs: Any)[source]¶
Same as a horizontal QHeaderView but responds to context menu requests when setThematicMode(True)
- class tuiview.querywindow.ThematicItemDelegate(*args: Any, **kwargs: Any)[source]¶
Because we can’t override the isSelected method of the modelselection we draw the selected state via the item delegate paint method as needed
- class tuiview.querywindow.ThematicTableModel(*args: Any, **kwargs: Any)[source]¶
This class is the ‘model’ that drives the thematic table. QTableView asks it for the data etc
- data(index, role)[source]¶
Gets the actual data. A variety of Qt.ItemDataRole’s are passed, but we only use DisplayRole for the text and Qt.BackgroundRole for the highlight role
- doUpdate(updateHorizHeader=False, updateVertHeader=False)[source]¶
Called by the parent window when the attributes have changed. Emits the appropriate signal.
- headerData(section, orientation, role)[source]¶
returns the header labels for either vertical or horizontal
- index(row, column, parent=None)[source]¶
Create a new QModelIndex for the specified row and column. The base class implementation just creates a new QModelIndex but we override this so we can set the “internalId” parameter which is available to clients to store more info. We use this parameter to store the current slider position. For most operations we could just obtain this by calling self.scroll.sliderPosition() again, but for selection this doesn’t work as they may have started the selection then scrolled down and ended the selection so we need to know the slider position for each index. This is espcially useful for the ItemDelegate which otherwise has no way of knowing what the scroll position was
The other obvious thing to do is to add the slider position onto the current row, but things get weird as sometimes Qt passes me a row with the position already added on…
- class tuiview.querywindow.ThematicVerticalHeader(*args: Any, **kwargs: Any)[source]¶
Our own vertical header that forwards the event on to the model to handle selection. In thematic mode only, otherwise behaves the same as the real thing.
- clicked¶
emitted when header clicked