qt 获取登录界面账号和密码

qt 获取登录界面账号和密码_第1张图片

 

#include "widget.h"
#include "ui_widget.h"
#include 

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);


    connect(ui->pushButton, &QPushButton::clicked, this, [=](int state){
        qDebug() << "state is " << state << endl;

        if (state == 0)
        {
            qDebug() << "飞流直下三千尺" << state << endl;

            QString user = ui->lineEdit_2->text();
            QString password = ui->lineEdit->text();
            qDebug() << "user is " << user << endl;
            qDebug() << "password is " << password << endl;
        }

    });


}

Widget::~Widget()
{
    delete ui;
}

你可能感兴趣的:(C/C++/QT,qt,ui,开发语言)