本文整理汇总了C++中KDialog::setMinimumWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ KDialog::setMinimumWidth方法的具体用法?C++ KDialog::setMinimumWidth怎么用?C++ KDialog::setMinimumWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDialog
的用法示例。
在下文中一共展示了KDialog::setMinimumWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: displayCollection
void NotifyCollection::displayCollection( QWidget *p ) const
{
//KMessageBox::information(p,collection(),i18n("Collected Notes"));
KDialog *dlg = new KDialog( p );
dlg->setCaption( i18n( "Collected Notes" ) );
dlg->setButtons( KDialog::Close );
dlg->setDefaultButton( KDialog::Close );
dlg->setModal( false );
KTextEdit *text = new KTextEdit( dlg );
text->setReadOnly( true );
text->setText( collection() );
dlg->setMainWidget( text );
dlg->setMinimumWidth( 300 );
dlg->setMinimumHeight( 300 );
dlg->show();
}
示例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;
}