45 columns <<
"t.rowid AS " + uid;
51 columns <<
"t." + f.
name();
68 columns << joinName +
"." + f +
" AS " + prefix + f;
77 columns << joinName +
"." + f.
name() +
" AS " + prefix + f.
name();
82 QString query =
"SELECT " + columns.
join(
", " ) +
" FROM " + layer->
id() +
" AS t " + leftJoins.
join(
" " );
QString joinFieldName
Join field in the source layer.
QString targetFieldName
Join field in the target layer.
QgsMapLayer * mapLayer(const QString &theLayerId) const
Retrieve a pointer to a registered layer by layer ID.
Container of fields for a vector layer.
QString join(const QString &separator) const
virtual QgsAttributeList pkAttributeIndexes()
Return list of indexes of fields that make up the primary key.
const QList< QgsVectorJoinInfo > vectorJoins() const
QgsFields fields() const
Returns the list of fields of this layer.
QString prefix
An optional prefix.
QString id() const
Get this layer's unique ID, this ID is used to access this layer from map layer registry.
void setQuery(const QString &query)
Set the SQL query.
static QgsVirtualLayerDefinition fromJoinedLayer(QgsVectorLayer *joinedLayer)
Get a virtual layer definition from a vector layer where vector joins are replaced by SQL LEFT JOINs...
Encapsulate a field in an attribute table or data source.
int fieldNameIndex(const QString &fieldName) const
Look up field's index from name also looks up case-insensitive if there is no match otherwise...
virtual const QgsFields & fields() const =0
Return a map of indexes with field names for this layer.
static QgsMapLayerRegistry * instance()
Returns the instance pointer, creating the object on the first call.
void setUid(const QString &uid)
Set the name of the field with unique identifiers.
QString name
Read property of QString layerName.
const QgsField & field(int fieldIdx) const
Get field at particular index (must be in range 0..N-1)
QgsVectorDataProvider * dataProvider()
Returns the data provider.
Represents a vector layer which manages a vector based data sets.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString joinLayerId
Source layer.
QStringList * joinFieldNamesSubset() const
Get subset of fields to be used from joined layer.
Class to manipulate the definition of a virtual layer.