本文整理汇总了C++中QComboBox::setAccessibleName方法的典型用法代码示例。如果您正苦于以下问题:C++ QComboBox::setAccessibleName方法的具体用法?C++ QComboBox::setAccessibleName怎么用?C++ QComboBox::setAccessibleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QComboBox
的用法示例。
在下文中一共展示了QComboBox::setAccessibleName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
BOOL CComboBox::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
{
QWidget *parentView = (QWidget *)pParentWnd->GetNSWindow();
QComboBox *comboBox = new QComboBox(parentView);
QRect contentRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
comboBox->move (contentRect.x(), contentRect.y());
comboBox->resize(contentRect.width(), contentRect.height());
comboBox->setAccessibleName(QString().setNum(nID));
m_hWnd = comboBox;
mParentWin = pParentWnd;
return TRUE;
}
示例2: 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;
}
示例3: synthesize
//.........这里部分代码省略.........
{
QIcon icon(pixmap);
QString str = "";
QPushButton *item = new QPushButton(icon, str);
item->setCheckable(true);
m_wToolbar->addWidget(item);
}
break;
}
case EV_TBIT_EditText:
{
break;
}
case EV_TBIT_DropDown:
{
break;
}
case EV_TBIT_ComboBox:
{
EV_Toolbar_Control * pControl = pFactory->getControl(this, id);
UT_ASSERT(pControl);
QComboBox *combo;
bool isFontCombo = false;
if(id == AP_TOOLBAR_ID_FMT_SIZE)
{
combo = new QComboBox();
}
else if(id == AP_TOOLBAR_ID_FMT_FONT)
{
isFontCombo = true;
combo = new QFontComboBox();
QString str = "AbiFontCombo";
combo->setAccessibleName(str);
}
else if(id == AP_TOOLBAR_ID_ZOOM)
{
combo = new QComboBox();
QString str = "AbiZoomCombo";
combo->setAccessibleName(str);
}
else if(id == AP_TOOLBAR_ID_FMT_STYLE)
{
combo = new QComboBox();
QString str = "AbiStyleCombo";
combo->setAccessibleName(str);
}
else
{
UT_ASSERT(0);
}
// populate it
if (pControl)
{
pControl->populate();
const UT_GenericVector<const char*> * v = pControl->getContents();
UT_ASSERT(v);
gint items = v->getItemCount();
if (isFontCombo)
{
for (gint m=0; m < items; m++)
{
QString str = v->getNthItem(m);
combo->addItem(str);
}