nodeguy/f1e3a1cd.7170cf2b.js
2021-02-09 17:09:28 +00:00

1 line
14 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[348],{406:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return c})),n.d(t,"rightToc",(function(){return i})),n.d(t,"default",(function(){return s}));var a=n(2),r=n(6),l=(n(0),n(436)),b={id:"qwheelevent",title:"QWheelEvent",sidebar_label:"QWheelEvent"},c={unversionedId:"api/generated/classes/qwheelevent",id:"api/generated/classes/qwheelevent",isDocsHomePage:!1,title:"QWheelEvent",description:"Hierarchy",source:"@site/docs/api/generated/classes/qwheelevent.md",slug:"/api/generated/classes/qwheelevent",permalink:"/docs/api/generated/classes/qwheelevent",editUrl:"https://github.com/nodegui/nodegui/edit/master/website/docs/api/generated/classes/qwheelevent.md",version:"current",sidebar_label:"QWheelEvent",sidebar:"api",previous:{title:"QVariant",permalink:"/docs/api/generated/classes/qvariant"},next:{title:"QWidget",permalink:"/docs/api/generated/classes/qwidget"}},i=[{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:"angleDelta",id:"angledelta",children:[]},{value:"buttons",id:"buttons",children:[]},{value:"globalPosition",id:"globalposition",children:[]},{value:"inverted",id:"inverted",children:[]},{value:"phase",id:"phase",children:[]},{value:"pixelDelta",id:"pixeldelta",children:[]},{value:"position",id:"position",children:[]}]}],o={rightToc:i};function s(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(l.b)("wrapper",Object(a.a)({},o,n,{components:t,mdxType:"MDXLayout"}),Object(l.b)("h2",{id:"hierarchy"},"Hierarchy"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"QWheelEvent"))),Object(l.b)("h2",{id:"index"},"Index"),Object(l.b)("h3",{id:"constructors"},"Constructors"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#constructor"}),"constructor"))),Object(l.b)("h3",{id:"properties"},"Properties"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#native"}),"native"))),Object(l.b)("h3",{id:"methods"},"Methods"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#angledelta"}),"angleDelta")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#buttons"}),"buttons")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#globalposition"}),"globalPosition")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#inverted"}),"inverted")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#phase"}),"phase")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#pixeldelta"}),"pixelDelta")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("a",Object(a.a)({parentName:"li"},{href:"/docs/api/generated/classes/qwheelevent#position"}),"position"))),Object(l.b)("h2",{id:"constructors-1"},"Constructors"),Object(l.b)("h3",{id:"constructor"},"constructor"),Object(l.b)("p",null,"+"," ",Object(l.b)("strong",{parentName:"p"},"new QWheelEvent"),"(",Object(l.b)("inlineCode",{parentName:"p"},"event"),": ",Object(l.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/api/generated/globals#nativerawpointer"}),"NativeRawPointer"),'\u2039"QEvent"\u203a): ',Object(l.b)("em",{parentName:"p"},Object(l.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/qwheelevent"}),"QWheelEvent"))),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Parameters:")),Object(l.b)("table",null,Object(l.b)("thead",{parentName:"table"},Object(l.b)("tr",{parentName:"thead"},Object(l.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Name"),Object(l.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Type"))),Object(l.b)("tbody",{parentName:"table"},Object(l.b)("tr",{parentName:"tbody"},Object(l.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(l.b)("inlineCode",{parentName:"td"},"event")),Object(l.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(l.b)("a",Object(a.a)({parentName:"td"},{href:"/docs/api/generated/globals#nativerawpointer"}),"NativeRawPointer"),'\u2039"QEvent"\u203a')))),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Returns:")," ",Object(l.b)("em",{parentName:"p"},Object(l.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/classes/qwheelevent"}),"QWheelEvent"))),Object(l.b)("h2",{id:"properties-1"},"Properties"),Object(l.b)("h3",{id:"native"},"native"),Object(l.b)("p",null,"\u2022 ",Object(l.b)("strong",{parentName:"p"},"native"),": ",Object(l.b)("em",{parentName:"p"},Object(l.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/globals#nativeelement"}),"NativeElement"))),Object(l.b)("h2",{id:"methods-1"},"Methods"),Object(l.b)("h3",{id:"angledelta"},"angleDelta"),Object(l.b)("p",null,"\u25b8 ",Object(l.b)("strong",{parentName:"p"},"angleDelta"),"(): ",Object(l.b)("em",{parentName:"p"},"object")),Object(l.b)("p",null,"Returns the relative amount that the wheel was rotated, in eighths of a degree.\nA positive value indicates that the wheel was rotated forwards away from the user;\na negative value indicates that the wheel was rotated backwards toward the user."),Object(l.b)("p",null,"angleDelta().y() provides the angle through which the common vertical mouse wheel was\nrotated since the previous event.\nangleDelta().x() provides the angle through which the horizontal mouse wheel was\nrotated, if the mouse has a horizontal wheel; otherwise it stays at zero."),Object(l.b)("p",null,"Some mice allow the user to tilt the wheel to perform horizontal scrolling,\nand some touchpads support a horizontal scrolling gesture;\nthat will also appear in angleDelta().x()."),Object(l.b)("p",null,"Most mouse types work in steps of 15 degrees,\nin which case the delta value is a multiple of 120; i.e.,\n120 units * 1/8 = 15 degrees."),Object(l.b)("p",null,"However, some mice have finer-resolution wheels and\nsend delta values that are less than 120 units (less than 15 degrees).\nTo support this possibility, you can either cumulatively add the delta\nvalues from events until the value of 120 is reached,\nthen scroll the widget, or you can partially scroll the widget in\nresponse to each wheel event."),Object(l.b)("p",null,"But to provide a more native feel, you should prefer pixelDelta()\non platforms where it's available."),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Returns:")," ",Object(l.b)("em",{parentName:"p"},"object")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("strong",{parentName:"p"},"x"),": ",Object(l.b)("em",{parentName:"p"},"number"))),Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("strong",{parentName:"p"},"y"),": ",Object(l.b)("em",{parentName:"p"},"number")))),Object(l.b)("hr",null),Object(l.b)("h3",{id:"buttons"},"buttons"),Object(l.b)("p",null,"\u25b8 ",Object(l.b)("strong",{parentName:"p"},"buttons"),"(): ",Object(l.b)("em",{parentName:"p"},"number")),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Returns:")," ",Object(l.b)("em",{parentName:"p"},"number")),Object(l.b)("hr",null),Object(l.b)("h3",{id:"globalposition"},"globalPosition"),Object(l.b)("p",null,"\u25b8 ",Object(l.b)("strong",{parentName:"p"},"globalPosition"),"(): ",Object(l.b)("em",{parentName:"p"},"object")),Object(l.b)("p",null,"Returns the global position of the mouse pointer at the time of\nthe event. This is important on asynchronous window systems such\nas X11; whenever you move your widgets around in response to mouse\nevents, globalPosition() can differ a lot from the current cursor\nposition returned by QCursor::pos()."),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Returns:")," ",Object(l.b)("em",{parentName:"p"},"object")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("strong",{parentName:"p"},"x"),": ",Object(l.b)("em",{parentName:"p"},"number"))),Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("strong",{parentName:"p"},"y"),": ",Object(l.b)("em",{parentName:"p"},"number")))),Object(l.b)("hr",null),Object(l.b)("h3",{id:"inverted"},"inverted"),Object(l.b)("p",null,"\u25b8 ",Object(l.b)("strong",{parentName:"p"},"inverted"),"(): ",Object(l.b)("em",{parentName:"p"},"boolean")),Object(l.b)("p",null,"Returns whether the delta values delivered with the event are inverted"),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Returns:")," ",Object(l.b)("em",{parentName:"p"},"boolean")),Object(l.b)("hr",null),Object(l.b)("h3",{id:"phase"},"phase"),Object(l.b)("p",null,"\u25b8 ",Object(l.b)("strong",{parentName:"p"},"phase"),"(): ",Object(l.b)("em",{parentName:"p"},Object(l.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/enums/scrollphase"}),"ScrollPhase"))),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Returns:")," ",Object(l.b)("em",{parentName:"p"},Object(l.b)("a",Object(a.a)({parentName:"em"},{href:"/docs/api/generated/enums/scrollphase"}),"ScrollPhase"))),Object(l.b)("hr",null),Object(l.b)("h3",{id:"pixeldelta"},"pixelDelta"),Object(l.b)("p",null,"\u25b8 ",Object(l.b)("strong",{parentName:"p"},"pixelDelta"),"(): ",Object(l.b)("em",{parentName:"p"},"object")),Object(l.b)("p",null,"Returns the scrolling distance in pixels on screen.\nThis value is provided on platforms that support\nhigh-resolution pixel-based delta values, such as macOS.\nThe value should be used directly to scroll content on screen"),Object(l.b)("p",null,"Note:On X11 this value is driver specific and unreliable, use angleDelta() instead"),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Returns:")," ",Object(l.b)("em",{parentName:"p"},"object")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("strong",{parentName:"p"},"x"),": ",Object(l.b)("em",{parentName:"p"},"number"))),Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("strong",{parentName:"p"},"y"),": ",Object(l.b)("em",{parentName:"p"},"number")))),Object(l.b)("hr",null),Object(l.b)("h3",{id:"position"},"position"),Object(l.b)("p",null,"\u25b8 ",Object(l.b)("strong",{parentName:"p"},"position"),"(): ",Object(l.b)("em",{parentName:"p"},"object")),Object(l.b)("p",null,"Returns the position of the mouse cursor relative to the widget that received the event.\nIf you move your widgets around in response to mouse events, use globalPosition() instead of this function.\nThis function was introduced in Qt 5.14"),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"Returns:")," ",Object(l.b)("em",{parentName:"p"},"object")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("strong",{parentName:"p"},"x"),": ",Object(l.b)("em",{parentName:"p"},"number"))),Object(l.b)("li",{parentName:"ul"},Object(l.b)("p",{parentName:"li"},Object(l.b)("strong",{parentName:"p"},"y"),": ",Object(l.b)("em",{parentName:"p"},"number")))))}s.isMDXComponent=!0},436: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 l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=r.a.createContext({}),s=function(e){var t=r.a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=s(e.components);return r.a.createElement(o.Provider,{value:t},e.children)},u={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,l=e.originalType,b=e.parentName,o=i(e,["components","mdxType","originalType","parentName"]),p=s(n),d=a,m=p["".concat(b,".").concat(d)]||p[d]||u[d]||l;return n?r.a.createElement(m,c(c({ref:t},o),{},{components:n})):r.a.createElement(m,c({ref:t},o))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,b=new Array(l);b[0]=d;var c={};for(var i in t)hasOwnProperty.call(t,i)&&(c[i]=t[i]);c.originalType=e,c.mdxType="string"==typeof e?e:a,b[1]=c;for(var o=2;o<l;o++)b[o]=n[o];return r.a.createElement.apply(null,b)}return r.a.createElement.apply(null,n)}d.displayName="MDXCreateElement"}}]);