Skip to content
Permalink
Browse files

[needs-docs][spatialite] Add datetime and date field types in the cre…

…ate new spatialite layer dialog
  • Loading branch information
nirvn committed May 29, 2020
1 parent 317c798 commit def348be2bd386cb6831184a4a3e5688550bb663
Showing with 5 additions and 1 deletion.
  1. +4 −0 src/app/qgsnewspatialitelayerdialog.cpp
  2. +1 −1 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -70,6 +70,8 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
mTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldText.svg" ) ), tr( "Text Data" ), "text" );
mTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldInteger.svg" ) ), tr( "Whole Number" ), "integer" );
mTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldFloat.svg" ) ), tr( "Decimal Number" ), "real" );
mTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldDate.svg" ) ), tr( "Date" ), "date" );
mTypeBox->addItem( QgsApplication::getThemeIcon( QStringLiteral( "/mIconFieldDateTime.svg" ) ), tr( "Date Time" ), "timestamp" );

mDatabaseComboBox->setProvider( QStringLiteral( "spatialite" ) );

@@ -119,6 +121,8 @@ void QgsNewSpatialiteLayerDialog::mTypeBox_currentIndexChanged( int index )
case 0: // Text data
case 1: // Whole number
case 2: // Decimal number
case 3: // Date
case 4: // Date time
default:
break;
}
@@ -620,7 +620,7 @@ QgsSpatiaLiteProvider::QgsSpatiaLiteProvider( QString const &uri, const Provider
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (double)" ), QStringLiteral( "FLOAT" ), QVariant::Double )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer)" ), QStringLiteral( "INTEGER" ), QVariant::LongLong )
<< QgsVectorDataProvider::NativeType( tr( "Date" ), QStringLiteral( "DATE" ), QVariant::Date )
<< QgsVectorDataProvider::NativeType( tr( "Date Time" ), QStringLiteral( "DATE" ), QVariant::DateTime )
<< QgsVectorDataProvider::NativeType( tr( "Date Time" ), QStringLiteral( "TIMESTAMP" ), QVariant::DateTime )

<< QgsVectorDataProvider::NativeType( tr( "Array of text" ), SPATIALITE_ARRAY_PREFIX.toUpper() + "TEXT" + SPATIALITE_ARRAY_SUFFIX.toUpper(), QVariant::StringList, 0, 0, 0, 0, QVariant::String )
<< QgsVectorDataProvider::NativeType( tr( "Array of decimal numbers (double)" ), SPATIALITE_ARRAY_PREFIX.toUpper() + "REAL" + SPATIALITE_ARRAY_SUFFIX.toUpper(), QVariant::List, 0, 0, 0, 0, QVariant::Double )

0 comments on commit def348b

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