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


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

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


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

示例1: KDialog

KSSLInfoDlg::KSSLInfoDlg(bool secureConnection, QWidget *parent, const char *name, bool modal)
    : KDialog(parent, name, modal, Qt::WDestructiveClose), d(new KSSLInfoDlgPrivate)
{
    QVBoxLayout *topLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    d->m_secCon = secureConnection;
    d->m_layout = new QGridLayout(topLayout, 3, 3, KDialog::spacingHint());
    d->m_layout->setColStretch(1, 1);
    d->m_layout->setColStretch(2, 1);

    d->pixmap = new QLabel(this);
    d->m_layout->addWidget(d->pixmap, 0, 0);

    d->info = new QLabel(this);
    d->m_layout->addWidget(d->info, 0, 1);

    if(KSSL::doesSSLWork())
    {
        if(d->m_secCon)
        {
            d->pixmap->setPixmap(BarIcon("encrypted"));
            d->info->setText(i18n("Current connection is secured with SSL."));
        }
        else
        {
            d->pixmap->setPixmap(BarIcon("decrypted"));
            d->info->setText(i18n("Current connection is not secured with SSL."));
        }
    }
    else
    {
        d->pixmap->setPixmap(BarIcon("decrypted"));
        d->info->setText(i18n("SSL support is not available in this build of KDE."));
    }
    d->m_layout->addRowSpacing(0, 50); // give minimum height to look better

    QHBoxLayout *buttonLayout = new QHBoxLayout(topLayout, KDialog::spacingHint());
    buttonLayout->addStretch(1);

    KPushButton *button;

    if(KSSL::doesSSLWork())
    {
        button = new KPushButton(KGuiItem(i18n("C&ryptography Configuration..."), "configure"), this);
        connect(button, SIGNAL(clicked()), SLOT(launchConfig()));
        buttonLayout->addWidget(button);
    }

    button = new KPushButton(KStdGuiItem::close(), this);
    connect(button, SIGNAL(clicked()), SLOT(close()));
    buttonLayout->addWidget(button);

    button->setFocus();

    setCaption(i18n("KDE SSL Information"));
    d->inQuestion = false;
}
开发者ID:,项目名称:,代码行数:56,代码来源:


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