Stellarium  26.3
Static Public Member Functions
ScmSCLoader Class Reference

Utility class for loading an existing sky culture. More...

#include <ScmSCLoader.hpp>

Static Public Member Functions

static scm::ScmSkyCulture * loadFromDirectory (const QDir &dir, QString *errorMsg=nullptr, QStringList *unrecognizedHeadings=nullptr)
 Loads a sky culture from a given directory. More...
 
static scm::ScmSkyCulture * selectAndLoad (QWidget *parent=nullptr, const QString &defaultPath={}, QString *errorMsg=nullptr, QStringList *unrecognizedHeadings=nullptr)
 Opens a directory picker and loads the selected sky culture. More...
 

Detailed Description

Utility class for loading an existing sky culture.

Member Function Documentation

◆ loadFromDirectory()

static scm::ScmSkyCulture* ScmSCLoader::loadFromDirectory ( const QDir &  dir,
QString *  errorMsg = nullptr,
QStringList *  unrecognizedHeadings = nullptr 
)
static

Loads a sky culture from a given directory.

The directory must contain at least an index.json file. The files territory.geojson and description.md are loaded when present.

Parameters
dirSky culture directory to load.
errorMsgIf non-null, receives a human-readable error description on failure.
unrecognizedHeadingsIf non-null, receives the list of headings in description.md that could not be mapped to a known section or constellation.
Returns
Newly heap-allocated ScmSkyCulture on success, nullptr on failure.

◆ selectAndLoad()

static scm::ScmSkyCulture* ScmSCLoader::selectAndLoad ( QWidget *  parent = nullptr,
const QString &  defaultPath = {},
QString *  errorMsg = nullptr,
QStringList *  unrecognizedHeadings = nullptr 
)
static

Opens a directory picker and loads the selected sky culture.

Parameters
parentParent widget for the file dialog (may be nullptr).
defaultPathInitial directory shown in the picker.
errorMsgIf non-null, receives a human-readable error on failure.
unrecognizedHeadingsIf non-null, receives the list of headings in description.md that could not be mapped to a known section or constellation.
Returns
Newly heap-allocated ScmSkyCulture, or nullptr if the user cancelled or loading failed.