QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | List of all members
QgsProjectBadLayerGuiHandler Class Reference

Handler for missing layers within project. More...

#include <qgsprojectbadlayerguihandler.h>

Inheritance diagram for QgsProjectBadLayerGuiHandler:
Inheritance graph
[legend]

Public Member Functions

 QgsProjectBadLayerGuiHandler ()
 
virtual void handleBadLayers (const QList< QDomNode > &layers, const QDomDocument &projectDom) override
 Implementation of the handler. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 
- Public Member Functions inherited from QgsProjectBadLayerHandler
virtual ~QgsProjectBadLayerHandler ()
 

Static Public Attributes

static bool mIgnore = false
 Flag to store the Ignore button press of MessageBox used by QgsLegend. More...
 

Protected Types

enum  DataType { IS_VECTOR, IS_RASTER, IS_BOGUS }
 file data representation More...
 
enum  ProviderType { IS_FILE, IS_DATABASE, IS_URL, IS_Unknown }
 the three flavors for data More...
 

Protected Member Functions

QString dataSource (QDomNode &layerNode)
 Return the data source for the given layer. More...
 
DataType dataType (QDomNode &layerNode)
 Returns data type associated with the given QgsProject file Dom node. More...
 
bool findLayer (const QString &fileFilters, const QDomNode &constLayerNode)
 Find relocated data source for the given layer. More...
 
void findLayers (const QString &fileFilters, const QList< QDomNode > &layerNodes)
 Find relocated data sources for given layers These QDom objects represent QgsProject nodes that map to specific layers. More...
 
bool findMissingFile (const QString &fileFilters, QDomNode &layerNode)
 This is used to locate files that have moved or otherwise are missing. More...
 
ProviderType providerType (QDomNode &layerNode)
 Return the physical storage type associated with the given layer. More...
 
void setDataSource (QDomNode &layerNode, const QString &dataSource)
 Set the datasource element to the new value. More...
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Handler for missing layers within project.

Gives user a chance to select path to the missing layers.

Definition at line 25 of file qgsprojectbadlayerguihandler.h.

Member Enumeration Documentation

◆ DataType

file data representation

Enumerator
IS_VECTOR 
IS_RASTER 
IS_BOGUS 

Definition at line 41 of file qgsprojectbadlayerguihandler.h.

◆ ProviderType

the three flavors for data

Enumerator
IS_FILE 
IS_DATABASE 
IS_URL 
IS_Unknown 

Definition at line 44 of file qgsprojectbadlayerguihandler.h.

Constructor & Destructor Documentation

◆ QgsProjectBadLayerGuiHandler()

QgsProjectBadLayerGuiHandler::QgsProjectBadLayerGuiHandler ( )

Definition at line 28 of file qgsprojectbadlayerguihandler.cpp.

Member Function Documentation

◆ dataSource()

QString QgsProjectBadLayerGuiHandler::dataSource ( QDomNode layerNode)
protected

Return the data source for the given layer.

The QDomNode is a QgsProject Dom node corresponding to a map layer state.

Essentially dumps datasource tag.

Definition at line 114 of file qgsprojectbadlayerguihandler.cpp.

◆ dataType()

QgsProjectBadLayerGuiHandler::DataType QgsProjectBadLayerGuiHandler::dataType ( QDomNode layerNode)
protected

Returns data type associated with the given QgsProject file Dom node.

The Dom node should represent the state associated with a specific layer.

Definition at line 84 of file qgsprojectbadlayerguihandler.cpp.

◆ findLayer()

bool QgsProjectBadLayerGuiHandler::findLayer ( const QString fileFilters,
const QDomNode constLayerNode 
)
protected

Find relocated data source for the given layer.

This QDom object represents a QgsProject node that maps to a specific layer.

Parameters
fileFiltersfile filters to use
constLayerNodeQDom node containing layer project information
Todo:

XXX Only implemented for file based layers. It will need to be extended for XXX other data source types such as databases.

Definition at line 258 of file qgsprojectbadlayerguihandler.cpp.

◆ findLayers()

void QgsProjectBadLayerGuiHandler::findLayers ( const QString fileFilters,
const QList< QDomNode > &  layerNodes 
)
protected

Find relocated data sources for given layers These QDom objects represent QgsProject nodes that map to specific layers.

Definition at line 290 of file qgsprojectbadlayerguihandler.cpp.

◆ findMissingFile()

bool QgsProjectBadLayerGuiHandler::findMissingFile ( const QString fileFilters,
QDomNode layerNode 
)
protected

This is used to locate files that have moved or otherwise are missing.

Definition at line 190 of file qgsprojectbadlayerguihandler.cpp.

◆ handleBadLayers()

void QgsProjectBadLayerGuiHandler::handleBadLayers ( const QList< QDomNode > &  layers,
const QDomDocument projectDom 
)
overridevirtual

Implementation of the handler.

Implements QgsProjectBadLayerHandler.

Definition at line 34 of file qgsprojectbadlayerguihandler.cpp.

◆ providerType()

QgsProjectBadLayerGuiHandler::ProviderType QgsProjectBadLayerGuiHandler::providerType ( QDomNode layerNode)
protected

Return the physical storage type associated with the given layer.

The QDomNode is a QgsProject Dom node corresponding to a map layer state.

If the provider tag is "ogr", then it's a file type.

However, if the layer is a raster, then there won't be a provider tag. It will always have an associated file.

If the layer doesn't fall into either of the previous two categories, then it's either a database or URL. If the datasource tag has "url=", then it's URL based and if it has "dbname=">, then the layer data is in a database.

Definition at line 132 of file qgsprojectbadlayerguihandler.cpp.

◆ setDataSource()

void QgsProjectBadLayerGuiHandler::setDataSource ( QDomNode layerNode,
const QString dataSource 
)
protected

Set the datasource element to the new value.

Definition at line 174 of file qgsprojectbadlayerguihandler.cpp.

Member Data Documentation

◆ mIgnore

bool QgsProjectBadLayerGuiHandler::mIgnore = false
static

Flag to store the Ignore button press of MessageBox used by QgsLegend.

Definition at line 36 of file qgsprojectbadlayerguihandler.h.


The documentation for this class was generated from the following files: