当前位置: 首页>>代码示例>>C++>>正文


C++ KPushButton::setFixedSize方法代码示例

本文整理汇总了C++中KPushButton::setFixedSize方法的典型用法代码示例。如果您正苦于以下问题:C++ KPushButton::setFixedSize方法的具体用法?C++ KPushButton::setFixedSize怎么用?C++ KPushButton::setFixedSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KPushButton的用法示例。


在下文中一共展示了KPushButton::setFixedSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createGroupBox

QGroupBox *
SelectableSubtitleDialog::createSubtitleGroupBox(const QString &title, bool addToLayout)
{
    m_subtitleGroupBox = createGroupBox(title, addToLayout);

    m_subtitleUrlLineEdit = new KLineEdit(m_subtitleGroupBox);
    m_subtitleUrlLineEdit->setCompletionObject(new KUrlCompletion());

    QLabel *subtitlePathLabel = new QLabel(m_subtitleGroupBox);
    subtitlePathLabel->setText(i18n("Path:"));
    subtitlePathLabel->setBuddy(m_subtitleUrlLineEdit);

    KPushButton *subtitleButton = new KPushButton(m_subtitleGroupBox);
    subtitleButton->setIcon(KIcon("document-open"));
    subtitleButton->setToolTip(i18n("Select subtitle"));
    int buttonSize = subtitleButton->sizeHint().height();
    subtitleButton->setFixedSize(buttonSize, buttonSize);

    connect(subtitleButton, SIGNAL(clicked()), SLOT(selectSubtitle()));

    m_subtitleEncodingComboBox = new KComboBox(m_subtitleGroupBox);
    m_subtitleEncodingComboBox->addItem(i18n("Autodetect"));
    m_subtitleEncodingComboBox->addItems(app()->availableEncodingNames());
    m_subtitleEncodingComboBox->setCurrentIndex(0);

    QLabel *subtitleEncodingLabel = new QLabel(m_subtitleGroupBox);
    subtitleEncodingLabel->setText(i18n("Encoding:"));
    subtitleEncodingLabel->setBuddy(m_subtitleEncodingComboBox);

    QHBoxLayout *subtitlePathLayout = new QHBoxLayout();
    subtitlePathLayout->addWidget(m_subtitleUrlLineEdit, 2);
    subtitlePathLayout->addWidget(subtitleButton);

    QHBoxLayout *subtitleEncodingLayout = new QHBoxLayout();
    subtitleEncodingLayout->addWidget(m_subtitleEncodingComboBox);
    subtitleEncodingLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));

    m_subtitleLayout = createLayout(m_subtitleGroupBox);
    m_subtitleLayout->setColumnStretch(1, 2);
    m_subtitleLayout->addWidget(subtitlePathLabel, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
    m_subtitleLayout->addLayout(subtitlePathLayout, 0, 1, 1, 2);
    m_subtitleLayout->addWidget(subtitleEncodingLabel, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
    m_subtitleLayout->addLayout(subtitleEncodingLayout, 1, 1);

    return m_subtitleGroupBox;
}
开发者ID:netrunner-debian-kde-extras,项目名称:subtitlecomposer,代码行数:46,代码来源:selectablesubtitledialog.cpp

示例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 );

//.........这里部分代码省略.........
开发者ID:unwork-inc,项目名称:soundkonverter,代码行数:101,代码来源:configbackendspage.cpp


注:本文中的KPushButton::setFixedSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。