31.QT坐标系
2024-08-28 08:18:32
- 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);
}
最新文章
- 关于.NET参数传递方式的思考
- angularjs指令(二)
- 在.net中序列化读写xml方法的总结
- JDBC 学习笔记(二)—— 大数据+存储过程+批处理+事务管理
- Javascript之基本包装类型
- js plugin
- Android颜色转换工具类ColorUtil
- 【转】成为Linux内核高手的四个方法
- ubuntu系统普通用户sudo命令执行报错解决方案
- C#实现中国身份证验证问题
- [开源] yvm - 自制Java虚拟机
- Bootstrap 简介: 创建响应式、移动项目的工具
- 爬虫----scrapy账号登录豆瓣,并且重定向到电影界面,获取界面信息
- python中的 uuid 模块使用示例
- Hankson 的趣味题
- java学习之路--String类的基本方法
- java中的编码和编码格式问题
- Kafka send问题
- <;mvc:annotation-driven/>;的作用
- 【LOJ】#2064. 「HAOI2016」找相同字符