1 line
6.9 KiB
JavaScript
1 line
6.9 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{115:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return s})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return d}));var a=n(2),r=n(6),i=(n(0),n(456)),o={title:"FAQ",sidebar_label:"FAQ"},s={id:"faq",title:"FAQ",description:"Why am I having trouble installing Qode?",source:"@site/docs/faq.md",permalink:"/docs/faq",editUrl:"https://github.com/nodegui/nodegui/edit/master/website/docs/faq.md",sidebar_label:"FAQ"},l=[{value:"Why am I having trouble installing Qode?",id:"why-am-i-having-trouble-installing-qode",children:[]},{value:"Javascript widgets are missing methods and properties as compared to QT widget?",id:"javascript-widgets-are-missing-methods-and-properties-as-compared-to-qt-widget",children:[]},{value:"When will Qode upgrade to latest Node.js / Qt version?",id:"when-will-qode-upgrade-to-latest-nodejs--qt-version",children:[]},{value:"My app's window/widgets/tray disappeared after a few minutes.",id:"my-apps-windowwidgetstray-disappeared-after-a-few-minutes",children:[]}],c={rightToc:l};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},c,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)("h2",{id:"why-am-i-having-trouble-installing-qode"},"Why am I having trouble installing Qode?"),Object(i.b)("p",null,"When running ",Object(i.b)("inlineCode",{parentName:"p"},"npm install @nodegui/qode"),", some users occasionally encounter\ninstallation errors."),Object(i.b)("p",null,"In almost all cases, these errors are the result of network problems and not\nactual issues with the ",Object(i.b)("inlineCode",{parentName:"p"},"@nodegui/qode")," npm package. Errors like ",Object(i.b)("inlineCode",{parentName:"p"},"ELIFECYCLE"),",\n",Object(i.b)("inlineCode",{parentName:"p"},"EAI_AGAIN"),", ",Object(i.b)("inlineCode",{parentName:"p"},"ECONNRESET"),", and ",Object(i.b)("inlineCode",{parentName:"p"},"ETIMEDOUT")," are all indications of such\nnetwork problems. The best resolution is to try switching networks, or\nwait a bit and try installing again."),Object(i.b)("p",null,"You can also attempt to download Qode directly from\n",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/nodegui/qode/releases"}),"nodegui/qode/releases"),"\nif installing via ",Object(i.b)("inlineCode",{parentName:"p"},"npm")," is failing."),Object(i.b)("h2",{id:"javascript-widgets-are-missing-methods-and-properties-as-compared-to-qt-widget"},"Javascript widgets are missing methods and properties as compared to QT widget?"),Object(i.b)("p",null,"As you would have noticed, the list of methods and properties are less compared to what is present in the Qt's corresponding widget class. This is because we havent written wrappers for them yet. You can help add more methods by following the development guide for contributors. Overtime this gap would reduce."),Object(i.b)("h2",{id:"when-will-qode-upgrade-to-latest-nodejs--qt-version"},"When will Qode upgrade to latest Node.js / Qt version?"),Object(i.b)("p",null,"When a new version of Node.js/Qt gets released, we usually wait for about a month\nbefore upgrading the one in Qode. So we can avoid getting affected by bugs\nintroduced in new Node.js/Qt versions, which happens very often."),Object(i.b)("h2",{id:"my-apps-windowwidgetstray-disappeared-after-a-few-minutes"},"My app's window/widgets/tray disappeared after a few minutes."),Object(i.b)("p",null,"This happens when the variable which is used to store the window/tray gets\ngarbage collected."),Object(i.b)("p",null,"If you encounter this problem, the following articles may prove helpful:"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("a",Object(a.a)({parentName:"li"},{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management"}),"Memory Management")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("a",Object(a.a)({parentName:"li"},{href:"https://msdn.microsoft.com/library/bzt2dkta(v=vs.94).aspx"}),"Variable Scope"))),Object(i.b)("p",null,"If you want a quick fix, you can make the variables global by changing your\ncode from this:"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-javascript"}),'const { QWidget } = require("@nodegui/nodegui");\n\nconst view = new QWidget();\nview.setObjectName("container");\nview.setLayout(new FlexLayout());\n')),Object(i.b)("p",null,"to this:"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-javascript"}),'const { QWidget } = require("@nodegui/nodegui");\n\nconst view = new QWidget();\nview.setObjectName("container");\nview.setLayout(new FlexLayout());\n\nglobal.view = view; //prevent GC\n')))}d.isMDXComponent=!0},456:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=r.a.createContext({}),d=function(e){var t=r.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=d(e.components);return r.a.createElement(c.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},b=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=d(n),b=a,m=p["".concat(o,".").concat(b)]||p[b]||u[b]||i;return n?r.a.createElement(m,s(s({ref:t},c),{},{components:n})):r.a.createElement(m,s({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=b;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:a,o[1]=s;for(var c=2;c<i;c++)o[c]=n[c];return r.a.createElement.apply(null,o)}return r.a.createElement.apply(null,n)}b.displayName="MDXCreateElement"}}]); |