26 addApplicationThemes();
29void QgsApplicationThemeRegistry::addApplicationThemes()
31 mThemes.insert(
"default"_L1, QString() );
34 for (
const QString &path : paths )
37 const QFileInfoList folderInfos = folder.entryInfoList( QDir::Dirs | QDir::NoDotAndDotDot );
38 for (
const QFileInfo &folderInfo : folderInfos )
40 const QString name = folderInfo.baseName();
41 const QString folder = folderInfo.absoluteFilePath();
49 if ( mThemes.contains( name ) )
54 const QFileInfo folderInfo( folder );
55 if ( !folderInfo.exists() )
60 const QFileInfo styleInfo( folderInfo.absoluteFilePath() +
"/style.qss" );
61 if ( !styleInfo.exists() )
66 mThemes.insert( name, folder );
72 if ( !mThemes.contains( name ) )
77 mThemes.remove( name );
83 return mThemes.keys();
88 return mThemes.value( name );
QHash< QString, QString > themeFolders() const
Returns a map of user interface theme names and folders.
QgsApplicationThemeRegistry()
Constructor for an empty user interface theme registry.
QStringList themes() const
Returns the list of available user interface themes.
QString themeFolder(const QString &name) const
Returns the user interface theme folder for a matching name.
bool addTheme(const QString &name, const QString &folder)
Adds a user interface theme into the registry.
bool removeTheme(const QString &name)
Removes a user interface theme with a matching name from the registry.
static QgsApplication * instance()
Returns the singleton instance of the QgsApplication.
static QString defaultThemesFolder()
Returns the path to default themes folder from install (works as a starting point).
static QString userThemesFolder()
Returns the path to user's themes folder.