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

昆明网站建设哪家最好做公司网站

昆明网站建设哪家最好,做公司网站,网页设计与制作实践,做定制商品的网站作业: 1】 思维导图 2】 在登录界面的登录取消按钮进行以下设置: 使用手动连接,将登录框中的取消按钮使用qt4版本的连接到自定义的槽函数中,在自定义的槽函数中调用关闭函数 将登录按钮使用qt5版本的连接到自定义的槽函数中&a…

作业:

1】 思维导图

2】 在登录界面的登录取消按钮进行以下设置:

使用手动连接,将登录框中的取消按钮使用qt4版本的连接到自定义的槽函数中,在自定义的槽函数中调用关闭函数

将登录按钮使用qt5版本的连接到自定义的槽函数中,在槽函数中判断ui界面上输入的账号是否为"admin",密码是否为"123456",如果账号密码匹配成功,则输出“登录成功”,并关闭该界面,弹出另一个界面。如果匹配失败,则输出登录失败,并将密码框中的内容清空

3】 自己完成一个使用qss的登陆窗口界面【资源文件的添加、qss语法】。

已更新12.29题目为新增功能代码

untitled.pro

QT       += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgetsCONFIG += c++11# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0SOURCES += \main.cpp \second.cpp \widget.cppHEADERS += \second.h \widget.hFORMS += \second.ui \widget.ui# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetRESOURCES += \ppppp.qrc

widget.h
 

#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>
#include <QPushButton>
#include <QMessageBox>QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACEclass Widget : public QWidget
{Q_OBJECTpublic:Widget(QWidget *parent = nullptr);~Widget();signals:void my_jump();//第一个界面准备的信号private slots:void on_pushButton_2_clicked();void on_pushButton_clicked();private:Ui::Widget *ui;
};
#endif // WIDGET_H

second.h
 

#ifndef SECOND_H
#define SECOND_H#include <QWidget>namespace Ui {
class Second;
}class Second : public QWidget
{Q_OBJECTpublic:explicit Second(QWidget *parent = nullptr);~Second();public slots:void jump_slot();//第二个界面准备的槽函数声明private:Ui::Second *ui;
};#endif // SECOND_H

main.cpp

#include "widget.h"
#include "second.h"
#include <QApplication>int main(int argc, char *argv[])
{QApplication a(argc, argv);Widget w;w.show();//实例化第二界面Second s;QObject::connect(&w,&Widget::my_jump,&s,&Second::jump_slot);return a.exec();
}

widget.cpp
 

#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget){ui->setupUi(this);//去掉标题,纯净模式this->setWindowFlag(Qt::FramelessWindowHint);//去掉空白部分this->setAttribute(Qt::WA_TranslucentBackground);connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(my_slot()));
}Widget::~Widget()
{delete ui;
}
//基于静态成员函数版本
void Widget::on_pushButton_2_clicked()
{int ret = QMessageBox::question(this,"问题对话框","您是否确认要退出登录?",QMessageBox::Yes|QMessageBox::No);if(ret==QMessageBox::Yes){this->close();}else{}
}void Widget::on_pushButton_clicked()
{if(ui->lineEdit->text()=="admin"&&ui->lineEdit_2->text()=="123456"){//基于基本属性版本QMessageBox msg(QMessageBox::Information,"信息对话框","登录成功",QMessageBox::Ok,this);//调用exec()弹出信息对话框int ret  = msg.exec();//if(ret == QMessageBox::Ok){this->close();emit my_jump();}}else{//基于静态成员函数版本int ret = QMessageBox::critical(this,"错误对话框","账号和密码不匹配,是否重新登录",QMessageBox::Yes|QMessageBox::No,QMessageBox::Yes);if(ret == QMessageBox::Yes){ui->lineEdit->clear();ui->lineEdit_2->clear();}else{this->close();}qDebug()<<"登录失败";}
}

second.cpp

#include "second.h"
#include "ui_second.h"Second::Second(QWidget *parent) :QWidget(parent),ui(new Ui::Second)
{ui->setupUi(this);//去掉标题,纯净模式this->setWindowFlag(Qt::FramelessWindowHint);//去掉空白部分this->setAttribute(Qt::WA_TranslucentBackground);
}Second::~Second()
{delete ui;
}//第二个界面来准备的槽函数实现
void Second::jump_slot()
{//显示this->show();
}


http://www.ysxn.cn/news/389.html

相关文章:

  • 创新的购物网站建设中小企业网站优化
  • 北京南站最新消息渠道推广费用咨询
  • 新洲建设局网站营销服务机构
  • 茂名网站建设服务如何进行网络营销
  • 广州网站推广多少钱深圳百度搜索排名优化
  • 北京网站建设公司电扬推广引流
  • 如何用flash做网站站长之家下载
  • 可以自己做安卓app的网站刷推广链接的网站
  • 沧州哪里可以做网站青岛seo
  • 做网站建设公司怎么样网络销售怎么样
  • 代理做网站seo外包公司哪家好
  • 网站建设工作职责说明书手机端百度收录入口
  • 在百度怎么做网站温州最好的seo
  • 集团网站建设服务软文推广怎么写
  • 银川市住房和城乡建设网站狼雨seo网站
  • 怎样用jsp做网站 新手教程福州seo推广服务
  • 深圳高端网站定制公搜索引擎大全排行榜
  • 旅行社网站设计方案黄冈便宜的网站推广怎么做
  • 网页无法访问打不开页面如何解决seo入门培训教程
  • 网站做三级等保费用友情链接怎么设置
  • 建设商城网站制作企业网站制作多少钱
  • 做网站推广员推推蛙网站诊断
  • 淄博网站推广优化seo月薪
  • 网站建设win2012线上it培训机构
  • 做视频资源网站有哪些内容推广宣传方式有哪些
  • 做网站技巧郑州seo顾问阿亮
  • 如何做一条动态网站十大微商推广平台
  • 做网站怎么实现鼠标经过图像免费建立个人网站官网
  • 政府部门网站建设意义友链互换平台推荐
  • 保定住房和城乡建设局网站无锡seo关键词排名