Qt窗口调度
来源:互联网 发布:淘宝网电脑网页版登陆 编辑:程序博客网 时间:2024/06/06 01:37
//main.cpp#include <QApplication>#include "tcp.h"#include "atm.h"int main(int argc, char *argv[]){ QApplication a(argc, argv); //此处不可以用以及Atm类的构造函数中都不能用.exe,否则不能形成消息循环 Atm *w = new Atm; return a.exec();}
//atm.h//主窗口#ifndef ATM_H#define ATM_H#include <QDialog>class Welcome;class Denglu;namespace Ui {class Atm;}class Atm : public QDialog{ Q_OBJECTpublic: explicit Atm(QWidget *parent = 0); ~Atm(); Welcome *welcome; Denglu *denglu;private slots: void on_Btn1_clicked();private: Ui::Atm *ui;}
//atm.cpp#include "atm.h"#include "ui_atm.h"#include "welcome.h"Atm::Atm(QWidget *parent) : QDialog(parent), ui(new Ui::Atm){ ui->setupUi(this); this->setFixedSize( this->width (),this->height ());//固定窗口大小 welcome = new Welcome; welcome->show(); denglu = new Denglu; //本地信号和槽 connect(welcome,SIGNAL(jump_to_denglu()),this,SLOT(respond_jump_to_denglu())); connect(denglu,SIGNAL(jump_to_welcome()),this,SLOT(respond_jump_to_welcome()));}//————————————————————————按键部分——————————————————————————void Atm::on_Btn1_clicked()//按键1:开户{//注意,此处是可以学习的地方,开户完还得返回主界面,因此先将主界面隐藏,开户完成后,再将主界面显示出来。 this->hide(); kaihu->exec(); this->show();}
//welcome.h//欢迎界面#ifndef WELCOME_H#define WELCOME_H#include <QDialog>#include <QString>namespace Ui {class Welcome;}class Welcome : public QDialog{ Q_OBJECTpublic: explicit Welcome(QWidget *parent = 0); ~Welcome();signals: void jump_to_denglu(); void jump_to_zhuce(); void ask_for_close();private slots: void on_Btn1_clicked(); void on_Btn2_clicked(); void on_Btn_3_clicked();private: Ui::Welcome *ui;};#endif // WELCOME_H
//welcome.cpp#include "welcome.h"#include "ui_welcome.h"#include <QProgressDialog>Welcome::Welcome(QWidget *parent) : QDialog(parent), ui(new Ui::Welcome){ ui->setupUi(this); this->setFixedSize( this->width (),this->height ());//固定窗口大小 this->setWindowFlags(Qt::FramelessWindowHint);//去掉标题栏}Welcome::~Welcome(){ delete ui;}void Welcome::on_Btn1_clicked()//注册{ emit jump_to_denglu(); this->hide();}void Welcome::on_Btn2_clicked(){ emit jump_to_zhuce(); this->hide();}void Welcome::on_Btn_3_clicked(){ emit ask_for_close(); this->hide();}
0 0
- Qt窗口调度
- Qt窗口
- QT窗口
- Qt窗口
- C#winform窗口调度问题
- qt 窗口无法全屏
- Qt不规则窗口
- Qt: 释放窗口资源
- QT窗口隐藏
- QT 弹出窗口
- qt 设置窗口半透明
- [C++] QT 窗口最大化
- Qt去掉窗口?按钮
- [Qt]整体拖动窗口
- Qt窗口部件
- QT窗口透明设置
- QT自定义窗口:
- QT分割子窗口
- dynamic debug log输出机制
- Activity,Service,和BroadCastReceiver的ANR,无响应时长是多少?
- android root权限运行
- C#之泛型
- AC自动机与dp(poj3691)
- Qt窗口调度
- JavaScript中的cookie
- 136. Single Number
- google可以ping通,但无法访问~~
- 百度和谷歌相比,差在哪?
- ubuntu 配置openjdk
- 如何查看OpenCV中自带函数的源代码
- 关于jquery中的extend方法的用法
- RancherOS正式版发布:最轻量的开源容器Linux操作系统