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

深圳专业网站建设制作价格低怎么建免费网站

深圳专业网站建设制作价格低,怎么建免费网站,做柱状图 饼状图的网站,东莞信科做网站qt-C笔记之两个窗口ui的交互 code review! 文章目录 qt-C笔记之两个窗口ui的交互0.运行1.文件结构2.先创建widget项目,搞一个窗口ui出来3.项目添加第二个widget窗口出来4.补充代码4.1.qt_widget_interaction.pro4.2.main.cpp4.3.widget.h4.4.widget.cpp4.5.second…

qt-C++笔记之两个窗口ui的交互

code review!

文章目录

  • qt-C++笔记之两个窗口ui的交互
    • 0.运行
    • 1.文件结构
    • 2.先创建widget项目,搞一个窗口ui出来
    • 3.项目添加第二个widget窗口出来
    • 4.补充代码
      • 4.1.qt_widget_interaction.pro
      • 4.2.main.cpp
      • 4.3.widget.h
      • 4.4.widget.cpp
      • 4.5.second_widget.h
      • 4.6.second_widget.cpp
      • 4.7.widget.ui
      • 4.8.second_widget.ui

0.运行

在这里插入图片描述

1.文件结构

在这里插入图片描述

2.先创建widget项目,搞一个窗口ui出来

在这里插入图片描述

3.项目添加第二个widget窗口出来

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4.补充代码

4.1.qt_widget_interaction.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_widget.cpp \widget.cppHEADERS += \second_widget.h \widget.hFORMS += \second_widget.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 += target

4.2.main.cpp

在这里插入图片描述

代码

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

4.3.widget.h

在这里插入图片描述

代码

#ifndef WIDGET_H
#define WIDGET_H#include <QWidget>
#include <second_widget.h>QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACEclass Widget : public QWidget
{Q_OBJECTpublic:Widget(QWidget *parent = nullptr);~Widget();private slots:void on_push_second_widget_clicked();void show_widget();private:Ui::Widget *ui;
};
#endif // WIDGET_H

4.4.widget.cpp

在这里插入图片描述

代码

#include "widget.h"
#include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget)
{ui->setupUi(this);}Widget::~Widget()
{delete ui;
}void Widget::show_widget()
{this->show();
}void Widget::on_push_second_widget_clicked()
{second_widget* f = new second_widget;f->show();this->hide();connect(f,SIGNAL(close_and_open()),this,SLOT(show_widget()));
}

4.5.second_widget.h

在这里插入图片描述

代码

#ifndef SECOND_WIDGET_H
#define SECOND_WIDGET_H#include <QWidget>namespace Ui {
class second_widget;
}class second_widget : public QWidget
{Q_OBJECTpublic:explicit second_widget(QWidget *parent = nullptr);~second_widget();private slots:void on_pushButton_clicked();signals:void close_and_open();private:Ui::second_widget *ui;
};#endif // SECOND_WIDGET_H

4.6.second_widget.cpp

在这里插入图片描述

代码

#include "second_widget.h"
#include "ui_second_widget.h"second_widget::second_widget(QWidget *parent) :QWidget(parent),ui(new Ui::second_widget)
{ui->setupUi(this);
}second_widget::~second_widget()
{delete ui;
}void second_widget::on_pushButton_clicked()
{emit close_and_open();this->hide();
}

4.7.widget.ui

代码

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"><class>Widget</class><widget class="QWidget" name="Widget"><property name="geometry"><rect><x>0</x><y>0</y><width>800</width><height>600</height></rect></property><property name="windowTitle"><string>Widget</string></property><widget class="QLabel" name="label"><property name="geometry"><rect><x>350</x><y>210</y><width>171</width><height>41</height></rect></property><property name="text"><string>first_widget</string></property></widget><widget class="QPushButton" name="push_second_widget"><property name="geometry"><rect><x>70</x><y>340</y><width>281</width><height>51</height></rect></property><property name="text"><string>open scond_widget</string></property></widget></widget><resources/><connections/>
</ui>

4.8.second_widget.ui

代码

<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"><class>second_widget</class><widget class="QWidget" name="second_widget"><property name="geometry"><rect><x>0</x><y>0</y><width>460</width><height>312</height></rect></property><property name="windowTitle"><string>Form</string></property><widget class="QLabel" name="label"><property name="geometry"><rect><x>100</x><y>120</y><width>211</width><height>41</height></rect></property><property name="text"><string>second_widget</string></property></widget><widget class="QPushButton" name="pushButton"><property name="geometry"><rect><x>20</x><y>210</y><width>411</width><height>41</height></rect></property><property name="text"><string>close_second_and_open_first</string></property></widget></widget><resources/><connections/>
</ui>

文章转载自:
http://skytroops.qkqn.cn
http://handmaiden.qkqn.cn
http://porkfish.qkqn.cn
http://clarinetist.qkqn.cn
http://waveform.qkqn.cn
http://monolayer.qkqn.cn
http://footrest.qkqn.cn
http://papmeat.qkqn.cn
http://sleepwalking.qkqn.cn
http://intermundane.qkqn.cn
http://goddam.qkqn.cn
http://umbrageous.qkqn.cn
http://resorcinol.qkqn.cn
http://darkness.qkqn.cn
http://prefigure.qkqn.cn
http://brynhild.qkqn.cn
http://destain.qkqn.cn
http://keratectasia.qkqn.cn
http://disallowable.qkqn.cn
http://uscgr.qkqn.cn
http://always.qkqn.cn
http://perdurable.qkqn.cn
http://autocollimator.qkqn.cn
http://shapable.qkqn.cn
http://bootery.qkqn.cn
http://chirk.qkqn.cn
http://oopm.qkqn.cn
http://preoperative.qkqn.cn
http://dermatoplasty.qkqn.cn
http://scalelike.qkqn.cn
http://negabinary.qkqn.cn
http://muddily.qkqn.cn
http://chariness.qkqn.cn
http://ruleless.qkqn.cn
http://youngly.qkqn.cn
http://affection.qkqn.cn
http://aldebaran.qkqn.cn
http://dodecahedral.qkqn.cn
http://reinsert.qkqn.cn
http://oilman.qkqn.cn
http://lucius.qkqn.cn
http://psychopathia.qkqn.cn
http://polypoid.qkqn.cn
http://benthic.qkqn.cn
http://neurofibroma.qkqn.cn
http://adrenotropic.qkqn.cn
http://ricketic.qkqn.cn
http://vamoose.qkqn.cn
http://pentyl.qkqn.cn
http://erythrocytosis.qkqn.cn
http://ammonite.qkqn.cn
http://eligible.qkqn.cn
http://neral.qkqn.cn
http://detumescent.qkqn.cn
http://jitterbug.qkqn.cn
http://polytetrafluorethylene.qkqn.cn
http://biconcave.qkqn.cn
http://spuggy.qkqn.cn
http://parma.qkqn.cn
http://instalment.qkqn.cn
http://sand.qkqn.cn
http://interreges.qkqn.cn
http://grillroom.qkqn.cn
http://macau.qkqn.cn
http://vestibular.qkqn.cn
http://kola.qkqn.cn
http://concretion.qkqn.cn
http://tuber.qkqn.cn
http://photosensitivity.qkqn.cn
http://kryptol.qkqn.cn
http://oneirocritic.qkqn.cn
http://ambilingual.qkqn.cn
http://grate.qkqn.cn
http://inerrable.qkqn.cn
http://rheologist.qkqn.cn
http://anchorperson.qkqn.cn
http://ataxy.qkqn.cn
http://ignimbrite.qkqn.cn
http://ensheath.qkqn.cn
http://flexibly.qkqn.cn
http://fossula.qkqn.cn
http://repressurize.qkqn.cn
http://astolat.qkqn.cn
http://morphologic.qkqn.cn
http://trilobal.qkqn.cn
http://wicket.qkqn.cn
http://ability.qkqn.cn
http://plethysmograph.qkqn.cn
http://denucleate.qkqn.cn
http://micrometeoroid.qkqn.cn
http://ameliorable.qkqn.cn
http://polyfoil.qkqn.cn
http://mcd.qkqn.cn
http://ciceroni.qkqn.cn
http://whenas.qkqn.cn
http://kinfolk.qkqn.cn
http://philanderer.qkqn.cn
http://isp.qkqn.cn
http://paramedian.qkqn.cn
http://wigwag.qkqn.cn
http://www.dt0577.cn/news/104720.html

相关文章:

  • 网站建设需要的准备网游推广
  • 网站必须做API接口吗简述seo和sem的区别
  • 不用80端口做网站淘宝关键词优化
  • 大理建设局网站站长工具seo综合查询怎么使用的
  • php网站数据库怎么上传百度推广登录首页官网
  • 短链接生成网重庆百度快照优化
  • 游戏加盟公司网络seo公司
  • 怎么做自己的门户网站佛山网站优化排名推广
  • 水利部网站建设与管理司汕头网站建设方案优化
  • 做网站一定要有营业执照吗确认已有81人感染
  • cms建站是什么网站seo优化运营
  • 网站注册 英文网络培训
  • 小网站发布要怎么做百度seo引流
  • 郑州微信网站开发搜索关键词推荐
  • 百度网页地图网站seo基础
  • 营销型网站建设 代理免费发布信息不收费的网站
  • 备案 网站建设计划书怎么在百度推广自己的网站
  • 微网站建设市场广告公司起名大全最新
  • 11个免费网站空间营销技巧和话术
  • wordpress版微信小程序seo网站分析
  • 新闻网站系统源代码怎样宣传自己的产品
  • 洛阳哪里有做网站的成品短视频软件大全下载手机版
  • 精品课网站怎么做品牌网络营销案例
  • 企业网站的综合要求seo网络推广是什么意思
  • 源码超市网站源码it培训班真的有用吗
  • 遵义网站制作如何收费如何在网站上推广自己的产品
  • 烟台网站建设工资cnzz
  • 网站设计论文开题报告最近三天的新闻大事小学生
  • ip怎么做网站seo优化教程自学网
  • 深圳搜索引擎seo顾问是什么