本文整理汇总了C++中KComboBox::setCurrentText方法的典型用法代码示例。如果您正苦于以下问题:C++ KComboBox::setCurrentText方法的具体用法?C++ KComboBox::setCurrentText怎么用?C++ KComboBox::setCurrentText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KComboBox
的用法示例。
在下文中一共展示了KComboBox::setCurrentText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KDialogBase
ProgrammerDlg::ProgrammerDlg( const QString & picID, QWidget *parent, const char *name )
: KDialogBase( parent, name, true, i18n("PIC Programmer"), Ok|Cancel )
{
// Change the "Ok" button to a "Burn" button
KGuiItem burnItem = KStdGuiItem::ok();
burnItem.setText( i18n("Burn") );
setButtonOK( burnItem );
m_bAccepted = false;
m_pProgrammerWidget = new ProgrammerWidget( this );
m_pProgrammerSettings = new PicProgrammerSettings;
// Setup the list of programmers
KComboBox * programmerCombo = m_pProgrammerWidget->m_pProgrammerProgram;
QStringList programmerNames = m_pProgrammerSettings->configNames( false );
programmerCombo->insertStringList( programmerNames );
programmerCombo->setSizeLimit( programmerNames.size() );
programmerCombo->setCurrentText( KTLConfig::picProgrammerProgram() );
// Sets up the list of ports
m_pProgrammerWidget->m_pPicProgrammerPort->insertStringList( Port::ports( Port::ExistsAndRW ) );
m_pProgrammerWidget->m_pPicProgrammerPort->setCurrentText( KTLConfig::picProgrammerPort() );
// Set the pic type to the one requested
if ( !picID.isEmpty() )
m_pProgrammerWidget->m_pMicroSelect->setMicro( picID );
setMainWidget( m_pProgrammerWidget );
}
示例2: slotRenamePinMap
void MicroSettingsDlg::slotRenamePinMap()
{
KComboBox * combo = m_pWidget->pinMapCombo;
QString oldName = combo->currentText();
if ( oldName.isEmpty() )
return;
PinMappingNameValidator * validator = new PinMappingNameValidator( this, oldName );
bool ok = false;
QString newName = KInputDialog::getText( i18n("New Pin Map Name"), i18n("Name"), oldName, & ok, this, 0, validator );
delete validator;
if ( !ok )
return;
if ( newName == oldName )
return;
m_pinMappings[ newName ] = m_pinMappings[ oldName ];
m_pinMappings.remove( oldName );
combo->setCurrentText( newName );
}
示例3: KComboBox
QWidget *KFileMetaInfoWidget::makeStringWidget()
{
if(m_validator && m_validator->inherits("KStringListValidator"))
{
KComboBox *b = new KComboBox(true, this, "metainfo combobox");
KStringListValidator *val = static_cast< KStringListValidator * >(m_validator);
b->insertStringList(val->stringList());
b->setCurrentText(m_item.value().toString());
connect(b, SIGNAL(activated(const QString &)), this, SLOT(slotComboChanged(const QString &)));
b->setValidator(val);
reparentValidator(b, val);
return b;
}