nodeguy/8605af0b.18749fc5.js
2023-03-07 20:59:20 +00:00

1 line
17 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[219],{279:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return i})),n.d(t,"rightToc",(function(){return o})),n.d(t,"default",(function(){return l}));var a=n(2),r=n(6),b=(n(0),n(470)),c={id:"qpointf",title:"QPointF",sidebar_label:"QPointF"},i={unversionedId:"api/generated/classes/qpointf",id:"api/generated/classes/qpointf",isDocsHomePage:!1,title:"QPointF",description:"The QPointF class defines a point in the plane using floating point precision",source:"@site/docs/api/generated/classes/qpointf.md",slug:"/api/generated/classes/qpointf",permalink:"/docs/api/generated/classes/qpointf",editUrl:"https://github.com/nodegui/nodegui/edit/master/website/docs/api/generated/classes/qpointf.md",version:"current",sidebar_label:"QPointF",sidebar:"api",previous:{title:"QPoint",permalink:"/docs/api/generated/classes/qpoint"},next:{title:"QProgressBar",permalink:"/docs/api/generated/classes/qprogressbar"}},o=[{value:"Hierarchy",id:"hierarchy",children:[]},{value:"Index",id:"index",children:[{value:"Constructors",id:"constructors",children:[]},{value:"Properties",id:"properties",children:[]},{value:"Methods",id:"methods",children:[]}]},{value:"Constructors",id:"constructors-1",children:[{value:"constructor",id:"constructor",children:[]}]},{value:"Properties",id:"properties-1",children:[{value:"native",id:"native",children:[]}]},{value:"Methods",id:"methods-1",children:[{value:"isNull",id:"isnull",children:[]},{value:"manhattanLength",id:"manhattanlength",children:[]},{value:"setX",id:"setx",children:[]},{value:"setY",id:"sety",children:[]},{value:"toPoint",id:"topoint",children:[]},{value:"transposed",id:"transposed",children:[]},{value:"x",id:"x",children:[]},{value:"y",id:"y",children:[]},{value:"<code>Static</code> dotProduct",id:"static-dotproduct",children:[]}]}],p={rightToc:o};function l(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(b.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(b.b)("p",null,"The QPointF class defines a point in the plane using floating point precision"),Object(b.b)("p",null,"A point is specified by a x coordinate and an y coordinate which can be accessed using the x() and y() functions. The coordinates of the point are specified using floating point numbers for accuracy. The isNull() function returns true if both x and y are set to 0.0. The coordinates can be set (or altered) using the setX() and setY() functions"),Object(b.b)("p",null,"In addition, the QPointF class provides a constructor converting a QPoint object into a QPointF object, and a corresponding toPoint() function which returns a QPoint copy of this point."),Object(b.b)("h2",{id:"hierarchy"},"Hierarchy"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("p",{parentName:"li"},Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/api/generated/classes/component"}),"Component")),Object(b.b)("p",{parentName:"li"},"\u21b3 ",Object(b.b)("strong",{parentName:"p"},"QPointF")))),Object(b.b)("h2",{id:"index"},"Index"),Object(b.b)("h3",{id:"constructors"},"Constructors"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#constructor"}),"constructor"))),Object(b.b)("h3",{id:"properties"},"Properties"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#native"}),"native"))),Object(b.b)("h3",{id:"methods"},"Methods"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#isnull"}),"isNull")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#manhattanlength"}),"manhattanLength")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#setx"}),"setX")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#sety"}),"setY")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#topoint"}),"toPoint")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#transposed"}),"transposed")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#x"}),"x")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#y"}),"y")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qpointf#static-dotproduct"}),"dotProduct"))),Object(b.b)("h2",{id:"constructors-1"},"Constructors"),Object(b.b)("h3",{id:"constructor"},"constructor"),Object(b.b)("p",null,"+"," ",Object(b.b)("strong",{parentName:"p"},"new QPointF"),"(",Object(b.b)("inlineCode",{parentName:"p"},"nativeOrXOrQPoint?"),": ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/api/generated/globals#nativeelement"}),"NativeElement")," | number | ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/api/generated/classes/qpoint"}),"QPoint"),", ",Object(b.b)("inlineCode",{parentName:"p"},"y"),": number): ",Object(b.b)("em",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/qpointf"}),"QPointF"))),Object(b.b)("p",null,Object(b.b)("em",{parentName:"p"},"Overrides ",Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/component"}),"Component"),".",Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/component#constructor"}),"constructor"))),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Parameters:")),Object(b.b)("table",null,Object(b.b)("thead",{parentName:"table"},Object(b.b)("tr",{parentName:"thead"},Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Name"),Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Type"),Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Default"))),Object(b.b)("tbody",{parentName:"table"},Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("inlineCode",{parentName:"td"},"nativeOrXOrQPoint?")),Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("a",Object(a.a)({parentName:"td"},{href:"/docs/api/generated/globals#nativeelement"}),"NativeElement")," ","|"," number ","|"," ",Object(b.b)("a",Object(a.a)({parentName:"td"},{href:"/docs/api/generated/classes/qpoint"}),"QPoint")),Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"-")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("inlineCode",{parentName:"td"},"y")),Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"number"),Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"0")))),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/qpointf"}),"QPointF"))),Object(b.b)("h2",{id:"properties-1"},"Properties"),Object(b.b)("h3",{id:"native"},"native"),Object(b.b)("p",null,"\u2022 ",Object(b.b)("strong",{parentName:"p"},"native"),": ",Object(b.b)("em",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/globals#nativeelement"}),"NativeElement")," | null")),Object(b.b)("p",null,Object(b.b)("em",{parentName:"p"},"Inherited from ",Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/component"}),"Component"),".",Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/component#native"}),"native"))),Object(b.b)("h2",{id:"methods-1"},"Methods"),Object(b.b)("h3",{id:"isnull"},"isNull"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"isNull"),"(): ",Object(b.b)("em",{parentName:"p"},"boolean")),Object(b.b)("p",null,"Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns false."),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},"boolean")),Object(b.b)("hr",null),Object(b.b)("h3",{id:"manhattanlength"},"manhattanLength"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"manhattanLength"),"(): ",Object(b.b)("em",{parentName:"p"},"number")),Object(b.b)("p",null,'Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point.'),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},"number")),Object(b.b)("hr",null),Object(b.b)("h3",{id:"setx"},"setX"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"setX"),"(",Object(b.b)("inlineCode",{parentName:"p"},"value"),": number): ",Object(b.b)("em",{parentName:"p"},"void")),Object(b.b)("p",null,"Sets the x coordinate of this point to the given x coordinate."),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Parameters:")),Object(b.b)("table",null,Object(b.b)("thead",{parentName:"table"},Object(b.b)("tr",{parentName:"thead"},Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Name"),Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Type"))),Object(b.b)("tbody",{parentName:"table"},Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("inlineCode",{parentName:"td"},"value")),Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"number")))),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},"void")),Object(b.b)("hr",null),Object(b.b)("h3",{id:"sety"},"setY"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"setY"),"(",Object(b.b)("inlineCode",{parentName:"p"},"value"),": number): ",Object(b.b)("em",{parentName:"p"},"void")),Object(b.b)("p",null,"Sets the y coordinate of this point to the given y coordinate."),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Parameters:")),Object(b.b)("table",null,Object(b.b)("thead",{parentName:"table"},Object(b.b)("tr",{parentName:"thead"},Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Name"),Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Type"))),Object(b.b)("tbody",{parentName:"table"},Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("inlineCode",{parentName:"td"},"value")),Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"number")))),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},"void")),Object(b.b)("hr",null),Object(b.b)("h3",{id:"topoint"},"toPoint"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"toPoint"),"(): ",Object(b.b)("em",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/qpoint"}),"QPoint"))),Object(b.b)("p",null,"Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rounded coordinates."),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/qpoint"}),"QPoint"))),Object(b.b)("hr",null),Object(b.b)("h3",{id:"transposed"},"transposed"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"transposed"),"(): ",Object(b.b)("em",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/qpointf"}),"QPointF"))),Object(b.b)("p",null,"Returns a point with x and y coordinates exchanged"),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/qpointf"}),"QPointF"))),Object(b.b)("hr",null),Object(b.b)("h3",{id:"x"},"x"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"x"),"(): ",Object(b.b)("em",{parentName:"p"},"number")),Object(b.b)("p",null,"Returns the x coordinate of this point"),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},"number")),Object(b.b)("hr",null),Object(b.b)("h3",{id:"y"},"y"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"y"),"(): ",Object(b.b)("em",{parentName:"p"},"number")),Object(b.b)("p",null,"Returns the y coordinate of this point"),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},"number")),Object(b.b)("hr",null),Object(b.b)("h3",{id:"static-dotproduct"},Object(b.b)("inlineCode",{parentName:"h3"},"Static")," dotProduct"),Object(b.b)("p",null,"\u25b8 ",Object(b.b)("strong",{parentName:"p"},"dotProduct"),"(",Object(b.b)("inlineCode",{parentName:"p"},"p1"),": ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/api/generated/classes/qpointf"}),"QPointF"),", ",Object(b.b)("inlineCode",{parentName:"p"},"p2"),": ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/api/generated/classes/qpointf"}),"QPointF"),"): ",Object(b.b)("em",{parentName:"p"},"number")),Object(b.b)("p",null,"Returns the dot product of p1 and p2"),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Parameters:")),Object(b.b)("table",null,Object(b.b)("thead",{parentName:"table"},Object(b.b)("tr",{parentName:"thead"},Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Name"),Object(b.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Type"))),Object(b.b)("tbody",{parentName:"table"},Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("inlineCode",{parentName:"td"},"p1")),Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("a",Object(a.a)({parentName:"td"},{href:"/docs/api/generated/classes/qpointf"}),"QPointF"))),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("inlineCode",{parentName:"td"},"p2")),Object(b.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(b.b)("a",Object(a.a)({parentName:"td"},{href:"/docs/api/generated/classes/qpointf"}),"QPointF"))))),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"Returns:")," ",Object(b.b)("em",{parentName:"p"},"number")))}l.isMDXComponent=!0},470:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return j}));var a=n(0),r=n.n(a);function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(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 i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},b=Object.keys(e);for(a=0;a<b.length;a++)n=b[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(a=0;a<b.length;a++)n=b[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=r.a.createContext({}),l=function(e){var t=r.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=l(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},O={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,b=e.originalType,c=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),s=l(n),d=a,j=s["".concat(c,".").concat(d)]||s[d]||O[d]||b;return n?r.a.createElement(j,i(i({ref:t},p),{},{components:n})):r.a.createElement(j,i({ref:t},p))}));function j(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var b=n.length,c=new Array(b);c[0]=d;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i.mdxType="string"==typeof e?e:a,c[1]=i;for(var p=2;p<b;p++)c[p]=n[p];return r.a.createElement.apply(null,c)}return r.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]);