本文整理汇总了C++中KComboBox::setToolTip方法的典型用法代码示例。如果您正苦于以下问题:C++ KComboBox::setToolTip方法的具体用法?C++ KComboBox::setToolTip怎么用?C++ KComboBox::setToolTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KComboBox
的用法示例。
在下文中一共展示了KComboBox::setToolTip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createEditor
QWidget* RuleDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
Q_UNUSED(option)
QWidget *editor = new QWidget(parent);
KLineEdit *ruleLineEdit = new KLineEdit(editor);
ruleLineEdit->setToolTip(i18n("Expression"));
KComboBox *matchComboBox = new KComboBox(editor);
matchComboBox->setToolTip(i18n("Match Mode"));
matchComboBox->addItem(i18n("Ignore"));
matchComboBox->addItem(i18n("Regular expression"));
matchComboBox->addItem(i18n("Partial match"));
matchComboBox->addItem(i18n("Exact match"));
QCheckBox *requiredCheckBox = new QCheckBox(editor);
requiredCheckBox->setToolTip(i18n("Required"));
QHBoxLayout *layout = new QHBoxLayout(editor);
layout->addWidget(ruleLineEdit);
layout->addWidget(matchComboBox);
layout->addWidget(requiredCheckBox);
layout->setMargin(0);
setEditorData(editor, index);
return editor;
}
示例2: KComboBox
void HolidayRegionSelector::Private::initItem( QTreeWidgetItem *listItem, HolidayRegion *region )
{
m_ui.regionTreeWidget->blockSignals( true );
QString languageName = KGlobal::locale()->languageCodeToName( region->languageCode() );
listItem->setCheckState( Private::SelectColumn, Qt::Unchecked );
QString text = i18n( "<p>Select to use Holiday Region</p>" );
listItem->setToolTip( Private::SelectColumn, text );
listItem->setToolTip( Private::ComboColumn, text );
text = i18n( "<p>Select to use Holiday Region</p>" );
listItem->setToolTip( Private::SelectColumn, text );
listItem->setToolTip( Private::ComboColumn, text );
listItem->setText( Private::RegionColumn, region->name() );
QString toolTip = i18n( "<p><b>Region:</b> %1<br/>"
"<b>Language:</b> %2<br/>"
"<b>Description:</b> %3</p>",
region->name(), languageName, region->description() );
listItem->setToolTip( Private::RegionColumn, toolTip );
listItem->setData( Private::RegionColumn, Qt::UserRole, region->regionCode() );
listItem->setText( Private::LanguageColumn, languageName );
listItem->setData( Private::LanguageColumn, Qt::UserRole, region->languageCode() );
listItem->setText( Private::DescriptionColumn, region->description() );
listItem->setToolTip( Private::DescriptionColumn, region->description() );
KComboBox *combo = new KComboBox();
combo->setAutoFillBackground( true );
QString comboText = i18n( "<p>You can choose to display the Holiday Region for information only, "
"or to use the Holiday Region when displaying or calculating days off "
"such as Public Holidays. If you choose to use the Holiday Region for "
"Days Off, then only those Holiday Events marked in the Holiday Region "
"as Days Off will be used for non-work days, Holiday Events that are "
"not marked in the Holiday Region as Days Off will continue to be "
"work days.</p>" );
combo->setToolTip( comboText );
comboText = i18nc( "Combobox label, Holiday Region not used", "Not Used" );
combo->addItem( comboText, QVariant( NotUsed ) );
comboText = i18nc( "Combobox label, use Holiday Region for information only", "Information" );
combo->addItem( comboText, QVariant( UseInformationOnly ) );
comboText = i18nc( "Combobox label, use Holiday Region for days off", "Days Off" );
combo->addItem( comboText, QVariant( UseDaysOff ) );
combo->setCurrentIndex( 0 );
listItem->setData( Private::ComboColumn, Qt::UserRole, NotUsed );
m_ui.regionTreeWidget->setItemWidget( listItem, ComboColumn, combo );
connect( combo, SIGNAL(currentIndexChanged(int)),
q, SLOT(itemChanged(int)) );
m_ui.regionTreeWidget->blockSignals( false );
}