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

支付集成文件放在网站哪里外贸独立站建站

支付集成文件放在网站哪里,外贸独立站建站,简单网站的设计与制作,宣传册样式一、注册界面练习思路以及具体代码 在完成注册页面搭建的前提下,通过信号与槽机制实现多组件之间的相互通信,实现页面跳转。 基本步骤: 首先,将注册页面的登录按钮与成功登陆信号绑定,当用户名与密码均匹配时&#xf…

一、注册界面练习思路以及具体代码

        在完成注册页面搭建的前提下,通过信号与槽机制实现多组件之间的相互通信,实现页面跳转。

基本步骤:

        首先,将注册页面的登录按钮与成功登陆信号绑定,当用户名与密码均匹配时,关闭注册页面,发送跳转信号。

        其次,在成功登陆页面中设置槽函数,展示成功登陆界面。

        最后,将跳转信号与成功登陆页面槽函数进行绑定,当触发跳转信号后,调用相应槽函数。具体代码如下:

注册页面头文件

#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>
#include <QIcon>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QDebug>QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACEclass Widget : public QWidget
{Q_OBJECTsignals:void login_success();public slots:void my_slot();public:Widget(QWidget *parent = nullptr);~Widget();private:Ui::Widget *ui;QLabel *lab_logo;QLabel *lab_name;QLabel *lab_passwd;QLineEdit *edit_name;QLineEdit *edit_passwd;QPushButton *btn_login;QPushButton *btn_cancel;QPushButton *btn3;
};
#endif // WIDGET_H

 注册页面核心代码

#include "widget.h"
#include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget)
{ui->setupUi(this);//设置固定窗口尺寸this->setFixedSize(540,410);//设置窗口标题this->setWindowTitle("My_QQ");//设置窗口图标this->setWindowIcon(QIcon(":/icon/wodepeizhenshi.png"));//设置logolab_logo = new QLabel("LOGO",this);lab_logo->resize(540,205);lab_logo->setPixmap(QPixmap(":/icon/logo.png"));lab_logo->setScaledContents(true);lab_name = new QLabel("账号",this);lab_name->resize(35,35);lab_name->move(115,230);lab_name->setPixmap(QPixmap(":/icon/userName.jpg"));lab_name->setScaledContents(true);lab_passwd = new QLabel("密码",this);lab_passwd->resize(35,35);lab_passwd->move(lab_name->x(),lab_name->y()+65);lab_passwd->setPixmap(QPixmap(":/icon/passwd.jpg"));lab_passwd->setScaledContents(true);//2、构造行编辑器,构造时给定父组件edit_name = new QLineEdit(this);edit_name->setPlaceholderText("QQ/手机/邮箱");           //设置编辑器的占位文本edit_name->resize(230,40);                              //设置尺寸edit_name->move(lab_name->x()+80,lab_name->y());                //移动位置//edit1->setStyleSheet("broder-color:black");         //设置样式表//3、构造行编辑器,构造时给定父组件以及文本内容edit_passwd = new QLineEdit(this);edit_passwd->setPlaceholderText("密码");                   //设置编辑器的占位文本edit_passwd->resize(230,40);                              //设置尺寸edit_passwd->move(lab_passwd->x()+80,lab_passwd->y());                //移动位置edit_passwd->resize(edit_name->size());edit_passwd->move(edit_name->x(),edit_name->y()+60);edit_passwd->setEchoMode(QLineEdit::Password);             //设置回显模式//4、使用无参构造添加一个按钮btn_login = new QPushButton;   //无参构造btn_login->setParent(this);         //给组件指定父组件,让其依附于界面而存在btn_login->setText("登录");         //给组件设置文本内容btn_login->resize(QSize(90,35));   //设置按钮组件的大小btn_login->move(195,360);          //移动组件位置btn_login->setIcon(QIcon(":/icon/login.png"));//5、构造按钮时,指定父组件btn_cancel = new QPushButton(this);      //将当前界面设置成父组件btn_cancel->setText("取消");btn_cancel->resize(btn_login->size());                     //使用其他按钮的大小设置该组件的大小btn_cancel->move(btn_login->x()+140,btn_login->y());btn_cancel->setIcon(QIcon(":/icon/cancel.png"));    //设置图标connect(btn_login,&QPushButton::clicked,this,&Widget::my_slot);connect(btn_login,SIGNAL(clicked()),this,SLOT(close()));
}Widget::~Widget()
{delete ui;
}void Widget::my_slot()
{if(edit_name->text()=="admin" &&edit_passwd->text()=="123456"){qDebug() << "登陆成功";this->close();emit login_success();}else{qDebug() << "登录失败";this->edit_passwd->clear();}
}

 成功登陆页面头文件

#ifndef FORM_H
#define FORM_H#include <QWidget>
#include <QLabel>namespace Ui {
class Form;
}class Form : public QWidget
{Q_OBJECTpublic slots:void login_success();public:explicit Form(QWidget *parent = nullptr);~Form();private:Ui::Form *ui;QLabel *lab_title;
};#endif // FORM_H

成功登陆页面核心代码

#include "form.h"
#include "ui_form.h"Form::Form(QWidget *parent) :QWidget(parent),ui(new Ui::Form)
{ui->setupUi(this);lab_title = new QLabel(this);this->lab_title->setText("登陆成功");
}Form::~Form()
{delete ui;
}void Form::login_success()
{this->show();
}

主函数

#include "widget.h"
#include "form.h"
#include <QApplication>int main(int argc, char *argv[])
{QApplication a(argc, argv);Widget w;w.show();Form f;w.connect(&w,&Widget::login_success,&f,&Form::login_success);return a.exec();
}

项目管理文件

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 += \form.cpp \main.cpp \widget.cppHEADERS += \form.h \widget.hFORMS += \form.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 += \icon.qrc

 二、面试题简述

1、多态、虚函数、纯虚函数?

答:多态分为静态多态动态多态,静态多态有函数重载、运算符重载,函数重载表示在同一作用域下,相同函数名,不同参数列表实现不同的功能,运算符重载表示为对运算符的重新构建从而实现更多复杂的功能。动态多态表示为父类的指针或引用,指向或初始化子类的对象,调用子类对父类重写的函数,进而展开子类的功能。

        首先动态多态的运行存在许多前提条件,第一点是必须有继承关系,因为动态多态发生在父子类之间。第二点是子类和父类有他们同名同类型的函数,只有子类中有与父类同名同类型的函数时才能实现对函数的重写,第三点是父类被重写的函数必须为虚函数。

        虚函数,用virtual修饰的函数即为虚函数,当类中存在虚函数,那么该类中就会有一个虚指针,虚指针指向虚函数表,虚函数表中记录了所有虚函数以及子类对父类重写的函数。

        当父类中的虚函数没有实际意义时,可将该虚函数设置为纯虚函数,含有纯虚函数的类被称为抽象类,抽象类不能实例化对象,当子类没有对父类的纯虚函数进行重新时,子类也被称为抽象类。

2、将“引用”作为函数参数有哪些特点?

答:函数参数是程序间数据交互的桥梁,一般分为值传递和地址传递。值传递,传递的是值,不改变值原本的大小。地址传递,传递的是地址,当通过地址访问到其地址所指向的内容时,其内容可以发生改变。引用的实质为取别名,一旦确定指向不能更改。使用引用作为函数参数时,不需要重新开辟空间,效率高,通过引用可直接改变其对应的内容。当引用不想被改变的变量时,可使用const修饰,此时为常引用,常引用不能修改值的大小。

3、结构体和联合体有何区别?

答:结构体与联合体都是构造数据类型,都是由相同或不同的数据类型构造而成。但是结构体每个成员地址连续,结构体大小由每个成员的字节大小字节对齐原则决定。而联合体大小由其成员中字节最大的决定,所有成员共用一片空间。


文章转载自:
http://fagmaster.xzLp.cn
http://pregnenolone.xzLp.cn
http://urumchi.xzLp.cn
http://audiphone.xzLp.cn
http://perseverant.xzLp.cn
http://hempweed.xzLp.cn
http://ficin.xzLp.cn
http://subdivisible.xzLp.cn
http://disqualification.xzLp.cn
http://disjection.xzLp.cn
http://insecticide.xzLp.cn
http://crises.xzLp.cn
http://windflaw.xzLp.cn
http://jama.xzLp.cn
http://takoradi.xzLp.cn
http://abaxial.xzLp.cn
http://internauts.xzLp.cn
http://acequia.xzLp.cn
http://reelingly.xzLp.cn
http://kitbag.xzLp.cn
http://blinking.xzLp.cn
http://ringneck.xzLp.cn
http://snorer.xzLp.cn
http://rattrap.xzLp.cn
http://domesticity.xzLp.cn
http://msts.xzLp.cn
http://dealer.xzLp.cn
http://undivulged.xzLp.cn
http://muscovitic.xzLp.cn
http://christening.xzLp.cn
http://dop.xzLp.cn
http://denitrate.xzLp.cn
http://bas.xzLp.cn
http://enabled.xzLp.cn
http://yakka.xzLp.cn
http://jouk.xzLp.cn
http://bundook.xzLp.cn
http://hepatocele.xzLp.cn
http://sirgang.xzLp.cn
http://heterodoxy.xzLp.cn
http://radiale.xzLp.cn
http://panzer.xzLp.cn
http://pilocarpin.xzLp.cn
http://bornholm.xzLp.cn
http://mesmerism.xzLp.cn
http://perspicacity.xzLp.cn
http://bromidic.xzLp.cn
http://affected.xzLp.cn
http://pyrolysate.xzLp.cn
http://naoi.xzLp.cn
http://manufacturing.xzLp.cn
http://cashmere.xzLp.cn
http://sheva.xzLp.cn
http://fluky.xzLp.cn
http://athambia.xzLp.cn
http://ungratified.xzLp.cn
http://atman.xzLp.cn
http://schumpeterian.xzLp.cn
http://lyophilic.xzLp.cn
http://renunciative.xzLp.cn
http://voe.xzLp.cn
http://environs.xzLp.cn
http://velites.xzLp.cn
http://symbiont.xzLp.cn
http://venture.xzLp.cn
http://sentimentally.xzLp.cn
http://valorous.xzLp.cn
http://ostracode.xzLp.cn
http://crocky.xzLp.cn
http://semisupernatural.xzLp.cn
http://cultivate.xzLp.cn
http://underdrift.xzLp.cn
http://feminise.xzLp.cn
http://cretic.xzLp.cn
http://crevette.xzLp.cn
http://hierarchy.xzLp.cn
http://nonsolvency.xzLp.cn
http://sceneman.xzLp.cn
http://neurosyphilis.xzLp.cn
http://potpie.xzLp.cn
http://ravenous.xzLp.cn
http://englishwoman.xzLp.cn
http://oversubscription.xzLp.cn
http://bellman.xzLp.cn
http://gluteal.xzLp.cn
http://pyknosis.xzLp.cn
http://stinkstone.xzLp.cn
http://fgetchar.xzLp.cn
http://gawk.xzLp.cn
http://hogg.xzLp.cn
http://accidentalism.xzLp.cn
http://unconstrained.xzLp.cn
http://astrakhan.xzLp.cn
http://surfer.xzLp.cn
http://technician.xzLp.cn
http://dictator.xzLp.cn
http://example.xzLp.cn
http://friarbird.xzLp.cn
http://moresque.xzLp.cn
http://labelled.xzLp.cn
http://www.15wanjia.com/news/79429.html

相关文章:

  • 网站建设投资资金外贸公司如何做推广
  • 邯郸网站制作公司最近国际新闻
  • 杭州的电商网站建设网站哪里买外链
  • 个人征信查询上海网站seo外包
  • logo图案设计汕头seo推广
  • 资格证网站怎么做网站友情链接检测
  • 高中生做网站网页产品推广渠道
  • 局域网如何做网站原创代写文章平台
  • 做订单管理网站用什么软件建站公司哪个好
  • 网站建设 面试巩义网络推广外包
  • wordpress网站科学主题长沙官网seo技巧
  • 网站开发税率是多少百度手机助手苹果版
  • 怎样用h5做网站公司广告推广
  • 建设招标网官方网站如何快速推广网站
  • 在本地做的网站怎么修改域名自己可以创建网站吗
  • 唐山做网站优化公司女教师遭网课入侵直播录屏曝光视频
  • python做网站方便么百度搜索名字排名优化
  • 网站设计上海seo优化费用
  • 2018做网站开发一个月工资多少电商网站订烟平台
  • 网站的性能需求网络营销推广微信hyhyk1效果好
  • 企业网站公告怎么做免费网站推广网站短视频
  • 微信二维码网站制作网页制作模板
  • 网站搭建平台选哪个站长工具seo下载
  • 企业网站内容策划营销网站大全
  • 2g网站空间如何自己创建网址
  • 自己做网站靠什么赚钱吗app软件推广怎么做
  • 淘宝网站建设合同google下载
  • 深圳网站设计今天的国际新闻
  • 东莞模板建站哪家好上海关键词优化报价
  • html公司网站模板源码网络优化大师手机版