Skip to content
Permalink
Browse files

Merge pull request #2647 from mhugo/vlayer_gui

Virtual layers GUI integration
  • Loading branch information
mhugo committed Jan 11, 2016
2 parents be5d657 + bbf2137 commit 70f26b66be4748e0fb37dbfa16cb363ed1b42231
@@ -128,6 +128,7 @@
<file>themes/default/mActionAddWfsLayer.svg</file>
<file>themes/default/mActionAddWmsLayer.svg</file>
<file>themes/default/mActionAddDelimitedTextLayer.svg</file>
<file>themes/default/mActionAddVirtualLayer.svg</file>
<file>themes/default/mActionAlignBottom.png</file>
<file>themes/default/mActionAlignHCenter.png</file>
<file>themes/default/mActionAlignLeft.png</file>
@@ -0,0 +1,276 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg5692"
version="1.1"
inkscape:version="0.48.4 r9939"
sodipodi:docname="vlayer.svg"
inkscape:export-filename="/media/home1/robert/svn/graphics/trunk/toolbar-icons/32x32/layer-vector.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<title
id="title2829">GIS icon theme 0.2</title>
<defs
id="defs5694">
<linearGradient
id="linearGradient3812">
<stop
style="stop-color:#6e97c4;stop-opacity:1;"
offset="0"
id="stop3814" />
<stop
style="stop-color:#6e97c4;stop-opacity:0;"
offset="1"
id="stop3816" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 16 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="32 : 16 : 1"
inkscape:persp3d-origin="16 : 10.666667 : 1"
id="perspective3486" />
<inkscape:perspective
id="perspective3496"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3600"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective7871"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective8710"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective9811"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective4762"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3812"
id="linearGradient3818"
x1="37.316311"
y1="36.925365"
x2="3.1572213"
y2="3.1572211"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="15.9375"
inkscape:cx="8.4239343"
inkscape:cy="11.653661"
inkscape:current-layer="layer2"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
borderlayer="false"
inkscape:window-width="1377"
inkscape:window-height="807"
inkscape:window-x="1932"
inkscape:window-y="134"
inkscape:window-maximized="0"
inkscape:snap-global="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-grids="false">
<inkscape:grid
type="xygrid"
id="grid5700"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
dotted="true"
originx="2.5px"
originy="2.5px" />
</sodipodi:namedview>
<metadata
id="metadata5697">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>GIS icon theme 0.2</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Robert Szczepanek</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>Robert Szczepanek</dc:title>
</cc:Agent>
</dc:rights>
<dc:subject>
<rdf:Bag>
<rdf:li>GIS icons</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:coverage>GIS icons</dc:coverage>
<dc:description>http://robert.szczepanek.pl/</dc:description>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer"
style="display:inline">
<path
inkscape:connector-curvature="0"
style="color:#000000;fill:none;stroke:#415a75;stroke-width:1.78710628;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="M 3.1572212,3.1572206 11.707585,23.749318 21.110969,3.3492624 28.84278,3.3200046"
id="path2960"
sodipodi:nodetypes="cccc" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#415a75;stroke-width:0.78947365;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2958"
sodipodi:cx="3.5"
sodipodi:cy="12.5"
sodipodi:rx="1"
sodipodi:ry="1"
d="m 4.5,12.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
transform="matrix(2.263668,0,0,2.263668,-4.7656167,-25.138629)" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#415a75;stroke-width:1.05263162;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2958-0"
sodipodi:cx="3.5"
sodipodi:cy="12.5"
sodipodi:rx="1"
sodipodi:ry="1"
d="m 4.5,12.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
transform="matrix(2.263668,0,0,2.263668,3.8127783,-5.6260389)" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#415a75;stroke-width:0.78947365;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2958-9"
sodipodi:cx="3.5"
sodipodi:cy="12.5"
sodipodi:rx="1"
sodipodi:ry="1"
d="m 4.5,12.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
transform="matrix(2.263668,0,0,2.263668,12.949214,-24.994533)" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#415a75;stroke-width:0.78947365;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path2958-6"
sodipodi:cx="3.5"
sodipodi:cy="12.5"
sodipodi:rx="1"
sodipodi:ry="1"
d="m 4.5,12.5 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
transform="matrix(2.263668,0,0,2.263668,20.919941,-24.975845)" />
<path
style="color:#000000;fill:url(#linearGradient3818);fill-opacity:1;stroke:#2e4e72;stroke-width:1.12999999999999989;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;fill-rule:nonzero;opacity:1"
d="m 4.8072919,3.0420338 22.3854161,0 c 1.042824,0 1.875,0.832177 1.875,1.875001 l 0,22.1971812 c 0,1.042824 -0.832176,1.90625 -1.875,1.90625 l -22.3854161,0 c -1.0428239,0 -1.875,-0.863426 -1.875,-1.90625 l 0,-22.1971812 c 0,-1.042824 0.8321761,-1.875001 1.875,-1.875001 z"
id="rect3022"
inkscape:connector-curvature="0"
sodipodi:nodetypes="sssssssss" />
<path
style="color:#000000;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.12999999999999989;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 0,0 0,32.0625 32,0 L 32,0 z m 4.7761029,3.0844363 22.3854161,0 c 1.042824,0 1.875,0.8321765 1.875,1.8750003 l 0,22.1971814 c 0,1.042824 -0.832176,1.90625 -1.875,1.90625 l -22.3854161,0 c -1.0428235,0 -1.875,-0.863426 -1.875,-1.90625 l 0,-22.1971814 c 0,-1.0428238 0.8321765,-1.8750003 1.875,-1.8750003 z"
id="rect3022"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccsssssssss" />
<g
style="display:inline"
id="g3772">
<rect
ry="2.6149368"
inkscape:export-ydpi="120"
inkscape:export-xdpi="120"
y="19"
x="19"
height="13"
width="13"
id="rect3563"
style="fill:#5a8c5a;fill-opacity:1;stroke:#555753;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
inkscape:export-filename="C:\Program Files\QGIS-Dev\themes\gis-0.1\mActionAddOgrLayer.png"
rx="2.6149371" />
<path
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.5999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 21.6,25.499999 7.8,0"
id="path3807"
sodipodi:nodetypes="cc" />
<path
inkscape:connector-curvature="0"
id="path3809"
d="M 25.5,29.399999 25.5,21.6"
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.5999999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:nodetypes="cc" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccsssc"
id="path6992"
d="m 20.3,25.499999 10.4,0 c 0,0 0,0 0,-2.6 C 30.7,20.3 30.05,20.3 25.5,20.3 c -4.55,0 -5.2,0 -5.2,2.599999 0,2.6 0,2.6 0,2.6 z"
style="opacity:0.3;fill:#fcffff;fill-rule:evenodd;stroke:none;display:inline;enable-background:new" />
</g>
</g>
</svg>
@@ -145,6 +145,7 @@
%Include qgsvisibilitypresetcollection.sip
%Include qgslayerdefinition.sip
%Include qgsvirtuallayerdefinition.sip
%Include qgsvirtuallayerdefinitionutils.sip
%Include qgsxmlutils.sip

%Include auth/qgsauthcertutils.sip
@@ -44,4 +44,11 @@ class QgsLayerTreeUtils
static QString legendFilterByExpression( const QgsLayerTreeLayer& layer, bool* enabled = 0 );
//! Test if one of the layers in a group has an expression filter
static bool hasLegendFilterExpression( const QgsLayerTreeGroup& group );

//! Insert a QgsMapLayer just below another one
//! @param group the tree group where layers are (can be the root group)
//! @param refLayer the reference layer
//! @param layerToInsert the new layer to insert just below the reference layer
//! @returns the new tree layer
static QgsLayerTreeLayer* insertLayerBelow( QgsLayerTreeGroup* group, const QgsMapLayer* refLayer, QgsMapLayer* layerToInsert );
};
@@ -0,0 +1,12 @@
/**
* Utils class for QgsVirtualLayerDefinition
*/
class QgsVirtualLayerDefinitionUtils
{
%TypeHeaderCode
#include <qgsvirtuallayerdefinitionutils.h>
%End
public:
//! Get a virtual layer definition from a vector layer where vector joins are replaced by SQL LEFT JOINs
static QgsVirtualLayerDefinition fromJoinedLayer( QgsVectorLayer* joinedLayer );
};
@@ -413,15 +413,14 @@ def getSqlDictionary(self):
from .sql_dictionary import getSqlDictionary
sql_dict = getSqlDictionary()

if True:
items = []
for tbl in self.getTables():
items.append(tbl[1]) # table name
items = []
for tbl in self.getTables():
items.append(tbl[1]) # table name

for fld in self.getTableFields((None, tbl[1])):
items.append(fld[1]) # field name

sql_dict["identifier"] = items
sql_dict["identifier"] = items
return sql_dict

def getQueryBuilderDictionary(self):

0 comments on commit 70f26b6

Please sign in to comment.
You can’t perform that action at this time.