zoukankan      html  css  js  c++  java
  • Qt 3D示例——cube

    Qt 3D官方示例

      cube的3D演示,一个纯C++的项目。虽然QML示例比较炫,但是要深入理解还是得从C++例子入手。

      从MainWidget.show入口。一步步可以跟踪到initializeGL,paintGL,resizeGL,对了解OpenGL运行流程有帮助。

      MainWidget.show---->Qwidget::show-----> setVisible(true);---> show_helper

      从show_helper中会引出一条主线

      sendPendingMoveAndResizeEvents主动触发QWidget::event事件(其中涉及到的通信机制太复杂),
        事件类型为QOpenGLWidget的resizeEvent。(d->initialize();)
        resizeEvent最终会调用到 MainWidget::initializeGL()
        resizeEvent最终会调用到 MainWidget::resizeGL()
        resizeEvent最终会调用到 MainWidget::initializeGL()

                                  ---> showChildren(false);

                                  ---->sendEvent(q, &showEvent);

                                  ---->show_sys---> setVisible(true);(显示窗口)

                                  

                                ----->sendSyntheticEnterLeave(this)

                  

    resizeEvent --> resizeGL --> 
    initTextures中会读取png图片放在Image(750x500)中用于贴图。

        setVisible函数内部会把所有初始化搞定,继续跟进工作量太大。

        QWidget::create---->

    
    

      

  • 相关阅读:
    C#随机数字生成的一种方法
    SqlServer2012自增主键跳跃增长的问题解决方案
    Mysql5.7初始化成空密码或随机密码的方式
    StyleCop的常见错误
    数据库同步相关的SQL语句
    Linux Shell角本中的条件判断
    Linux(CentOS)中使用Mono+jexus部署Asp.net4.5网站
    Mina.Net实现的UDP多路广播
    Linux CentOS 6.6安装JDK1.7
    linux 常用命令
  • 原文地址:https://www.cnblogs.com/daiker/p/Qt3D.html
Copyright © 2011-2022 走看看