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---->

    
    

      

  • 相关阅读:
    NOI-1.1-04输出保留3位小数的浮点数
    百练7619-合影效果-2015正式D题-简单排序&输出格式
    百练6376-二维数组右上左下遍历-2015正式C题
    C++ 开发环境配置
    go语言 http学习
    Git 命令及分支管理学习
    配置go语言编辑环境
    DNS的过程
    Split Array into Consecutive Subsequences
    组委会正在为美团点评CodeM大赛的决赛设计新赛制
  • 原文地址:https://www.cnblogs.com/daiker/p/Qt3D.html
Copyright © 2011-2022 走看看