• 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);
    }

最新文章

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

热门文章

  1. TLD算法
  2. 修复wordpress插件编辑器漏洞
  3. 09.javaweb简单标签编程
  4. Goldengate升级之目标端(replicat端)升级
  5. VS2012编译PCL1.70的过程
  6. iframe里面开启全屏allowfullscreen=&quot;true&quot;
  7. Python基础:编码
  8. MongoDB经典入门(2)--shell命令
  9. Python设计模式--单例模式(懒汉式)
  10. 邓_ Php&#183;面试