QT實現登陸註冊介面並於Mysql相連線

2021-08-20 05:18:23 字數 1663 閱讀 6798

login.h

#ifndef login_h

#define login_h

#include

#include

#include

#include

#include

#include

class

loginwindow : public

qdialog

;#endif // dialog_

register.h

#ifndef register_h

#define register_h

#include

#include

#include

#include

#include

#include

class

registerwindow:public

qdialog

;#endif // register_h

login.cpp

#include "login.h"

#include

#include

#include

#include "register.h"

#include

loginwindow::loginwindow(qwidget *parent)

: qdialog(parent)

//槽函式實現

void loginwindow::login_slots()

void loginwindow::register_slots()

loginwindow::~loginwindow()

register.h

#include "register.h"

#include

#include

#include

#include

registerwindow::registerwindow(qwidget *parent)

:qdialog(parent)

//槽函式實現

void registerwindow::confirm_slots()

else

qmessagebox::warning(null,"error","密碼不重複,請重試!!!");

}registerwindow::~registerwindow()

main.h

#include "login.h"

#include

#include

int main(int argc, char *argv)

else

return a.exec();

}

***.pro中加入qt += sql

qt版本5.9.3,mysql版本8.0.11;

需要注意的是qt連線mysql的時候,要將

libmysql.dll和libmysql.lib拷貝至x:\qt\qt5.9.3\tools\mingw530_32\bin 目錄下,而且重要的是這兩個需要的是32位的,用64位與編譯器不符合會報錯。

Qt 登陸介面實現

qt 登陸介面實現 新專案要用到qt,所以最近研究qt,昨天安裝好部署好qt creator現在馬上開始第乙個程式。做乙個簡單的登陸 介面功能 效果圖如下 部分 mainwindow.h include logindlg.h 主介面logindlg login 登陸介面 if login.exec ...

Qt 登陸介面實現

新專案要用到qt,所以最近研究qt,昨天安裝好部署好qt creator現在馬上開始第乙個程式。做乙個簡單的登陸介面功能 效果圖如下 部分 mainwindow.h include logindlg.h int main int argc,char argv else return0 ifndef ...

php實現註冊登陸功能

先來截圖下需要用到的檔案 這個是signup.html 1237 82627 寫好html繼續寫signup.php 1 2 header content type text html charset utf8 設定下utf 8編碼34 if isset post submit 78 usernam...