本文整理汇总了C++中KDialog::showButtonSeparator方法的典型用法代码示例。如果您正苦于以下问题:C++ KDialog::showButtonSeparator方法的具体用法?C++ KDialog::showButtonSeparator怎么用?C++ KDialog::showButtonSeparator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDialog
的用法示例。
在下文中一共展示了KDialog::showButtonSeparator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make
// static
void MessageBox::make( QWidget * parent, QMessageBox::Icon icon, const QString & text, const Job * job, const QString & caption, KMessageBox::Options options ) {
KDialog * dialog = new KDialog( parent );
dialog->setCaption( caption );
dialog->setButtons( showAuditLogButton( job ) ? ( KDialog::Yes | KDialog::No ) : KDialog::Yes );
dialog->setDefaultButton( KDialog::Yes );
dialog->setEscapeButton( KDialog::Yes );
dialog->setObjectName( "error" );
dialog->setModal( true );
dialog->showButtonSeparator( true );
dialog->setButtonGuiItem( KDialog::Yes, KStandardGuiItem::ok() );
if ( GpgME::hasFeature( GpgME::AuditLogFeature ) )
dialog->setButtonGuiItem( KDialog::No, KGuiItem_showAuditLog() );
if ( options & KMessageBox::PlainCaption )
dialog->setPlainCaption( caption );
if ( KDialog::No == KMessageBox::createKMessageBox( dialog, icon, text, QStringList(), QString::null, 0, options ) )
auditLog( 0, job );
}
示例2: mouseDoubleClickEvent
bool Item::mouseDoubleClickEvent( const EventInfo & eventInfo )
{
Q_UNUSED(eventInfo);
Property * property = 0l;
Variant::Type::Value type = Variant::Type::None;
const VariantDataMap::iterator variantDataEnd = m_variantData.end();
for ( VariantDataMap::iterator it = m_variantData.begin(); it != variantDataEnd; ++it )
{
Property * current = *it;
if ( current->type() == Variant::Type::Multiline ||
current->type() == Variant::Type::RichText )
{
property = current;
type = current->type();
break;
}
}
if ( !property )
return false;
if ( type == Variant::Type::Multiline )
{
//KDialog * dlg = new KDialog( 0l, "", true, property->editorCaption(), KDialog::Ok|KDialog::Cancel|KDialog::User1, KDialog::Ok,
// false, KStandardGuiItem::clear() );
KDialog * dlg = new KDialog( 0 );
dlg->setModal(true);
dlg->setCaption( property->editorCaption() );
dlg->setButtons(KDialog::Ok|KDialog::Cancel|KDialog::User1);
dlg->setDefaultButton(KDialog::Ok);
dlg->showButtonSeparator(false);
dlg->setButtonText(KDialog::User1, KStandardGuiItem::clear().text());
//QFrame *frame = dlg->makeMainWidget();
QFrame *frame = new QFrame(dlg);
dlg->setMainWidget(frame);
QVBoxLayout *layout = new QVBoxLayout( frame );
layout->setMargin(0);
layout->setSpacing(dlg->spacingHint());
KTextEdit *textEdit = new KTextEdit( frame );
//textEdit->setTextFormat( Qt::PlainText ); // 2018.12.02
textEdit->setAcceptRichText(false);
textEdit->setText( property->value().toString() );
layout->addWidget( textEdit, 10 );
textEdit->setFocus();
connect( dlg, SIGNAL( user1Clicked() ), textEdit, SLOT( clear() ) );
dlg->setMinimumWidth( 600 );
if ( dlg->exec() == KDialog::Accepted )
{
property->setValue( textEdit->toPlainText() );
dataChanged();
p_itemDocument->setModified(true);
}
delete dlg;
}
else
{
// Is rich text
RichTextEditorDlg * dlg = new RichTextEditorDlg( 0l, property->editorCaption() );
dlg->setText( property->value().toString() );
if ( dlg->exec() == KDialog::Accepted )
{
property->setValue( dlg->text() );
dataChanged();
p_itemDocument->setModified(true);
}
delete dlg;
}
return true;
}