25 #include <QPushButton> 30 #include <QFileDialog> 35 if ( dialog.
exec() == QDialog::Rejected )
43 switch ( geometrytype )
49 geomType =
"linestring";
55 geomType =
"multipoint";
58 geomType =
"multilinestring";
61 geomType =
"multipolygon";
88 mPointRadioButton->setChecked(
true );
93 mCrsSelector->setCrs( defaultCrs );
95 mNameLineEdit->setText(
tr(
"New scratch layer" ) );
106 if ( !buttonGroupGeometry->isChecked() )
110 else if ( mPointRadioButton->isChecked() )
114 else if ( mLineRadioButton->isChecked() )
118 else if ( mPolygonRadioButton->isChecked() )
122 else if ( mMultiPointRadioButton->isChecked() )
126 else if ( mMultiLineRadioButton->isChecked() )
130 else if ( mMultiPolygonRadioButton->isChecked() )
139 return mCrsSelector->crs();
144 return mNameLineEdit->text();
QGis::WkbType selectedType() const
Returns the selected geometry type.
QByteArray toByteArray() const
QgsNewMemoryLayerDialog(QWidget *parent=nullptr, const Qt::WindowFlags &fl=QgisGui::ModalDialogFlags)
QString & append(QChar ch)
void validate()
Perform some validation on this CRS.
static QgsVectorLayer * runAndCreateLayer(QWidget *parent=nullptr)
Runs the dialoag and creates a new memory layer.
WkbType
Used for symbology operations.
QString tr(const char *sourceText, const char *disambiguation, int n)
void setValue(const QString &key, const QVariant &value)
bool createFromOgcWmsCrs(QString theCrs)
Set up this CRS from the given OGC CRS.
const char * name() const
const QString GEO_EPSG_CRS_AUTHID
Geographic coord sys from EPSG authority.
QString layerName() const
Returns the layer name.
QVariant value(const QString &key, const QVariant &defaultValue) const
~QgsNewMemoryLayerDialog()
Class for storing a coordinate reference system (CRS)
QString authid() const
Returns the authority identifier for the CRS, which includes both the authority (eg EPSG) and the CRS...
QgsCoordinateReferenceSystem crs() const
Returns the selected crs.
Represents a vector layer which manages a vector based data sets.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const