@@ -55,13 +55,19 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
55
55
QgsSettings settings;
56
56
restoreGeometry ( settings.value ( QStringLiteral ( " Windows/NewSpatiaLiteLayer/geometry" ) ).toByteArray () );
57
57
58
+ mGeometryTypeBox ->addItem ( tr ( " Point" ), QStringLiteral ( " POINT" ) );
59
+ mGeometryTypeBox ->addItem ( tr ( " Line" ), QStringLiteral ( " LINE" ) );
60
+ mGeometryTypeBox ->addItem ( tr ( " Polygon" ), QStringLiteral ( " POLYGON" ) );
61
+ mGeometryTypeBox ->addItem ( tr ( " MultiPoint" ), QStringLiteral ( " MULTIPOINT" ) );
62
+ mGeometryTypeBox ->addItem ( tr ( " MultiLine" ), QStringLiteral ( " MULTILINE" ) );
63
+ mGeometryTypeBox ->addItem ( tr ( " MultiPolygon" ), QStringLiteral ( " MULTIPOLYGON" ) );
64
+
58
65
mAddAttributeButton ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionNewAttribute.svg" ) ) );
59
66
mRemoveAttributeButton ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionDeleteAttribute.svg" ) ) );
60
67
mTypeBox ->addItem ( tr ( " Text data" ), " text" );
61
68
mTypeBox ->addItem ( tr ( " Whole number" ), " integer" );
62
69
mTypeBox ->addItem ( tr ( " Decimal number" ), " real" );
63
70
64
- mPointRadioButton ->setChecked ( true );
65
71
// Populate the database list from the stored connections
66
72
settings.beginGroup ( QStringLiteral ( " SpatiaLite/connections" ) );
67
73
QStringList keys = settings.childGroups ();
@@ -137,33 +143,7 @@ void QgsNewSpatialiteLayerDialog::toolButtonNewDatabase_clicked()
137
143
138
144
QString QgsNewSpatialiteLayerDialog::selectedType () const
139
145
{
140
- if ( mPointRadioButton ->isChecked () )
141
- {
142
- return QStringLiteral ( " POINT" );
143
- }
144
- else if ( mLineRadioButton ->isChecked () )
145
- {
146
- return QStringLiteral ( " LINESTRING" );
147
- }
148
- else if ( mPolygonRadioButton ->isChecked () )
149
- {
150
- return QStringLiteral ( " POLYGON" );
151
- }
152
- else if ( mMultipointRadioButton ->isChecked () )
153
- {
154
- return QStringLiteral ( " MULTIPOINT" );
155
- }
156
- else if ( mMultilineRadioButton ->isChecked () )
157
- {
158
- return QStringLiteral ( " MULTILINESTRING" );
159
- }
160
- else if ( mMultipolygonRadioButton ->isChecked () )
161
- {
162
- return QStringLiteral ( " MULTIPOLYGON" );
163
- }
164
-
165
- Q_ASSERT ( !" no type selected" );
166
- return QLatin1String ( " " );
146
+ return mGeometryTypeBox ->currentData ( Qt::UserRole ).toString ();
167
147
}
168
148
169
149
void QgsNewSpatialiteLayerDialog::checkOk ()
0 commit comments