Skip to content

Commit 2a25116

Browse files
author
esseffe
committedNov 17, 2009
upgraded SpatiaLite provider:
- supporting SpatiaLite 2.4.0 [Release Candidate] - supporting SQLite 3.6.20 [introducing foreign key constraints] git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12163 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

13 files changed

+33773
-13211
lines changed

13 files changed

+33773
-13211
lines changed
 

‎src/app/qgsspatialitesourceselect.cpp

Lines changed: 231 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ QgsSpatiaLiteSourceSelect::QgsSpatiaLiteSourceSelect( QgisApp * app, Qt::WFlags
3939
QDialog( app, fl ), qgisApp( app )
4040
{
4141
setupUi( this );
42-
mAddButton = new QPushButton( tr( "&Add" ) );
43-
buttonBox->addButton( mAddButton, QDialogButtonBox::ActionRole );
44-
connect( mAddButton, SIGNAL( clicked() ), this, SLOT( addClicked() ) );
45-
connect( buttonBox, SIGNAL( helpRequested() ), this, SLOT( helpClicked() ) );
46-
47-
mAddButton->setEnabled( false );
42+
btnAdd->setEnabled( false );
4843
populateConnectionList();
4944

5045
mSearchModeComboBox->addItem( tr( "Wildcard" ) );
@@ -84,15 +79,15 @@ void QgsSpatiaLiteSourceSelect::on_btnDelete_clicked()
8479
}
8580

8681
// Slot for performing action when the Add button is clicked
87-
void QgsSpatiaLiteSourceSelect::addClicked()
82+
void QgsSpatiaLiteSourceSelect::on_btnAdd_clicked()
8883
{
8984
addTables();
9085
}
9186

9287
// Slot for showing help
93-
void QgsSpatiaLiteSourceSelect::helpClicked()
88+
void QgsSpatiaLiteSourceSelect::on_btnHelp_clicked()
9489
{
95-
QgsContextHelp::run( context_id );
90+
showHelp();
9691
}
9792

9893
/** End Autoconnected SLOTS **/
@@ -480,19 +475,19 @@ void QgsSpatiaLiteSourceSelect::on_btnConnect_clicked()
480475

481476
// BEGIN CHANGES ECOS
482477
if ( cmbConnections->count() > 0 )
483-
mAddButton->setEnabled( true );
478+
btnAdd->setEnabled( true );
484479
// END CHANGES ECOS
485480

486481
mTablesTreeView->sortByColumn( 0, Qt::AscendingOrder );
487-
mTablesTreeView->header()->resizeSection( 1, 140 );
488-
mTablesTreeView->resizeColumnToContents( 0 );
489482

490483
//expand all the toplevel items
491484
int numTopLevelItems = mTableModel.invisibleRootItem()->rowCount();
492485
for ( int i = 0; i < numTopLevelItems; ++i )
493486
{
494487
mTablesTreeView->expand( mProxyModel.mapFromSource( mTableModel.indexFromItem( mTableModel.invisibleRootItem()->child( i ) ) ) );
495488
}
489+
mTablesTreeView->resizeColumnToContents( 0 );
490+
mTablesTreeView->resizeColumnToContents( 1 );
496491
}
497492

498493
QStringList QgsSpatiaLiteSourceSelect::selectedTables()
@@ -514,6 +509,7 @@ bool QgsSpatiaLiteSourceSelect::getTableInfo( sqlite3 * handle )
514509
int columns;
515510
char *errMsg = NULL;
516511
bool ok = false;
512+
char sql[1024];
517513
QApplication::setOverrideCursor( Qt::WaitCursor );
518514

519515
// setting the SQLite DB name
@@ -522,8 +518,9 @@ bool QgsSpatiaLiteSourceSelect::getTableInfo( sqlite3 * handle )
522518
mTableModel.setSqliteDb( myName );
523519

524520
// the following query return the tables containing a Geometry column
525-
ret = sqlite3_get_table( handle,
526-
"SELECT f_table_name, f_geometry_column, type FROM geometry_columns", &results, &rows, &columns, &errMsg );
521+
strcpy( sql, "SELECT f_table_name, f_geometry_column, type ");
522+
strcat( sql, "FROM geometry_columns");
523+
ret = sqlite3_get_table( handle, sql, &results, &rows, &columns, &errMsg );
527524
if ( ret != SQLITE_OK )
528525
goto error;
529526
if ( rows < 1 )
@@ -535,13 +532,70 @@ bool QgsSpatiaLiteSourceSelect::getTableInfo( sqlite3 * handle )
535532
QString tableName = results[( i * columns ) + 0];
536533
QString column = results[( i * columns ) + 1];
537534
QString type = results[( i * columns ) + 2];
535+
if ( isDeclaredHidden( handle, tableName, column ))
536+
continue;
538537

539538
mTableModel.addTableEntry( type, tableName, column );
540539
}
541540
ok = true;
542541
}
543542
sqlite3_free_table( results );
544543

544+
if ( checkViewsGeometryColumns( handle ) )
545+
{
546+
// the following query return the views supporting a Geometry column
547+
strcpy( sql, "SELECT view_name, view_geometry, type ");
548+
strcat( sql, "FROM views_geometry_columns ");
549+
strcat( sql, "JOIN geometry_columns USING (f_table_name, f_geometry_column)");
550+
ret = sqlite3_get_table( handle, sql, &results, &rows, &columns, &errMsg );
551+
if ( ret != SQLITE_OK )
552+
goto error;
553+
if ( rows < 1 )
554+
;
555+
else
556+
{
557+
for ( i = 1; i <= rows; i++ )
558+
{
559+
QString tableName = results[( i * columns ) + 0];
560+
QString column = results[( i * columns ) + 1];
561+
QString type = results[( i * columns ) + 2];
562+
if ( isDeclaredHidden( handle, tableName, column ))
563+
continue;
564+
565+
mTableModel.addTableEntry( type, tableName, column );
566+
}
567+
ok = true;
568+
}
569+
sqlite3_free_table( results );
570+
}
571+
572+
if ( checkVirtsGeometryColumns( handle ) )
573+
{
574+
// the following query return the VirtualShapefiles
575+
strcpy( sql, "SELECT virt_name, virt_geometry, type ");
576+
strcat( sql, "FROM virts_geometry_columns");
577+
ret = sqlite3_get_table( handle, sql, &results, &rows, &columns, &errMsg );
578+
if ( ret != SQLITE_OK )
579+
goto error;
580+
if ( rows < 1 )
581+
;
582+
else
583+
{
584+
for ( i = 1; i <= rows; i++ )
585+
{
586+
QString tableName = results[( i * columns ) + 0];
587+
QString column = results[( i * columns ) + 1];
588+
QString type = results[( i * columns ) + 2];
589+
if ( isDeclaredHidden( handle, tableName, column ))
590+
continue;
591+
592+
mTableModel.addTableEntry( type, tableName, column );
593+
}
594+
ok = true;
595+
}
596+
sqlite3_free_table( results );
597+
}
598+
545599
QApplication::restoreOverrideCursor();
546600
return ok;
547601

@@ -558,6 +612,169 @@ bool QgsSpatiaLiteSourceSelect::getTableInfo( sqlite3 * handle )
558612
return false;
559613
}
560614

615+
QString QgsSpatiaLiteSourceSelect::quotedValue( QString value ) const
616+
{
617+
if ( value.isNull() )
618+
return "NULL";
619+
620+
value.replace( "'", "''" );
621+
return value.prepend( "'" ).append( "'" );
622+
}
623+
624+
bool QgsSpatiaLiteSourceSelect::checkGeometryColumnsAuth( sqlite3 * handle )
625+
{
626+
int ret;
627+
int i;
628+
char **results;
629+
int rows;
630+
int columns;
631+
bool exists = false;
632+
633+
// checking the metadata tables
634+
QString sql = QString( "SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'geometry_columns_auth'" );
635+
636+
ret = sqlite3_get_table( handle, sql.toUtf8().constData(), &results, &rows, &columns, NULL );
637+
if ( ret != SQLITE_OK )
638+
return false;
639+
if ( rows < 1 )
640+
;
641+
else
642+
{
643+
for ( i = 1; i <= rows; i++ )
644+
{
645+
if ( results[( i * columns ) + 0] != NULL)
646+
{
647+
const char *name = results[( i * columns ) + 0];
648+
if (name)
649+
exists = true;
650+
}
651+
}
652+
}
653+
sqlite3_free_table( results );
654+
return exists;
655+
}
656+
657+
bool QgsSpatiaLiteSourceSelect::checkViewsGeometryColumns( sqlite3 * handle )
658+
{
659+
int ret;
660+
int i;
661+
char **results;
662+
int rows;
663+
int columns;
664+
bool exists = false;
665+
666+
// checking the metadata tables
667+
QString sql = QString( "SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'views_geometry_columns'" );
668+
669+
ret = sqlite3_get_table( handle, sql.toUtf8().constData(), &results, &rows, &columns, NULL );
670+
if ( ret != SQLITE_OK )
671+
return false;
672+
if ( rows < 1 )
673+
;
674+
else
675+
{
676+
for ( i = 1; i <= rows; i++ )
677+
{
678+
if ( results[( i * columns ) + 0] != NULL)
679+
{
680+
const char *name = results[( i * columns ) + 0];
681+
if (name)
682+
exists = true;
683+
}
684+
}
685+
}
686+
sqlite3_free_table( results );
687+
return exists;
688+
}
689+
690+
bool QgsSpatiaLiteSourceSelect::checkVirtsGeometryColumns( sqlite3 * handle )
691+
{
692+
int ret;
693+
int i;
694+
char **results;
695+
int rows;
696+
int columns;
697+
bool exists = false;
698+
699+
// checking the metadata tables
700+
QString sql = QString( "SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'virts_geometry_columns'" );
701+
702+
ret = sqlite3_get_table( handle, sql.toUtf8().constData(), &results, &rows, &columns, NULL );
703+
if ( ret != SQLITE_OK )
704+
return false;
705+
if ( rows < 1 )
706+
;
707+
else
708+
{
709+
for ( i = 1; i <= rows; i++ )
710+
{
711+
if ( results[( i * columns ) + 0] != NULL)
712+
{
713+
const char *name = results[( i * columns ) + 0];
714+
if (name)
715+
exists = true;
716+
}
717+
}
718+
}
719+
sqlite3_free_table( results );
720+
return exists;
721+
}
722+
723+
bool QgsSpatiaLiteSourceSelect::isDeclaredHidden( sqlite3 * handle, QString table, QString geom )
724+
{
725+
int ret;
726+
int i;
727+
char **results;
728+
int rows;
729+
int columns;
730+
char *errMsg = NULL;
731+
bool isHidden = false;
732+
733+
if ( checkGeometryColumnsAuth( handle ) == false )
734+
return false;
735+
// checking if some Layer has been declared as HIDDEN
736+
QString sql = QString( "SELECT hidden FROM geometry_columns_auth"
737+
" WHERE f_table_name=%1 and f_geometry_column=%2" ).arg( quotedValue( table ) ).
738+
arg( quotedValue( geom ) );
739+
740+
ret = sqlite3_get_table( handle, sql.toUtf8().constData(), &results, &rows, &columns, &errMsg );
741+
if ( ret != SQLITE_OK )
742+
goto error;
743+
if ( rows < 1 )
744+
;
745+
else
746+
{
747+
for ( i = 1; i <= rows; i++ )
748+
{
749+
if ( results[( i * columns ) + 0] != NULL)
750+
{
751+
if (atoi( results[( i * columns ) + 0] ) != 0)
752+
isHidden = true;
753+
}
754+
}
755+
}
756+
sqlite3_free_table( results );
757+
758+
return isHidden;
759+
760+
error:
761+
// unexpected IO error
762+
QString errCause = tr( "unknown error cause" );
763+
if ( errMsg != NULL )
764+
{
765+
errCause = errMsg;
766+
sqlite3_free( errMsg );
767+
}
768+
QMessageBox::critical( this, tr( "SpatiaLite getTableInfo Error" ),
769+
tr( "Failure exploring tables from: %1\n\n%2" ).arg( mSqlitePath ).arg( errCause ) );
770+
return false;
771+
}
772+
773+
void QgsSpatiaLiteSourceSelect::showHelp()
774+
{
775+
QgsContextHelp::run( context_id );
776+
}
777+
561778
QString QgsSpatiaLiteSourceSelect::fullDescription( QString table, QString column, QString type )
562779
{
563780
QString full_desc = "";

‎src/app/qgsspatialitesourceselect.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "qgisgui.h"
2222
#include "qgsspatialitefilterproxymodel.h"
2323
#include "qgsspatialitetablemodel.h"
24-
#include <QPushButton>
2524

2625
extern "C"
2726
{
@@ -81,14 +80,14 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
8180
* Once connected, available layers are displayed.
8281
*/
8382
void on_btnConnect_clicked();
84-
void addClicked();
83+
void on_btnAdd_clicked();
8584
void on_btnNew_clicked();
8685
void on_btnDelete_clicked();
8786
void on_mSearchOptionsButton_clicked();
8887
void on_mSearchTableEdit_textChanged( const QString & text );
8988
void on_mSearchColumnComboBox_currentIndexChanged( const QString & text );
9089
void on_mSearchModeComboBox_currentIndexChanged( const QString & text );
91-
void helpClicked();
90+
void on_btnHelp_clicked();
9291
void on_cmbConnections_activated( int );
9392
void setLayerType( QString table, QString column, QString type );
9493
//!Sets a new regular expression to the model
@@ -106,6 +105,21 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
106105
typedef std::pair < QString, QString > geomPair;
107106
typedef std::list < geomPair > geomCol;
108107

108+
/**Checks if geometry_columns_auth table exists*/
109+
bool checkGeometryColumnsAuth( sqlite3 * handle );
110+
111+
/**Checks if views_geometry_columns table exists*/
112+
bool checkViewsGeometryColumns( sqlite3 * handle );
113+
114+
/**Checks if virts_geometry_columns table exists*/
115+
bool checkVirtsGeometryColumns( sqlite3 * handle );
116+
117+
/**Checks if this layer has been declared HIDDEN*/
118+
bool isDeclaredHidden( sqlite3 * handle, QString table, QString geom );
119+
120+
/**cleaning well-formatted SQL strings*/
121+
QString quotedValue( QString value ) const;
122+
109123
/**Inserts information about the spatial tables into mTableModel*/
110124
bool getTableInfo( sqlite3 * handle );
111125

@@ -116,6 +130,8 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
116130
// Set the position of the database connection list to the last
117131
// used one.
118132
void setConnectionListPosition();
133+
// Show the context help for the dialog
134+
void showHelp();
119135
// Combine the table and column data into a single string
120136
// useful for display to the user
121137
QString fullDescription( QString table, QString column, QString type );
@@ -131,7 +147,6 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsSpatiaLiteSource
131147
//! Model that acts as datasource for mTableTreeWidget
132148
QgsSpatiaLiteTableModel mTableModel;
133149
QgsSpatiaLiteFilterProxyModel mProxyModel;
134-
QPushButton * mAddButton;
135150
};
136151

137152
#endif // QGSSPATIALITESOURCESELECT_H

‎src/core/spatialite/headers/spatialite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
spatialite.h -- Gaia spatial support for SQLite
33
4-
version 2.3, 2008 October 13
4+
version 2.4, 2009 September 17
55
66
Author: Sandro Furieri a.furieri@lqt.it
77

‎src/core/spatialite/headers/spatialite/gaiaaux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
gaiaaux.h -- Gaia common utility functions
33
4-
version 2.3, 2008 October 13
4+
version 2.4, 2009 September 17
55
66
Author: Sandro Furieri a.furieri@lqt.it
77

‎src/core/spatialite/headers/spatialite/gaiaexif.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
gaiaexif.h -- Gaia common EXIF Metadata reading functions
33
4-
version 2.3, 2008 October 13
4+
version 2.4, 2009 September 17
55
66
Author: Sandro Furieri a.furieri@lqt.it
77

‎src/core/spatialite/headers/spatialite/gaiageo.h

Lines changed: 235 additions & 30 deletions
Large diffs are not rendered by default.

‎src/core/spatialite/headers/spatialite/spatialite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
spatialite.h -- Gaia support for SQLite extensions
33
4-
version 2.3, 2008 October 13
4+
version 2.4, 2009 September 17
55
66
Author: Sandro Furieri a.furieri@lqt.it
77

‎src/core/spatialite/headers/spatialite/sqlite3.h

Lines changed: 454 additions & 308 deletions
Large diffs are not rendered by default.

‎src/core/spatialite/spatialite.c

Lines changed: 21668 additions & 6237 deletions
Large diffs are not rendered by default.

‎src/core/spatialite/sqlite3.c

Lines changed: 10579 additions & 6465 deletions
Large diffs are not rendered by default.

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 408 additions & 53 deletions
Large diffs are not rendered by default.

‎src/providers/spatialite/qgsspatialiteprovider.h

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
143143
*/
144144
const QgsFieldMap & fields() const;
145145

146-
/** Reset the layer - for a PostgreSQL layer, this means clearing the PQresult
147-
* pointer, setting it to 0 and reloading the field list
148-
*/
146+
/** Reset the layer */
149147
void rewind();
150148

151149
/** Returns the minimum value of an attribute
@@ -241,7 +239,7 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
241239
signals:
242240
/**
243241
* This is emitted whenever the worker thread has fully calculated the
244-
* PostGIS extents for this layer, and its event has been received by this
242+
* extents for this layer, and its event has been received by this
245243
* provider.
246244
*/
247245
void fullExtentCalculated();
@@ -267,6 +265,22 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
267265
* Flag indicating if the layer data source is a valid SpatiaLite layer
268266
*/
269267
bool valid;
268+
/**
269+
* Flag indicating if the layer data source is based on a plain Table
270+
*/
271+
bool mTableBased;
272+
/**
273+
* Flag indicating if the layer data source is based on a View
274+
*/
275+
bool mViewBased;
276+
/**
277+
* Flag indicating if the layer data source is based on a VirtualShape
278+
*/
279+
bool mVShapeBased;
280+
/**
281+
* Flag indicating if the layer data source has ReadOnly restrictions
282+
*/
283+
bool mReadOnly;
270284
/**
271285
* DB full path
272286
*/
@@ -278,11 +292,19 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
278292
/**
279293
* Name of the primary key column in the table
280294
*/
281-
QString primaryKey;
295+
QString mPrimaryKey;
282296
/**
283297
* Name of the geometry column in the table
284298
*/
285-
QString geometryColumn;
299+
QString mGeometryColumn;
300+
/**
301+
* Name of the SpatialIndex table
302+
*/
303+
QString mIndexTable;
304+
/**
305+
* Name of the SpatialIndex geometry column
306+
*/
307+
QString mIndexGeometry;
286308
/**
287309
* Geometry type
288310
*/
@@ -335,7 +357,12 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
335357
//void sqliteOpen();
336358
void closeDb();
337359
QString quotedValue( QString value ) const;
360+
bool checkLayerType();
338361
bool getGeometryDetails();
362+
bool getTableGeometryDetails();
363+
bool getViewGeometryDetails();
364+
bool getVShapeGeometryDetails();
365+
bool getSridDetails();
339366
bool getTableSummary();
340367

341368
public:
@@ -361,6 +388,7 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
361388
void sqliteClose();
362389

363390
static SqliteHandles *openDb( const QString & dbPath );
391+
static bool checkMetadata( sqlite3 * handle );
364392
static void closeDb( SqliteHandles * &handle );
365393
static void closeDb( QMap < QString, SqliteHandles * >&handlesRO, SqliteHandles * &handle );
366394

‎src/ui/qgsspatialitesourceselectbase.ui

Lines changed: 141 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,244 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<ui version="4.0">
1+
<ui version="4.0" >
32
<class>QgsSpatiaLiteSourceSelectBase</class>
4-
<widget class="QDialog" name="QgsSpatiaLiteSourceSelectBase">
5-
<property name="geometry">
3+
<widget class="QDialog" name="QgsSpatiaLiteSourceSelectBase" >
4+
<property name="geometry" >
65
<rect>
76
<x>0</x>
87
<y>0</y>
9-
<width>472</width>
8+
<width>672</width>
109
<height>687</height>
1110
</rect>
1211
</property>
13-
<property name="windowTitle">
12+
<property name="windowTitle" >
1413
<string>Add SpatiaLite Table(s)</string>
1514
</property>
16-
<property name="windowIcon">
15+
<property name="windowIcon" >
1716
<iconset>
1817
<normaloff/>
1918
</iconset>
2019
</property>
21-
<property name="sizeGripEnabled">
20+
<property name="sizeGripEnabled" >
2221
<bool>true</bool>
2322
</property>
24-
<property name="modal">
23+
<property name="modal" >
2524
<bool>true</bool>
2625
</property>
27-
<layout class="QGridLayout">
28-
<property name="margin">
26+
<layout class="QGridLayout" >
27+
<property name="margin" >
2928
<number>9</number>
3029
</property>
31-
<property name="spacing">
30+
<property name="spacing" >
3231
<number>6</number>
3332
</property>
34-
<item row="2" column="0">
33+
<item row="2" column="0" >
3534
<spacer>
36-
<property name="orientation">
35+
<property name="orientation" >
3736
<enum>Qt::Horizontal</enum>
3837
</property>
39-
<property name="sizeHint" stdset="0">
38+
<property name="sizeHint" >
4039
<size>
4140
<width>271</width>
4241
<height>20</height>
4342
</size>
4443
</property>
4544
</spacer>
4645
</item>
47-
<item row="1" column="0" colspan="2">
48-
<widget class="QTreeView" name="mTablesTreeView">
49-
<property name="selectionMode">
46+
<item row="1" column="0" colspan="2" >
47+
<widget class="QTreeView" name="mTablesTreeView" >
48+
<property name="selectionMode" >
5049
<enum>QAbstractItemView::MultiSelection</enum>
5150
</property>
5251
</widget>
5352
</item>
54-
<item row="0" column="0" colspan="2">
55-
<widget class="QGroupBox" name="groupBox">
56-
<property name="title">
53+
<item row="0" column="0" colspan="2" >
54+
<widget class="QGroupBox" name="groupBox" >
55+
<property name="title" >
5756
<string>SpatiaLite DBs</string>
5857
</property>
59-
<layout class="QGridLayout">
60-
<property name="margin">
58+
<layout class="QGridLayout" >
59+
<property name="margin" >
6160
<number>11</number>
6261
</property>
63-
<property name="spacing">
62+
<property name="spacing" >
6463
<number>6</number>
6564
</property>
66-
<item row="1" column="2">
67-
<widget class="QPushButton" name="btnDelete">
68-
<property name="text">
65+
<item row="1" column="2" >
66+
<widget class="QPushButton" name="btnDelete" >
67+
<property name="text" >
6968
<string>Delete</string>
7069
</property>
7170
</widget>
7271
</item>
73-
<item row="1" column="1">
74-
<widget class="QPushButton" name="btnNew">
75-
<property name="text">
72+
<item row="1" column="1" >
73+
<widget class="QPushButton" name="btnNew" >
74+
<property name="text" >
7675
<string>New</string>
7776
</property>
7877
</widget>
7978
</item>
80-
<item row="1" column="0">
81-
<widget class="QPushButton" name="btnConnect">
82-
<property name="text">
79+
<item row="1" column="0" >
80+
<widget class="QPushButton" name="btnConnect" >
81+
<property name="text" >
8382
<string>Connect</string>
8483
</property>
8584
</widget>
8685
</item>
87-
<item row="0" column="0" colspan="3">
88-
<widget class="QComboBox" name="cmbConnections"/>
86+
<item row="0" column="0" colspan="3" >
87+
<widget class="QComboBox" name="cmbConnections" />
8988
</item>
9089
</layout>
9190
</widget>
9291
</item>
93-
<item row="3" column="0" colspan="2">
94-
<widget class="QGroupBox" name="mSearchGroupBox">
95-
<property name="title">
92+
<item row="4" column="0" colspan="2" >
93+
<layout class="QHBoxLayout" >
94+
<property name="margin" >
95+
<number>11</number>
96+
</property>
97+
<property name="spacing" >
98+
<number>6</number>
99+
</property>
100+
<item>
101+
<widget class="QPushButton" name="btnHelp" >
102+
<property name="enabled" >
103+
<bool>true</bool>
104+
</property>
105+
<property name="text" >
106+
<string>Help</string>
107+
</property>
108+
<property name="shortcut" >
109+
<string>F1</string>
110+
</property>
111+
<property name="autoDefault" >
112+
<bool>true</bool>
113+
</property>
114+
</widget>
115+
</item>
116+
<item>
117+
<spacer>
118+
<property name="orientation" >
119+
<enum>Qt::Horizontal</enum>
120+
</property>
121+
<property name="sizeType" >
122+
<enum>QSizePolicy::Expanding</enum>
123+
</property>
124+
<property name="sizeHint" >
125+
<size>
126+
<width>141</width>
127+
<height>21</height>
128+
</size>
129+
</property>
130+
</spacer>
131+
</item>
132+
<item>
133+
<widget class="QPushButton" name="btnAdd" >
134+
<property name="text" >
135+
<string>Add</string>
136+
</property>
137+
<property name="shortcut" >
138+
<string/>
139+
</property>
140+
<property name="autoDefault" >
141+
<bool>true</bool>
142+
</property>
143+
<property name="default" >
144+
<bool>true</bool>
145+
</property>
146+
</widget>
147+
</item>
148+
<item>
149+
<widget class="QPushButton" name="btnCancel" >
150+
<property name="text" >
151+
<string>Close</string>
152+
</property>
153+
<property name="shortcut" >
154+
<string/>
155+
</property>
156+
<property name="autoDefault" >
157+
<bool>true</bool>
158+
</property>
159+
</widget>
160+
</item>
161+
</layout>
162+
</item>
163+
<item row="3" column="0" colspan="2" >
164+
<widget class="QGroupBox" name="mSearchGroupBox" >
165+
<property name="title" >
96166
<string/>
97167
</property>
98-
<layout class="QGridLayout">
99-
<property name="margin">
168+
<layout class="QGridLayout" >
169+
<property name="margin" >
100170
<number>9</number>
101171
</property>
102-
<property name="spacing">
172+
<property name="spacing" >
103173
<number>6</number>
104174
</property>
105-
<item row="0" column="0">
106-
<widget class="QLabel" name="mSearchLabel">
107-
<property name="text">
175+
<item row="0" column="0" >
176+
<widget class="QLabel" name="mSearchLabel" >
177+
<property name="text" >
108178
<string>Search:</string>
109179
</property>
110-
<property name="buddy">
111-
<cstring>mSearchTableEdit</cstring>
112-
</property>
113180
</widget>
114181
</item>
115-
<item row="2" column="0" colspan="2">
116-
<widget class="QLabel" name="mSearchModeLabel">
117-
<property name="text">
182+
<item row="2" column="0" colspan="2" >
183+
<widget class="QLabel" name="mSearchModeLabel" >
184+
<property name="text" >
118185
<string>Search mode:</string>
119186
</property>
120-
<property name="buddy">
121-
<cstring>mSearchModeComboBox</cstring>
122-
</property>
123187
</widget>
124188
</item>
125-
<item row="2" column="2">
126-
<widget class="QComboBox" name="mSearchModeComboBox"/>
189+
<item row="2" column="2" >
190+
<widget class="QComboBox" name="mSearchModeComboBox" />
127191
</item>
128-
<item row="1" column="0" colspan="2">
129-
<widget class="QLabel" name="mSearchColumnsLabel">
130-
<property name="text">
192+
<item row="1" column="0" colspan="2" >
193+
<widget class="QLabel" name="mSearchColumnsLabel" >
194+
<property name="text" >
131195
<string>Search in columns:</string>
132196
</property>
133-
<property name="buddy">
134-
<cstring>mSearchColumnComboBox</cstring>
135-
</property>
136197
</widget>
137198
</item>
138-
<item row="1" column="2">
139-
<widget class="QComboBox" name="mSearchColumnComboBox"/>
199+
<item row="1" column="2" >
200+
<widget class="QComboBox" name="mSearchColumnComboBox" />
140201
</item>
141-
<item row="0" column="1" colspan="2">
142-
<widget class="QLineEdit" name="mSearchTableEdit"/>
202+
<item row="0" column="1" colspan="2" >
203+
<widget class="QLineEdit" name="mSearchTableEdit" />
143204
</item>
144205
</layout>
145206
</widget>
146207
</item>
147-
<item row="2" column="1">
148-
<widget class="QPushButton" name="mSearchOptionsButton">
149-
<property name="text">
208+
<item row="2" column="1" >
209+
<widget class="QPushButton" name="mSearchOptionsButton" >
210+
<property name="text" >
150211
<string>Search options...</string>
151212
</property>
152213
</widget>
153214
</item>
154-
<item row="4" column="0" colspan="2">
155-
<widget class="QDialogButtonBox" name="buttonBox">
156-
<property name="standardButtons">
157-
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
158-
</property>
159-
</widget>
160-
</item>
161215
</layout>
162216
</widget>
163-
<layoutdefault spacing="6" margin="11"/>
217+
<layoutdefault spacing="6" margin="11" />
164218
<tabstops>
165219
<tabstop>cmbConnections</tabstop>
166220
<tabstop>btnConnect</tabstop>
167221
<tabstop>btnNew</tabstop>
168222
<tabstop>btnDelete</tabstop>
169-
<tabstop>mTablesTreeView</tabstop>
170-
<tabstop>mSearchOptionsButton</tabstop>
171-
<tabstop>mSearchTableEdit</tabstop>
172-
<tabstop>mSearchColumnComboBox</tabstop>
173-
<tabstop>mSearchModeComboBox</tabstop>
174-
<tabstop>buttonBox</tabstop>
223+
<tabstop>btnHelp</tabstop>
224+
<tabstop>btnAdd</tabstop>
225+
<tabstop>btnCancel</tabstop>
175226
</tabstops>
176227
<resources/>
177228
<connections>
178229
<connection>
179-
<sender>buttonBox</sender>
180-
<signal>rejected()</signal>
230+
<sender>btnCancel</sender>
231+
<signal>clicked()</signal>
181232
<receiver>QgsSpatiaLiteSourceSelectBase</receiver>
182233
<slot>reject()</slot>
183234
<hints>
184-
<hint type="sourcelabel">
185-
<x>431</x>
186-
<y>666</y>
235+
<hint type="sourcelabel" >
236+
<x>404</x>
237+
<y>446</y>
187238
</hint>
188-
<hint type="destinationlabel">
189-
<x>465</x>
190-
<y>527</y>
239+
<hint type="destinationlabel" >
240+
<x>229</x>
241+
<y>236</y>
191242
</hint>
192243
</hints>
193244
</connection>

0 commit comments

Comments
 (0)
Please sign in to comment.