1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{470: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"},69: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(470)),o={title:"FAQ",sidebar_label:"FAQ"},s={unversionedId:"faq",id:"faq",isDocsHomePage:!1,title:"FAQ",description:'Why does installation fail at "Minimal Qt setup"?',source:"@site/docs/faq.md",slug:"/faq",permalink:"/docs/faq",editUrl:"https://github.com/nodegui/nodegui/edit/master/website/docs/faq.md",version:"current",sidebar_label:"FAQ"},l=[{value:"Why does installation fail at "Minimal Qt setup"?",id:"why-does-installation-fail-at-minimal-qt-setup",children:[]},{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-does-installation-fail-at-minimal-qt-setup"},'Why does installation fail at "Minimal Qt setup"?'),Object(i.b)("p",null,"NodeGui currently relies on the ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://qt.io"}),"Qt framework")," to acheive cross-platform native interfaces. The library uses a minimal configuration of specific open source Qt components which are downloaded upon installation."),Object(i.b)("p",null,"If the server which hosts the component binaries is down or unavailable, the installation will fail and you might see something along the lines of:"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sh"}),"Minimal Qt 5.14.1 setup:\nFetchError: request to https://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_5141/qt.qt5.5141.clang_64/5.14.1-0-202001241000qttools-MacOS-MacOS_10_13-Clang-MacOS-MacOS_10_13-X86_64.7z failed, reason: connect ETIMEDOUT 77.86.229.90:443\n at ClientRequest.<anonymous> (.../nodegui/node_modules/node-fetch/lib/index.js:1461:11)\n at ClientRequest.emit (events.js:315:20)\n at TLSSocket.socketErrorListener (_http_client.js:426:9)\n at TLSSocket.emit (events.js:315:20)\n at emitErrorNT (internal/streams/destroy.js:92:8)\n at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)\n at processTicksAndRejections (internal/process/task_queues.js:84:21) {\n type: 'system',\n errno: 'ETIMEDOUT',\n code: 'ETIMEDOUT'\n}\n")),Object(i.b)("p",null,"In this scenario, you would need to find a mirror (alternate domain) for the binaries which can then be substituted using the ",Object(i.b)("inlineCode",{parentName:"p"},"QT_LINK_MIRROR")," environment variable. Let's assume we've found an active mirror, for example, ",Object(i.b)("inlineCode",{parentName:"p"},"https://qt-mirror.dannhauer.de"),", we can then follow these steps to configure the installation:"),Object(i.b)("h4",{id:"unix--macos"},Object(i.b)("strong",{parentName:"h4"},"Unix / MacOS")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sh"}),"QT_LINK_MIRROR=https://qt-mirror.dannhauer.de\n\nnpm install\n")),Object(i.b)("h4",{id:"windows"},Object(i.b)("strong",{parentName:"h4"},"Windows")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cmd"}),"set QT_LINK_MIRROR=https://qt-mirror.dannhauer.de\n\nnpm install\n")),Object(i.b)("p",null,"Now, instead of requesting the resource from"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"https://download.qt.io/online/...")),Object(i.b)("p",null,"as in the example above, the script responsible for installing these components would use "),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"https://qt-mirror.dannhauer.de/online/...")),Object(i.b)("p",null,"If this does not solve your problem, please make sure you have installed all the necessary ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/guides/getting-started#developer-environment"}),"requirements")),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}}]); |