1<?xml version="1.0" encoding="UTF-8"?> 2<ui version="4.0"> 3 <class>QgsVirtualLayerSourceSelectBase</class> 4 <widget class="QDialog" name="QgsVirtualLayerSourceSelectBase"> 5 <property name="geometry"> 6 <rect> 7 <x>0</x> 8 <y>0</y> 9 <width>906</width> 10 <height>661</height> 11 </rect> 12 </property> 13 <property name="windowTitle"> 14 <string>Create a Virtual Layer</string> 15 </property> 16 <layout class="QVBoxLayout" name="verticalLayout"> 17 <item> 18 <layout class="QHBoxLayout" name="horizontalLayout_4"> 19 <item> 20 <widget class="QLabel" name="label_2"> 21 <property name="text"> 22 <string>Layer name</string> 23 </property> 24 </widget> 25 </item> 26 <item> 27 <widget class="QComboBox" name="mLayerNameCombo"> 28 <property name="editable"> 29 <bool>true</bool> 30 </property> 31 </widget> 32 </item> 33 <item> 34 <spacer name="horizontalSpacer"> 35 <property name="orientation"> 36 <enum>Qt::Horizontal</enum> 37 </property> 38 <property name="sizeHint" stdset="0"> 39 <size> 40 <width>40</width> 41 <height>20</height> 42 </size> 43 </property> 44 </spacer> 45 </item> 46 </layout> 47 </item> 48 <item> 49 <widget class="QgsCollapsibleGroupBox" name="mEmbeddedlLayersGroup"> 50 <property name="title"> 51 <string>Embedded layers</string> 52 </property> 53 <property name="collapsed" stdset="0"> 54 <bool>false</bool> 55 </property> 56 <layout class="QVBoxLayout" name="verticalLayout_4"> 57 <item> 58 <widget class="QTableWidget" name="mLayersTable"> 59 <property name="toolTip"> 60 <string>Embedded layers can be added to have SQL queries with layers that are independent from layers loaded by the current QGIS project. 61In particular, saving a virtual layer with embedded layers to a QLR file can be done to reuse its definition in another project.</string> 62 </property> 63 <property name="selectionMode"> 64 <enum>QAbstractItemView::SingleSelection</enum> 65 </property> 66 <property name="selectionBehavior"> 67 <enum>QAbstractItemView::SelectRows</enum> 68 </property> 69 <attribute name="horizontalHeaderStretchLastSection"> 70 <bool>true</bool> 71 </attribute> 72 <attribute name="verticalHeaderVisible"> 73 <bool>false</bool> 74 </attribute> 75 <column> 76 <property name="text"> 77 <string>Local name</string> 78 </property> 79 </column> 80 <column> 81 <property name="text"> 82 <string>Provider</string> 83 </property> 84 </column> 85 <column> 86 <property name="text"> 87 <string>Encoding</string> 88 </property> 89 </column> 90 <column> 91 <property name="text"> 92 <string>Source</string> 93 </property> 94 </column> 95 </widget> 96 </item> 97 <item> 98 <layout class="QHBoxLayout" name="horizontalLayout"> 99 <item> 100 <widget class="QPushButton" name="mAddLayerBtn"> 101 <property name="toolTip"> 102 <string>Add a new embedded layer</string> 103 </property> 104 <property name="text"> 105 <string>Add</string> 106 </property> 107 </widget> 108 </item> 109 <item> 110 <widget class="QPushButton" name="mImportLayerBtn"> 111 <property name="enabled"> 112 <bool>true</bool> 113 </property> 114 <property name="toolTip"> 115 <string>Import layer definition from loaded layers of the current project</string> 116 </property> 117 <property name="text"> 118 <string>Import</string> 119 </property> 120 </widget> 121 </item> 122 <item> 123 <widget class="QPushButton" name="mRemoveLayerBtn"> 124 <property name="enabled"> 125 <bool>false</bool> 126 </property> 127 <property name="toolTip"> 128 <string>Remove the selected embedded layer</string> 129 </property> 130 <property name="text"> 131 <string>Remove</string> 132 </property> 133 </widget> 134 </item> 135 <item> 136 <spacer name="horizontalSpacer_2"> 137 <property name="orientation"> 138 <enum>Qt::Horizontal</enum> 139 </property> 140 <property name="sizeHint" stdset="0"> 141 <size> 142 <width>40</width> 143 <height>20</height> 144 </size> 145 </property> 146 </spacer> 147 </item> 148 </layout> 149 </item> 150 </layout> 151 </widget> 152 </item> 153 <item> 154 <widget class="QGroupBox" name="mQueryBox"> 155 <property name="title"> 156 <string>Query</string> 157 </property> 158 <property name="checkable"> 159 <bool>false</bool> 160 </property> 161 <property name="checked"> 162 <bool>false</bool> 163 </property> 164 <layout class="QVBoxLayout" name="verticalLayout_2"> 165 <item> 166 <widget class="QgsCodeEditorSQL" name="mQueryEdit" native="true"> 167 <property name="toolTip"> 168 <string><html><head/><body><p>This is the SQL query editor. You can edit here an SQL query referring to any existing vector layers or embedded layers.</p><p>Virtual layers rely on SQLite and SpatiaLite. Any functions from SQLite or SpatiaLite can then be used in the query. To add or access geometries of a table, you can use "tablename.geometry", regardless of original geometry column's name.</p><p><span style=" font-weight:600;">Special comments:</span></p><p>Because it is not always possible to autodetect the data type of each column in a query, special comments can be used in the query to force a specific type.</p><p>Special comments must be placed on the right of a column name and have the form <tt>/*:type*/</tt> where type can be any of <span style=" font-style:italic;">int</span>, <span style=" font-style:italic;">real</span> or <span style=" font-style:italic;">text</span>. They can also be used to specify the type and SRID of the geometry column with the following syntax: <tt>/*:gtype:srid*/</tt> where <span style=" font-style:italic;">gtype</span> can be <span style=" font-style:italic;">point</span>, <span style=" font-style:italic;">linestring</span> or <span style=" font-style:italic;">polygon</span> (with an optional <span style=" font-style:italic;">multi</span> prefix) and <span style=" font-style:italic;">srid</span> is an integer identifier.</p><p>Example:</p><p><tt>SELECT id + 1 as id /*:int*/, ST_Centroid(geometry) as geom /*:point:4326*/ FROM tab</tt></p></body></html></string> 169 </property> 170 </widget> 171 </item> 172 </layout> 173 </widget> 174 </item> 175 <item> 176 <layout class="QHBoxLayout" name="horizontalLayout_5"> 177 <item> 178 <widget class="QCheckBox" name="mUIDColumnNameChck"> 179 <property name="text"> 180 <string>Unique identifier column</string> 181 </property> 182 </widget> 183 </item> 184 <item> 185 <widget class="QLineEdit" name="mUIDField"> 186 <property name="enabled"> 187 <bool>false</bool> 188 </property> 189 <property name="text"> 190 <string/> 191 </property> 192 </widget> 193 </item> 194 </layout> 195 </item> 196 <item> 197 <widget class="QgsCollapsibleGroupBox" name="mGeometryGroup"> 198 <property name="title"> 199 <string>Geometry</string> 200 </property> 201 <property name="collapsed" stdset="0"> 202 <bool>true</bool> 203 </property> 204 <layout class="QVBoxLayout" name="verticalLayout_3"> 205 <item> 206 <widget class="QRadioButton" name="mAutodetectGeometryRadio"> 207 <property name="text"> 208 <string>Autodetect</string> 209 </property> 210 <property name="checked"> 211 <bool>true</bool> 212 </property> 213 </widget> 214 </item> 215 <item> 216 <widget class="QRadioButton" name="mNoGeometryRadio"> 217 <property name="text"> 218 <string>No geometry</string> 219 </property> 220 </widget> 221 </item> 222 <item> 223 <layout class="QHBoxLayout" name="horizontalLayout_3"> 224 <item> 225 <widget class="QRadioButton" name="mGeometryRadio"> 226 <property name="text"> 227 <string/> 228 </property> 229 </widget> 230 </item> 231 <item> 232 <widget class="QFrame" name="mGeometryFrame"> 233 <property name="enabled"> 234 <bool>false</bool> 235 </property> 236 <property name="frameShape"> 237 <enum>QFrame::StyledPanel</enum> 238 </property> 239 <property name="frameShadow"> 240 <enum>QFrame::Raised</enum> 241 </property> 242 <layout class="QFormLayout" name="formLayout_2"> 243 <item row="0" column="0"> 244 <widget class="QLabel" name="label"> 245 <property name="text"> 246 <string>Geometry column</string> 247 </property> 248 </widget> 249 </item> 250 <item row="0" column="1"> 251 <widget class="QLineEdit" name="mGeometryField"> 252 <property name="text"> 253 <string>geometry</string> 254 </property> 255 </widget> 256 </item> 257 <item row="1" column="0"> 258 <widget class="QLabel" name="label_3"> 259 <property name="text"> 260 <string>Type</string> 261 </property> 262 </widget> 263 </item> 264 <item row="1" column="1"> 265 <widget class="QComboBox" name="mGeometryType"> 266 <item> 267 <property name="text"> 268 <string>Point</string> 269 </property> 270 </item> 271 <item> 272 <property name="text"> 273 <string>LineString</string> 274 </property> 275 </item> 276 <item> 277 <property name="text"> 278 <string>Polygon</string> 279 </property> 280 </item> 281 <item> 282 <property name="text"> 283 <string>MultiPoint</string> 284 </property> 285 </item> 286 <item> 287 <property name="text"> 288 <string>MultiLineString</string> 289 </property> 290 </item> 291 <item> 292 <property name="text"> 293 <string>MultiPolygon</string> 294 </property> 295 </item> 296 </widget> 297 </item> 298 <item row="2" column="0"> 299 <widget class="QLabel" name="label_5"> 300 <property name="text"> 301 <string>CRS</string> 302 </property> 303 </widget> 304 </item> 305 <item row="2" column="1"> 306 <layout class="QHBoxLayout" name="horizontalLayout_2"> 307 <item> 308 <widget class="QLineEdit" name="mCRS"> 309 <property name="readOnly"> 310 <bool>true</bool> 311 </property> 312 </widget> 313 </item> 314 <item> 315 <widget class="QToolButton" name="mBrowseCRSBtn"> 316 <property name="text"> 317 <string>…</string> 318 </property> 319 </widget> 320 </item> 321 </layout> 322 </item> 323 </layout> 324 </widget> 325 </item> 326 </layout> 327 </item> 328 </layout> 329 </widget> 330 </item> 331 <item> 332 <layout class="QHBoxLayout" name="horizontalLayout_6"> 333 <item> 334 <widget class="QPushButton" name="mTestButton"> 335 <property name="text"> 336 <string>Test</string> 337 </property> 338 </widget> 339 </item> 340 <item> 341 <widget class="QDialogButtonBox" name="buttonBox"> 342 <property name="orientation"> 343 <enum>Qt::Horizontal</enum> 344 </property> 345 <property name="standardButtons"> 346 <set>QDialogButtonBox::NoButton</set> 347 </property> 348 </widget> 349 </item> 350 </layout> 351 </item> 352 </layout> 353 </widget> 354 <customwidgets> 355 <customwidget> 356 <class>QgsCollapsibleGroupBox</class> 357 <extends>QGroupBox</extends> 358 <header>qgscollapsiblegroupbox.h</header> 359 <container>1</container> 360 </customwidget> 361 <customwidget> 362 <class>QgsCodeEditorSQL</class> 363 <extends>QWidget</extends> 364 <header location="global">qgscodeeditorsql.h</header> 365 <container>1</container> 366 </customwidget> 367 </customwidgets> 368 <tabstops> 369 <tabstop>mGeometryGroup</tabstop> 370 <tabstop>buttonBox</tabstop> 371 <tabstop>mGeometryRadio</tabstop> 372 <tabstop>mGeometryField</tabstop> 373 <tabstop>mGeometryType</tabstop> 374 <tabstop>mCRS</tabstop> 375 <tabstop>mBrowseCRSBtn</tabstop> 376 </tabstops> 377 <resources/> 378 <connections> 379 <connection> 380 <sender>buttonBox</sender> 381 <signal>rejected()</signal> 382 <receiver>QgsVirtualLayerSourceSelectBase</receiver> 383 <slot>reject()</slot> 384 <hints> 385 <hint type="sourcelabel"> 386 <x>316</x> 387 <y>260</y> 388 </hint> 389 <hint type="destinationlabel"> 390 <x>286</x> 391 <y>274</y> 392 </hint> 393 </hints> 394 </connection> 395 <connection> 396 <sender>mGeometryRadio</sender> 397 <signal>toggled(bool)</signal> 398 <receiver>mGeometryFrame</receiver> 399 <slot>setEnabled(bool)</slot> 400 <hints> 401 <hint type="sourcelabel"> 402 <x>36</x> 403 <y>729</y> 404 </hint> 405 <hint type="destinationlabel"> 406 <x>460</x> 407 <y>729</y> 408 </hint> 409 </hints> 410 </connection> 411 <connection> 412 <sender>mUIDColumnNameChck</sender> 413 <signal>toggled(bool)</signal> 414 <receiver>mUIDField</receiver> 415 <slot>setEnabled(bool)</slot> 416 <hints> 417 <hint type="sourcelabel"> 418 <x>107</x> 419 <y>431</y> 420 </hint> 421 <hint type="destinationlabel"> 422 <x>543</x> 423 <y>432</y> 424 </hint> 425 </hints> 426 </connection> 427 </connections> 428</ui> 429