Giter Club home page Giter Club logo

Comments (1)

peterq avatar peterq commented on September 18, 2024 4

@zaoqi 为了解释moc, 你需要先了解:
qt 是由c++ 编写的. qml 是qt5的一个功能, 可以用js语法来写界面, 本项目就是用qml来写的界面. 为了让js执行环境可以和c++环境交互, 可以利用原生组件, 即c++编写的组件. 原生组件和qml组件可以互相调用, 所以可以实现2种语言执行环境的互相通信. 但是本项目是golang 编写的, 为了避免出现c++代码, 原生组件采用go来编写. 但是go 写的组件qt是不能识别的. 那怎么办? 用c++写一个组件的壳子, 声明所有需要的方法和属性, 但不负责实现, qt对这个壳子的所有调用都会转调go的实现. 而go正好是支持和c混编并互相调用的.

通过扫描你代码里的结构体, 找出go实现的原生组件, 然后自动生成这个壳子, 也就是一个c++的类. 这个过程就叫moc, 生成的壳子叫 moc code

Am I explaining it clearly?

from pan-light.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.