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


C++ KLineEdit::setProperty方法代码示例

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


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

示例1: SettingWidget

Security8021xAuthWidget::Security8021xAuthWidget(Knm::Connection* connection, const QStringList &secrets, QWidget * parent)
: SettingWidget(*new Security8021xAuthWidgetPrivate, parent)
{
    Q_D(Security8021xAuthWidget);
    d->connection = connection;
    d->setting = static_cast<Knm::Security8021xSetting *>(connection->setting(Knm::Setting::Security8021x));

    d->layout = new QFormLayout(this);
    this->setLayout(d->layout);

    if (secrets.contains(QLatin1String("password"))) {
        QLabel *label = new QLabel(this);
        label->setText(i18n("Password:"));
        KLineEdit *lineEdit = new KLineEdit(this);
        lineEdit->setPasswordMode(true);
        lineEdit->setProperty("setting", "password");
        d->layout->addRow(label, lineEdit);
    }
    if (secrets.contains(QLatin1String("private-key-password"))) {
        QLabel *label = new QLabel(this);
        label->setText(i18n("Private Key Password:"));
        KLineEdit *lineEdit = new KLineEdit(this);
        lineEdit->setPasswordMode(true);
        lineEdit->setProperty("setting", "private-key-password");
        d->layout->addRow(label, lineEdit);
    }
    if (secrets.contains(QLatin1String("phase2-private-key-password"))) {
        QLabel *label = new QLabel(this);
        label->setText(i18n("Phase 2 Private Key Password:"));
        KLineEdit *lineEdit = new KLineEdit(this);
        lineEdit->setPasswordMode(true);
        lineEdit->setProperty("setting", "phase2-private-key-password");
        d->layout->addRow(label, lineEdit);
    }

    for (int i = 0; i < d->layout->rowCount(); i++)
    {
        KLineEdit *le = qobject_cast<KLineEdit*>(d->layout->itemAt(i, QFormLayout::FieldRole)->widget());
        if (le && le->text().isEmpty()) {
            le->setFocus(Qt::OtherFocusReason);
            break;
        }
    }

    QCheckBox *showPasswords = new QCheckBox(this);
    showPasswords->setText(i18n("&Show password"));
    d->layout->setWidget(d->layout->rowCount(), QFormLayout::FieldRole, showPasswords);
    connect(showPasswords, SIGNAL(toggled(bool)), this, SLOT(showPasswordsToggled(bool)));
    d->layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
}
开发者ID:KDE,项目名称:networkmanagement,代码行数:50,代码来源:security8021xauth.cpp


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