代码拉取完成,页面将自动刷新
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "commandlinemanager.h"
#include <QCommandLineOption>
class CommandLineManagerGlobal : public CommandLineManager {};
Q_GLOBAL_STATIC(CommandLineManagerGlobal, commandLineManagerGlobal);
CommandLineManager::CommandLineManager()
: m_commandParser(new QCommandLineParser)
{
// 必须设置为长选项模式,否则解析时 -window-id 将识别错误
m_commandParser->setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
initOptions();
}
CommandLineManager *CommandLineManager::instance()
{
return commandLineManagerGlobal;
}
CommandLineManager::~CommandLineManager()
{
}
void CommandLineManager::initOptions()
{
QCommandLineOption subWindowOption("window-id", "displays as a child of the given ID window.\nNOTE:is '-window-id',not '--window-id'", "ID");
QCommandLineOption pathOption(QStringList() << "d" << "directory", "set the path to find pictures.", "PATH");
QCommandLineOption intervalTimeOption(QStringList() << "t" << "interval-time", "set the number of seconds slideshow pictures."
"\n 0:1 minutes\n 1:3 minutes\n 2:5 minutes\n 3:10 minutes"
"\n 4:30 minutes\n 5:60 minutes", "TIME");
QCommandLineOption intervalModeOption(QStringList() << "m" << "interval-mode", "set whether to paly randomly.\n true or false", "MODE");
QCommandLineOption config(QStringList() << "config", "show config user Interface");
m_commandParser->addOption(subWindowOption);
m_commandParser->addOption(pathOption);
m_commandParser->addOption(intervalTimeOption);
m_commandParser->addOption(intervalModeOption);
m_commandParser->addOption(config);
}
void CommandLineManager::process(const QStringList &arguments)
{
m_commandParser->process(arguments);
}
bool CommandLineManager::isSet(const QString &name) const
{
return m_commandParser->isSet(name);
}
QString CommandLineManager::value(const QString &name) const
{
return m_commandParser->value(name);
}
QStringList CommandLineManager::positionalArguments()
{
return m_commandParser->positionalArguments();
}
QStringList CommandLineManager::unknownOptionNames()
{
return m_commandParser->unknownOptionNames();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。