viewerwindow¶
Main Window of the TuiView application. Contains the ViewerWidget, menus, toolbars and status bars.
- class tuiview.viewerwindow.ViewerWindow(*args: Any, **kwargs: Any)[source]¶
Main window for viewer application. The ViewerWidget is contained in the ‘viewwidget’ attribute.
- newQueryWindowSig¶
user has opened a new query window
alias of
QueryDockWidget
- readViewersState¶
read viewer state from a tile
alias of
object
- tileWindowsSig¶
user has requested that the windows are tiles
alias of
int
- writeViewersState¶
write viewer state to a file
alias of
object
- activeToolChanged(obj)[source]¶
Called when the active tool changed. If we didn’t cause it then show our tools as disabled
- addLayersFromJSONFile(fileobj, nlayers)[source]¶
Gets the widget to read layer definitions from fileobj and add them
- addRasterInternal(fname, stretch=None, showError=True)[source]¶
Actually to the file opening. If stretch is None is is determined using our automatic scheme. if showError is True a message box will be displayed with any error if false an exception will be raised.
- addVectorFile()[source]¶
User wants to add a vector layer. OGR seems to have no way to determine extensions… From a file.
- addVectorInternal(path, layername=None, sql=None, label=None)[source]¶
Open OGR dataset and layer and tell widget to add it to the list of layers
- closeAll()[source]¶
Send a signal to geolinked viewers close all windows. For some reason, doing this right now causes a crash. Seems safest to wait until GUI is idle (using a single shot timer with a timeout of 0) then call closeAllOnTimer() to do the actual work.
- closeAllOnTimer()[source]¶
See closeAll() below. Does the actual work when called by the single shot timer.
- closeEvent(event)[source]¶
Window is being closed. Save the position and size. Check that any of the query windows don’t have unsaved data
- dragEnterEvent(event)[source]¶
Called when user about to drop some data on the window accept it if it has urls (which are usually just files)
- dropEvent(event)[source]¶
Called when the user attempts to drop some data onto the window We only respond to files being dropped
- static findDefaultStretchForDataset(gdaldataset)[source]¶
Attempts to find the default stretch that matches the given gdal dataset. Returns None on failure.
- newQueryWindow()[source]¶
Create a new QueryDockWidget and connect signals and increment our count of these windows
- newVectorQueryWindow()[source]¶
Create a new VectorQueryDockWidget and connect signals and increment our count of these windows
- newWindow()[source]¶
Triggered when user wants a new window. Send signal to GeolinkedViewers class (if there is one!)
- profileClosed(profileDock)[source]¶
Profile dock window has been closed. Disconnect from polylineCollected signal and decrement our count
- queryClosed(queryDock)[source]¶
Query dock window has been closed. Disconnect from locationSelected signal and decrement our count
- resizeForWidgetSize(xsize, ysize)[source]¶
Resizes this window so that the widget is the given size Takes into account the border etc
- restoreFromSettings()[source]¶
Restore any settings from last time n.b. need to rationalize with preferences window
- saveCurrentViewInternalGDAL(fname, driver, creationOptions)[source]¶
Like saveCurrentViewInternal but saves as a georeferenced image file using GDAL
- tileWindows()[source]¶
Triggered when user wants to tile windows. Display dialog to allow number to be selected, then send signal to GeolinkedViewers class (if there is one!)
- updateWindowTitle(layer)[source]¶
called in response to the topLayerChanged(PyQt_PyObject) signal from the layers to say the top displayed layer has changed
- vectorQueryClosed(queryDock)[source]¶
Query dock window has been closed. Disconnect from vectorLocationSelected signal and decrement our count
- closeAllWindowsSig¶
close all tuiview windows
- newWindowSig¶
new window created
- class tuiview.viewerwindow.WildcardFileDialog(*args: Any, **kwargs: Any)[source]¶
Our version of the Qt Filedialog thathas an “Expand Wildcards” button.
- tuiview.viewerwindow.createFilter(driver)[source]¶
Given a GDAL driver, creates the Qt QFileDialog compatible filter for the file type