当前位置: 首页>>代码示例>>C++>>正文


C++ QComboBox::setAccessibleName方法代码示例

本文整理汇总了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;
}
开发者ID:mdmitry1973,项目名称:CShell,代码行数:16,代码来源:CComboBox.cpp

示例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;
}
开发者ID:Brandon7357,项目名称:rockbox,代码行数:79,代码来源:encttscfggui.cpp

示例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);
								}	
开发者ID:hfiguiere,项目名称:abiword,代码行数:67,代码来源:ev_QtToolbar.cpp


注:本文中的QComboBox::setAccessibleName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。