本文整理汇总了C++中QCheckBox::setAccessibleName方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::setAccessibleName方法的具体用法?C++ QCheckBox::setAccessibleName怎么用?C++ QCheckBox::setAccessibleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::setAccessibleName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createWidgets
QWidget* EncTtsCfgGui::createWidgets(EncTtsSetting* setting)
{
// value display
QWidget* value = NULL;
switch(setting->type())
{
case EncTtsSetting::eDOUBLE:
{
QDoubleSpinBox *spinBox = new QDoubleSpinBox(this);
spinBox->setAccessibleName(setting->name());
spinBox->setMinimum(setting->min().toDouble());
spinBox->setMaximum(setting->max().toDouble());
spinBox->setSingleStep(0.01);
spinBox->setValue(setting->current().toDouble());
connect(spinBox,SIGNAL(valueChanged(double)),this,SLOT(updateSetting()));
value = spinBox;
break;
}
case EncTtsSetting::eINT:
{
QSpinBox *spinBox = new QSpinBox(this);
spinBox->setAccessibleName(setting->name());
spinBox->setMinimum(setting->min().toInt());
spinBox->setMaximum(setting->max().toInt());
spinBox->setValue(setting->current().toInt());
connect(spinBox,SIGNAL(valueChanged(int)),this,SLOT(updateSetting()));
value = spinBox;
break;
}
case EncTtsSetting::eSTRING:
{
QLineEdit *lineEdit = new QLineEdit(this);
lineEdit->setAccessibleName(setting->name());
lineEdit->setText(setting->current().toString());
connect(lineEdit,SIGNAL(textChanged(QString)),this,SLOT(updateSetting()));
value = lineEdit;
break;
}
case EncTtsSetting::eREADONLYSTRING:
{
value = new QLabel(setting->current().toString(),this);
break;
}
case EncTtsSetting::eSTRINGLIST:
{
QComboBox *comboBox = new QComboBox(this);
comboBox->setAccessibleName(setting->name());
comboBox->addItems(setting->list());
int index = comboBox->findText(setting->current().toString());
comboBox->setCurrentIndex(index);
connect(comboBox,SIGNAL(currentIndexChanged(QString)),this,SLOT(updateSetting()));
value = comboBox;
break;
}
case EncTtsSetting::eBOOL:
{
QCheckBox *checkbox = new QCheckBox(this);
checkbox->setAccessibleName(setting->name());
checkbox->setCheckState(setting->current().toBool() == true ? Qt::Checked : Qt::Unchecked);
connect(checkbox,SIGNAL(stateChanged(int)),this,SLOT(updateSetting()));
value = checkbox;
break;
}
default:
{
LOG_WARNING() << "Warning: unknown EncTTsSetting type" << setting->type();
break;
}
}
// remember widget
if(value != NULL)
{
m_settingsWidgetsMap.insert(setting,value);
connect(setting,SIGNAL(updateGui()),this,SLOT(updateWidget()));
}
return value;
}