本文整理汇总了C++中KPushButton::setFlat方法的典型用法代码示例。如果您正苦于以下问题:C++ KPushButton::setFlat方法的具体用法?C++ KPushButton::setFlat怎么用?C++ KPushButton::setFlat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPushButton
的用法示例。
在下文中一共展示了KPushButton::setFlat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KPushButton
KPushButton * PostWidget::addButton(const QString & objName, const QString & toolTip, const KIcon & icon)
{
KPushButton * button = new KPushButton(icon, QString(), _mainWidget);
button->setObjectName(objName);
button->setToolTip(toolTip);
button->setIconSize(QSize(16,16));
button->setMinimumSize(QSize(20, 20));
button->setMaximumSize(QSize(20, 20));
button->setFlat(true);
button->setVisible(false);
button->setCursor(Qt::PointingHandCursor);
d->mUiButtons.insert(objName, button);
d->buttonsLayout->addWidget( button, 1, d->mUiButtons.count() );
return button;
}
示例2: ConfigPageBase
ConfigBackendsPage::ConfigBackendsPage( Config *_config, QWidget *parent )
: ConfigPageBase( parent ),
config( _config )
{
QVBoxLayout *box = new QVBoxLayout( this );
QFont groupFont;
groupFont.setBold( true );
QLabel *lCdRipper = new QLabel( i18n("CD ripper"), this );
lCdRipper->setFont( groupFont );
box->addWidget( lCdRipper );
box->addSpacing( ConfigDialogSpacingSmall );
QHBoxLayout *ripperBox = new QHBoxLayout();
ripperBox->addSpacing( ConfigDialogOffset );
box->addLayout( ripperBox );
QLabel *lSelectorRipper = new QLabel( i18n("Use plugin:"), this );
ripperBox->addWidget( lSelectorRipper );
ripperBox->setStretchFactor( lSelectorRipper, 2 );
cSelectorRipper = new KComboBox( this );
cSelectorRipper->addItems( config->data.backends.rippers );
ripperBox->addWidget( cSelectorRipper );
ripperBox->setStretchFactor( cSelectorRipper, 1 );
connect( cSelectorRipper, SIGNAL(activated(int)), this, SLOT(somethingChanged()) );
connect( cSelectorRipper, SIGNAL(activated(const QString&)), this, SLOT(ripperChanged(const QString&)) );
pConfigureRipper = new KPushButton( KIcon("configure"), "", this );
pConfigureRipper->setFixedSize( cSelectorRipper->sizeHint().height(), cSelectorRipper->sizeHint().height() );
pConfigureRipper->setFlat( true );
ripperBox->addWidget( pConfigureRipper );
ripperBox->setStretchFactor( pConfigureRipper, 1 );
connect( pConfigureRipper, SIGNAL(clicked()), this, SLOT(configureRipper()) );
box->addSpacing( ConfigDialogSpacingBig );
QLabel *lFilters = new QLabel( i18n("Filters"), this );
lFilters->setFont( groupFont );
box->addWidget( lFilters );
box->addSpacing( ConfigDialogSpacingSmall );
QHBoxLayout *filterBox = new QHBoxLayout();
filterBox->addSpacing( ConfigDialogOffset );
box->addLayout( filterBox );
QGridLayout *filterGrid = new QGridLayout();
int row = 0;
foreach( const QString filterPluginName, config->data.backends.filters )
{
if( row == 0 )
{
QLabel *lSelectorFilter = new QLabel( i18n("Enable plugins:"), this );
filterGrid->addWidget( lSelectorFilter, row, 0 );
}
QCheckBox *newCheckBox = new QCheckBox( filterPluginName, this );
newCheckBox->setChecked( config->data.backends.enabledFilters.contains(filterPluginName) );
filterGrid->addWidget( newCheckBox, row, 1 );
filterCheckBoxes.append( newCheckBox );
connect( newCheckBox, SIGNAL(stateChanged(int)), this, SLOT(somethingChanged()) );
KPushButton *newConfigButton = new KPushButton( KIcon("configure"), "", this );
newConfigButton->setFixedSize( cSelectorRipper->sizeHint().height(), cSelectorRipper->sizeHint().height() );
newConfigButton->setFlat( true );
filterGrid->addWidget( newConfigButton, row, 2 );
connect( newConfigButton, SIGNAL(clicked()), this, SLOT(configureFilter()) );
filterConfigButtons.append( newConfigButton );
FilterPlugin *plugin = qobject_cast<FilterPlugin*>(config->pluginLoader()->backendPluginByName(filterPluginName));
if( plugin )
{
newConfigButton->setEnabled( plugin->isConfigSupported(BackendPlugin::General,"") );
}
else
{
newConfigButton->setEnabled( false );
}
if( newConfigButton->isEnabled() )
newConfigButton->setToolTip( i18n("Configure %1 ...",filterPluginName) );
row++;
}
filterGrid->setColumnStretch( 0, 2 );
filterGrid->setColumnStretch( 1, 1 );
filterBox->addLayout( filterGrid );
box->addSpacing( ConfigDialogSpacingBig );
QLabel *lPriorities = new QLabel( i18n("Priorities"), this );
lPriorities->setFont( groupFont );
box->addWidget( lPriorities );
box->addSpacing( ConfigDialogSpacingSmall );
QVBoxLayout *formatBox = new QVBoxLayout();
box->addLayout( formatBox, 1 );
//.........这里部分代码省略.........