querywindow

Module that contains the QueryDockWidget

class tuiview.querywindow.ContinuousTableModel(banddata, bandNames, stretch, parent)[source]

This class is the ‘model’ that drives the continuous table. QTableView asks it for the data etc

columnCount(parent)[source]

number of columns

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.

headerData(section, orientation, role)[source]

returns the header labels for either vertical or horizontal

rowCount(parent)[source]

returns the number of rows

class tuiview.querywindow.QueryDockWidget(parent, viewwidget)[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

addColumn()[source]

User wants to add a column

changeCursorColor()[source]

User wishes to change cursor color

changeHighlightColor()[source]

User wishes to change highlight color

changeLabel(checked)[source]

State of display labels check has been changed. Redisplay plot.

closeEvent(event)[source]

Window is being closed - inform parent window

decreaseCursorSize()[source]

increase the cursor size

editColor()[source]

Change the colour of the selected rows

editColumn(col)[source]

User has requested to edit a column

geogLineSelect(checked)[source]

Turn on the polyline tool so we can select the area

geogPointSelect(checked)[source]

Turn on the query tool so we can select a point

geogSelect(checked)[source]

Turn on the polygon tool so we can select the area

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

increaseCursorSize()[source]

increase the cursor size

keyPressEvent(event)[source]

User has pressed a key. See if we are recording keystrokes and updating attribute columns

locationSelected(qi)[source]

The ViewerWidget has told us it has a new coordinate from the query tool.

moveColumn(col, code)[source]

Move column left or right in the display based on code.

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

onPlotScaling()[source]

Allows the user to change the Y axis scaling of the plot

removeSelection()[source]

Remove the current selection from the table widget

saveColOrder()[source]

Get the layer to save the current order of columns into the GDAL metadata

savePlot()[source]

Save the plot as a file. Either .pdf or .ps QPrinter chooses format based on extension.

scrollToFirstSelected()[source]

scroll to the first selected row

selectAll()[source]

Select all the rows in the table

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.

setupActions()[source]

Create the actions to be shown on the toolbar

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.

setupToolbar()[source]

Add the actions to the toolbar

showUserExpression()[source]

Allow user to enter expression to select rows

storeLastSelection()[source]

Take a copy of self.selectionArray and store it

toggleCoordsSelect(checked)[source]

toggle the displayPixelCoords flag.

unlockDataset(state)[source]

User wants to lock or unlock dataset

updateColorTableInWidget()[source]

Call this when the color table changed and the LUT will be reloaded and redisplayed

updatePlot(qi, color)[source]

Updates the plot widget with new data/color

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
class tuiview.querywindow.QueryTableView(parent)[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.

keyPressEvent(event)[source]
class tuiview.querywindow.ThematicHorizontalHeader(parent)[source]

Same as a horizontal QHeaderView but responds to context menu requests when setThematicMode(True)

contextMenuEvent(event)[source]

Respond to context menu event

setThematicMode(mode)[source]

Set the mode (True or False) for context menu

class tuiview.querywindow.ThematicItemDelegate(parent)[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

paint(painter, option, index)[source]

Paint method - paint as selected if needed

class tuiview.querywindow.ThematicSelectionModel(model, parent)[source]

Selection model for the thematic table. We override the default because we don’t want the selection model to record any selections to make life easier for us. Ideally we would override the isSelected method but this is not declared virtual so we have to do this and paint the selections via the ItemDelegate.

select(index, command)[source]

Override and don’t call base class so nothing selected as far as selection model concerned

class tuiview.querywindow.ThematicTableModel(attributes, parent)[source]

This class is the ‘model’ that drives the thematic table. QTableView asks it for the data etc

columnCount(parent)[source]

number of columns

createColorIcon(row)[source]

Returns the colour icon for the given row

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 attributes have changed. Emits the appropriate signal.

headerData(section, orientation, role)[source]

returns the header labels for either vertical or horizontal

rowCount(parent)[source]

returns the number of rows

setHighlightRow(row)[source]

Called by setupTableThematic to indicate the row that should be highlighted

tuiview.querywindow.safeCreateColor(r, g, b, a=255)[source]

Same as QColor constructor but ensures vales all between 0 and 255 to avoid annoying warnings from Qt