资源简介

Qt基于networkmanager嵌入式linux的wifi网络连接,嵌入式linux系统需要支持networkmanager网络管理工具,主要是通过对nmcli命令连接wifi方式用qt进行了封装,实现了类似windows操作系统下wifi连接可视化操作。

资源截图

代码片段和文件信息

#include “inputpassworddialog.h“

InputPasswordDialog::InputPasswordDialog(QWidget *parent)
    : QWidget(parent)
{
    this->guiInit();
    QDesktopWidget desktop;
    this->setFixedSize(desktop.width()/3desktop.height()/4);
}

void InputPasswordDialog::guiInit()
{
    QLabel *inputLabel = new QLabel(this);
    inputLabel->setText(tr(“Password“));
    inputLabel->setAlignment(Qt::AlignCenter);
    inputLabel->setSizePolicy(QSizePolicy::FixedQSizePolicy::Fixed);
    inputLabel->setFixedHeight(30);

    QLineEdit *inputLine = new QLineEdit(this);
    inputLine->setSizePolicy(QSizePolicy::PreferredQSizePolicy::Fixed);
    inputLine->setFixedHeight(30);

    QPushButton *okBtn = new QPushButton(this);
    okBtn->setText(tr(“OK“));
    okBtn->setSizePolicy(QSizePolicy::PreferredQSizePolicy::Fixed);
    okBtn->setFixedHeight(30);

    QPushButton *cancelBtn = new QPushButton(this);
    cancelBtn->setText(tr(“Cancel“));
    cancelBtn->setSizePolicy(QSizePolicy::PreferredQSizePolicy::Fixed);
    cancelBtn->setFixedHeight(30);

    QGridLayout *layout = new QGridLayout;
    layout->addWidget(inputLabel0011);
    layout->addWidget(inputLine0112);
    layout->addWidget(okBtn1111);
    layout->addWidget(cancelBtn1211);
    this->setLayout(layout);

    connect(okBtn&QPushButton::clicked[=](){
        if(inputLine->text().isEmpty()){
            emit confirmPassword(inputLine->text());
        }
    });
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1440  2018-12-16 00:09  WifiConnectedTest\inputpassworddialog.cpp

     文件        453  2018-12-16 00:00  WifiConnectedTest\inputpassworddialog.h

     文件        182  2018-12-14 21:31  WifiConnectedTest\main.cpp

     文件       1137  2018-12-15 23:36  WifiConnectedTest\WifiConnectedTest.pro

     文件       7087  2018-12-16 22:18  WifiConnectedTest\wificonnecttest.cpp

     文件       1106  2018-12-15 23:57  WifiConnectedTest\wificonnecttest.h

     目录          0  2018-12-16 22:20  WifiConnectedTest

----------- ---------  ---------- -----  ----

                11405                    7


评论

共有 条评论