(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{469:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var a=n(0),i=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=i.a.createContext({}),c=function(e){var t=i.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=c(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},u=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,r=e.parentName,s=d(e,["components","mdxType","originalType","parentName"]),p=c(n),u=a,m=p["".concat(r,".").concat(u)]||p[u]||b[u]||o;return n?i.a.createElement(m,l(l({ref:t},s),{},{components:n})):i.a.createElement(m,l({ref:t},s))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,r=new Array(o);r[0]=u;var l={};for(var d in t)hasOwnProperty.call(t,d)&&(l[d]=t[d]);l.originalType=e,l.mdxType="string"==typeof e?e:a,r[1]=l;for(var s=2;s // example : ../../core/YogaWidget/yogawidget.h\n")),Object(o.b)("p",null,"So for nlabel I would run it as:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{}),"moc nlabel.h -o nlabel_moc.cpp --include ../../core/YogaWidget/yogawidget.h\n")),Object(o.b)("p",null,"This will run moc on ",Object(o.b)("inlineCode",{parentName:"p"},"headername.h")," and generate ",Object(o.b)("inlineCode",{parentName:"p"},"headername_moc.cpp"),". We will include ",Object(o.b)("inlineCode",{parentName:"p"},"headername_moc.cpp")," in ",Object(o.b)("inlineCode",{parentName:"p"},"config/moc.gypi"),". If you dont do this. Then it will give a symbol not found error."),Object(o.b)("p",null,"I hope QLabel's example is enough for now. For more examples and inspirations we can take a look at other wrapped widgets."),Object(o.b)("h2",{id:"learning-materials"},"Learning Materials"),Object(o.b)("ol",null,Object(o.b)("li",{parentName:"ol"},"Beginners guide to NodeJS Addon - ",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://medium.com/@atulanand94/beginners-guide-to-writing-nodejs-addons-using-c-and-n-api-node-addon-api-9b3b718a9a7f"}),"https://medium.com/@atulanand94/beginners-guide-to-writing-nodejs-addons-using-c-and-n-api-node-addon-api-9b3b718a9a7f")),Object(o.b)("li",{parentName:"ol"},"First read this: N-API in nodejs docs"),Object(o.b)("li",{parentName:"ol"},Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://www.youtube.com/watch?v=-Oniup60Afs&feature=youtu.be"}),"https://www.youtube.com/watch?v=-Oniup60Afs&feature=youtu.be")),Object(o.b)("li",{parentName:"ol"},"See samples at ",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://github.com/nodejs/abi-stable-node-addon-examples/"}),"https://github.com/nodejs/abi-stable-node-addon-examples/"),"\n4.1. You can see the readme of ",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://github.com/nodejs/node-addon-api.git/"}),"https://github.com/nodejs/node-addon-api.git/")),Object(o.b)("li",{parentName:"ol"},"See node-qt implementation. It is implemented in Nan (explained in video)."),Object(o.b)("li",{parentName:"ol"},"Now try to match the implementation in node-qt and convert to N-API using examples from samples."),Object(o.b)("li",{parentName:"ol"},"Implementations not in node-qt need to be done with effort.")))}c.isMDXComponent=!0}}]);