本文整理汇总了C++中KPushButton::setPixmap方法的典型用法代码示例。如果您正苦于以下问题:C++ KPushButton::setPixmap方法的具体用法?C++ KPushButton::setPixmap怎么用?C++ KPushButton::setPixmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPushButton
的用法示例。
在下文中一共展示了KPushButton::setPixmap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KDialogBase
NewProject::NewProject( QString prefix ) : KDialogBase( Plain,
i18n( "Create New Project" ), Help | Ok | Cancel, Ok ) {
QFrame* top = plainPage();
QGridLayout* layoutGeneral = new QGridLayout( top, 2, 3, 5, 6 );
int row = 0;
QLabel* vobFilesLabel = new QLabel( i18n( "Vob or Sub files" ), top );
vobFilesLabel->setAlignment( Qt::AlignTop );
layoutGeneral->addWidget( vobFilesLabel, row, 0 );
vobFilesList = new KListBox( top );
layoutGeneral->addWidget( vobFilesList, row, 1 );
QVBoxLayout* layoutFilesButton = new QVBoxLayout( 0, 0, 6 );
KPushButton* vobFilesButton = new KPushButton ( top );
layoutFilesButton->addWidget( vobFilesButton );
layoutFilesButton->addItem( new QSpacerItem( 20, 40, QSizePolicy::Minimum,
QSizePolicy::Expanding ) );
layoutGeneral->addLayout( layoutFilesButton, row, 2 );
++row;
QLabel* dirLabel = new QLabel( i18n( "Directory" ), top );
layoutGeneral->addWidget( dirLabel, row, 0 );
dirEdit = new KLineEdit( top );
dirEdit->setValidator( new DirValidator( dirEdit ) );
dirEdit->setURLDropsEnabled( true );
KURLCompletion* complet = new KURLCompletion( KURLCompletion::DirCompletion );
dirEdit->setCompletionObject( complet );
layoutGeneral->addWidget( dirEdit, row, 1 );
KPushButton* dirButton = new KPushButton ( top );
layoutGeneral->addWidget( dirButton, row, 2 );
++row;
QLabel* prefixLabel = new QLabel( i18n( "Prefix" ), top );
layoutGeneral->addWidget( prefixLabel, row, 0 );
prefixEdit = new KLineEdit( prefix, top );
prefixEdit->setValidator( new QRegExpValidator( QRegExp( "\\S+" ), prefixEdit ) );
layoutGeneral->addWidget( prefixEdit, row, 1 );
enableButtonOK( false );
vobFilesButton->setPixmap( KGlobal::iconLoader()->loadIcon( "fileopen", KIcon::Small ) );
dirButton->setPixmap( KGlobal::iconLoader()->loadIcon( "fileopen", KIcon::Small ) );
connect( vobFilesButton, SIGNAL( clicked() ), this, SLOT( selectVobs() ) );
connect( dirButton, SIGNAL( clicked() ), this, SLOT( selectDir() ) );
connect( prefixEdit, SIGNAL( textChanged( const QString& ) ),
this, SLOT( tryEnableButtonOk() ) );
connect( dirEdit, SIGNAL( textChanged( const QString& ) ),
this, SLOT( tryEnableButtonOk() ) );
}