本文整理汇总了C++中setHelp函数的典型用法代码示例。如果您正苦于以下问题:C++ setHelp函数的具体用法?C++ setHelp怎么用?C++ setHelp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setHelp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print
ParameterList::ParameterList()
{
Callback helpCallback = [&](uint32_t) {
print();
};
setHelp(add("help", helpCallback), "Print help");
setHelp(add("h", helpCallback), "Print help");
}
示例2: columns
CmdStatistics::CmdStatistics():
columns(-1),
sorting(-1)
{
setCmd("stat");
setInfo("Messages statistics.");
setHelp("rpri [name] [priority] Set render priority.");
setHelp("stat [columns=-1] [sorting=-1] Number of colums to output (-1:all), sort by column (-1:none).");
setMsgType( af::Msg::TStatRequest);
setMsgOutType( af::Msg::TStatData);
}
示例3: it
void Application::parseOptions(const QStringList &options)
{
QStringListIterator it(options);
// skip file name;
if (it.hasNext()) it.next();
//parse options; if help or bad option exit
while (it.hasNext()) {
QString option = it.next();
if (option == QLatin1String("--help") || option == QLatin1String("-h")) {
setHelp();
break;
} else if (option == QLatin1String("--logwindow") ||
option == QLatin1String("-l")) {
_showLogWindow = true;
} else if (option == QLatin1String("--logfile")) {
if (it.hasNext() && !it.peekNext().startsWith(QLatin1String("--"))) {
_logFile = it.next();
} else {
setHelp();
}
} else if (option == QLatin1String("--logdir")) {
if (it.hasNext() && !it.peekNext().startsWith(QLatin1String("--"))) {
_logDir = it.next();
} else {
setHelp();
}
} else if (option == QLatin1String("--logexpire")) {
if (it.hasNext() && !it.peekNext().startsWith(QLatin1String("--"))) {
_logExpire = it.next().toInt();
} else {
setHelp();
}
} else if (option == QLatin1String("--logflush")) {
_logFlush = true;
} else if (option == QLatin1String("--confdir")) {
if (it.hasNext() && !it.peekNext().startsWith(QLatin1String("--"))) {
QString confDir = it.next();
if (!ConfigFile::setConfDir( confDir )) {
std::cerr << "Invalid path passed to --confdir" << std::endl;
std::exit(1);
}
} else {
showHelp();
}
} else if (option == QLatin1String("--debug")) {
_debugMode = true;
} else {
setHelp();
break;
}
}
}
示例4: setCmd
CmdInvalid::CmdInvalid()
{
setCmd("inv");
setInfo("Try invalid message.");
setHelp("Send invalid type of message. For debug purposes.");
setMsgType( af::Msg::TInvalid);
}
示例5: setCmd
CmdRenderDelete::CmdRenderDelete()
{
setCmd("rdel");
setInfo("Delete render.");
setHelp("rdel [name] Delete render with specified name, in no name porivieded, local host name used.");
setMsgType( af::Msg::TJSON);
}
示例6: setCmd
CmdFork::CmdFork()
{
setCmd("fork");
setArgsCount(1);
setInfo("Fork process.");
setHelp("fork [count] Fork command process. For debug purposes only !");
}
示例7: setAlias
DisplayVersionCommand::DisplayVersionCommand()
{
osVersion = "0.001.001 BETA";
setAlias("ver");
setHelp("This command shows the current version of the running operating system.");
setDesc("Shows the current operating system version number");
}
示例8: setCmd
CmdTestThreads::CmdTestThreads()
{
setCmd("tthr");
setArgsCount(1);
setInfo("Test threads.");
setHelp("tthr [count]\nRaise [count] number of threads. For debug purposes.");
}
示例9: KDialog
TemplateManagementDialog::TemplateManagementDialog(
QWidget *parent, const QStringList &templates, const QString &type )
: KDialog( parent ), m_templates( templates ), m_type( type ), m_changed( false )
{
QString m_type_translated = i18n( qPrintable( m_type ) );
setCaption( i18n( "Manage %1 Templates", m_type_translated ) );
setButtons( Ok | Cancel | Help );
setObjectName( "template_management_dialog" );
setHelp( "entering-data-events-template-buttons", "korganizer" );
QWidget *widget = new QWidget( this );
widget->setObjectName( "template_management_dialog_base" );
m_base.setupUi( widget );
setMainWidget( widget );
m_base.m_listBox->addItems( m_templates );
m_base.m_listBox->setSelectionMode( QAbstractItemView::SingleSelection );
connect( m_base.m_buttonAdd, SIGNAL(clicked()),
SLOT(slotAddTemplate()) );
connect( m_base.m_buttonRemove, SIGNAL(clicked()),
SLOT(slotRemoveTemplate()) );
connect( m_base.m_buttonApply, SIGNAL(clicked()),
SLOT(slotApplyTemplate()) );
connect( m_base.m_listBox, SIGNAL(itemSelectionChanged()),
SLOT(slotItemSelected()) );
connect( m_base.m_listBox, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
SLOT(slotApplyTemplate()) );
connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
m_base.m_buttonRemove->setEnabled( false );
m_base.m_buttonApply->setEnabled( false );
}
示例10: KDialog
ExportDialog::ExportDialog(QWidget * parent)
: KDialog(parent),m_outputStream(0)
{
kDebug() << "ExportDialog::ExportDialog";
setButtons(Help | User1 | Cancel);
kDebug() << "ExportDialog: setButtons";
ui.setupUi(mainWidget());
kDebug() << "ExportDialog: ui.setupUi(mainWidget());";
setButtonGuiItem(User1, KGuiItem(i18n("OK")));
kDebug() << "ExportDialog: setButtonGuiItem(User1, KGuiItem(i18n(\"OK\")));";
ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);
kDebug() << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
setCaption(i18n("Export Chemical Data"));
kDebug() << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
populateElementList();
kDebug() << "ui.targetFile->setMode(KFile::File | KFile::Directory | KFile::LocalOnly);";
ui.formatList->addItem(".html (formatted html document)", "html");
ui.formatList->addItem(".xml (raw element data)", "xml");
ui.formatList->addItem(".csv (comma-separated data)", "csv");
kDebug() << "ui.formatList->addItem(...);";
connect(this, SIGNAL(user1Clicked()), this, SLOT(slotOkClicked()));
kDebug() << "connect(this, SIGNAL(user1Clicked()), this, SLOT(slotOkClicked()));";
setHelp(QString(),"kalzium");
kDebug() << "setHelp(QString(),\"kalzium\");";
}
示例11: setCmd
CmdNetwork::CmdNetwork()
{
setCmd("net");
setArgsCount(1);
setInfo("Network operations.");
setHelp("net [operation] For testing purposes. Operations: [if,ip,pm,pa].");
}
示例12: setCmd
CmdSrvCapacity::CmdSrvCapacity()
{
setCmd("srvcap");
setArgsCount(2);
setInfo("apply capacity to command.");
setHelp("srvcap [servicename] [command] [capacity]");
}
示例13: KPageDialog
ConfigDialog::ConfigDialog( const ActionList *list, KGlobalAccel *accel,
bool isApplet )
: KPageDialog()
{
setFaceType( Tabbed );
setCaption( i18n("Configure") );
setButtons( Ok | Cancel | Help );
if ( isApplet )
setHelp( QString(), "klipper" );
KVBox *w = 0L; // the parent for the widgets
w = new KVBox( this );
generalWidget = new GeneralWidget( w, "general widget" );
addPage( w, i18n("&General") );
w = new KVBox( this );
actionWidget = new ActionWidget( list, this, w, "actions widget" );
addPage( w, i18n("Ac&tions") );
w = new KVBox( this );
shortcutsWidget = new KShortcutsEditor( w, KShortcutsEditor::GlobalAction );
addPage( w, i18n("&Shortcuts") );
}
示例14: KDialogBase
NewIdentityDialog::NewIdentityDialog(const QStringList &identities,
QWidget *parent, const char *name,
bool modal)
: KDialogBase(parent, name, modal, i18n("New Identity"),
Ok | Cancel | Help, Ok, true)
{
setHelp(QString::fromLatin1("configure-identity-newidentitydialog"));
QWidget *page = makeMainWidget();
QVBoxLayout *vlay = new QVBoxLayout(page, 0, spacingHint());
// row 0: line edit with label
QHBoxLayout *hlay = new QHBoxLayout(vlay); // inherits spacing
mLineEdit = new KLineEdit(page);
mLineEdit->setFocus();
hlay->addWidget(new QLabel(mLineEdit, i18n("&New identity:"), page));
hlay->addWidget(mLineEdit, 1);
connect(mLineEdit, SIGNAL(textChanged(const QString &)),
this, SLOT(slotEnableOK(const QString &)));
mButtonGroup = new QButtonGroup(page);
mButtonGroup->hide();
// row 1: radio button
QRadioButton *radio = new QRadioButton(i18n("&With empty fields"), page);
radio->setChecked(true);
mButtonGroup->insert(radio, Empty);
vlay->addWidget(radio);
// row 2: radio button
radio = new QRadioButton(i18n("&Use Control Center settings"), page);
mButtonGroup->insert(radio, ControlCenter);
vlay->addWidget(radio);
// row 3: radio button
radio = new QRadioButton(i18n("&Duplicate existing identity"), page);
mButtonGroup->insert(radio, ExistingEntry);
vlay->addWidget(radio);
// row 4: combobox with existing identities and label
hlay = new QHBoxLayout(vlay); // inherits spacing
mComboBox = new QComboBox(false, page);
mComboBox->insertStringList(identities);
mComboBox->setEnabled(false);
QLabel *label = new QLabel(mComboBox, i18n("&Existing identities:"), page);
label->setEnabled(false);
hlay->addWidget(label);
hlay->addWidget(mComboBox, 1);
vlay->addStretch(1); // spacer
// enable/disable combobox and label depending on the third radio
// button's state:
connect(radio, SIGNAL(toggled(bool)),
label, SLOT(setEnabled(bool)));
connect(radio, SIGNAL(toggled(bool)),
mComboBox, SLOT(setEnabled(bool)));
enableButtonOK(false); // since line edit is empty
}
示例15: setAlias
DisplayHelpCommand::DisplayHelpCommand(std::vector<Command*>* cmdList)
{
setAlias("help");
setDesc("Displays help information about system or command");
setHelp("Follow this command with the name of another command to get more information \n about that command.");
setCommandList(cmdList);
}