Stellarium
23.4
|
Static Public Member Functions | |
static bool | argsGetOption (const QStringList &argList, QString shortOpt, QString longOpt) |
Check if a QStringList has a CLI-style option in it (before the first –). More... | |
static QVariant | argsGetOptionWithArg (const QStringList &argList, QString shortOpt, QString longOpt, QVariant defaultValue) |
Retrieve the argument to an option from a QStringList. More... | |
static int | argsGetYesNoOption (const QStringList &argList, QString shortOpt, QString longOpt, int defaultValue) |
Check if a QStringList has a yes/no CLI-style option in it, and find out the argument to that parameter. More... | |
static void | parseCLIArgsPreConfig (const QStringList &argList) |
Processing of command line options which is to be done before config file is read. More... | |
static void | parseCLIArgsPreQApp (const QStringList argList) |
Processing of command-line options which must be processed before QGuiApplication is created. More... | |
static void | parseCLIArgsPostConfig (const QStringList &argList, QSettings *conf) |
Processing of command line options which is to be done after the config file is read. More... | |
|
static |
Check if a QStringList has a CLI-style option in it (before the first –).
argList | a list of strings, think argv |
shortOpt | a short-form option string, e.g, "-h" |
longOpt | a long-form option string, e.g. "--help" |
|
static |
Retrieve the argument to an option from a QStringList.
Given a list of strings, this function will extract the argument of type T to an option, where the option in an element which matches either the short or long forms, and the argument to that option is the following element in the list, e.g. ("--option", "arg"). It is also possible to extract argument to options which are part of the option element, separated by the "=" character, e.g. ( "--option=arg" ). Type conversion is done using the QTextStream class, and as such possible types which this template function may use are restricted to those where there is a value operator<<() defined in the QTextStream class for that type. The argument list is only processed as far as the first value "--". If an argument "--" is to be retrieved, it must be apecified using the "--option=--" form.
argList | a list of strings, think argv. |
shortOpt | the short form of the option, e.g. "-n". |
longOpt | the long form of the option, e.g. "--number". |
defaultValue | the default value to return if the option was not found in args. |
runtime_error("no_optarg") | the expected argument to the option was not found. |
runtime_error("optarg_type") | the expected argument to the option could not be converted. |
|
static |
Check if a QStringList has a yes/no CLI-style option in it, and find out the argument to that parameter.
e.g. option –use-foo can have parameter "yes" or "no" It is also possible for the argument to take values, "1", "0"; "true", "false";
argList | a list of strings, think argv |
shortOpt | a short-form option string, e.g, "-h" |
longOpt | a long-form option string, e.g. "--help" |
defaultValue | the default value to return if the option was not found in args. |
runtime_error("no_optarg") | the expected argument to the option was not found. The longOpt value is appended in parenthesis. |
runtime_error("optarg_type") | the expected argument to the option could not be converted. The longOpt value is appended in parenthesis. |
|
static |
Processing of command line options which is to be done after the config file is read.
This gives us the chance to over-ride settings which are in the configuration file.
|
static |
Processing of command line options which is to be done before config file is read.
This includes the chance to set the configuration file name. It is to be done in the sub-class of the StelApp, as the sub-class may want to manage the argument list, as is the case with the StelMainWindow version.
|
static |
Processing of command-line options which must be processed before QGuiApplication is created.
This includes the options that set environment variables like QT_OPENGL that are read in the constructor of QGuiApplication.