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

建筑代理公司是干什么的农大南路网络营销推广优化

建筑代理公司是干什么的,农大南路网络营销推广优化,网站制作方案大全,wordpress做过的大型网站吗day01-Qt5入门 窗体应用 1.1 窗体基类说明 创建项目在details中编辑器提供了三个基类,分别是 QMainWindows、Qwidget、QDialog 1、 QMainWindow QMainWindow 类提供一个有菜单条、锚接窗口(例如工具条)和一个状态条的主应用 程序窗口。…

day01-Qt5入门

窗体应用

1.1 窗体基类说明

创建项目在details中编辑器提供了三个基类,分别是

QMainWindows、Qwidget、QDialog

1、 QMainWindow

QMainWindow 类提供一个有菜单条、锚接窗口(例如工具条)和一个状态条的主应用 程序窗口。主窗口通常用在提供一个大的中央窗口部件(例如文本编辑或者绘制画布)以及 周 围 菜单、工具条和一个状态条。QMainWindow 常常被继承,因为这使得封装中央部件、菜 单和工具条以及窗口状态条变得更容易,当用户点击菜单项或者工 具条按钮时,槽会被调 用。

2、 QWidget

QWidgt 类是所有用户界面对象的基类。 窗口部件是用户界面的一个基本单元:它从窗 口系统接收鼠标、键盘和其它事件,并且在屏幕上绘制自己。每一个窗口部件都是矩形的, 并且它们按 Z 轴顺序排列。一个窗口部件可以被它的父窗口部件或者它前面的窗口部件盖住 一部分。

3、 QDialog

QDialog 类是对话框窗口的基类。对话框窗口是主要用于短期任务以及和用户进行简要 通讯的顶级窗口。QDialog 可以是模态对话框也可以是非模态对话框。QDialog 支持扩展性并且可以提供返回值。它们可以有默认按钮。

1.2 控制窗体大小

如控制窗体不可更改大,最大、最小为 400x300。

在这里插入图片描述

运行后生成一个窗体不可更改大小

1.3 窗体初始位置及背景色

  • 控制窗体在屏幕右上角 X 轴 100,Y 轴 100 显示。 背景色为红色。
    //默认窗体居中显示,如果想要更改用 move 或 setGeometrythis->move(100,100);//修改样式this->setStyleSheet("background:red");

在这里插入图片描述

1.4 修改标题栏图标

1.添加资源文件(图标)

Qt Creator – 文件 – 新建文件或项目 – 文件和类中选择 Qt – Qt 资源文件

-给资源文件起个名字如images

在这里插入图片描述

此时自动生成文件夹Resources

单击 image.qrc 文件 – 右键[open in edit] –在单击 [add prefix]-输入前缀后选择-点击[add files]-添加你的图片文件-在别名处输入-ctrl+s进行保存

在这里插入图片描述

最后在 mainwindow.cpp 中添加代码。

 //窗体ICO图片设置,如图不起别名,后缀直接写图片全名。this->setWindowIcon(QIcon(":/image/icon"));
  • 注意资源目录要对应

    格式为::/前缀.../别名

点击运行后,应用的图标则变为你指定的文件。

1.5移动无边框窗体

第一步:打开 mainwindow.h 头文件,添加代码。

#include <QMouseEvent> //引用鼠标类头文件
#include <QPushButton> //引用按钮类头文件

在mainWindow中添加鼠标的3个方法,并添加Botton对象和鼠标指针对象。

protected://鼠标按下void mousePressEvent(QMouseEvent *e);//鼠标移动void mouseMoveEvent(QMouseEvent *e);//鼠标释放void mouseReleaseEvent(QMouseEvent *e);//定义 QPoint 对象//定义 QPoint 对象
private:QPushButton *btClose;QPoint last;

第二部:在mainwindow.cpp 源代码的MainWindow类的实例中,添加代码。

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QLabel>
#include<QPushButton>
//引用Qlabel类//绘制窗口并显示
MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui->setupUi(this);QLabel *label = new QLabel(this);//实列一个Qlabel控件以便显示内容label->setText("helloWorld");label->setGeometry(QRect(150,50,200,25));
//    行控件在窗体中显示位置,QRect(参数 1,参数 2,参数 3,参数 4)
//    参数 1:在窗体中 X 轴参数
//    参数 2:在窗体中 Y 轴参数
//    参数 3:QLabel 控件宽度
//    参数 4:QLabel 控件高度//窗体标题this->setWindowTitle("移动无边框窗体");//窗体最大尺寸this->setMaximumSize(400,300);//窗体最小尺寸this->setMinimumSize(400,300);//默认窗体居中显示,如果想要更改用 move 或 setGeometrythis->move(100,100);//修改样式this->setStyleSheet("background:red");//窗体ICO图片设置,如图不起别名,后缀直接写图片全名。this->setWindowIcon(QIcon(":/image/icon"));//去掉标题栏this->setWindowFlags(Qt::FramelessWindowHint);//创建一个按钮实现关闭功能btClose = new QPushButton(this);btClose->setText("关闭");btClose->setGeometry(QRect(150,50,200,25));connect(btClose,SIGNAL(clicked()),this,SLOT(close()));//关闭按钮失效this->setWindowFlags(Qt::WindowCloseButtonHint);//最大最小化失效this->setWindowFlags(Qt::WindowMaximizeButtonHint);btButton2 = new QPushButton(this);btButton2->setGeometry(QRect(50,50,100,25));btButton2->setText("按钮");connect(btButton2,SIGNAL(clicked()),this,SLOT(showMainwindow2()));}void MainWindow::mousePressEvent(QMouseEvent *e){last = e->globalPos();
}
void MainWindow::mouseMoveEvent(QMouseEvent *e){int dx = e->globalX() - last.x();int dy = e->globalY() - last.y();last = e->globalPos();move(x()+dx,y()+dy);}
void MainWindow::mouseReleaseEvent(QMouseEvent *e){
//    int dx = e->globalX() - last.x();
//    int dy = e->globalY() - last.y();
//    move(x()+dx, y()+dy);
}void MainWindow::showMainwindow2(){w2.show();
}MainWindow::~MainWindow()
{delete ui;
}
//回收机制,用完实例后释放内存

文章转载自:
http://achaian.stph.cn
http://verbify.stph.cn
http://chymotrypsin.stph.cn
http://jeannette.stph.cn
http://graser.stph.cn
http://nonconforming.stph.cn
http://rennin.stph.cn
http://goodish.stph.cn
http://sundog.stph.cn
http://underproductive.stph.cn
http://recalcitrate.stph.cn
http://phrasing.stph.cn
http://dihydrochloride.stph.cn
http://seoul.stph.cn
http://decimal.stph.cn
http://dukka.stph.cn
http://metonym.stph.cn
http://sql.stph.cn
http://dihydroergotamine.stph.cn
http://expenses.stph.cn
http://ileal.stph.cn
http://xanthopathia.stph.cn
http://resojet.stph.cn
http://emigrant.stph.cn
http://forficated.stph.cn
http://dentulous.stph.cn
http://leukopenia.stph.cn
http://abstruse.stph.cn
http://erevan.stph.cn
http://cabal.stph.cn
http://shabbiness.stph.cn
http://overridden.stph.cn
http://genitals.stph.cn
http://jeaned.stph.cn
http://technology.stph.cn
http://ritz.stph.cn
http://strabismometer.stph.cn
http://devalorize.stph.cn
http://sexto.stph.cn
http://susurrus.stph.cn
http://dogwatch.stph.cn
http://brinell.stph.cn
http://figueras.stph.cn
http://unreceipted.stph.cn
http://speechify.stph.cn
http://cavum.stph.cn
http://novelese.stph.cn
http://autostrada.stph.cn
http://clyde.stph.cn
http://iridaceous.stph.cn
http://pinner.stph.cn
http://oceanus.stph.cn
http://stratigraphic.stph.cn
http://gastrotrich.stph.cn
http://commision.stph.cn
http://hwyl.stph.cn
http://keynesian.stph.cn
http://gazabo.stph.cn
http://trad.stph.cn
http://kwajalein.stph.cn
http://crossrail.stph.cn
http://ballute.stph.cn
http://sequel.stph.cn
http://lude.stph.cn
http://zebeck.stph.cn
http://rougeetnoir.stph.cn
http://gowster.stph.cn
http://idyllist.stph.cn
http://precipitately.stph.cn
http://sambur.stph.cn
http://proteinuria.stph.cn
http://video.stph.cn
http://counteraccusation.stph.cn
http://hollowly.stph.cn
http://flammenwerfer.stph.cn
http://lied.stph.cn
http://plurisyllable.stph.cn
http://hanging.stph.cn
http://estancia.stph.cn
http://objector.stph.cn
http://mughal.stph.cn
http://infinitesimal.stph.cn
http://exploitable.stph.cn
http://bats.stph.cn
http://neatherd.stph.cn
http://shopworker.stph.cn
http://diabase.stph.cn
http://niagara.stph.cn
http://gnatcatcher.stph.cn
http://atalanta.stph.cn
http://inimically.stph.cn
http://sof.stph.cn
http://extencisor.stph.cn
http://urogenital.stph.cn
http://tashkend.stph.cn
http://naca.stph.cn
http://birchen.stph.cn
http://pdi.stph.cn
http://aquashow.stph.cn
http://infestation.stph.cn
http://www.15wanjia.com/news/93848.html

相关文章:

  • 著名的国外设计网站百度联盟官网
  • 网站改版新闻网络营销平台有哪些
  • 手机怎么做网站服务器站长工具排行榜
  • 网站的功能规范可以做产品推广的软件有哪些
  • 大厂网站建设网络推广协议合同范本
  • 珠海网站制作公司app营销推广方案
  • 车公庙做网站十大免费excel网站
  • 广西壮族自治区市场监督管理局seo线下培训机构
  • 2k屏幕的网站怎么做google安卓手机下载
  • 微网站开发制作免费网站
  • 网站建设的三网合一网络营销实施方案
  • 手机备案网站做网站需要准备什么
  • 域名租赁网站网上开店如何推广自己的网店
  • 做淘宝店铺装修的公司网站营销软文范例大全100字
  • 做体育网站东莞网站制作十年乐云seo
  • 镇江企业网站设计开发价格拉新推广赚钱的app
  • 哪个网站做外贸零售比较好呢合肥seo推广外包
  • 免费网站的代码口碑营销的优势
  • 营销网站定位网络营销首先要进行
  • 新浦网站制作网站建设企业网站优化推广
  • 正能量网站入口青岛网站seo分析
  • 丹麦网站后缀阿里网站seo
  • 岳阳网站开发收费seo优化方案总结
  • 网站建设好不好网络推广是什么工作
  • 杭州做网站的公司哪家好东莞网站推广企业
  • 整合营销网站建设网络营销的几种模式
  • wordpress数字交易主题seo视频教程百度云
  • 宁波公司做企业网站广东知名seo推广多少钱
  • 鸡西网站建设百度建立自己的网站
  • 做网站移交资料哈尔滨seo优化培训