QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
39 defaultTags.sort( Qt::CaseInsensitive );
40 mTags->addItems( defaultTags );
42 QList< QgsStyle::StyleEntity > possibleEntities;
46 this->setWindowTitle( tr(
"Save New Symbol" ) );
51 this->setWindowTitle( tr(
"Save New Color Ramp" ) );
56 this->setWindowTitle( tr(
"Save New Text Format" ) );
61 this->setWindowTitle( tr(
"Save New Label Settings" ) );
66 this->setWindowTitle( tr(
"Save New Legend Patch Shape" ) );
71 this->setWindowTitle( tr(
"Save New 3D Symbol" ) );
80 #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
81 mLabelDestination->hide();
82 mComboBoxDestination->hide();
88 if ( styleProxyModel->rowCount( QModelIndex() ) == 0 )
90 mLabelDestination->hide();
91 mComboBoxDestination->hide();
96 mComboBoxDestination->setModel( styleProxyModel );
100 if ( possibleEntities.size() < 2 )
102 mLabelSaveAs->hide();
103 mComboSaveAs->hide();
112 mComboSaveAs->addItem( tr(
"Symbol" ), e );
140 mComboSaveAs->setCurrentIndex( 0 );
146 return mName->text();
151 mTags->setCurrentText( tags );
156 return mTags->currentText();
161 return mFavorite->isChecked();
166 if ( mComboSaveAs->count() > 0 )
174 #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
177 if (
QgsStyle *style = qobject_cast< QgsStyle * >( mComboBoxDestination->model()->data( mComboBoxDestination->model()->index( mComboBoxDestination->currentIndex(), 0, QModelIndex() ),
QgsProjectStyleDatabaseModel::StyleRole ).value< QObject * >() ) )
@ ColorrampEntity
Color ramps.
List model representing the style databases associated with a QgsProject.
void setDefaultTags(const QString &tags)
Sets the default tags for the newly created item.
QgsStyle * destinationStyle()
Returns the destination style database.
QgsStyleSaveDialog(QWidget *parent=nullptr, QgsStyle::StyleEntity type=QgsStyle::SymbolEntity)
Constructor for QgsSymbolSaveDialog.
static QgsProject * instance()
Returns the QgsProject singleton instance.
@ FilterHideReadOnly
Hide read-only style databases.
@ LegendPatchShapeEntity
Legend patch shape (since QGIS 3.14)
@ LabelSettingsEntity
Label settings.
static QgsStyle * defaultStyle()
Returns default application-wide style.
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
QString name() const
Returns the entered name for the new symbol.
@ Symbol3DEntity
3D symbol entity (since QGIS 3.14)
QgsStyle::StyleEntity selectedType() const
Returns the type of style entity to save.
QStringList tags() const
Returns a list of all tags in the style database.
@ SmartgroupEntity
Smart groups.
bool isFavorite() const
Returns true if the favorite is checked for the symbol.
QString tags() const
Returns any tags entered for the new symbol (as a comma separated value list).
void setFilters(QgsProjectStyleDatabaseProxyModel::Filters filters)
Sets the current filters used for filtering available styles.
@ TextFormatEntity
Text formats.
A proxy model for filtering QgsProjectStyleDatabaseModel.
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
void setShowDefaultStyle(bool show)
Sets whether the default style should also be included in the model.
StyleEntity
Enum for Entities involved in a style.