15 #ifndef QGSPROJECTSTYLESETTINGS_H
16 #define QGSPROJECTSTYLESETTINGS_H
18 #include "qgis_core.h"
23 #include <QAbstractListModel>
24 #include <QSortFilterProxyModel>
143 bool readXml(
const QDomElement &element,
const QgsReadWriteContext &context, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
168 QList< QgsStyle * > styles()
const;
173 QgsStyle *styleAtPath(
const QString &path );
187 void addStyleDatabasePath(
const QString &path );
201 void setStyleDatabasePaths(
const QStringList &paths );
203 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
225 void styleDatabasesChanged();
234 void styleDatabaseAboutToBeAdded(
const QString &path );
241 void styleDatabaseAdded(
const QString &path );
248 void styleDatabaseAboutToBeRemoved(
const QString &path );
255 void styleDatabaseRemoved(
const QString &path );
262 void projectStyleChanged();
269 std::unique_ptr< QgsSymbol > mDefaultMarkerSymbol;
270 std::unique_ptr< QgsSymbol > mDefaultLineSymbol;
271 std::unique_ptr< QgsSymbol > mDefaultFillSymbol;
272 std::unique_ptr< QgsColorRamp > mDefaultColorRamp;
275 bool mRandomizeDefaultSymbolColor =
true;
276 double mDefaultSymbolOpacity = 1.0;
279 QStringList mStyleDatabases;
280 QList< QPointer< QgsStyle > > mStyles;
284 void loadStyleAtPath(
const QString &path );
306 StyleRole = Qt::UserRole + 1,
315 int rowCount(
const QModelIndex &parent )
const override;
316 QVariant data(
const QModelIndex &index,
int role )
const override;
322 QgsStyle *styleFromIndex(
const QModelIndex &index )
const;
328 QModelIndex indexFromStyle(
QgsStyle *style )
const;
335 void setShowDefaultStyle(
bool show );
345 void styleDatabaseAboutToBeAdded(
const QString &path );
346 void styleDatabaseAboutToBeRemoved(
const QString &path );
347 void styleDatabaseAdded(
const QString &path );
348 void styleDatabaseRemoved(
const QString &path );
350 void setProjectStyle(
QgsStyle *style );
351 void projectStyleAboutToBeDestroyed();
352 void projectStyleDestroyed();
353 void projectStyleChanged();
357 bool mShowDefault =
false;
358 QPointer< QgsStyle > mProjectStyle;
378 FilterHideReadOnly = 1 << 0,
382 Q_DECLARE_FLAGS( Filters, Filter )
390 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
397 QgsProjectStyleDatabaseProxyModel::Filters filters()
const;
404 void setFilters( QgsProjectStyleDatabaseProxyModel::Filters filters );
408 QgsProjectStyleDatabaseProxyModel::Filters mFilters;
414 #endif // QGSPROJECTSTYLESETTINGS_H