31.QT坐标系
- dialog.h
#ifndef DIALOG_H
#define DIALOG_H #include <QDialog>
#include <QLabel>
#include <QGridLayout>
#include <QMouseEvent>
#include <QEvent> namespace Ui {
class Dialog;
} class Dialog : public QDialog
{
Q_OBJECT public:
explicit Dialog(QWidget *parent = );
~Dialog(); private:
Ui::Dialog *ui; 25 void moveEvent(QMoveEvent *event);
26 void resizeEvent(QResizeEvent *event);
27
28 public:
29 void show1();
}; #endif // DIALOG_H - dialog.cpp
#include "dialog.h"
#include "ui_dialog.h"
#include <QDebug> Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
} Dialog::~Dialog()
{
delete ui;
} void Dialog::moveEvent(QMoveEvent *event)
{
qDebug() << ""<<endl;
show1();
} void Dialog::resizeEvent(QResizeEvent *event)
{
qDebug() << ""<<endl;
show1();
} void Dialog::show1()
{
QString infoall;
QString x;
33 x.sprintf("x()=%d",this->x());
infoall = infoall +x + "\r\n"; QString y;
37 y.sprintf("y()=%d",this->y());
infoall = infoall +y + "\r\n"; QString width;
41 width.sprintf("width=%d",this->width());
infoall = infoall +width + "\r\n"; QString height;
45 height.sprintf("height=%d",this->height());
infoall = infoall +height + "\r\n";
ui->textEdit->setText(infoall);
}
31.QT坐标系的更多相关文章
- Qt坐标系以及自定义可移动控件
1.效果 黑色这个控件是自定义的,可以在界面拖动 2.新建控件的Qt类,父类是QWidget,带ui的,Control.h #ifndef CONTROL_H #define CONTROL_H #i ...
- 31.qt quick-使用SwipeView添加滑动视图-高仿微信V2版本
在上章我们学习了ListView,然后实现了: 28.qt quick-ListView高仿微信好友列表和聊天列表,本章我们来学习SwipeView滑动视图,并出高仿微信V2版本: 1.Contain ...
- Qt中常用知识点
1:QRegExp 正则表达式 QRegExp regExp("[a-zA-Z][1-9][0-9]{0,2}"); xxx->setValidator(new QRegEx ...
- Qt Charts_Audio实践
这里完全是照搬帮助文档中的代码生成的程序 上预览图 工程文件代码 #------------------------------------------------- # # Project crea ...
- QT中视图(setViewport)和窗口(setWindow) 小总结
参考博客: https://blog.csdn.net/weixin_39583140/article/details/92798127 https://blog.csdn.net/u01244271 ...
- Qt开发技术:图形视图框架(一)基本介绍
前话 使用到Qt的视图框架. Qt视图框架介绍 简介 图形视图框架(The Graphic View Framework)用于管理和与大量定制的二维图形项目交互,以及用于可视化项目的视图小 ...
- 【秒懂音视频开发】05_Qt开发基础
控件的基本使用 为了更好地学习Qt控件的使用,建议创建项目时先不要生成ui文件. 打开mainwindow.cpp,在MainWindow的构造函数中编写界面的初始化代码. 窗口设置 MainWind ...
- 城市代码表mysql
只有代码: # ************************************************************ # Sequel Pro SQL dump # Version ...
- Qt 学习之路 2(31):贪吃蛇游戏(1)
Qt 学习之路 2(31):贪吃蛇游戏(1) 豆子 2012年12月18日 Qt 学习之路 2 41条评论 经过前面一段时间的学习,我们已经了解到有关 Qt 相当多的知识.现在,我们将把前面所讲过的知 ...
随机推荐
- webpack打包大概流程
webpack 步骤 1. 新建一个webpack.config.prod.js 2. 压缩bundle.js和index.html //设置为生产环境 new webpack.DefinePlugi ...
- echarts 圆形图、柱状图
首先引入echarts的js包 <script type="text/javascript" src="js/esl.js"></script ...
- Kinect+OpenNI+OpenCV使用
关于OpenNI,已经可以使用2.0,可以不再使用PrimeSense: 这里的是转载其他人的 OpenCV系列: 原文:http://blog.csdn.net/chenxin_130/articl ...
- RabbitMQ学习之spring-amqp的重要类的认识
对于大多数应用来说都做了与spring整合,对于rabbitmq来说.也有与spring的整合.可能通过spring的官网找到spring-amqp项目下载.spring-amqp项目包括三个子项目: ...
- 如何避免命令 rm -rf 的悲剧
一.root高管用户为例,其他用户类同. https://www.cnblogs.com/eos666/articles/10389179.html [root@jenkins /]# vim /ro ...
- 如何在php中优雅的地调用python程序
1.准备工作 安装有python和php环境的电脑一台. 2.书写程序. php程序如下 我们也可以将exec('python test.py') 换成 system('python test.p ...
- 如何添加删除子网卡eth0:1(linux案例)
这种方法实现了单网卡多IP,我的系统是centos7的,如何添加删除子网卡IP详细请看下面操作例子 添加子网卡IP:ifconfig ens3:1 192.168.0.100/24 ...
- ubuntu的LAMP环境搭建
服务器的搭建,经典组合:LAMP(Linux+Apache+Mysql+PHP) unbuntu源更新:sudo apt update 更新:sudo apt upgrade 安装Apache:sud ...
- 1.1 Eclipse的安装
下载地址:http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/indigosr1 2.java jdk 的 ...
- 跳出$.each()循环
return false:将停止循环 ,跳出eachreturn true:跳至下一个循环(就像在普通的循环中使用'continue').