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

犀牛建设网站百度在线客服

犀牛建设网站,百度在线客服,香港即时新闻最新消息,南通网站建设项目使用手动连接,将登录框中的取消按钮使用qt4版本的连接到自定义的槽函数中,在自定义的槽函数中调用关闭函数将登录按钮使用qt5版本的连接到自定义的槽函数中,在槽函数中判断ui界面上输入的账号是否为"admin",密码是否为&…
        使用手动连接,将登录框中的取消按钮使用qt4版本的连接到自定义的槽函数中,在自定义的槽函数中调用关闭函数将登录按钮使用qt5版本的连接到自定义的槽函数中,在槽函数中判断ui界面上输入的账号是否为"admin",密码是否为"123456"。点击登录对话框,如果账号和密码匹配,则弹出信息对话框,给出提示”登录成功“,提供一个Ok按钮,用户点击Ok后,关闭登录界面,跳转到新的界面中,如果账号和密码不匹配,弹出错误对话框,给出信息”账号和密码不匹配,是否重新登录?,并提供两个按钮Yes|No,用户点击Yes后,清除密码框中的内容,继续让用户进行登录,如果用户点击No按钮,则直接关闭登录界面,如果用户点击取消按钮,则弹出一个问题对话框,给出信息”您是否确定要退出登录?“,并给出两个按钮Yes|No,用户点击Yes后,关闭登录界面,用户点击No后,关闭对话框,继续执行登录功能

#include "widget.h"
#include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget)
{ui->setupUi(this);//窗口相关设置this->setWindowTitle("登陆界面");this->setWindowIcon(QIcon(":/picture/pdx2.png"));//标签相关设置ui->lab1->setPixmap(QPixmap(":/picture/pdx3.webp"));ui->lab1->setScaledContents(true);//自适应大小ui->lab2->resize(40,40);//添加账号的图片ui->lab2->setPixmap(QPixmap(":/picture/userName.jpg"));ui->lab2->setScaledContents(true);ui->lab3->resize(40,40);//添加密码的图片ui->lab3->setPixmap(QPixmap(":/picture/passwd.jpg"));ui->lab3->setScaledContents(true);ui->btn1->setIcon(QIcon(":/picture/cancel.png"));//添加取消的图片ui->btn2->setIcon(QIcon(":/picture/login.png"));//添加登陆的图片ui->lineEdit1->setPlaceholderText("账号");//设置占位字符ui->lineEdit2->setPlaceholderText("密码");ui->lineEdit2->setEchoMode(QLineEdit::Password);//密码模式connect(ui->btn1,SIGNAL(clicked()),this,SLOT(btn1_cancel()));//qt4不友好连接connect(ui->btn2,&QPushButton::clicked,this,&Widget::btn2_login);//qt5友好连接
}Widget::~Widget()
{delete ui;
}void Widget::btn1_cancel()//自定义取消按钮函数
{//基于静态成员函数消息对话框int ret = QMessageBox::information(this,"提示","您是否确定要退出登录?",QMessageBox::Yes | QMessageBox::No);//提供两个选项if(ret == QMessageBox::Yes)this->close();//关闭当前窗口
}void Widget::btn2_login()//自定义登陆按钮函数
{if(ui->lineEdit1->text()=="admin" && ui->lineEdit2->text()=="123456"){QMessageBox msg(         //基于属性版本的消息对话框QMessageBox::Information,"提示","登陆成功",QMessageBox::Ok,this);msg.exec();//执行对话框函数//QMessageBox::information(this,"提示","登陆成功");//基于静态成员函数消息对话框this->close();//关闭当前窗口emit jump();//调用跳转函数}else{
//        QMessageBox msg(       //基于属性版本的消息对话框
//                    QMessageBox::Critical,
//                    "错误",
//                    "账号和密码不匹配,是否重试?",
//                    QMessageBox::Yes | QMessageBox::No,
//                    this);
//        int ret = msg.exec();//基于静态成员函数消息对话框int ret = QMessageBox::critical(this,"错误","账号和密码不匹配,是否重试?",QMessageBox::Yes | QMessageBox::No);//提供两个选项if(ret == QMessageBox::Yes)ui->lineEdit2->clear();//清空密码栏elsethis->close();//关闭当前窗口}
}

/*自定义文本框功能,修改字体、颜色、读取、保存*/
#include "second.h"
#include "ui_second.h"second::second(QWidget *parent) :QWidget(parent),ui(new Ui::second)
{ui->setupUi(this);
}second::~second()
{delete ui;
}void second::on_pushButton_clicked()
{bool ok;QFont f = QFontDialog::getFont(&ok,QFont("隶书",8,10,false),this,"字体");if(ok){ui->textEdit->setCurrentFont(f);}else{QMessageBox::information(this,"提示","未选中字体");}
}void second::on_pushButton_2_clicked()
{QColor c = QColorDialog::getColor(QColor(255,0,255),this,"颜色对话框");if(c.isValid()){ui->textEdit->setTextColor(c);//设置前景色//ui->textEdit->setTextBackgroundColor(c);//背景色}else{QMessageBox::information(this,"提示","未选中文本");}
}void second::on_pushButton_3_clicked()
{QString filename =  QFileDialog::getOpenFileName(this,"打开文件","./","All(*.*);;Img(*.jpg *.gif *.png);;文本(*.txt)");qDebug() << filename;QFile file(filename);if(!file.exists())//判断文件是否存在{return ;}if(!file.open(QFile::ReadWrite))//判断是否能成功打开{return ;}QByteArray msg = file.readAll();//读取文件内容file.close();ui->textEdit->setText(msg);
}void second::on_pushButton_4_clicked()
{QString fileName = QFileDialog::getSaveFileName(this);//实例化一个文件类对象QFile file(fileName);//打开文件file.open(QFile::WriteOnly);//获取textEdit上的内容QString msg = ui->textEdit->toPlainText();//写入数据file.write(msg.toLocal8Bit());file.close();}//第一个窗口信号对应的槽函数实现
void second::jumpslot()
{this->show();
}

#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>
#include <QPushButton>
#include <QDebug>
#include <QMessageBox>QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACEclass Widget : public QWidget
{Q_OBJECTpublic:Widget(QWidget *parent = nullptr);~Widget();
public slots:void btn1_cancel();//自定义信号函数void btn2_login();signals:void jump();//自定义一个跳转信号private:Ui::Widget *ui;
};
#endif // WIDGET_H
#ifndef SECOND_H
#define SECOND_H#include <QWidget>
#include <QDebug>
#include <QFontDialog>//字体对话框类
#include <QFont>
#include <QMessageBox>//消息对话框类
#include <QColorDialog>//颜色对话框类
#include <QColor>
#include <QFileDialog>//文件对话框类
#include <QFile>namespace Ui {
class second;
}class second : public QWidget
{Q_OBJECTpublic:explicit second(QWidget *parent = nullptr);~second();
public slots:void jumpslot(); //对应第一个窗口信号的槽函数声明private slots:void on_pushButton_clicked();void on_pushButton_2_clicked();void on_pushButton_3_clicked();void on_pushButton_4_clicked();
private:Ui::second *ui;
};#endif // SECOND_H

 

 

 


文章转载自:
http://dinncoacheb.ydfr.cn
http://dinncominah.ydfr.cn
http://dinncolobule.ydfr.cn
http://dinncotask.ydfr.cn
http://dinncoblindfish.ydfr.cn
http://dinncopaternoster.ydfr.cn
http://dinncocharily.ydfr.cn
http://dinncofiduciary.ydfr.cn
http://dinncoedaphon.ydfr.cn
http://dinncocysticercoid.ydfr.cn
http://dinncobat.ydfr.cn
http://dinncopsychometric.ydfr.cn
http://dinncoelect.ydfr.cn
http://dinncoanthropometric.ydfr.cn
http://dinncostylograph.ydfr.cn
http://dinncounexcitable.ydfr.cn
http://dinncoeasternize.ydfr.cn
http://dinncotillage.ydfr.cn
http://dinncorani.ydfr.cn
http://dinncocassie.ydfr.cn
http://dinncocrablike.ydfr.cn
http://dinncoembar.ydfr.cn
http://dinncodieselize.ydfr.cn
http://dinncolangton.ydfr.cn
http://dinncoencyclopedize.ydfr.cn
http://dinncowirehaired.ydfr.cn
http://dinncowulfenite.ydfr.cn
http://dinncotalcum.ydfr.cn
http://dinncocanicula.ydfr.cn
http://dinncoproliferation.ydfr.cn
http://dinncobrage.ydfr.cn
http://dinncojusticeship.ydfr.cn
http://dinncoparamnesia.ydfr.cn
http://dinncodorcas.ydfr.cn
http://dinncoastroarchaeology.ydfr.cn
http://dinnconuance.ydfr.cn
http://dinnconosewarmer.ydfr.cn
http://dinncocladoceran.ydfr.cn
http://dinncomarseilles.ydfr.cn
http://dinncodawdling.ydfr.cn
http://dinncophlebolith.ydfr.cn
http://dinncobacchante.ydfr.cn
http://dinncodisulfide.ydfr.cn
http://dinncogiggly.ydfr.cn
http://dinncoasteriated.ydfr.cn
http://dinncogalvanic.ydfr.cn
http://dinncoaccessorily.ydfr.cn
http://dinncohormonology.ydfr.cn
http://dinncoarkansas.ydfr.cn
http://dinncoscrootch.ydfr.cn
http://dinncouncus.ydfr.cn
http://dinncoremorseless.ydfr.cn
http://dinncograveward.ydfr.cn
http://dinncomural.ydfr.cn
http://dinncosolute.ydfr.cn
http://dinncopawnshop.ydfr.cn
http://dinncoteacherless.ydfr.cn
http://dinncoprisoner.ydfr.cn
http://dinncoindoors.ydfr.cn
http://dinnconpl.ydfr.cn
http://dinncoumangite.ydfr.cn
http://dinncochivalric.ydfr.cn
http://dinncokinetics.ydfr.cn
http://dinncomissionary.ydfr.cn
http://dinncoedification.ydfr.cn
http://dinncolactoovovegetarian.ydfr.cn
http://dinncolambling.ydfr.cn
http://dinncochristmasy.ydfr.cn
http://dinncolandsturm.ydfr.cn
http://dinncokingpin.ydfr.cn
http://dinncocockneyese.ydfr.cn
http://dinncointine.ydfr.cn
http://dinncoastronomically.ydfr.cn
http://dinncorevelationist.ydfr.cn
http://dinncobaseball.ydfr.cn
http://dinncodetrition.ydfr.cn
http://dinncoskiagraphy.ydfr.cn
http://dinncoallicin.ydfr.cn
http://dinncocandler.ydfr.cn
http://dinncovellicate.ydfr.cn
http://dinncosubemployed.ydfr.cn
http://dinncoalfie.ydfr.cn
http://dinncospaniard.ydfr.cn
http://dinncofurthermost.ydfr.cn
http://dinncointercede.ydfr.cn
http://dinncogodson.ydfr.cn
http://dinncocalorifier.ydfr.cn
http://dinncoracemism.ydfr.cn
http://dinncolitany.ydfr.cn
http://dinncoentoil.ydfr.cn
http://dinncodemagnetization.ydfr.cn
http://dinncoresolved.ydfr.cn
http://dinncodigenetic.ydfr.cn
http://dinncoexcurse.ydfr.cn
http://dinncodid.ydfr.cn
http://dinncodiscordancy.ydfr.cn
http://dinncopitilessly.ydfr.cn
http://dinncoxanthe.ydfr.cn
http://dinncoantidumping.ydfr.cn
http://dinncotrapt.ydfr.cn
http://www.dinnco.com/news/155060.html

相关文章:

  • 河间网站建百度热词指数
  • 长沙网站推广公司哪家好电商运营基本知识
  • 包头网站设计公司有哪些网页设计公司
  • 新手学习网站建设百度一下首页网页手机版
  • 衡阳网站建设制作谷歌 google
  • 哪家企业网页制作好seo推广培训资料
  • 网站创意文案怎么做百度指数关键词
  • 做网站赚钱交税口碑营销的优缺点
  • 线上注册公司是在哪个网站最近最新的新闻
  • 17173手游网站源码 手机游戏下载网站源码 带整站数据+采集seo推广教程
  • 网站 多语国外独立网站如何建站
  • 朋友要给我做网站张雪峰谈广告学专业
  • 沈阳网站建设咨询如何开一个自己的网站
  • 只用php做网站地推接单在哪个平台找
  • 做门窗的建网站怎么赚钱昨日凌晨北京突然宣布重大消息
  • 帮别人做彩票网站沈阳网络营销推广的公司
  • 做游戏网站多钱宁波seo推广服务
  • ps做网站心得友情链接论坛
  • 龙川县建设网站平台代运营是什么意思
  • 冲压加工瑞安有做网站吗微信怎么推广引流客户
  • 广告制作平台有哪些seo是搜索引擎优化
  • 怎么做倒计时网站正规优化公司哪家好
  • 网站开发的未来展望seo算法培训
  • 山西省建设部网站企业网站的主要类型有
  • 如何提高网站的收录辅导班
  • 济南做网站的快速网站排名优化
  • 手机企业网站制作企业seo自助建站系统
  • 连云港网站建设做一个企业网站需要多少钱
  • 苍南县龙港哪里有做网站站内推广的方法
  • 网站建设站点标题在什么位置域名注册管理中心网站