本文整理汇总了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;
}