15#ifndef QGSPROJECTSTYLESETTINGS_H
16#define QGSPROJECTSTYLESETTINGS_H
25#include <QAbstractListModel>
28#include <QSortFilterProxyModel>
111 void setRandomizeDefaultSymbolColor(
bool randomized );
121 void setDefaultSymbolOpacity(
double opacity );
133 void removeProjectStyle();
197 void setColorSpace(
const QColorSpace &colorSpace );
210 QColorSpace colorSpace()
const;
241 QList< QgsStyle * > styles()
const;
246 QgsStyle *styleAtPath(
const QString &path );
260 void addStyleDatabasePath(
const QString &path );
274 void setStyleDatabasePaths(
const QStringList &paths );
337 std::unique_ptr< QgsSymbol > mDefaultMarkerSymbol;
338 std::unique_ptr< QgsSymbol > mDefaultLineSymbol;
339 std::unique_ptr< QgsSymbol > mDefaultFillSymbol;
340 std::unique_ptr< QgsColorRamp > mDefaultColorRamp;
343 bool mRandomizeDefaultSymbolColor =
true;
344 double mDefaultSymbolOpacity = 1.0;
347 QStringList mStyleDatabases;
348 QList< QPointer< QgsStyle > > mStyles;
352 QColorSpace mColorSpace;
353 QString mIccProfileFilePath;
355 void loadStyleAtPath(
const QString &path );
399 int rowCount(
const QModelIndex &parent )
const override;
400 QVariant data(
const QModelIndex &index,
int role )
const override;
406 QgsStyle *styleFromIndex(
const QModelIndex &index )
const;
412 QModelIndex indexFromStyle(
QgsStyle *style )
const;
419 void setShowDefaultStyle(
bool show );
429 void styleDatabaseAboutToBeAdded(
const QString &path );
430 void styleDatabaseAboutToBeRemoved(
const QString &path );
431 void styleDatabaseAdded(
const QString &path );
432 void styleDatabaseRemoved(
const QString &path );
434 void setProjectStyle(
QgsStyle *style );
435 void projectStyleAboutToBeDestroyed();
436 void projectStyleDestroyed();
437 void projectStyleChanged();
441 bool mShowDefault =
false;
442 QPointer< QgsStyle > mProjectStyle;
462 FilterHideReadOnly = 1 << 0,
474 bool filterAcceptsRow(
int sourceRow, const QModelIndex &sourceParent ) const override;
QFlags< ProjectReadFlag > ProjectReadFlags
Project load flags.
ColorModel
Color model types.
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.
QgsProjectStyleDatabaseModel(QgsProjectStyleSettings *settings, QObject *parent=nullptr)
Constructor for QgsProjectStyleDatabaseModel, showing the styles from the specified settings.
Filter
Available filter flags for filtering the model.
QgsProjectStyleDatabaseProxyModel::Filters filters() const
Returns the current filters used for filtering available style.
QFlags< Filter > Filters
Available filter flags for filtering the model.
void setFilters(QgsProjectStyleDatabaseProxyModel::Filters filters)
Sets the current filters used for filtering available styles.
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
QgsProjectStyleDatabaseProxyModel(QgsProjectStyleDatabaseModel *model, QObject *parent=nullptr)
Constructor for QgsProjectStyleDatabaseProxyModel, for the specified style database model.
Contains settings and properties relating to how a QgsProject should handle styling.
void setDefaultTextFormat(const QgsTextFormat &textFormat)
Sets the project default text format.
friend class TestQgsProjectProperties
QgsTextFormat defaultTextFormat() const
Returns the project default text format.
double defaultSymbolOpacity() const
Returns the default symbol opacity.
void projectStyleChanged()
Emitted when the style returned by projectStyle() is changed.
QgsColorRamp * defaultColorRamp() const
Returns the project default color ramp.
QgsSymbol * defaultSymbol(Qgis::SymbolType symbolType) const
Returns the project default symbol for a given type.
void setDefaultSymbol(Qgis::SymbolType symbolType, QgsSymbol *symbol)
Sets the project default symbol for a given type.
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.
QgsProjectStyleSettings(QgsProject *project=nullptr)
Constructor for QgsProjectStyleSettings for the specified 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 setDefaultColorRamp(QgsColorRamp *colorRamp)
Sets the project default color ramp.
void styleDatabaseRemoved(const QString &path)
Emitted when a style database path is removed.
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,...
A container for the context for various read/write operations on objects.
A database of saved style entities, including symbols, color ramps, text formats and others.
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)