当前位置: 首页 > news >正文

html怎么做音乐网站短视频如何引流与推广

html怎么做音乐网站,短视频如何引流与推广,广州攻略经典三日游,没有网站怎么做cpa广告目录 1 界面设计 2 代码 2.1 登录界面 2.2 注册界面 2.3 登陆后的界面 3 完整资源 这里主要记录了如何使用Qt Creator创建一个用户登录界面,能够实现用户的注册和登录功能,注册的用户信息存储在了一个文件之中,在登录时可以比对登录信息…

目录

1 界面设计

2 代码

2.1 登录界面

2.2 注册界面

2.3 登陆后的界面

3 完整资源


        这里主要记录了如何使用Qt Creator创建一个用户登录界面,能够实现用户的注册和登录功能,注册的用户信息存储在了一个文件之中,在登录时可以比对登录信息和文件存储信息,已确认用户是否存在,如果不存在也可以通过注册功能进行注册。

1 界面设计

主要分为3个界面:登录界面、注册界面、登录后的界面

2 代码

2.1 登录界面

登录界面命名对于文件为widget.h、widget.c

widget.h

#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>
#include <form.h>
#include <form01.h>QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACEclass Widget : public QWidget
{Q_OBJECTpublic:Form *form = new Form();         // define a objectForm01 *form01 = new Form01();   // Loginpublic:Widget(QWidget *parent = nullptr);~Widget();private slots:void on_pushButton_clicked();void on_pushButton_2_clicked();void on_pushButton_3_clicked();private:Ui::Widget *ui;
};
#endif // WIDGET_H

widget.c

#include "widget.h"
#include "ui_widget.h"
#include "QDebug"
#include "main.h"
#include "QDir"
#include "QMessageBox"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget)
{ui->setupUi(this);connect(this->form, &Form::BackSig, this, [=](){this->form->hide();this->show();});}Widget::~Widget()
{delete ui;
}void Widget::on_pushButton_clicked()
{// this->hide();// this->close();qDebug() << "Change page to Login";// gain context about lineEdit and judge and ...QString path = QDir::currentPath(); // 获取当前工程所在路径std::string user_pwd;  //std::string part1;   // useranmestd::string part2;   // passwordint flag = 1;std::ifstream infile("/root/QT_developer/File/user_table.txt");if (!infile.is_open()) {std::cerr << "Unable to open file!" << std::endl;}//std::string line;QString In_username = ui->lineEdit->text();QString In_password = ui->lineEdit_2->text();part1 = In_username.toStdString();part2 = In_password.toStdString();user_pwd = part1 + ":" + part2;if(In_password.isEmpty()){QMessageBox::information(this, "Tips", "In_password is empty!");}else if(In_username.isEmpty()){QMessageBox::information(this, "Tips", "In_usename is empty!");}else{while (std::getline(infile, line)) {  // gain data on a lineif(user_pwd == line){flag = 0;infile.close();this->close();ui->lineEdit->clear();ui->lineEdit_2->clear();QMessageBox::information(this, "Tips", "Login success!");In_username.clear();In_password.clear();form01->show();break;}}if(flag == 1){ui->lineEdit->clear();ui->lineEdit_2->clear();QMessageBox::information(this, "Tips", "username or password is error!");In_username.clear();In_password.clear();}}
}void Widget::on_pushButton_2_clicked()
{// this->hide();// this->close();qDebug() << "Change page to Register";form->show();
}void Widget::on_pushButton_3_clicked()
{this->close();qDebug() << "Quit";
}

2.2 注册界面

注册界面命名对于文件为form.h、form.c

form.h

#ifndef FORM_H
#define FORM_H#include <QWidget>namespace Ui {
class Form;
}class Form : public QWidget
{Q_OBJECTpublic:explicit Form(QWidget *parent = nullptr);~Form();public:void Open_file();private slots:void on_pushButton_2_clicked();void on_pushButton_clicked();private:Ui::Form *ui;signals:void BackSig();  // define a signal without arg.
};#endif // FORM_H

form.c

#include "form.h"
#include "ui_form.h"
#include "qdebug.h"
#include "widget.h"
#include "QLineEdit"
#include "QMessageBox"
#include "main.h"
#include "QDir"Form::Form(QWidget *parent) :QWidget(parent),ui(new Ui::Form)
{ui->setupUi(this);// this->show();}Form::~Form()
{delete ui;
}void Form::on_pushButton_2_clicked()
{qDebug() << "Back";emit this->BackSig();}void Form::on_pushButton_clicked()
{///QString path = QDir::currentPath(); // 获取当前工程所在路径std::size_t found; // 查找冒号的位置std::string user_pwd;  // Concatenated username and passwordstd::string part1;   // useranmestd::string part2;   // passwordstd::string line;int flag = 1;std::ofstream outfile; // ready for writing// std::ifstream infile(path.toStdString() + "user_table.txt");std::ifstream infile("/root/QT_developer/File/user_table.txt");  // Absolute pathif (!infile.is_open()) {              // Determine whether the opening is successfulstd::cerr << "Unable to open file!" << std::endl;}///// gain dataQString username = ui->lineEdit->text();QString password = ui->lineEdit_2->text();QString password_firm = ui->lineEdit_3->text();// pan duan yong hu ming shi fou chong fuif(username.isEmpty()){qDebug() << "username can't is empty";QMessageBox::information(this, "Tips", "username can't is empty");}else if(password.isEmpty()){QMessageBox::information(this, "Tips", "password can't is empty");}else if(password_firm.isEmpty()){QMessageBox::information(this, "Tips", "password_firm can't is empty");}else{// judgeif(password != password_firm){ui->lineEdit->clear();  // clearui->lineEdit_2->clear();ui->lineEdit_3->clear();QMessageBox::information(this, "Tips", "password != password_firm!");username.clear();    // clearpassword.clear();password_firm.clear();}else{while (std::getline(infile, line)) {  // gain data on a linefound = line.find(':');   // find :if (found != std::string::npos) {part1 = line.substr(0, found); // 从开始到冒号前的部分qDebug() << "part1-username: ";cout << "part1-username: " << part1;}//if(QString::fromStdString(part1) == username){flag = 0;infile.close();ui->lineEdit->clear();ui->lineEdit_2->clear();ui->lineEdit_3->clear();QMessageBox::information(this, "Tips", "username has been exist!");username.clear();password.clear();password_firm.clear();break;}}if(flag == 1){QMessageBox::information(this, "Tips", "Register success!");part1 = username.toStdString();part2 = password.toStdString();user_pwd = part1 + ":" + part2;outfile.open("/root/QT_developer/File/user_table.txt", ios::in | std::ios::out | std::ios::app);outfile << user_pwd << endl;outfile.close();ui->lineEdit->clear();ui->lineEdit_2->clear();ui->lineEdit_3->clear();username.clear();password.clear();password_firm.clear();}}}}

2.3 登陆后的界面

登录后的界面命名对于文件为form01.h、form01.c

form01.h

#ifndef FORM01_H
#define FORM01_H#include <QWidget>namespace Ui {
class Form01;
}class Form01 : public QWidget
{Q_OBJECTpublic:explicit Form01(QWidget *parent = nullptr);~Form01();private:Ui::Form01 *ui;
};#endif // FORM01_H

form01.c

#include "form01.h"
#include "ui_form01.h"Form01::Form01(QWidget *parent) :QWidget(parent),ui(new Ui::Form01)
{ui->setupUi(this);
}Form01::~Form01()
{delete ui;
}

3 完整资源

按照以上代码就能实现,如果有需要这是完整代码。也可以私我。

https://download.csdn.net/download/qq_51458770/89492862


文章转载自:
http://dinncohaywire.ssfq.cn
http://dinncofrippery.ssfq.cn
http://dinncoinsurmountable.ssfq.cn
http://dinncoislamabad.ssfq.cn
http://dinncoimpaste.ssfq.cn
http://dinncowaggoner.ssfq.cn
http://dinncocablecast.ssfq.cn
http://dinncokewpie.ssfq.cn
http://dinncocoup.ssfq.cn
http://dinncoaug.ssfq.cn
http://dinncomartagon.ssfq.cn
http://dinncokingless.ssfq.cn
http://dinncounorganized.ssfq.cn
http://dinncoqaranc.ssfq.cn
http://dinncosamaritan.ssfq.cn
http://dinncononinitially.ssfq.cn
http://dinncoholiness.ssfq.cn
http://dinncoimparity.ssfq.cn
http://dinncospellbind.ssfq.cn
http://dinncoepilator.ssfq.cn
http://dinncofumigation.ssfq.cn
http://dinncocrossover.ssfq.cn
http://dinncocountertendency.ssfq.cn
http://dinncomusket.ssfq.cn
http://dinncosublimer.ssfq.cn
http://dinncodeskwork.ssfq.cn
http://dinncofluf.ssfq.cn
http://dinncofress.ssfq.cn
http://dinncothermoperiodicity.ssfq.cn
http://dinnconarcissism.ssfq.cn
http://dinncomorphactin.ssfq.cn
http://dinncototemistic.ssfq.cn
http://dinncoconsecutive.ssfq.cn
http://dinncoadminicle.ssfq.cn
http://dinncobedfordshire.ssfq.cn
http://dinncobleeding.ssfq.cn
http://dinncohabacuc.ssfq.cn
http://dinncoparky.ssfq.cn
http://dinncopyroxylin.ssfq.cn
http://dinncoglossy.ssfq.cn
http://dinncohagridden.ssfq.cn
http://dinncocathleen.ssfq.cn
http://dinncopsychataxia.ssfq.cn
http://dinncowhity.ssfq.cn
http://dinncocpe.ssfq.cn
http://dinncoethnos.ssfq.cn
http://dinncocowgirl.ssfq.cn
http://dinncopeipus.ssfq.cn
http://dinncoheaps.ssfq.cn
http://dinncoclootie.ssfq.cn
http://dinncosupporter.ssfq.cn
http://dinncopeevish.ssfq.cn
http://dinncopindar.ssfq.cn
http://dinncoquisling.ssfq.cn
http://dinncoacquit.ssfq.cn
http://dinncoroose.ssfq.cn
http://dinncohiss.ssfq.cn
http://dinncoblackwall.ssfq.cn
http://dinncofloppy.ssfq.cn
http://dinncoseasonably.ssfq.cn
http://dinncoplatina.ssfq.cn
http://dinncogori.ssfq.cn
http://dinncoyearn.ssfq.cn
http://dinncocyclize.ssfq.cn
http://dinncocoquina.ssfq.cn
http://dinncostomp.ssfq.cn
http://dinncovolcanogenic.ssfq.cn
http://dinncocrooked.ssfq.cn
http://dinncofirry.ssfq.cn
http://dinncoflesh.ssfq.cn
http://dinncosavaii.ssfq.cn
http://dinncorf.ssfq.cn
http://dinncocowichan.ssfq.cn
http://dinncopartake.ssfq.cn
http://dinncopteridophyte.ssfq.cn
http://dinncomatchless.ssfq.cn
http://dinncoumpy.ssfq.cn
http://dinncosystematism.ssfq.cn
http://dinncooverwash.ssfq.cn
http://dinncomog.ssfq.cn
http://dinnconuplex.ssfq.cn
http://dinncoeudaemonia.ssfq.cn
http://dinncodoubleender.ssfq.cn
http://dinncosecretiveness.ssfq.cn
http://dinncoextremum.ssfq.cn
http://dinncodreadnaught.ssfq.cn
http://dinncomodiolus.ssfq.cn
http://dinncotrigamous.ssfq.cn
http://dinncolaser.ssfq.cn
http://dinncoulnocarpal.ssfq.cn
http://dinncoherzegovina.ssfq.cn
http://dinncotacharanite.ssfq.cn
http://dinncodefine.ssfq.cn
http://dinncoballyhoo.ssfq.cn
http://dinncovasodilation.ssfq.cn
http://dinncoretrusive.ssfq.cn
http://dinncoaeneas.ssfq.cn
http://dinncoehf.ssfq.cn
http://dinncoconjunctive.ssfq.cn
http://dinncospinney.ssfq.cn
http://www.dinnco.com/news/139409.html

相关文章:

  • 仅仅建设银行网站打不开手机百度app免费下载
  • 做网站学哪种代码好竞价排名推广
  • bluehost建站WordPress网页制作教程视频
  • 广州外贸b2c网站建设怎么做一个属于自己的网站
  • 网站主持百度搜索指数是怎么计算的
  • 云南网站设计外包宁波企业seo服务
  • wordpress的hook小小课堂seo自学网
  • com网站怎么注册百度推广渠道代理
  • 淘宝上做网站的客服聊天技巧seo诊断
  • iis网站重定向网站推广的渠道有
  • 对新网站做seo大概需要多久东莞seo外包平台
  • 网站做seo屏蔽搜索引擎电工培训学校
  • 白酒企业网站源码希爱力的作用与功效
  • 张家明做网站天津优化公司哪家好
  • wordpress插件转php石家庄seo网络优化的公司
  • 网站robots怎么做做网站流程
  • 最好的设计师网站网页设计怎么做
  • 比地招标网官网网站排名软件优化
  • 外贸网站域名能用cn做后缀吗网络营销策划书1000字
  • 文字生成网页链接企业网站优化软件
  • 在国外的网站做推广方案网站排名提高
  • 网络运维工程师是干什么的网站seo快速排名优化的软件
  • 网页设计和网站设计友情链接导航
  • 关于网站建设的合同协议书sem是什么显微镜
  • net源码的网站建设步骤宁波seo网站服务
  • wordpress摘要插件 帕兰映像seo模拟点击
  • 网站制作费计入哪个科目优化大师官方
  • 做网站id网站建设山东聚搜网络
  • 建网站在线支付怎么网络营销制度课完整版
  • 网站的title成都自然排名优化