15#ifndef QGSPROJECTSTYLESETTINGS_H
16#define QGSPROJECTSTYLESETTINGS_H
24#include <QAbstractListModel>
25#include <QSortFilterProxyModel>
131 void removeProjectStyle();
151 bool readXml(
const QDomElement &element,
const QgsReadWriteContext &context, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
176 QList< QgsStyle * > styles()
const;
181 QgsStyle *styleAtPath(
const QString &path );
195 void addStyleDatabasePath(
const QString &path );
209 void setStyleDatabasePaths(
const QStringList &paths );
272 std::unique_ptr< QgsSymbol > mDefaultMarkerSymbol;
273 std::unique_ptr< QgsSymbol > mDefaultLineSymbol;
274 std::unique_ptr< QgsSymbol > mDefaultFillSymbol;
275 std::unique_ptr< QgsColorRamp > mDefaultColorRamp;
278 bool mRandomizeDefaultSymbolColor =
true;
279 double mDefaultSymbolOpacity = 1.0;
282 QStringList mStyleDatabases;
283 QList< QPointer< QgsStyle > > mStyles;
287 void loadStyleAtPath(
const QString &path );
327 int rowCount(
const QModelIndex &parent )
const override;
328 QVariant data(
const QModelIndex &index,
int role )
const override;
334 QgsStyle *styleFromIndex(
const QModelIndex &index )
const;
340 QModelIndex indexFromStyle(
QgsStyle *style )
const;
347 void setShowDefaultStyle(
bool show );
357 void styleDatabaseAboutToBeAdded(
const QString &path );
358 void styleDatabaseAboutToBeRemoved(
const QString &path );
359 void styleDatabaseAdded(
const QString &path );
360 void styleDatabaseRemoved(
const QString &path );
362 void setProjectStyle(
QgsStyle *style );
363 void projectStyleAboutToBeDestroyed();
364 void projectStyleDestroyed();
365 void projectStyleChanged();
369 bool mShowDefault =
false;
370 QPointer< QgsStyle > mProjectStyle;
390 FilterHideReadOnly = 1 << 0,
394 Q_DECLARE_FLAGS( Filters, Filter )
402 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
409 QgsProjectStyleDatabaseProxyModel::Filters filters()
const;
416 void setFilters( QgsProjectStyleDatabaseProxyModel::Filters filters );
420 QgsProjectStyleDatabaseProxyModel::Filters mFilters;
SymbolType
Attribute editing capabilities which may be supported by vector data providers.
Abstract base class for color ramps.
A model which contains entities from multiple QgsStyle databases.
List model representing the style databases associated with a QgsProject.
CustomRole
Custom model roles.
bool showDefaultStyle() const
Returns true if the model includes the default style.
A proxy model for filtering QgsProjectStyleDatabaseModel.
Filter
Available filter flags for filtering the model.
Contains settings and properties relating to how a QgsProject should handle styling.
double defaultSymbolOpacity() const
Returns the default symbol opacity.
void projectStyleChanged()
Emitted when the style returned by projectStyle() is changed.
bool randomizeDefaultSymbolColor() const
Returns whether the default symbol fill color is randomized.
QStringList styleDatabasePaths() const
Returns a list of all style databases (file paths) associated with the project.
void styleDatabaseAdded(const QString &path)
Emitted when a style database path is added.
void styleDatabaseAboutToBeRemoved(const QString &path)
Emitted when a style database path is about to be removed.
void setRandomizeDefaultSymbolColor(bool randomized)
Sets whether the default symbol fill color is randomized.
void styleDatabaseRemoved(const QString &path)
Emitted when a style database path is removed.
void setDefaultSymbolOpacity(double opacity)
Sets the default symbol opacity.
void styleDatabaseAboutToBeAdded(const QString &path)
Emitted when a style database path is about to be added.
void styleDatabasesChanged()
Emitted whenever the set of style databases associated with the project is changed.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
The class is used as a container of context for various read/write operations on other objects.
Abstract base class for all rendered symbols.
Container for all settings relating to text rendering.
#define SIP_ENUM_BASETYPE(type)
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)