qt登录注册mysql_QT实现登陆注册界面并于Mysql相连接

该博客介绍了如何使用QT5.9.3创建登录和注册界面,并实现与MySQL8.0.11数据库的连接。通过Login和Register窗口类,实现了输入验证、用户数据查询与插入操作。同时,强调了在QT中连接MySQL需要的32位libmysql.dll和libmysql.lib库文件。
摘要由CSDN通过智能技术生成

Login.h #ifndef LOGIN_H #define LOGIN_H #include #include #include #include #include #include class Loginwindow : public QDialog { Q_OBJECT public: Loginwindow(QWidget *parent = 0); ~Loginwindow(); private: //声明布局 QGridLayout *MessageLayout; QGridLayout *ButtonLayout; QGridLayout *MainLayout; //声明信息成员 QLabel *UserName; QLabel *Password; QLineEdit *UserNameEdit; QLineEdit *PasswordEdit; QPushButton *LoginButton; QPushButton *RegisterButton; //声明槽 public slots: void Login_slots(); void Register_slots(); }; #endif // DIALOG_

Register.h #ifndef REGISTER_H #define REGISTER_H #include #include #include #include #include #include class registerwindow:public QDialog { Q_OBJECT public: registerwindow(QWidget *parent = 0); ~registerwindow(); private: //声明布局 QGridLayout *MessageLayout; QGridLayout *ButtonLayout; QGridLayout *MainLayout; //声明信息成员 QLabel *UserName; QLabel *Password; QLabel *RePassword; QLineEdit *UserNameEdit; QLineEdit *PasswordEdit; QLineEdit *RePasswordEdit; QLabel *Email; QLineEdit *EmailEdit; QPushButton *confirm; QPushButton *resetting; //声明槽 public slots: void confirm_slots(); }; #endif // REGISTER_H

Login.cpp #include "Login.h" #include #include #include #include "Register.h" #include Loginwindow::Loginwindow(QWidget *parent) : QDialog(parent) { //登陆界面定义 setWindowTitle(tr("登陆界面")); //窗口只能最小化 this->setWindowFlags

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值