Adds automatic docs for now (#308)

* adds basic typedoc

* backup

* Adds all docs to source code

* Adds autogenerated docs

* Fixes doc links

* Updates docs
This commit is contained in:
Atul R 2019-12-29 00:42:06 +05:30 committed by GitHub
parent 96e7799988
commit 392aa3cd4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
268 changed files with 50947 additions and 2599 deletions

115
package-lock.json generated
View File

@ -569,6 +569,12 @@
"integrity": "sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==",
"dev": true
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
"dev": true
},
"@types/node": {
"version": "12.12.21",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.21.tgz",
@ -984,6 +990,15 @@
"babel-plugin-jest-hoist": "^24.9.0"
}
},
"backbone": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/backbone/-/backbone-1.4.0.tgz",
"integrity": "sha512-RLmDrRXkVdouTg38jcgHhyQ/2zjg7a8E6sz2zxfz21Hh17xDJYUHBZimVIt5fUyS8vbfpeSmTL3gUjTEvUV3qQ==",
"dev": true,
"requires": {
"underscore": ">=1.8.3"
}
},
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@ -3215,6 +3230,15 @@
}
}
},
"highlight.js": {
"version": "9.17.1",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.17.1.tgz",
"integrity": "sha512-TA2/doAur5Ol8+iM3Ov7qy3jYcr/QiJ2eDTdRF4dfbjG7AaaB99J5G+zSl11ljbl6cIcahgPY6SKb3sC3EJ0fw==",
"dev": true,
"requires": {
"handlebars": "^4.5.3"
}
},
"hosted-git-info": {
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz",
@ -3451,6 +3475,12 @@
}
}
},
"interpret": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz",
"integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==",
"dev": true
},
"invariant": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
@ -4470,6 +4500,12 @@
"supports-color": "^6.1.0"
}
},
"jquery": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
"integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==",
"dev": true
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@ -4741,6 +4777,12 @@
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
"integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA=="
},
"lunr": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.8.tgz",
"integrity": "sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg==",
"dev": true
},
"make-dir": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
@ -4795,6 +4837,12 @@
"object-visit": "^1.0.0"
}
},
"marked": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz",
"integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==",
"dev": true
},
"memory-stream": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/memory-stream/-/memory-stream-0.0.3.tgz",
@ -5634,6 +5682,15 @@
"util.promisify": "^1.0.0"
}
},
"rechoir": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
"integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=",
"dev": true,
"requires": {
"resolve": "^1.1.6"
}
},
"regex-not": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
@ -5937,6 +5994,17 @@
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true
},
"shelljs": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz",
"integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==",
"dev": true,
"requires": {
"glob": "^7.0.0",
"interpret": "^1.0.0",
"rechoir": "^0.6.2"
}
},
"shellwords": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
@ -6609,6 +6677,47 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"typedoc": {
"version": "0.15.5",
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.5.tgz",
"integrity": "sha512-AKXLtOUCLRlSTyfXQHYp3LFPy6RiFLnxnKS5z1jwQsYXmCPbHWuhmfgS264Es2hPMZjzvHqk/ZQDzCBpb49u6w==",
"dev": true,
"requires": {
"@types/minimatch": "3.0.3",
"fs-extra": "^8.1.0",
"handlebars": "^4.5.3",
"highlight.js": "^9.17.1",
"lodash": "^4.17.15",
"marked": "^0.7.0",
"minimatch": "^3.0.0",
"progress": "^2.0.3",
"shelljs": "^0.8.3",
"typedoc-default-themes": "^0.6.2",
"typescript": "3.7.x"
}
},
"typedoc-default-themes": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.6.2.tgz",
"integrity": "sha512-+O+1aHjVIpDLsbkIDkZSNu+kutqmg7WdzahT+4KwBC/95mUgAb0xkbwdPpEJEpRX0ov1UJoCmvEPb1/VHxnTuw==",
"dev": true,
"requires": {
"backbone": "^1.4.0",
"jquery": "^3.4.1",
"lunr": "^2.3.8",
"underscore": "^1.9.1"
}
},
"typedoc-plugin-markdown": {
"version": "2.2.14",
"resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-2.2.14.tgz",
"integrity": "sha512-MukndnFdFWMc24HpzvCPDRKMX8Fx92arfMvlAVFhPv8ClXyK7aQVPygHLB1iWXvev6TzggUSQf6IM3LHvoknCw==",
"dev": true,
"requires": {
"fs-extra": "^8.1.0",
"handlebars": "^4.5.3"
}
},
"typescript": {
"version": "3.7.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz",
@ -6626,6 +6735,12 @@
"source-map": "~0.6.1"
}
},
"underscore": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
"integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==",
"dev": true
},
"union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",

View File

@ -8,13 +8,14 @@
"license": "MIT",
"private": false,
"scripts": {
"dev": "npm run build && qode dist/demo.js",
"dev": "npm run build && qode dist/demo.js",
"build": "tsc && npm run build:addon",
"postinstall": "npm run build:addon",
"build:addon": "cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile",
"test": "qode ./node_modules/jest/bin/jest -i",
"lint:cpp": "clang-format -i --glob=src/cpp/**/*.[h,c]*",
"lint:ts": "tsc --noEmit && cross-env eslint './src/**/*.{ts,tsx,js,jsx}' --fix"
"lint:ts": "tsc --noEmit && cross-env eslint './src/**/*.{ts,tsx,js,jsx}' --fix",
"docs": "typedoc && mv ./website/website/sidebars.js ./website/docs/api/sidebar-gen.js"
},
"dependencies": {
"@nodegui/qode": "^1.0.6",
@ -38,6 +39,8 @@
"jest": "^24.9.0",
"prettier": "^1.18.2",
"ts-jest": "^24.1.0",
"typedoc": "^0.15.5",
"typedoc-plugin-markdown": "^2.2.14",
"typescript": "^3.7.3"
},
"husky": {

View File

@ -7,6 +7,7 @@ import { QAction } from './lib/QtWidgets/QAction';
const win = new QMainWindow();
const center = new QWidget();
const layout = new FlexLayout();
const label = new QLabel();
const tray = new QSystemTrayIcon();
const menu = new QMenu();

View File

@ -4,6 +4,23 @@ import { checkIfNativeElement } from '../utils/helpers';
import { QClipboard } from './QClipboard';
import { QStyle } from './QStyle';
/**
> QApplication is the root object for the entire application. It manages app level settings.
* **This class is a JS wrapper around Qt's [QApplication class](https://doc.qt.io/qt-5/qapplication.html)**
The QApplication class manages the GUI application's control flow and main settings. In NodeGui you will never create an instance of it manually. NodeGui's internal runtime `Qode` does it for you on app start. You can access the initialised QApplication though if needed.
### Example
```js
const { QApplication } = require("@nodegui/nodegui");
const qApp = QApplication.instance();
qApp.quit();
```
*/
export class QApplication extends Component {
native: NativeElement;
constructor();

View File

@ -1,6 +1,25 @@
import { Component, NativeElement } from '../core/Component';
import { checkIfNativeElement } from '../utils/helpers';
/**
> The QClipboard class provides access to the window system clipboard.
* **This class is a JS wrapper around Qt's [QClipboard class](https://doc.qt.io/qt-5/QClipboard.html)**
### Example
```javascript
const {
QClipboard,
QClipboardMode,
QApplication
} = require("@nodegui/nodegui");
const clipboard = QApplication.clipboard();
const text = clipboard.text(QClipboardMode.Clipboard);
```
*/
export class QClipboard extends Component {
native: NativeElement;
constructor(native: NativeElement) {

View File

@ -1,6 +1,21 @@
import addon from '../utils/addon';
import { Component, NativeElement } from '../core/Component';
import { CursorShape } from '../QtEnums';
/**
> The QCursor class provides scalable icons in different modes and states.
* **This class is a JS wrapper around Qt's [QCursor class](https://doc.qt.io/qt-5/qcursor.html)**
### Example
```javascript
const { QCursor } = require("@nodegui/nodegui");
const cursor = new QCursor();
```
*/
export class QCursor extends Component {
native: NativeElement;
constructor();

View File

@ -15,6 +15,21 @@ export enum QIconState {
On,
}
/**
> The QIcon class provides scalable icons in different modes and states.
* **This class is a JS wrapper around Qt's [QIcon class](https://doc.qt.io/qt-5/qicon.html)**
### Example
```javascript
const { QIcon } = require("@nodegui/nodegui");
const imageUrl = "path/to/png";
const icon = new QIcon(imageUrl);
```
*/
export class QIcon extends Component {
native: NativeElement;
constructor();

View File

@ -1,6 +1,20 @@
import addon from '../utils/addon';
import { Component, NativeElement } from '../core/Component';
/**
> The QKeySequence class encapsulates a key sequence as used by shortcuts. .
* **This class is a JS wrapper around Qt's [QKeySequence class](https://doc.qt.io/qt-5/qkeysequence.html)**
### Example
```javascript
const { QKeySequence } = require("@nodegui/nodegui");
const keySequence = new QKeySequence(`Ctrl+L`);
```
*/
export class QKeySequence extends Component {
native: NativeElement;
constructor();

View File

@ -6,6 +6,23 @@ import { QVariant } from '../QtCore/QVariant';
export type ImageFormats = 'BMP' | 'GIF' | 'JPG' | 'JPEG' | 'PNG' | 'PBM' | 'PGM' | 'PPM' | 'XBM' | 'XPM' | 'SVG';
/**
> The QPixmap class helps hold an image in the form of off-screen image representation.
* **This class is a JS wrapper around Qt's [QPixmap class](https://doc.qt.io/qt-5/qpixmap.html)**
A `QPixmap` provides ability to store an image in the memory.
### Example
```javascript
const { QPixmap } = require("@nodegui/nodegui");
const imageUrl = "path/to/png";
const pixMap = new QPixmap(imageUrl);
```
*/
export class QPixmap extends Component {
native: NativeElement;
constructor();

View File

@ -2,6 +2,20 @@ import { NodeWidget, QWidget, QWidgetSignals } from './QWidget';
import { ScrollBarPolicy } from '../QtEnums/ScrollBarPolicy';
export type QAbstractScrollAreaSignals = QWidgetSignals;
/**
> Abstract class to add functionalities common to all scrollarea based widgets.
**This class implements all methods, properties of Qt's [QAbstractScrollArea class](https://doc.qt.io/qt-5/qabstractscrollarea.html) so that it can be inherited by all scroll based widgets**
`QAbstractScrollArea` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all scrollable widget's easily. If you wish to create a scrollarea use [QScrollArea](api/QScrollArea.md) instead.
**QAbstractScrollArea is the base class for all widgets.**
QAbstractScrollArea will list all methods and properties that are common to all scrollable widgets in the NodeGui world.
*/
export abstract class QAbstractScrollArea<Signals extends QAbstractScrollAreaSignals> extends NodeWidget<Signals> {
viewportWidget?: NodeWidget<any>;
setViewport(widget: NodeWidget<any>): void {

View File

@ -9,6 +9,20 @@ export interface QAbstractSliderSignals extends QWidgetSignals {
sliderReleased: () => void;
valueChanged: (value: number) => void;
}
/**
> Abstract class to add functionalities common to all slider based widgets.
**This class implements all methods, properties of Qt's [QAbstractSlider class](https://doc.qt.io/qt-5/qabstractslider.html) so that it can be inherited by all slider based widgets**
`QAbstractSlider` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all slider widget's easily. If you wish to create a slider use [QDial](api/QDial.md) instead.
**QAbstractSlider is the base class for all slider widgets.**
QAbstractSlider will list all methods and properties that are common to all slider widgets in the NodeGui world.
*/
export abstract class QAbstractSlider<Signals extends QAbstractSliderSignals> extends NodeWidget<Signals> {
setSingleStep(step: number): void {
this.native.setSingleStep(step);

View File

@ -15,6 +15,26 @@ export interface QActionSignals extends QObjectSignals {
toggled: (checked: boolean) => void;
}
/**
> The QAction class provides an abstract user interface action that can be inserted into widgets.
* **This class is a JS wrapper around Qt's [QAction class](https://doc.qt.io/qt-5/qaction.html)**
### Example
```javascript
const { QAction, QMenu } = require("@nodegui/nodegui");
const menu = new QMenu();
const menuAction = new QAction();
menuAction.setText("subAction");
menuAction.addEventListener("triggered", () => {
console.log("Action clicked");
});
menu.addAction(menuAction);
```
*/
export class QAction extends NodeObject<QActionSignals> {
native: NativeElement;
icon?: QIcon;

View File

@ -5,6 +5,23 @@ import { QAbstractButton, QAbstractButtonSignals } from './QAbstractButton';
export type QCheckBoxSignals = QAbstractButtonSignals;
/**
> Create and control checkbox.
* **This class is a JS wrapper around Qt's [QCheckBox class](https://doc.qt.io/qt-5/qcheckbox.html)**
A `QCheckBox` provides ability to add and manipulate native checkbox widgets.
### Example
```javascript
const { QCheckBox } = require("@nodegui/nodegui");
const checkbox = new QCheckBox();
checkbox.setText("Hello");
```
*/
export class QCheckBox extends QAbstractButton<QCheckBoxSignals> {
native: NativeElement;
constructor();

View File

@ -4,6 +4,23 @@ import { NativeElement } from '../core/Component';
import { QAbstractSlider, QAbstractSliderSignals } from './QAbstractSlider';
export type QDialSignals = QAbstractSliderSignals;
/**
> Create and control dial slider widgets.
* **This class is a JS wrapper around Qt's [QDial class](https://doc.qt.io/qt-5/qdial.html)**
A `QDial` provides ability to add and manipulate native dial slider widgets.
### Example
```javascript
const { QDial } = require("@nodegui/nodegui");
const dial = new QDial();
```
*/
export class QDial extends QAbstractSlider<QDialSignals> {
native: NativeElement;
constructor();

View File

@ -5,6 +5,31 @@ import { NativeElement } from '../core/Component';
export type QGridLayoutSignals = QLayoutSignals;
/**
> The QGridLayout class lays out widgets in a grid.
* **This class is a JS wrapper around Qt's [QGridLayout](https://doc.qt.io/qt-5/qgridlayout.html)**
### Example
```javascript
const { QGridLayout, QWidget, QLabel } = require("@nodegui/nodegui");
const view = new QWidget();
const layout = new QGridLayout();
view.setLayout(layout);
const label = new QLabel();
label.setText("label1");
const label2 = new QLabel();
label2.setText("label2");
layout.addWidget(label);
layout.addWidget(label2);
```
*/
export class QGridLayout extends NodeLayout<QGridLayoutSignals> {
native: NativeElement;
constructor();

View File

@ -7,6 +7,24 @@ import { AlignmentFlag } from '../QtEnums/AlignmentFlag';
import { TextFormat } from '../QtEnums/TextFormat';
export type QLabelSignals = QWidgetSignals;
/**
> Create and control text.
* **This class is a JS wrapper around Qt's [QLabel class](https://doc.qt.io/qt-5/qlabel.html)**
A `QLabel` provides ability to add and manipulate text.
### Example
```javascript
const { QLabel } = require("@nodegui/nodegui");
const label = new QLabel();
label.setText("Hello");
```
*/
export class QLabel extends NodeWidget<QLabelSignals> {
native: NativeElement;
private _pixmap?: QPixmap;

View File

@ -4,6 +4,35 @@ import { NodeObject, QObjectSignals } from '../QtCore/QObject';
// All Layouts should extend this abstract class.
export type QLayoutSignals = QObjectSignals;
/**
> Abstract class to add functionalities common to all Layout.
**This class implements all methods, properties of Qt's [QLayout class](https://doc.qt.io/qt-5/qlayout.html) so that it can be inherited by all layouts**
`NodeLayout` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all layout's easily. Additionally it helps in typechecking process.
### Example
```javascript
const {
NodeLayout,
NodeWidget,
FlexLayout,
GridLayout,
QPushButton,
QWidget
} = require("@nodegui/nodegui");
// addChildToLayout can accept any layout since it expects NodeLayout
const addChildToLayout = (layout: NodeLayout, widget: NodeWidget) => {
layout.addWidget(widget);
};
addChildToLayout(new FlexLayout(), new QPushButton());
addChildToLayout(new GridLayout(), new QWidget());
```
*/
export abstract class NodeLayout<Signals extends QLayoutSignals> extends NodeObject<Signals> {
type = 'layout';
abstract addWidget(childWidget: NodeWidget<any>, ...args: any[]): void;

View File

@ -17,6 +17,23 @@ export interface QLineEditSignals extends QWidgetSignals {
textChanged: (text: string) => void;
textEdited: (text: string) => void;
}
/**
> Create and control editable text field.
* **This class is a JS wrapper around Qt's [QLineEdit class](https://doc.qt.io/qt-5/qlineedit.html)**
A `QLineEdit` provides ability to add and manipulate native editable text field widgets.
### Example
```javascript
const { QLineEdit } = require("@nodegui/nodegui");
const lineEdit = new QLineEdit();
```
*/
export class QLineEdit extends NodeWidget<QLineEditSignals> {
native: NativeElement;
constructor();

View File

@ -5,6 +5,33 @@ import { NodeLayout } from './QLayout';
import { QMenuBar } from './QMenuBar';
export type QMainWindowSignals = QWidgetSignals;
/**
> Create and control windows.
* **This class is a JS wrapper around Qt's [QMainWindow class](https://doc.qt.io/qt-5/qmainwindow.html)**
A `QMainWindow` provides a main application window. Every widget in NodeGui should be a child/nested child of QMainWindow. QMainWindow in NodeGui is also responsible for FlexLayout calculations of its children.
### Example
```javascript
const { QMainWindow, QWidget } = require("@nodegui/nodegui");
const win = new QMainWindow();
const centralWidget = new QWidget();
win.setCentralWidget(centralWidget);
win.show();
global.win = win; // prevent's gc of win
```
QMainWindow needs to have a central widget set before other widgets can be added as a children/nested children.
Once a central widget is set you can add children/layout to the central widget.
*/
export class QMainWindow extends NodeWidget<QMainWindowSignals> {
native: NativeElement;
public centralWidget?: NodeWidget<any> | null;

View File

@ -4,6 +4,21 @@ import addon from '../utils/addon';
import { QAction } from './QAction';
export type QMenuSignals = QWidgetSignals;
/**
> The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
* **This class is a JS wrapper around Qt's [QMenu class](https://doc.qt.io/qt-5/qmenu.html)**
### Example
```javascript
const { QMenu } = require("@nodegui/nodegui");
const menu = new QMenu();
```
*/
export class QMenu extends NodeWidget<QMenuSignals> {
native: NativeElement;
actions: Set<QAction>;

View File

@ -6,6 +6,24 @@ import { checkIfNativeElement } from '../utils/helpers';
export type QMenuBarSignals = QWidgetSignals;
/**
> The QMenuBar class provides a menu widget for use in menu bars, context menus, and other popup menus.
* **This class is a JS wrapper around Qt's [QMenuBar class](https://doc.qt.io/qt-5/qmenu.html)**
### Example
```javascript
const { QMenuBar, QMainWindow } = require("@nodegui/nodegui");
const win = new QMainWindow();
const menu = new QMenuBar();
const menuBar = new QMenuBar();
win.setMenuBar(menuBar);
win.show();
global.win = win;
```
*/
export class QMenuBar extends NodeWidget<QMenuBarSignals> {
native: NativeElement;
constructor();

View File

@ -19,6 +19,23 @@ export enum LineWrapMode {
NoWrap,
WidgetWidth,
}
/**
> Used to edit and display plain text.
* **This class is a JS wrapper around Qt's [QPlainTextEdit class](https://doc.qt.io/qt-5/qplaintextedit.html)**
A `QPlainTextEdit` provides ability to add and manipulate native editable text field widgets.
### Example
```javascript
const { QPlainTextEdit } = require("@nodegui/nodegui");
const plainTextEdit = new QPlainTextEdit();
```
*/
export class QPlainTextEdit extends QAbstractScrollArea<QPlainTextEditSignals> {
native: NativeElement;
placeholderText?: string;

View File

@ -6,6 +6,22 @@ import { Orientation } from '../QtEnums';
export interface QProgressBarSignals extends QWidgetSignals {
valueChanged: (value: number) => void;
}
/**
> Create and control progress bar widgets.
* **This class is a JS wrapper around Qt's [QProgressBar class](https://doc.qt.io/qt-5/qprogressbar.html)**
A `QProgressBar` provides ability to add and manipulate native progress bar widgets.
### Example
```javascript
const { QProgressBar } = require("@nodegui/nodegui");
const progressBar = new QProgressBar();
```
*/
export class QProgressBar extends NodeWidget<QProgressBarSignals> {
native: NativeElement;
constructor();

View File

@ -4,7 +4,23 @@ import { NativeElement } from '../core/Component';
import { QAbstractButton, QAbstractButtonSignals } from './QAbstractButton';
export type QPushButtonSignals = QAbstractButtonSignals;
/**
> Create and control buttons.
* **This class is a JS wrapper around Qt's [QPushButton class](https://doc.qt.io/qt-5/qpushbutton.html)**
A `QPushButton` provides ability to add and manipulate native button widgets.
### Example
```javascript
const { QPushButton } = require("@nodegui/nodegui");
const button = new QPushButton();
button.setText("Hello");
```
*/
export class QPushButton extends QAbstractButton<QPushButtonSignals> {
native: NativeElement;
constructor();

View File

@ -4,6 +4,25 @@ import { NativeElement } from '../core/Component';
import { QAbstractButton, QAbstractButtonSignals } from './QAbstractButton';
export type QRadioButtonSignals = QAbstractButtonSignals;
/**
> Create and control radio button.
* **This class is a JS wrapper around Qt's [QRadioButton class](https://doc.qt.io/qt-5/qradiobutton.html)**
A `QRadioButton` provides ability to add and manipulate native radio button widgets.
### Example
```javascript
const { QRadioButton } = require("@nodegui/nodegui");
const radioButton = new QRadioButton();
radioButton.setText("Hello");
```
*/
export class QRadioButton extends QAbstractButton<QRadioButtonSignals> {
native: NativeElement;
constructor();

View File

@ -4,6 +4,30 @@ import { NativeElement } from '../core/Component';
import { QAbstractScrollArea, QAbstractScrollAreaSignals } from './QAbstractScrollArea';
export type QScrollAreaSignals = QAbstractScrollAreaSignals;
/**
> A `QScrollArea` provides a scrolling view onto another widget.
* **This class is a JS wrapper around Qt's [QScrollArea class](https://doc.qt.io/qt-5/qscrollarea.html)**
### Example
```javascript
const { QScrollArea } = require("@nodegui/nodegui");
const scrollArea = new QScrollArea();
scrollArea.setInlineStyle("flex: 1; width:'100%';");
const imageLabel = new QLabel();
const pixmap = new QPixmap(
path.resolve(__dirname, "../extras/assets/kitchen.png")
);
imageLabel.setPixmap(pixmap);
scrollArea.setWidget(imageLabel);
```
*/
export class QScrollArea extends QAbstractScrollArea<QScrollAreaSignals> {
native: NativeElement;
contentWidget?: NodeWidget<any> | null;

View File

@ -10,6 +10,30 @@ export interface QShortcutSignals extends QObjectSignals {
activatedAmbiguously: () => void;
}
/**
> The QShortcut class is used to create keyboard shortcuts.
* **This class is a JS wrapper around Qt's [QShortcut class](https://doc.qt.io/qt-5/qshortcut.html)**
### Example
```javascript
const { QShortcut, QKeySequence, QMainWindow } = require("@nodegui/nodegui");
const win = new QMainWindow();
const shortcut = new QShortcut(win);
shortcut.setKey(new QKeySequence("Ctrl+M"));
shortcut.setEnabled(true);
shortcut.addEventListener(QShortcutEvents.activated, () => {
console.log("Shortcut Activated");
});
win.show();
global.win = win;
global.shortcut = shortcut;
```
*/
export class QShortcut extends NodeObject<QShortcutSignals> {
native: NativeElement;
constructor(parent: NodeWidget<any>) {

View File

@ -6,6 +6,22 @@ export interface QSpinBoxSignals extends QWidgetSignals {
valueChanged: (value: number) => void;
}
/**
> Create and control spin box widgets.
* **This class is a JS wrapper around Qt's [QSpinBox class](https://doc.qt.io/qt-5/qspinbox.html)**
A `QSpinBox` provides ability to add and manipulate native spin box widgets.
### Example
```javascript
const { QSpinBox } = require("@nodegui/nodegui");
const spinBox = new QSpinBox();
```
*/
export class QSpinBox extends NodeWidget<QSpinBoxSignals> {
native: NativeElement;
constructor();

View File

@ -10,6 +10,28 @@ export interface QSystemTrayIconSignals extends QObjectSignals {
messageClicked: () => void;
}
/**
> Create and control system tray icon.
* **This class is a JS wrapper around Qt's [QSystemTrayIcon class](https://doc.qt.io/qt-5/qsystemtrayicon.html)**
A `QSystemTrayIcon` provides ability to add and manipulate native system tray icon.
### Example
```javascript
const { QSystemTrayIcon, QIcon } = require("@nodegui/nodegui");
const trayIcon = new QIcon(
resolve(__dirname, "some/image/file.png");
);
const tray = new QSystemTrayIcon();
tray.show();
global.tray = tray; // prevents garbage collection of tray
```
*/
export class QSystemTrayIcon extends NodeObject<QSystemTrayIconSignals> {
native: NativeElement;
contextMenu?: QMenu;

View File

@ -12,8 +12,40 @@ import { YogaWidget } from '../core/YogaWidget';
import { QSize } from '../QtCore/QSize';
import { QRect } from '../QtCore/QRect';
import { QObjectSignals } from '../QtCore/QObject';
// All Widgets should extend from NodeWidget
// Implement all native QWidget methods here so that all widgets get access to those aswell
/**
> Abstract class to add functionalities common to all Widgets.
**This class implements all methods, properties of Qt's [QWidget class](https://doc.qt.io/qt-5/qwidget.html) so that it can be inherited by all widgets**
`NodeWidget` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all widget's easily. Additionally it helps in type checking process. If you wish to create a `div` like widget use [QWidget](api/QWidget.md) instead.
**NodeWidget is the base class for all widgets.**
### Example
```javascript
const {
NodeWidget,
QPushButton,
QWidget,
QRadioButton
} = require("@nodegui/nodegui");
// showWidget can accept any widget since it expects NodeWidget
const showWidget = (widget: NodeWidget) => {
widget.show();
};
showWidget(new QPushButton());
showWidget(new QWidget());
showWidget(new QRadioButton());
```
All Widgets should extend from NodeWidget
Implement all native QWidget methods here so that all widgets get access to those aswell
*/
export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWidget<Signals> {
layout?: NodeLayout<Signals>;
_rawInlineStyle = '';
@ -180,6 +212,25 @@ export interface QWidgetSignals extends QObjectSignals {
windowIconChanged: (iconNative: NativeElement) => void;
customContextMenuRequested: (pos: { x: number; y: number }) => void;
}
/**
> Create and control views.
* **This class is a JS wrapper around Qt's [QWidget class](https://doc.qt.io/qt-5/qwidget.html)**
A `QWidget` can be used to encapsulate other widgets and provide structure. It functions similar to a `div` in the web world.
### Example
```javascript
const { QWidget } = require("@nodegui/nodegui");
const view = new QWidget();
view.setObjectName("container"); //Similar to setting `id` on the web
view.setLayout(new FlexLayout());
```
*/
export class QWidget extends NodeWidget<QWidgetSignals> {
native: NativeElement;
constructor(arg?: NodeWidget<QWidgetSignals> | NativeElement) {

View File

@ -1,6 +1,22 @@
export type NativeElement = { type: 'native'; [key: string]: any };
/**
> Abstract class that is root most base class for all widgets and layouts in the NodeGui World.
**This class is used to add core properties to all widgets, layouts etc in NodeGui world.
Currently it helps us maintain references to the native C++ instance of the widget or layout.
It also helps in preventing gc of child elements of a layout or widget**
`Component` is an abstract class and hence no instances of the same should be created.
It exists so that we can add core functionalities to all widgets and layouts easily. This is an internal class.
Its the root base class in NodeGui world.
*/
export abstract class Component {
nodeChildren = new Set<Component>();
nodeChildren = new Set();
nodeParent?: Component;
setNodeParent(parent?: Component): void {
this.nodeParent = parent;

View File

@ -1,5 +1,32 @@
import { EventEmitter } from 'events';
import { NativeElement, Component } from './Component';
/**
> Abstract class that adds event handling support to all widgets.
**This class implements an event emitter and merges it with Qt's event and signal system. It allows us to register and unregister event and signal listener at will from javascript**
`EventWidget` is an abstract class and hence no instances of the same should be created. It exists so that we can add event handling functionalities to all widget's easily. This is an internal class.
### Example
```javascript
const { QWidget, QWidgetSignals, WidgetEventTypes } = require("@nodegui/nodegui");
const view = new QWidget();
// You either listen for a widget's signal
view.addEventListener('windowTitleChanged', () => {
console.log("window title changed");
});
// or you can listen for an event
view.addEventListener(WidgetEventTypes.MouseMove, () => {
console.log("mouse moved");
});
```
*/
export abstract class EventWidget<Signals extends {}> extends Component {
private emitter: EventEmitter;
constructor(native: NativeElement) {
@ -12,7 +39,32 @@ export abstract class EventWidget<Signals extends {}> extends Component {
}
}
/**
*
@param signalType SignalType is a signal from the widgets signals interface.
@param callback Corresponding callback for the signal as mentioned in the widget's signal interface
@returns void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
*/
addEventListener<SignalType extends keyof Signals>(signalType: SignalType, callback: Signals[SignalType]): void;
/**
@param eventType
@param callback
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
*/
addEventListener(eventType: WidgetEventTypes, callback: (event?: NativeElement) => void): void;
addEventListener(eventOrSignalType: string, callback: (...payloads: any[]) => void): void {
this.native.subscribeToQtEvent(eventOrSignalType);

View File

@ -5,6 +5,33 @@ import { FlexNode } from './YogaWidget';
import { NativeElement } from './Component';
export type FlexLayoutSignals = QLayoutSignals;
/**
> Custom layout to help layout child widgets using flex layout.
* **This class is a JS wrapper around custom Qt layout implemented using [Yoga](https://github.com/facebook/yoga)**
A `FlexLayout` can be used to layout all child NodeGui widgets using flex.
### Example
```javascript
const { FlexLayout, QWidget, QLabel } = require("@nodegui/nodegui");
const view = new QWidget();
const layout = new FlexLayout();
view.setLayout(layout);
const label = new QLabel();
label.setText("label1");
const label2 = new QLabel();
label2.setText("label2");
layout.addWidget(label);
layout.addWidget(label2);
```
*/
export class FlexLayout extends NodeLayout<FlexLayoutSignals> {
native: NativeElement;
protected flexNode?: FlexNode;

View File

@ -1,10 +1,34 @@
import { NodeObject, QObjectSignals } from '../QtCore/QObject';
export type FlexNode = {};
/**
> Abstract class to add common functionality related to Flex layout to all Widgets.
**This class implements methods related to flex layout required to be present in all widgets**
`YogaWidget` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities related to flex layout to all widget's easily. We implement flex layout using a library called [Yoga](https://github.com/facebook/yoga). As part of yoga every widget needs to store its own flex properties such as alignItems, flexDirection etc. This is done with the help of YogaWidget.
```javascript
const { QWidget } = require("@nodegui/nodegui");
const view = new QWidget();
// getFlexNode is a method from YogaWidget
const flexNode = view.getFlexNode();
```
YogaWidget helps in storing all flex properties of a widget.
*/
export abstract class YogaWidget<Signals extends QObjectSignals> extends NodeObject<Signals> {
getFlexNode(): FlexNode {
return this.native.getFlexNode();
}
/**
* sets whether the widget's size is controlled by someone else (for example a window's size is controlled by its frame when dragged).
* @param isSizeControlled
*/
setFlexNodeSizeControlled(isSizeControlled: boolean): void {
this.native.setFlexNodeSizeControlled(isSizeControlled);
}

View File

@ -10,5 +10,19 @@
"esModuleInterop": true,
"resolveJsonModule": true
},
"include": ["src"]
"include": ["src"],
"typedocOptions": {
"mode": "file",
"out": "website/docs/api/generated",
"plugin": ["typedoc-plugin-markdown"],
"exclude": ["demo.ts"],
"excludeExternals": true,
"excludeNotExported": true,
"excludePrivate": true,
"excludeProtected": true,
"includeDeclarations": true,
"hideBreadcrumbs": true,
"hideSources": true,
"theme": "docusaurus2"
}
}

View File

@ -1,26 +0,0 @@
---
sidebar_label: Component
title: Component
---
> Abstract class that is root most base class for all widgets and layouts in the NodeGui World.
**This class is used to add core properties to all widgets, layouts etc in NodeGui world. Currently it helps us maintain references to the native C++ instance of the widget or layout. It also helps in preventing gc of child elements of a layout or widget**
`Component` is an abstract class and hence no instances of the same should be created. It exists so that we can add core functionalities to all widgets and layouts easily. This is an internal class.
**Component is the base class for YogaWidget and NodeLayout which means all widgets and layouts inherit it aswell. Its the root base class in NodeGui world**
To get a clearer picture you can take a look at the Component source code here: `src/lib/core/Component/index.ts`
## Static Methods
There are no public static methods for Component.
## Instance Properties
There are no public instance properties for Component.
## Instance Methods
There are no public instance methods for Component.

View File

@ -1,63 +0,0 @@
---
sidebar_label: EventWidget
title: EventWidget
---
> Abstract class that adds event handling support to all widgets.
**This class implements an event emitter and merges it with Qt's event and signal system. It allows us to register and unregister event and signal listener at will from javascript**
`EventWidget` is an abstract class and hence no instances of the same should be created. It exists so that we can add event handling functionalities to all widget's easily. This is an internal class.
**EventWidget is the base class for NodeWidget which means all widgets inherit it aswell. It inherits from another abstract class [YogaWidget](api/YogaWidget.md)**
### Example
```javascript
const { QWidget, QWidgetEvents } = require("@nodegui/nodegui");
const view = new QWidget();
// addEventListener is a method from EventWidget
view.addEventListener("MouseMove", () => {
console.log("mouse moved");
});
or;
// addEventListener is a method from EventWidget
view.addEventListener(QWidgetEvents.MouseMove, () => {
console.log("mouse moved");
});
```
EventWidget will contain all methods and properties that are useful to handle events and signals of widgets in the NodeGui world.
## Static Methods
EventWidget can access all the static methods defined in [YogaWidget](api/YogaWidget.md)
## Instance Properties
EventWidget can access all the instance properties defined in [YogaWidget](api/YogaWidget.md)
## Instance Methods
EventWidget can access all the instance methods defined in [YogaWidget](api/YogaWidget.md)
Additionally it also has the following instance methods:
### `widget.addEventListener(eventType, callback)`
Adds an event listener to the widget to listen to events that occur on a widget.
- `eventType` string - The event or signal you wish to listen to for the widget. Every widget exports its own enum of all possible events and signal types it can take. For example: `QWidget` exports `QWidgetEvents`, `QPushButton` exports `QPushButtonEvents`.
- `callback` (payload?: NativeEvent | any) => void - A callback function to invoke when an event occurs. Usually you receive a nativeEvent or a string as argument.
### `widget.removeEventListener(eventType, callback?)`
Removes the specified event listener from the widget.
- `eventType` string - The event or signal for which you wish to remove the listener.
- `callback` Function (_Optional_) - If specified the removeEventListener will remove the specified listener only, otherwise all eventlisteners of the eventType on the widget will be removed.

View File

@ -1,73 +0,0 @@
---
sidebar_label: FlexLayout
title: FlexLayout
---
> Custom layout to help layout child widgets using flex layout.
**This class is a JS wrapper around custom Qt layout implemented using [Yoga](https://github.com/facebook/yoga)**
A `FlexLayout` can be used to layout all child NodeGui widgets using flex.
**FlexLayout inherits from [NodeLayout](api/NodeLayout.md)**
### Example
```javascript
const { FlexLayout, QWidget, QLabel } = require("@nodegui/nodegui");
const view = new QWidget();
const layout = new FlexLayout();
view.setLayout(layout);
const label = new QLabel();
label.setText("label1");
const label2 = new QLabel();
label2.setText("label2");
layout.addWidget(label);
layout.addWidget(label2);
```
## Static Methods
FlexLayout can access all the static methods defined in [NodeLayout](api/NodeLayout.md)
## Instance Properties
FlexLayout can access all the instance properties defined in [NodeLayout](api/NodeLayout.md)
## Instance Methods
FlexLayout can access all the instance methods defined in [NodeLayout](api/NodeLayout.md)
Additionally it also has the following instance methods:
### `layout.addWidget(childWidget, childFlexNode?)`
Adds the childWidget to the layout. It calls the native method of custom FlexLayout.
- `childWidget` NodeWidget - child widget that needs to be added to the layout.
- `childFlexNode` flexNode ref (_Optional_) - flexNode reference of the child widget. You can get this by calling `childWidget.getFlexNode()`.
### `layout.insertChildBefore(childWidget, beforeChildWidget, childFlexNode?, beforeChildFlexNode?)`
Adds the childWidget before another already set childWidget in the layout. It calls the native method of custom FlexLayout.
- `childWidget` NodeWidget - child widget that needs to be added to the layout.
- `beforeChildWidget` NodeWidget - the widget before which the `childWidget` needs to be added in the layout.
- `childFlexNode` flexNode ref (_Optional_) - flexNode reference of the child widget. You can get this by calling `childWidget.getFlexNode()`.
- `beforeChildFlexNode` flexNode ref (_Optional_) - flexNode reference of the before child widget. You can get this by calling `beforeChildWidget.getFlexNode()`.
### `layout.removeWidget(childWidget, childFlexNode?)`
Removes the childWidget from the layout. It calls the native method of custom FlexLayout.
- `childWidget` NodeWidget - child widget that needs to be added to the layout.
- `childFlexNode` flexNode ref (_Optional_) - flexNode reference of the child widget. You can get this by calling `childWidget.getFlexNode()`.
### `layout.setFlexNode(flexNode)`
A layout doesnt have its own flexNode. This method sets the flex Node to use for calculating position of the child widgets. Hence this should be always equal to the flex node of widget for which this layout is set. This is called internally by `widget.setLayout`.
- `flexNode` flexNode ref - flexNode reference of the widget for which this layout is set. You can get this by calling `widget.getFlexNode()`.

View File

@ -1,74 +0,0 @@
---
sidebar_label: NodeLayout
title: NodeLayout
---
> Abstract class to add functionalities common to all Layout.
**This class implements all methods, properties of Qt's [QLayout class](https://doc.qt.io/qt-5/qlayout.html) so that it can be inherited by all layouts**
`NodeLayout` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all layout's easily. Additionally it helps in typechecking process.
**NodeLayout is the base class for all layouts. It inherits from another abstract class [Component](api/Component.md)**
### Example
```javascript
const {
NodeLayout,
NodeWidget,
FlexLayout,
GridLayout,
QPushButton,
QWidget
} = require("@nodegui/nodegui");
// addChildToLayout can accept any layout since it expects NodeLayout
const addChildToLayout = (layout: NodeLayout, widget: NodeWidget) => {
layout.addWidget(widget);
};
addChildToLayout(new FlexLayout(), new QPushButton());
addChildToLayout(new GridLayout(), new QWidget());
```
NodeLayout will list all methods and properties that are common to all layouts in the NodeGui world.
## Static Methods
NodeLayout can access all the static methods defined in [Component](api/Component.md)
## Instance Properties
NodeLayout can access all the instance properties defined in [Component](api/Component.md)
Additionally it also has the following instance properties:
### `layout.type`
This will return the string `layout` for all layouts.
## Instance Methods
NodeLayout can access all the instance methods defined in [Component](api/Component.md)
Additionally it also has the following instance methods:
### `layout.addWidget(childWidget, ...args)`
This is an abstract method in NodeLayout class. All Layouts inheriting from NodeLayout should implement this method.
- `childWidget` NodeWidget - Any widget in the NodeGui world.
- `...args` any[] - Additional params as required by the layout.
### `layout.activate()`
Redoes the layout for parent widget of this layout if necessary. Returns true if the layout was redone.
### `layout.invalidate()`
Invalidates any cached information in this layout.
### `layout.update()`
Updates the layout for parent widget of this layout. You should generally not need to call this because it is automatically called at the most appropriate times.

View File

@ -1,223 +0,0 @@
---
sidebar_label: NodeWidget
title: NodeWidget
---
> Abstract class to add functionalities common to all Widgets.
**This class implements all methods, properties of Qt's [QWidget class](https://doc.qt.io/qt-5/qwidget.html) so that it can be inherited by all widgets**
`NodeWidget` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all widget's easily. Additionally it helps in type checking process. If you wish to create a `div` like widget use [QWidget](api/QWidget.md) instead.
**NodeWidget is the base class for all widgets. It inherits from another abstract class [EventWidget](api/EventWidget.md)**
### Example
```javascript
const {
NodeWidget,
QPushButton,
QWidget,
QRadioButton
} = require("@nodegui/nodegui");
// showWidget can accept any widget since it expects NodeWidget
const showWidget = (widget: NodeWidget) => {
widget.show();
};
showWidget(new QPushButton());
showWidget(new QWidget());
showWidget(new QRadioButton());
```
NodeWidget will list all methods and properties that are common to all widgets in the NodeGui world.
## Static Methods
NodeWidget can access all the static methods defined in [EventWidget](api/EventWidget.md)
## Instance Properties
NodeWidget can access all the instance properties defined in [EventWidget](api/EventWidget.md)
Additionally it also has the following instance properties:
### `widget.layout`
A `NodeLayout` representing current layout that is set on the widget.
### `widget.type`
This will return the string `widget` for all widgets.
## Instance Methods
NodeWidget can access all the instance methods defined in [EventWidget](api/EventWidget.md)
Additionally it also has the following instance methods:
### `widget.show()`
Shows the widget and its children. It calls the native method [QWidget: show](https://doc.qt.io/qt-5/qwidget.html#show).
### `widget.resize(width, height)`
Resizes the widget. It calls the native method [QWidget: resize](https://doc.qt.io/qt-5/qwidget.html#resize-1).
- `width` number - Pixels.
- `height` number - Pixels.
### `widget.close()`
Closes this widget. It calls the native method [QWidget: close](https://doc.qt.io/qt-5/qwidget.html#close).
Returns true if the widget was closed; otherwise returns false.
### `widget.setLayout(layout)`
Sets the layout manager for this widget to layout. It calls the native method [QWidget: setLayout](https://doc.qt.io/qt-5/qwidget.html#setLayout).
- `layout` NodeLayout - Any layout that inherits from NodeLayout class.
### `widget.setStyleSheet(styleSheet)`
Sets the property that holds the widget's style sheet. It calls the native method [QWidget: styleSheet](https://doc.qt.io/qt-5/qwidget.html#styleSheet-prop).
- `styleSheet` string - String which holds the widget's style sheet. Make sure you create this string using `StyleSheet.create()`
### `widget.setCursor(cursor)`
Sets the window mouse cursor. It calls the native method [QWidget: setCursor](https://doc.qt.io/qt-5/qwidget.html#cursor-prop).
- `cursor` CursorShape - Specifies current cursor for the window [CursorShape is an enum from Qt](api/QtEnums.md)
### `widget.setWindowIcon(icon)`
Sets the window icon. It calls the native method [QWidget: setWindowIcon](https://doc.qt.io/qt-5/qwidget.html#windowIcon-prop).
- `icon` QIcon - Specifies icon for the window.
### `widget.setWindowState(state)`
Sets the window state. It calls the native method [QWidget: setWindowState](https://doc.qt.io/qt-5/qwidget.html#setWindowState).
- `state` WindowState - Specifies current state for the window [WindowState is an enum from Qt](api/QtEnums.md)
### `widget.setWindowTitle(title)`
Sets the window title property. It calls the native method [QWidget: setWindowTitle](https://doc.qt.io/qt-5/qwidget.html#windowTitle-prop).
- `title` string - String which holds the windows title.
### `widget.styleSheet()`
Gets the property that holds the widget's style sheet. It calls the native method [QWidget: styleSheet](https://doc.qt.io/qt-5/qwidget.html#styleSheet-prop).
### `widget.hide()`
Hides the widget and its children. It calls the native method [QWidget: hide](https://doc.qt.io/qt-5/qwidget.html#hide).
### `widget.move(x, y)`
Sets the screen position of the widget. It calls the native method [QWidget: move](https://doc.qt.io/qt-5/qwidget.html#move-1).
- `x` number - Pixels.
- `y` number - Pixels.
### `widget.setObjectName(objectName)`
Sets the object name of the widget in Qt. It calls the native method [QObject: setObjectName](https://doc.qt.io/qt-5/qobject.html#objectName-prop). Object name can be analogous to `id` of an element in the web world. Using the objectName of the widget one can reference it in the Qt's stylesheet much like what we do with id in the web world.
- `objectName` string - String which holds the widget's object name.
### `widget.objectName()`
Gets the property that holds the widget's object name. It calls the native method [QObject: setObjectName](https://doc.qt.io/qt-5/qobject.html#objectName-prop).
### `widget.setMouseTracking(isMouseTracked)`
Sets the property that tells whether mouseTracking is enabled for the widget. It calls the native method [QWidget: mouseTracking](https://doc.qt.io/qt-5/qwidget.html#mouseTracking-prop).
- `isMouseTracked` boolean - Set it to true to enable mouse tracking.
### `widget.setEnabled(enabled)`
Sets the property that tells whether the widget is enabled. It calls the native method [QWidget: enabled](https://doc.qt.io/qt-5/qwidget.html#enabled-prop). In general an enabled widget handles keyboard and mouse events; a disabled widget does not.
- `enabled` boolean - Set it to true to enable the widget.
### `widget.setFixedSize(width, height)`
Sets both the minimum and maximum sizes of the widget. It calls the native method [QWidget: setFixedSize](https://doc.qt.io/qt-5/qwidget.html#setFixedSize).
- `width` number - Pixels.
- `height` number - Pixels.
### `widget.setGeometry(x, y, width, height)`
Sets the screen position as well as size of the widget. It calls the native method [QWidget: setGeometry](https://doc.qt.io/qt-5/qwidget.html#setGeometry-1).
- `x` number - Pixels.
- `y` number - Pixels.
- `width` number - Pixels.
- `height` number - Pixels.
### `widget.setMaximumSize(width, height)`
Sets the maximum size of the widget. It calls the native method [QWidget: setMaximumSize](https://doc.qt.io/qt-5/qwidget.html#setMaximumSize-1).
- `width` number - Pixels.
- `height` number - Pixels.
### `widget.setMinimumSize(width, height)`
Sets the minimum size of the widget. It calls the native method [QWidget: setMinimumSize](https://doc.qt.io/qt-5/qwidget.html#setMinimumSize-1).
- `width` number - Pixels.
- `height` number - Pixels.
### `widget.repaint()`
Repaints the widget. It calls the native method [QWidget: repaint](https://doc.qt.io/qt-5/qwidget.html#repaint).
### `widget.update()`
Updates the widget. It calls the native method [QWidget: update](https://doc.qt.io/qt-5/qwidget.html#update).
### `widget.pos()`
Returns the current widget position. It calls the native method [QWidget: pos](https://doc.qt.io/qt-5/qwidget.html#pos-prop). The returned size object contains x and y coordinates in pixels.
### `widget.size()`
Returns the current widget size. It calls the native method [QWidget: size](https://doc.qt.io/qt-5/qwidget.html#size-prop). The returned size object contains width and height in pixels.
### `widget.updateGeometry()`
Notifies the layout system that this widget has changed and may need to change geometry.
### `widget.setAttribute(attributeName, switchOn)`
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute. It calls the native method [QWidget: setAttribute](https://doc.qt.io/qt-5/qwidget.html#setAttribute).
- `attributeName` WidgetAttribute - Enum from WidgetAttribute.
- `switchOn` boolean - set it to true if you want to enable an attribute.
### `widget.testAttribute(attributeName)`
Returns true if attribute attribute is set on this widget; otherwise returns false. It calls the native method [QWidget: testAttribute](https://doc.qt.io/qt-5/qwidget.html#testAttribute).
- `attributeName` WidgetAttribute - Enum from WidgetAttribute.
#### `widget.inherits(className)`
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. A class is considered to inherit itself. Example:
```ts
const progressBar = new QProgressBar();
progressBar.inherits("QObject"); // returns true
progressBar.inherits("QProgressBar"); // returns true
progressBar.inherits("QTabWidget"); // returns false
```
- `className` string - Name of the class to get if this widget inherits from.

View File

@ -1,38 +0,0 @@
---
sidebar_label: QAbstractScrollArea
title: QAbstractScrollArea
---
> Abstract class to add functionalities common to all scrollarea based widgets.
**This class implements all methods, properties of Qt's [QAbstractScrollArea class](https://doc.qt.io/qt-5/qabstractscrollarea.html) so that it can be inherited by all scroll based widgets**
`QAbstractScrollArea` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all scrollable widget's easily. If you wish to create a scrollarea use [QScrollArea](api/QScrollArea.md) instead.
**QAbstractScrollArea is the base class for all widgets. It inherits from another abstract class [NodeWidget](api/NodeWidget.md)**
QAbstractScrollArea will list all methods and properties that are common to all scrollable widgets in the NodeGui world.
## Static Methods
QAbstractScrollArea can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QAbstractScrollArea can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QAbstractScrollArea can access all the instance methods defined in [NodeWidget](api/NodeWidget.md)
Additionally it also has the following instance methods:
### `widget.setViewport(widget)`
Sets the viewport to be the given widget. It calls the native method [QAbstractScrollArea: setViewport](https://doc.qt.io/qt-5/qabstractscrollarea.html#setViewport).
- `widget` NodeWidget.
### `widget.viewport()`
Returns the viewport widget (NodeWidget). It calls the native method [QAbstractScrollArea: viewport](https://doc.qt.io/qt-5/qabstractscrollarea.html#viewport).

View File

@ -1,70 +0,0 @@
---
sidebar_label: QAbstractSlider
title: QAbstractSlider
---
> Abstract class to add functionalities common to all slider based widgets.
**This class implements all methods, properties of Qt's [QAbstractSlider class](https://doc.qt.io/qt-5/qabstractslider.html) so that it can be inherited by all slider based widgets**
`QAbstractSlider` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all slider widget's easily. If you wish to create a slider use [QDial](api/QDial.md) instead.
**QAbstractSlider is the base class for all widgets. It inherits from another abstract class [NodeWidget](api/NodeWidget.md)**
QAbstractSlider will list all methods and properties that are common to all slider widgets in the NodeGui world.
## Static Methods
QAbstractSlider can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QAbstractSlider can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QAbstractSlider can access all the instance methods defined in [NodeWidget](api/NodeWidget.md)
Additionally it also has the following instance methods:
### `widget.setSingleStep(step)`
Sets the step value for user arrow key slider interaction. It calls the native method [QAbstractSlider: setSingleStep](https://doc.qt.io/qt-5/qabstractslider.html#singleStep-prop).
- `step` number - Specified single step value.
### `widget.setMaximum(maximum)`
Sets the maximum value for slider. It calls the native method [QAbstractSlider: setMaximum](https://doc.qt.io/qt-5/qabstractslider.html#maximum-prop).
- `maximum` number - Specified maximum slider value.
### `widget.setMinimum(minimum)`
Sets the minimum value for slider. It calls the native method [QAbstractSlider: setMinimum](https://doc.qt.io/qt-5/qabstractslider.html#minimum-prop).
- `minimum` number - Specified minimum slider value.
### `widget.setValue(value)`
Sets the current value for slider. It calls the native method [QAbstractSlider: setValue](https://doc.qt.io/qt-5/qabstractslider.html#value-prop).
- `value` number - Specified current slider value.
### `widget.setOrientation(orientation)`
Sets the current orientation for slider. It calls the native method [QAbstractSlider: setOrientation](https://doc.qt.io/qt-5/qabstractslider.html#orientation-prop).
- `orientation` Orientation - Specifies visual orientation of the slider. [Orientation is an enum from Qt](api/QtEnums.md)
### `slider.maximum()`
Returns the maximum value (Number) of the slider. It calls the native method [QAbstractSlider: maximum](https://doc.qt.io/qt-5/qabstractslider.html#maximum-prop).
### `slider.minimum()`
Returns the minimum value (Number) of the slider. It calls the native method [QAbstractSlider: minimum](https://doc.qt.io/qt-5/qabstractslider.html#minimum-prop).
### `slider.value()`
Returns the current value (Number) of the slider. It calls the native method [QAbstractSlider: value](https://doc.qt.io/qt-5/qabstractslider.html#value-prop).

View File

@ -1,119 +0,0 @@
---
sidebar_label: QAction
title: QAction
---
> The QAction class provides an abstract user interface action that can be inserted into widgets.
**This class is a JS wrapper around Qt's [QAction class](https://doc.qt.io/qt-5/qaction.html)**
**QAction inherits from [EventWidget](api/EventWidget.md)**
### Example
```javascript
const { QAction, QMenu } = require("@nodegui/nodegui");
const menu = new QMenu();
const menuAction = new QAction();
menuAction.setText("subAction");
menuAction.addEventListener("triggered", () => {
console.log("Action clicked");
});
menu.addAction(menuAction);
```
### `new QAction(parent?)`
- `parent` NodeWidget. Constructs an action with parent. If parent is an action group the action will be automatically inserted into the group.
## Static Methods
QAction can access all the static methods defined in [EventWidget](api/EventWidget.md)
## Instance Properties
QAction can access all the instance properties defined in [EventWidget](api/EventWidget.md)
## Instance Methods
QAction can access all the instance methods defined in [EventWidget](api/EventWidget.md). Additionally it also has the following instance methods:
### `action.setEnabled(enabled)`
This property holds whether the action is enabled. It calls the native method [QAction: setEnabled](https://doc.qt.io/qt-5/qaction.html#enabled-prop).
- `enabled` - Boolean
### `action.setText(on)`
This property holds the action's descriptive text. It calls the native method [QAction: setText](https://doc.qt.io/qt-5/qaction.html#text-prop).
- `text` - string
### `action.setIcon(icon)`
Sets the icon of action. It calls the native method [QAction: setIcon](https://doc.qt.io/qt-5/qaction.html#icon-prop).
- `icon` [QIcon](api/QIcon.md)
### `action.setMenu(menu)`
Sets the menu contained by this action to the specified menu. It calls the native method [QAction: setMenu](https://doc.qt.io/qt-5/qaction.html#setMenu).
- `menu` [QMenu](api/QMenu.md)
### `action.setShortcut(keySequence)`
This property holds the action's key sequence. It calls the native method [QAction: setShortcut](https://doc.qt.io/qt-5/qaction.html#shortcut-prop).
- `keySequence` [QKeySequence](api/QKeySequence.md)
### `action.setShortcutContext(contextEnum)`
This property holds the context in which the action is valid. It calls the native method [QAction: setShortcutContext](https://doc.qt.io/qt-5/qaction.html#shortcutContext-prop).
- `contextEnum` - ShortcutContext enum.
### `action.isCheckable()`
Returns true if this action has been marked as checkable. It calls the native method [QAction: isCheckable](https://doc.qt.io/qt-5/qaction.html#checkable-prop).
### `action.setCheckable(isCheckable)`
Indicate that this action is checkable.
A checkable action is one which has an on/off state. For example, in a word processor, a Bold toolbar button may be either on or off. An action which is not a toggle action is a command action; a command action is simply executed, e.g. file save. By default, this property is `false`.
It calls the native method [QAction: setCheckable](https://doc.qt.io/qt-5/qaction.html#checkable-prop).
- `isCheckable`: boolean
### `action.isChecked()`
Returns true if this action has been marked as checked. It calls the native method [QAction: isChecked](https://doc.qt.io/qt-5/qaction.html#checked-prop).
### `action.setChecked(isChecked)`
Indicate that this action is checked.
Only checkable actions can be checked. By default, this is false (the action is unchecked).
It calls the native method [QAction: setChecked](https://doc.qt.io/qt-5/qaction.html#checkable-prop).
- `isChecked`: boolean
### `action.isSeparator()`
Returns `true` if this action is a separator action; otherwise it returns `false`. It calls the native method [QAction: isSeparator](https://doc.qt.io/qt-5/qaction.html#isSeparator).
### `action.setSeparator(isSeparator)`
If `isSeparator` is `true` then this action will be considered a separator.
How a separator is represented depends on the widget it is inserted into. Under most circumstances the text, submenu, and icon will be ignored for separator actions.
It calls the native method [QAction: setSeparator](https://doc.qt.io/qt-5/qaction.html#setSeparator).
- `isSeparator`: boolean

View File

@ -1,63 +0,0 @@
---
sidebar_label: QApplication
title: QApplication
---
> QApplication is the root object for the entire application. It manages app level settings.
**This class is a JS wrapper around Qt's [QApplication class](https://doc.qt.io/qt-5/qapplication.html)**
The QApplication class manages the GUI application's control flow and main settings. In NodeGui you will never create an instance of it manually. NodeGui's internal runtime `Qode` does it for you on app start. You can access the initialised QApplication though if needed.
**QApplication inherits from [Component](api/Component.md)**
### Example
```js
const { QApplication } = require("@nodegui/nodegui");
const qApp = QApplication.instance();
qApp.quit();
```
## Static Methods
QApplication can access all the static methods defined in [Component](api/Component.md). Additionally it also has the following static methods.
### `QApplication.instance()`
Returns the already initialised QApplication instance. It calls the native method [QApplication: instance](https://doc.qt.io/qt-5/qcoreapplication.html#instance).
### `QApplication.clipboard()`
Returns the object for interacting with the clipboard. It calls the native method [QApplication: clipboard](https://doc.qt.io/qt-5/qguiapplication.html#clipboard). See QClipboard.
## Instance Properties
QApplication can access all the instance properties defined in [Component](api/Component.md)
## Instance Methods
QApplication can access all the instance methods defined in [Component](api/Component.md). Additionally it also has the following instance methods:
### `qApp.quit()`
Quits the entire app. It calls the native method [QApplication: quit](https://doc.qt.io/qt-5/qcoreapplication.html#quit).
### `qApp.exit(returnCode)`
Tells the application to exit with a return code. It calls the native method [QApplication: exit](https://doc.qt.io/qt-5/qcoreapplication.html#exit).
- `returnCode` number - The exit code while quitting the app.
### `qApp.processEvents()`
Processes all pending events for the calling thread . It calls the native method [QApplication: processEvents](https://doc.qt.io/qt-5/qcoreapplication.html#processEvents).
### `qApp.exec()`
> We will never call this method in NodeGui, since Qode will execute this function for us. It exists for experiments only.
Enters the main event loop and waits until exit() is called. Returns the value that was passed to exit() (which is 0 if exit() is called via quit()). It calls the native method [QApplication: exec](https://doc.qt.io/qt-5/qcoreapplication.html#exec).
Returns the exit code after app exits.

View File

@ -1,55 +0,0 @@
---
sidebar_label: QCheckBox
title: QCheckBox
---
> Create and control checkbox.
**This class is a JS wrapper around Qt's [QCheckBox class](https://doc.qt.io/qt-5/qcheckbox.html)**
A `QCheckBox` provides ability to add and manipulate native checkbox widgets.
**QCheckBox inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QCheckBox } = require("@nodegui/nodegui");
const checkbox = new QCheckBox();
checkbox.setText("Hello");
```
### `new QCheckBox(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QCheckBox can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QCheckBox can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QCheckBox can access all the instance methods defined in [NodeWidget](api/NodeWidget.md)
Additionally it also has the following instance methods:
### `checkbox.setText(text)`
Sets the given text to the checkbox.
- `text` string
### `checkbox.isChecked()`
returns whether the checkbox is checked or not. It calls the native method [QAbstractButton: isChecked](https://doc.qt.io/qt-5/qabstractbutton.html#checked-prop).
### `checkbox.setChecked(check)`
This property holds whether the button is checked. It calls the native method [QAbstractButton: setChecked](https://doc.qt.io/qt-5/qabstractbutton.html#checked-prop).
- `check` boolean

View File

@ -1,55 +0,0 @@
---
sidebar_label: QClipboard
title: QClipboard
---
> The QClipboard class provides access to the window system clipboard.
**This class is a JS wrapper around Qt's [QClipboard class](https://doc.qt.io/qt-5/QClipboard.html)**
**QClipboard inherits from [Component](api/Component.md)**
### Example
```javascript
const {
QClipboard,
QClipboardMode,
QApplication
} = require("@nodegui/nodegui");
const clipboard = QApplication.clipboard();
const text = clipboard.text(QClipboardMode.Clipboard);
```
## Static Methods
QClipboard can access all the static methods defined in [Component](api/Component.md)
## Instance Properties
QClipboard can access all the instance properties defined in [Component](api/Component.md)
## Instance Methods
QClipboard can access all the instance methods defined in [Component](api/Component.md). Additionally it has:
### `clipboard.clear(mode)`
Clear the clipboard contents. It calls the native method [QClipboard: clear](https://doc.qt.io/qt-5/qclipboard.html#clear).
- `mode` - This enum type is used to control which part of the system clipboard is used. See https://doc.qt.io/qt-5/qclipboard.html#Mode-enum
### `clipboard.setText(text, mode)`
Copies text into the clipboard as plain text. It calls the native method [QClipboard: setText](https://doc.qt.io/qt-5/qclipboard.html#setText).
- `text` - The text you want to copy to clipboard.
- `mode` - This enum type is used to control which part of the system clipboard is used. See https://doc.qt.io/qt-5/qclipboard.html#Mode-enum
### `clipboard.text(mode)`
Returns the clipboard text as plain text, or an empty string if the clipboard does not contain any text. It calls the native method [QClipboard: text](https://doc.qt.io/qt-5/qclipboard.html#text).
- `mode` - This enum type is used to control which part of the system clipboard is used. See https://doc.qt.io/qt-5/qclipboard.html#Mode-enum

View File

@ -1,20 +0,0 @@
---
sidebar_label: QCursor
title: QCursor
---
> The QCursor class provides scalable icons in different modes and states.
**This class is a JS wrapper around Qt's [QCursor class](https://doc.qt.io/qt-5/qcursor.html)**
### Example
```javascript
const { QCursor } = require("@nodegui/nodegui");
const cursor = new QCursor();
```
### `new QCursor(cursor)`
- `cursor` CursorShape (_optional_). Defines shape for the cursor. [CursorShape is an enum from Qt](api/QtEnums.md)

View File

@ -1,70 +0,0 @@
---
sidebar_label: QDial
title: QDial
---
> Create and control dial slider widgets.
**This class is a JS wrapper around Qt's [QDial class](https://doc.qt.io/qt-5/qdial.html)**
A `QDial` provides ability to add and manipulate native dial slider widgets.
**QDial inherits from [QAbstractSlider](api/QAbstractSlider.md)**
### Example
```javascript
const { QDial } = require("@nodegui/nodegui");
const dial = new QDial();
```
### `new QDial(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QDial can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QDial can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QDial can access all the instance methods defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance methods:
### `dial.setNotchesVisible(visible)`
Sets the visibility of notches drawn around the dial. It calls the native method [QDial: setNotchesVisible](https://doc.qt.io/qt-5/qdial.html#notchTarget-prop).
- `visible` boolean - Set the value as current notch visibility.
### `dial.setWrapping(on)`
Sets the ability to wrap arrow around the dial instead of limiting it to upper part of the dial. It calls the native method [QDial: setWrapping](https://doc.qt.io/qt-5/qdial.html#wrapping-prop).
- `on` boolean - Set the value as current wrapping setting.
### `dial.setNotchTarget(target)`
Sets the number of pixels between dial notches. It calls the native method [QDial: setNotchTarget](https://doc.qt.io/qt-5/qdial.html#notchTarget-prop).
- `target` number - Specifies number of pixels between notches.
### `dial.notchTarget()`
Returns the current number of pixels between dial notches. It calls the native method [QDial: notchTarget](https://doc.qt.io/qt-5/qdial.html#notchTarget-prop).
### `dial.notchesVisible()`
Returns the visibility status (Boolean) of dial notches. It calls the native method [QDial: notchesVisible](https://doc.qt.io/qt-5/qdial.html#notchesVisible-prop).
### `dial.notchesVisible()`
Returns the visibility status (Boolean) of dial notches. It calls the native method [QDial: notchesVisible](https://doc.qt.io/qt-5/qdial.html#notchesVisible-prop).
### `dial.wrapping()`
Returns the current wrapping (Boolean) state of the dial. It calls the native method [QDial: wrapping](https://doc.qt.io/qt-5/qdial.html#wrapping-prop).

View File

@ -1,54 +0,0 @@
---
sidebar_label: QGridLayout
title: QGridLayout
---
> The QGridLayout class lays out widgets in a grid.
**This class is a JS wrapper around Qt's [QGridLayout](https://doc.qt.io/qt-5/qgridlayout.html)**
**QGridLayout inherits from [NodeLayout](api/NodeLayout.md)**
### Example
```javascript
const { QGridLayout, QWidget, QLabel } = require("@nodegui/nodegui");
const view = new QWidget();
const layout = new QGridLayout();
view.setLayout(layout);
const label = new QLabel();
label.setText("label1");
const label2 = new QLabel();
label2.setText("label2");
layout.addWidget(label);
layout.addWidget(label2);
```
## Static Methods
QGridLayout can access all the static methods defined in [NodeLayout](api/NodeLayout.md)
## Instance Properties
QGridLayout can access all the instance properties defined in [NodeLayout](api/NodeLayout.md)
## Instance Methods
QGridLayout can access all the instance methods defined in [NodeLayout](api/NodeLayout.md)
Additionally it also has the following instance methods:
### `layout.addWidget(childWidget)`
Adds the childWidget to the layout. It calls the native method QGridLayout [QGridLayout: addWidget](https://doc.qt.io/qt-5/qwidget.html#show).
- `childWidget` NodeWidget - child widget that needs to be added to the layout.
### `layout.removeWidget(childWidget)`
Removes the childWidget from the layout. It calls the native method of custom QGridLayout. [QGridLayout: removeWidget](https://doc.qt.io/qt-5/qlayout.html#removeWidget).
- `childWidget` NodeWidget - child widget that needs to be added to the layout.

View File

@ -1,56 +0,0 @@
---
sidebar_label: QIcon
title: QIcon
---
> The QIcon class provides scalable icons in different modes and states.
**This class is a JS wrapper around Qt's [QIcon class](https://doc.qt.io/qt-5/qicon.html)**
**QIcon inherits from [Component](api/Component.md)**
### Example
```javascript
const { QIcon } = require("@nodegui/nodegui");
const imageUrl = "path/to/png";
const icon = new QIcon(imageUrl);
```
### `new QIcon(imageUrl?)`
- `imageUrl` string (_optional_). Absolute path of the image that needs to be loaded in the memory.
## Static Methods
QIcon can access all the static methods defined in [Component](api/Component.md)
## Instance Properties
QIcon can access all the instance properties defined in [Component](api/Component.md)
## Instance Methods
QIcon can access all the instance methods defined in [Component](api/Component.md)
Additionally it also has the following instance methods:
### `icon.pixmap(width, height, mode?, state?)` (v0.1.10 & up)
Returns a pixmap with the requested size, mode, and state, generating one if necessary. The pixmap might be smaller than requested, but never larger.
. It calls the native method [QIcon: pixmap](https://doc.qt.io/qt-5/qicon.html#pixmap-3).
- `width`: number,
- `height`: number
- `mode?`: QIconMode
- `state?`: QIconState
### `icon.isMask()`
Returns true if this icon has been marked as a mask image. It calls the native method [QIcon: isMask](https://doc.qt.io/qt-5/qicon.html#isMask).
### `icon.setIsMask(isMask)`
Indicate that this icon is a mask image, and hence can potentially be modified based on where it's displayed. It calls the native method [QIcon: setIsMask](https://doc.qt.io/qt-5/qicon.html#setIsMask).
- `isMask`: boolean

View File

@ -1,39 +0,0 @@
---
sidebar_label: QKeySequence
title: QKeySequence
---
> The QKeySequence class encapsulates a key sequence as used by shortcuts. .
**This class is a JS wrapper around Qt's [QKeySequence class](https://doc.qt.io/qt-5/qkeysequence.html)**
**QKeySequence inherits from [Component](api/Component.md)**
### Example
```javascript
const { QKeySequence } = require("@nodegui/nodegui");
const keySequence = new QKeySequence(`Ctrl+L`);
```
### `new QKeySequence(sequence?)`
- `sequence` string (_optional_). String representation of the key sequence. For example: `Ctrl+M`
## Static Methods
QKeySequence can access all the static methods defined in [Component](api/Component.md)
## Instance Properties
QKeySequence can access all the instance properties defined in [Component](api/Component.md)
## Instance Methods
QKeySequence can access all the instance methods defined in [Component](api/Component.md)
Additionally it also has the following instance methods:
### `keySequence.count()`
Returns the number of keys in the key sequence. The maximum is 4. It calls the native method [QKeySequence: count](https://doc.qt.io/qt-5/QKeySequence.html#count).

View File

@ -1,61 +0,0 @@
---
sidebar_label: QLabel
title: QLabel
---
> Create and control text.
**This class is a JS wrapper around Qt's [QLabel class](https://doc.qt.io/qt-5/qlabel.html)**
A `QLabel` provides ability to add and manipulate text.
**QLabel inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QLabel } = require("@nodegui/nodegui");
const label = new QLabel();
label.setText("Hello");
```
### `new QLabel(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QLabel can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QLabel can access all the instance properties defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance properties:
### `label.pixmap`
The pixmap currently set on this label.
### `label.text`
the current text set on the label.
## Instance Methods
QLabel can access all the instance methods defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance methods:
### `label.setText(text)`
Sets the given text to the label.
- `text` string
### `label.setWordWrap(on)`
- `on` boolean - If true it sets wordwrap on the label
### `label.setPixmap(pixMap)`
Images in the form of a pixmap can be set as the label content
- `pixMap` [QPixmap](api/QPixmap.md) - Allows to set image content in the form of a QPixmap on the label

View File

@ -1,74 +0,0 @@
---
sidebar_label: QLineEdit
title: QLineEdit
---
> Create and control editable text field.
**This class is a JS wrapper around Qt's [QLineEdit class](https://doc.qt.io/qt-5/qlineedit.html)**
A `QLineEdit` provides ability to add and manipulate native editable text field widgets.
**QLineEdit inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QLineEdit } = require("@nodegui/nodegui");
const lineEdit = new QLineEdit();
```
### `new QLineEdit(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QLineEdit can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QLineEdit can access all the instance properties defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance properties:
### `lineEdit.placeholderText`
The placeholder text set on the lineEdit.
## Instance Methods
QLineEdit can access all the instance methods defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance methods:
### `lineEdit.setText(text)`
Sets the given text to the lineEdit.
- `text` string
### `lineEdit.setPlaceholderText(text)`
Sets the given text to the lineEdit's placeholder.
- `text` string
### `lineEdit.text()`
Returns the currently set text from native lineEdit widget.
### `lineEdit.setReadOnly(isReadOnly)`
Sets the lineEdit to be read only. lineEdit property holds whether the line edit is read only.
- `isReadOnly` boolean
### `lineEdit.setEchoMode(echoMode)`
Sets the property that determines how the text entered in the line edit is displayed (or echoed) to the user.
The widget's display and the ability to copy or drag the text is affected by this setting.
- `echoMode` EchoMode
### `lineEdit.clear()`
Clears the lineEdit.

View File

@ -1,72 +0,0 @@
---
sidebar_label: QMainWindow
title: QMainWindow
---
> Create and control windows.
**This class is a JS wrapper around Qt's [QMainWindow class](https://doc.qt.io/qt-5/qmainwindow.html)**
A `QMainWindow` provides a main application window. Every widget in NodeGui should be a child/nested child of QMainWindow. QMainWindow in NodeGui is also responsible for FlexLayout calculations of its children.
**QMainWindow inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QMainWindow, QWidget } = require("@nodegui/nodegui");
const win = new QMainWindow();
const centralWidget = new QWidget();
win.setCentralWidget(centralWidget);
win.show();
global.win = win; // prevent's gc of win
```
QMainWindow needs to have a central widget set before other widgets can be added as a children/nested children.
Once a central widget is set you can add children/layout to the central widget.
## Static Methods
QMainWindow can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QMainWindow can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
Additionally it also has the following instance properties:
### `win.layout`
A `NodeLayout` representing current layout that is set on the window. If a centralWidget is set then the layout of central widget is returned.
### `win.centralWidget`
A `NodeWidget` representing currently set central widget on the window.
## Instance Methods
QMainWindow can access all the instance methods defined in [NodeWidget](api/NodeWidget.md)
Additionally it also has the following instance methods:
### `win.setCentralWidget(widget)`
Sets the given widget to be the main window's central widget.
- `widget` NodeWidget - Any widget that inherits from NodeWidget class.
### `win.setMenuBar(menuBar)`
Sets the given menuBar to be the window's menubar widget.
- `menuBar` [QMenuBar](api/QMenuBar)
### `win.setMenuWidget(menuWidget)`
Sets the given widget to be the window's menubar widget.
- `menuWidget` NodeWidget

View File

@ -1,46 +0,0 @@
---
sidebar_label: QMenu
title: QMenu
---
> The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
**This class is a JS wrapper around Qt's [QMenu class](https://doc.qt.io/qt-5/qmenu.html)**
**QMenu inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QMenu } = require("@nodegui/nodegui");
const menu = new QMenu();
```
### `new QMenu(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QMenu can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QMenu can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QMenu can access all the instance methods defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance methods:
### `menu.setTitle(title)`
This property holds the title of the menu. It calls the native method [QMenu: setTitle](https://doc.qt.io/qt-5/qmenu.html#title-prop).
- `title` string
### `menu.addAction(action)`
Appends the action action to this widget's list of actions. It calls the native method [QMenu: addAction](https://doc.qt.io/qt-5/qwidget.html#addAction).
- `action` [QAction](api/QAction).

View File

@ -1,50 +0,0 @@
---
sidebar_label: QMenuBar
title: QMenuBar
---
> The QMenuBar class provides a menu widget for use in menu bars, context menus, and other popup menus.
**This class is a JS wrapper around Qt's [QMenuBar class](https://doc.qt.io/qt-5/qmenu.html)**
**QMenuBar inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QMenuBar, QMainWindow } = require("@nodegui/nodegui");
const win = new QMainWindow();
const menu = new QMenuBar();
const menuBar = new QMenuBar();
win.setMenuBar(menuBar);
win.show();
global.win = win;
```
### `new QMenuBar(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QMenuBar can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QMenuBar can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QMenuBar can access all the instance methods defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance methods:
### `menu.addMenu(menu)`
Appends menu to the menu bar. It calls the native method [QMenuBar: addMenu](https://doc.qt.io/qt-5/qmenubar.html#addMenu).
- `menu` [QMenu](api/QMenu).
### `menu.setNativeMenuBar(nativeMenuBar)`
This property holds whether or not a menubar will be used as a native menubar on platforms that support it. It calls the native method [QMenuBar: setNativeMenuBar](https://doc.qt.io/qt-5/qmenubar.html#nativeMenuBar-prop).
- `nativeMenuBar` Boolean.

View File

@ -1,66 +0,0 @@
---
sidebar_label: QPixmap
title: QPixmap
---
> The QPixmap class helps hold an image in the form of off-screen image representation.
**This class is a JS wrapper around Qt's [QPixmap class](https://doc.qt.io/qt-5/qpixmap.html)**
A `QPixmap` provides ability to store an image in the memory.
**QPixmap inherits from [Component](api/Component.md)**
### Example
```javascript
const { QPixmap } = require("@nodegui/nodegui");
const imageUrl = "path/to/png";
const pixMap = new QPixmap(imageUrl);
```
### `new QPixmap(imageUrl?)`
- `imageUrl` string (_optional_). Absolute path of the image that needs to be loaded in the memory.
## Static Methods
QPixmap can access all the static methods defined in [Component](api/Component.md)
## Instance Properties
QPixmap can access all the instance properties defined in [Component](api/Component.md)
## Instance Methods
QPixmap can access all the instance methods defined in [Component](api/Component.md)
Additionally it also has the following instance methods:
### `pixMap.load(imageUrl)`
loads an image from the url into memory as a Pixmap.
returns true if load was successful otherwise returns false.
- `imageUrl` string (_optional_). Absolute path of the image that needs to be loaded in the memory.
#### `pixMap.save(fileName, format)`
Saves the pixmap to the file with the given fileName using the specified image file format and quality factor. Returns `true` if successful; otherwise returns false.
If format is 0, an image format will be chosen from fileName's suffix.
See also [Reading and Writing Image Files.](https://doc.qt.io/qt-5/qpixmap.html#reading-and-writing-image-files).
- `fileName` string.
- `format` string. (_optional_).
#### `pixMap.scaled(width, height, aspectRatioMode?)`
Scales the pixmap to provided height and width with respect to aspectRatioMode.
This method doesnt mutate this pixmap and rather returns a new pixmap with new height and width.
- `width` number. Width in pixels for new pixmap.
- `height` number. Height in pixels for new pixmap.
- `aspectRatioMode` AspectRatioMode (_optional_). Specifies how scaling should happen. [AspectRatio is an enum from Qt](api/QtEnums.md)

View File

@ -1,84 +0,0 @@
---
sidebar_label: QPlainTextEdit
title: QPlainTextEdit
---
> Used to edit and display plain text.
**This class is a JS wrapper around Qt's [QPlainTextEdit class](https://doc.qt.io/qt-5/qplaintextedit.html)**
A `QPlainTextEdit` provides ability to add and manipulate native editable text field widgets.
**QPlainTextEdit inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QPlainTextEdit } = require("@nodegui/nodegui");
const plainTextEdit = new QPlainTextEdit();
```
### `new QPlainTextEdit(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QPlainTextEdit can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QPlainTextEdit can access all the instance properties defined in [NodeWidget](api/NodeWidget.md).
### `plainTextEdit.placeholderText`
The placeholder text set on the plainTextEdit.
## Instance Methods
QPlainTextEdit can access all the instance methods defined in [NodeWidget](api/NodeWidget.md).
### `plainTextEdit.setPlainText(text)`
Sets the given text to the plainTextEdit. It calls the native method [QPlainTextEdit: setPlainText](https://doc.qt.io/qt-5/qplaintextedit.html#setPlainText).
- `text` string
### `plainTextEdit.setPlaceholderText(text)`
Sets the given text to the plainTextEdit's placeholder.
- `text` string
### `plainTextEdit.toPlainText()`
Returns the text of the text edit as plain text. [QPlainTextEdit: toPlainText](https://doc.qt.io/qt-5/qplaintextedit.html#toPlainText).
### `plainTextEdit.setReadOnly(isReadOnly)`
Sets the plainTextEdit to be read only. [QPlainTextEdit: isReadOnly](https://doc.qt.io/qt-5/qplaintextedit.html#readOnly-prop).
### `plainTextEdit.clear()`
Deletes all the text in the text edit.[QPlainTextEdit: clear](https://doc.qt.io/qt-5/qplaintextedit.html#clear).
### `plainTextEdit.setWordWrapMode(mode)`
This property holds the mode QPlainTextEdit will use when wrapping text by words.[QPlainTextEdit: setWordWrapMode](https://doc.qt.io/qt-5/qplaintextedit.html#wordWrapMode-prop).
- mode: QTextOptionWrapMode
### `plainTextEdit.wordWrapMode()`
returns word wrap mode. [QPlainTextEdit: wordWrapMode](https://doc.qt.io/qt-5/qplaintextedit.html#wordWrapMode-prop).
### `plainTextEdit.setLineWrapMode(mode)`
This property holds the line wrap mode. [QPlainTextEdit: setLineWrapMode](https://doc.qt.io/qt-5/qplaintextedit.html#lineWrapMode-prop).
- mode: LineWrapMode
### `plainTextEdit.lineWrapMode()`
returns line wrap mode. [QPlainTextEdit: setLineWrapMode](https://doc.qt.io/qt-5/qplaintextedit.html#lineWrapMode-prop).

View File

@ -1,64 +0,0 @@
---
sidebar_label: QProgressBar
title: QProgressBar
---
> Create and control progress bar widgets.
**This class is a JS wrapper around Qt's [QProgressBar class](https://doc.qt.io/qt-5/qprogressbar.html)**
A `QProgressBar` provides ability to add and manipulate native progress bar widgets.
**QProgressBar inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QProgressBar } = require("@nodegui/nodegui");
const progressBar = new QProgressBar();
```
### `new QProgressBar(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QProgressBar can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QProgressBar can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QProgressBar can access all the instance methods defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance methods:
### `progressBar.setValue(value)`
Sets the current value of the progressBar. It calls the native method [QProgressBar: setValue](https://doc.qt.io/qt-5/qprogressbar.html#value-prop).
- `value` number - Set the value as current value
### `progressBar.setMaximum(max)`
Sets the max value of the progressBar. It calls the native method [QProgressBar: setMaximum](https://doc.qt.io/qt-5/qprogressbar.html#maximum-prop).
- `max` number - Set the value as max value of the progress bar.
### `progressBar.setMinimum(min)`
Sets the min value of the progressBar. It calls the native method [QProgressBar: setMinimum](https://doc.qt.io/qt-5/qprogressbar.html#minimum-prop).
- `min` number - Set the value as min value of the progress bar.
### `progressBar.setOrientation(orientation)`
Sets the orientation of the progressBar. It calls the native method [QProgressBar: setOrientation](https://doc.qt.io/qt-5/qprogressbar.html#orientation-prop).
- `orientation` Orientation - Specifies visual orientation of the progress bar. [Orientation is an enum from Qt](api/QtEnums.md)
### `progressBar.value()`
Returns the current value (Number) of the progressBar. It calls the native method [QProgressBar: value](https://doc.qt.io/qt-5/qprogressbar.html#value-prop).

View File

@ -1,57 +0,0 @@
---
sidebar_label: QPushButton
title: QPushButton
---
> Create and control buttons.
**This class is a JS wrapper around Qt's [QPushButton class](https://doc.qt.io/qt-5/qpushbutton.html)**
A `QPushButton` provides ability to add and manipulate native button widgets.
**QPushButton inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QPushButton } = require("@nodegui/nodegui");
const button = new QPushButton();
button.setText("Hello");
```
### `new QPushButton(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QPushButton can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QPushButton can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QPushButton can access all the instance methods defined in [NodeWidget](api/NodeWidget.md)
Additionally it also has the following instance methods:
### `button.setText(text)`
Sets the given text to the button.
- `text` string
### `button.setFlat(isFlat)`
Sets whether the button border is raised.
- `isFlat` boolean
### `button.setIcon(icon)`
Sets an icon in the button.
- `icon` QIcon

View File

@ -1,45 +0,0 @@
---
sidebar_label: QRadioButton
title: QRadioButton
---
> Create and control radio button.
**This class is a JS wrapper around Qt's [QRadioButton class](https://doc.qt.io/qt-5/qradiobutton.html)**
A `QRadioButton` provides ability to add and manipulate native radio button widgets.
**QRadioButton inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QRadioButton } = require("@nodegui/nodegui");
const radioButton = new QRadioButton();
radioButton.setText("Hello");
```
### `new QRadioButton(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QRadioButton can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QRadioButton can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QRadioButton can access all the instance methods defined in [NodeWidget](api/NodeWidget.md)
Additionally it also has the following instance methods:
### `radioButton.setText(text)`
Sets the given text to the radioButton.
- `text` string

View File

@ -1,49 +0,0 @@
---
sidebar_label: QScrollArea
title: QScrollArea
---
> A `QScrollArea` provides a scrolling view onto another widget.
**This class is a JS wrapper around Qt's [QScrollArea class](https://doc.qt.io/qt-5/qscrollarea.html)**
**QScrollArea inherits from [QAbstractScrollArea](api/QAbstractScrollArea.md)**
### Example
```javascript
const { QScrollArea } = require("@nodegui/nodegui");
const scrollArea = new QScrollArea();
scrollArea.setInlineStyle("flex: 1; width:'100%';");
const imageLabel = new QLabel();
const pixmap = new QPixmap(
path.resolve(__dirname, "../extras/assets/kitchen.png")
);
imageLabel.setPixmap(pixmap);
scrollArea.setWidget(imageLabel);
```
### `new QScrollArea(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QScrollArea can access all the static methods defined in [QAbstractScrollArea](api/QAbstractScrollArea.md)
## Instance Properties
QScrollArea can access all the instance properties defined in [QAbstractScrollArea](api/QAbstractScrollArea.md)
## Instance Methods
QScrollArea can access all the instance methods defined in [QAbstractScrollArea](api/QAbstractScrollArea.md). Additionally it also has the following instance methods:
### `scrollArea.setWidget(widget)`
Sets the scroll area's widget. It calls the native method [QScrollArea: setWidget](https://doc.qt.io/qt-5/qscrollarea.html#setWidget).
- `widget` NodeWidget - Any widget you want to enclose in a scroll area.

View File

@ -1,68 +0,0 @@
---
sidebar_label: QShortcut
title: QShortcut
---
> The QShortcut class is used to create keyboard shortcuts.
**This class is a JS wrapper around Qt's [QShortcut class](https://doc.qt.io/qt-5/qshortcut.html)**
**QShortcut inherits from [EventWidget](api/EventWidget.md)**
### Example
```javascript
const { QShortcut, QKeySequence, QMainWindow } = require("@nodegui/nodegui");
const win = new QMainWindow();
const shortcut = new QShortcut(win);
shortcut.setKey(new QKeySequence("Ctrl+M"));
shortcut.setEnabled(true);
shortcut.addEventListener(QShortcutEvents.activated, () => {
console.log("Shortcut Activated");
});
win.show();
global.win = win;
global.shortcut = shortcut;
```
### `new QShortcut(parent)`
- `parent` NodeWidget. Any widget inheriting from NodeWidget can be passed as a parent. This will make this shortcut bind to the parent widget.
## Static Methods
QShortcut can access all the static methods defined in [EventWidget](api/EventWidget.md)
## Instance Properties
QShortcut can access all the instance properties defined in [EventWidget](api/EventWidget.md)
## Instance Methods
QShortcut can access all the instance methods defined in [EventWidget](api/EventWidget.md). Additionally it also has the following instance methods:
### `shortcut.setEnabled(enabled)`
This property holds whether the shortcut is enabled. It calls the native method [QShortcut: setEnabled](https://doc.qt.io/qt-5/qshortcut.html#enabled-prop).
- `enabled` - Boolean
### `shortcut.setAutoRepeat(on)`
This property holds whether the shortcut can auto repeat. It calls the native method [QShortcut: setAutoRepeat](https://doc.qt.io/qt-5/qshortcut.html#autoRepeat-prop).
- `on` - Boolean
### `shortcut.setKey(keySequence)`
This property holds the shortcut's key sequence. It calls the native method [QShortcut: setKey](https://doc.qt.io/qt-5/qshortcut.html#key-prop).
- `keySequence` [QKeySequence](api/QKeySequence.md)
### `shortcut.setContext(contextEnum)`
This property holds the context in which the shortcut is valid. It calls the native method [QShortcut: setContext](https://doc.qt.io/qt-5/qshortcut.html#context-prop).
- `contextEnum` - ShortcutContext enum.

View File

@ -1,82 +0,0 @@
---
sidebar_label: QSpinBox
title: QSpinBox
---
> Create and control spin box widgets.
**This class is a JS wrapper around Qt's [QSpinBox class](https://doc.qt.io/qt-5/qspinbox.html)**
A `QSpinBox` provides ability to add and manipulate native spin box widgets.
**QSpinBox inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QSpinBox } = require("@nodegui/nodegui");
const spinBox = new QSpinBox();
```
### `new QSpinBox(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QSpinBox can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QSpinBox can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QSpinBox can access all the instance methods defined in [NodeWidget](api/NodeWidget.md). Additionally it also has the following instance methods:
### `spinBox.setValue(val)`
Sets the current value of the spinBox. It calls the native method [QSpinBox: setValue](https://doc.qt.io/qt-5/qspinbox.html#value-prop).
- `val` number - Set the value as current value
### `spinBox.setRange(minimum, maximum)`
Sets the min/max value of the spinBox. It calls the native method [QSpinBox: setRange](https://doc.qt.io/qt-5/qspinbox.html#setRange).
- `max` number - Set the value as max value of the progress bar.
### `spinBox.setPrefix(prefix)`
Sets the prefix of the spinBox. It calls the native method [QSpinBox: setPrefix](https://doc.qt.io/qt-5/qspinbox.html#prefix-prop).
- `prefix` string - Specifies prefix content shows before the spinBox value. [Prefix is an enum from Qt](api/QtEnums.md)
### `spinBox.setSuffix(suffix)`
Sets the suffix of the spinBox. It calls the native method [QSpinBox: setSuffix](https://doc.qt.io/qt-5/qspinbox.html#suffix-prop).
- `suffix` string - Specifies suffix content shows after the spinBox value. [Suffix is an enum from Qt](api/QtEnums.md)
### `spinBox.setSingleStep(val)`
Sets the single step value of the spinBox. It calls the native method [QSpinBox: setSingleStep](https://doc.qt.io/qt-5/qspinbox.html#singleStep-prop).
- `val` number - Specifies amount value changes with each step. [Suffix is an enum from Qt](api/QtEnums.md)
### `spinBox.cleanText()`
Returns the text content (String) of the spinBox excluding any prefix, suffix, or leading or trailing whitespace. It calls the native method [QSpinBox: value](https://doc.qt.io/qt-5/qspinbox.html#minimum-prop).
### `spinBox.minimum()`
Returns the minimum value (Number) of the spinBox. It calls the native method [QSpinBox: value](https://doc.qt.io/qt-5/qspinbox.html#minimum-prop).
### `spinBox.maximum()`
Returns the maximum value (Number) of the spinBox. It calls the native method [QSpinBox: value](https://doc.qt.io/qt-5/qspinbox.html#maximum-prop).
### `spinBox.value()`
Returns the current value (Number) of the spinBox. It calls the native method [QSpinBox: value](https://doc.qt.io/qt-5/qspinbox.html#value-prop).

View File

@ -1,71 +0,0 @@
---
sidebar_label: QSystemTrayIcon
title: QSystemTrayIcon
---
> Create and control system tray icon.
**This class is a JS wrapper around Qt's [QSystemTrayIcon class](https://doc.qt.io/qt-5/qsystemtrayicon.html)**
A `QSystemTrayIcon` provides ability to add and manipulate native system tray icon.
**QSystemTrayIcon inherits from [EventWidget](api/EventWidget.md)**
### Example
```javascript
const { QSystemTrayIcon, QIcon } = require("@nodegui/nodegui");
const trayIcon = new QIcon(
resolve(__dirname, "some/image/file.png");
);
const tray = new QSystemTrayIcon();
tray.show();
global.tray = tray; // prevents garbage collection of tray
```
### `new QSystemTrayIcon(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QSystemTrayIcon can access all the static methods defined in [EventWidget](api/EventWidget.md)
## Instance Properties
QSystemTrayIcon can access all the instance properties defined in [EventWidget](api/EventWidget.md)
## Instance Methods
QSystemTrayIcon can access all the instance methods defined in [EventWidget](api/EventWidget.md). Additionally it also has the following instance methods:
### `trayIcon.show()`
Shows the icon in the system tray icon. It calls the native method [QSystemTrayIcon: show](https://doc.qt.io/qt-5/qsystemtrayicon.html#show).
### `trayIcon.hide()`
Hides the system tray icon. It calls the native method [QSystemTrayIcon: hide](https://doc.qt.io/qt-5/qsystemtrayicon.html#hide).
### `trayIcon.setIcon(icon)`
Sets the icon of system tray. It calls the native method [QSystemTrayIcon: setIcon](https://doc.qt.io/qt-5/qsystemtrayicon.html#icon-prop).
- `icon` [QIcon](api/QIcon.md)
### `trayIcon.isVisible()`
Returns the visibility of icon. It calls the native method [QSystemTrayIcon: setIcon](https://doc.qt.io/qt-5/qsystemtrayicon.html#visible-prop).
### `trayIcon.setToolTip(toolTip)`
Sets the tooltip of system tray. It calls the native method [QSystemTrayIcon: setToolTip](https://doc.qt.io/qt-5/qsystemtrayicon.html#toolTip-prop).
- `toolTip` string.
### `trayIcon.setContextMenu(contextMenu)`
Sets the specified menu to be the context menu for the system tray icon. It calls the native method [QSystemTrayIcon: setIcon](https://doc.qt.io/qt-5/qsystemtrayicon.html#setContextMenu).
- `contextMenu` [QMenu](api/QMenu.md)

View File

@ -1,6 +0,0 @@
---
sidebar_label: QTabWidget
title: QTabWidget
---
Will be available from NodeGUI v0.1.10 and up

View File

@ -1,38 +0,0 @@
---
sidebar_label: QWidget
title: QWidget
---
> Create and control views.
**This class is a JS wrapper around Qt's [QWidget class](https://doc.qt.io/qt-5/qwidget.html)**
A `QWidget` can be used to encapsulate other widgets and provide structure. It functions similar to a `div` in the web world.
**QWidget inherits from [NodeWidget](api/NodeWidget.md)**
### Example
```javascript
const { QWidget } = require("@nodegui/nodegui");
const view = new QWidget();
view.setObjectName("container"); //Similar to setting `id` on the web
view.setLayout(new FlexLayout());
```
### `new QWidget(parent?)`
- `parent` NodeWidget (_optional_). Any widget inheriting from NodeWidget can be passed as a parent. This will make this widget, the child of the parent widget.
## Static Methods
QWidget can access all the static methods defined in [NodeWidget](api/NodeWidget.md)
## Instance Properties
QWidget can access all the instance properties defined in [NodeWidget](api/NodeWidget.md)
## Instance Methods
QWidget can access all the instance methods defined in [NodeWidget](api/NodeWidget.md)

View File

@ -1,18 +0,0 @@
---
sidebar_label: Qt Enums
title: Qt Enums
---
## Enums from Qt
For a complete list of Enums that we can use from Javascript see file
Qt enums: [`src/lib/QtEnums/index.ts`](https://github.com/nodegui/nodegui/blob/master/src/lib/QtEnums/index.ts) in the NodeGui repo.
All the enums in this file can be imported directly from `@nodegui/@nodegui`.
### Example
```js
import { AspectRatioMode } from "@nodegui/nodegui";
```

View File

@ -1,40 +0,0 @@
---
sidebar_label: YogaWidget
title: YogaWidget
---
> Abstract class to add common functionality related to Flex layout to all Widgets.
**This class implements methods related to flex layout required to be present in all widgets**
`YogaWidget` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities related to flex layout to all widget's easily. We implement flex layout using a library called [Yoga](https://github.com/facebook/yoga). As part of yoga every widget needs to store its own flex properties such as alignItems, flexDirection etc. This is done with the help of YogaWidget.
**YogaWidget is the base class for EventWidget which means all widgets inherit it aswell. It inherits from another abstract class [Component](api/Component.md)**
```javascript
const { QWidget } = require("@nodegui/nodegui");
const view = new QWidget();
// getFlexNode is a method from YogaWidget
const flexNode = view.getFlexNode();
```
YogaWidget helps in storing all flex properties of a widget.
## Static Methods
YogaWidget can access all the static methods defined in [Component](api/Component.md)
## Instance Properties
YogaWidget can access all the instance properties defined in [Component](api/Component.md)
## Instance Methods
YogaWidget can access all the instance methods defined in [Component](api/Component.md)
Additionally it also has the following instance methods:
### `widget.getFlexNode()`
Returns a native reference to the flex node used in c++ instance for the widget. This is not a regular javascript object and hence no methods or properties can be accessed from it. It exists so that we pass around a widgets flex node to layouts, etc.

View File

@ -0,0 +1,100 @@
---
id: "component"
title: "Component"
sidebar_label: "Component"
---
> Abstract class that is root most base class for all widgets and layouts in the NodeGui World.
*This class is used to add core properties to all widgets, layouts etc in NodeGui world.
Currently it helps us maintain references to the native C++ instance of the widget or layout.
It also helps in preventing gc of child elements of a layout or widget**
`Component` is an abstract class and hence no instances of the same should be created.
It exists so that we can add core functionalities to all widgets and layouts easily. This is an internal class.
Its the root base class in NodeGui world.
## Hierarchy
* **Component**
↳ [QClipboard](qclipboard.md)
↳ [QStyle](qstyle.md)
↳ [QApplication](qapplication.md)
↳ [QKeySequence](qkeysequence.md)
↳ [QVariant](qvariant.md)
↳ [QPixmap](qpixmap.md)
↳ [QIcon](qicon.md)
↳ [EventWidget](eventwidget.md)
↳ [QSize](qsize.md)
↳ [QCursor](qcursor.md)
↳ [QFontDatabase](qfontdatabase.md)
↳ [QRect](qrect.md)
↳ [QTableWidgetItem](qtablewidgetitem.md)
↳ [QTreeWidgetItem](qtreewidgetitem.md)
↳ [QColor](qcolor.md)
↳ [QPoint](qpoint.md)
↳ [QPainter](qpainter.md)
↳ [QUrl](qurl.md)
## Index
### Properties
* [native](component.md#abstract-native)
* [nodeChildren](component.md#nodechildren)
* [nodeParent](component.md#optional-nodeparent)
### Methods
* [setNodeParent](component.md#setnodeparent)
## Properties
### `Abstract` native
**native**: *[NativeElement](../globals.md#nativeelement)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
## Methods
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*

View File

@ -0,0 +1,202 @@
---
id: "eventwidget"
title: "EventWidget"
sidebar_label: "EventWidget"
---
> Abstract class that adds event handling support to all widgets.
*This class implements an event emitter and merges it with Qt's event and signal system. It allows us to register and unregister event and signal listener at will from javascript**
`EventWidget` is an abstract class and hence no instances of the same should be created. It exists so that we can add event handling functionalities to all widget's easily. This is an internal class.
### Example
```javascript
const { QWidget, QWidgetSignals, WidgetEventTypes } = require("@nodegui/nodegui");
const view = new QWidget();
// You either listen for a widget's signal
view.addEventListener('windowTitleChanged', () => {
console.log("window title changed");
});
// or you can listen for an event
view.addEventListener(WidgetEventTypes.MouseMove, () => {
console.log("mouse moved");
});
```
## Type parameters
**Signals**: *__type*
## Hierarchy
* [Component](component.md)
↳ **EventWidget**
↳ [NodeObject](nodeobject.md)
## Index
### Constructors
* [constructor](eventwidget.md#constructor)
### Properties
* [native](eventwidget.md#abstract-native)
* [nodeChildren](eventwidget.md#nodechildren)
* [nodeParent](eventwidget.md#optional-nodeparent)
### Methods
* [addEventListener](eventwidget.md#addeventlistener)
* [removeEventListener](eventwidget.md#removeeventlistener)
* [setNodeParent](eventwidget.md#setnodeparent)
## Constructors
### constructor
\+ **new EventWidget**(`native`: [NativeElement](../globals.md#nativeelement)): *[EventWidget](eventwidget.md)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[EventWidget](eventwidget.md)*
## Properties
### `Abstract` native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Inherited from [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
**Type parameters:**
**SignalType**: *keyof Signals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
**Type parameters:**
**SignalType**: *keyof Signals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*

View File

@ -0,0 +1,403 @@
---
id: "flexlayout"
title: "FlexLayout"
sidebar_label: "FlexLayout"
---
> Custom layout to help layout child widgets using flex layout.
**This class is a JS wrapper around custom Qt layout implemented using [Yoga](https://github.com/facebook/yoga)**
A `FlexLayout` can be used to layout all child NodeGui widgets using flex.
### Example
```javascript
const { FlexLayout, QWidget, QLabel } = require("@nodegui/nodegui");
const view = new QWidget();
const layout = new FlexLayout();
view.setLayout(layout);
const label = new QLabel();
label.setText("label1");
const label2 = new QLabel();
label2.setText("label2");
layout.addWidget(label);
layout.addWidget(label2);
```
## Hierarchy
↳ [NodeLayout](nodelayout.md)[FlexLayoutSignals](../globals.md#flexlayoutsignals)
↳ **FlexLayout**
## Index
### Constructors
* [constructor](flexlayout.md#constructor)
### Properties
* [native](flexlayout.md#native)
* [nodeChildren](flexlayout.md#nodechildren)
* [nodeParent](flexlayout.md#optional-nodeparent)
* [type](flexlayout.md#type)
### Methods
* [activate](flexlayout.md#activate)
* [addEventListener](flexlayout.md#addeventlistener)
* [addWidget](flexlayout.md#addwidget)
* [inherits](flexlayout.md#inherits)
* [insertChildBefore](flexlayout.md#insertchildbefore)
* [invalidate](flexlayout.md#invalidate)
* [objectName](flexlayout.md#objectname)
* [property](flexlayout.md#property)
* [removeEventListener](flexlayout.md#removeeventlistener)
* [removeWidget](flexlayout.md#removewidget)
* [setFlexNode](flexlayout.md#setflexnode)
* [setNodeParent](flexlayout.md#setnodeparent)
* [setObjectName](flexlayout.md#setobjectname)
* [setProperty](flexlayout.md#setproperty)
* [update](flexlayout.md#update)
## Constructors
### constructor
\+ **new FlexLayout**(): *[FlexLayout](flexlayout.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Returns:** *[FlexLayout](flexlayout.md)*
\+ **new FlexLayout**(`parent`: [NodeWidget](nodewidget.md)any): *[FlexLayout](flexlayout.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`parent` | [NodeWidget](nodewidget.md)any |
**Returns:** *[FlexLayout](flexlayout.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
___
### type
**type**: *string* = "layout"
*Inherited from [NodeLayout](nodelayout.md).[type](nodelayout.md#type)*
## Methods
### activate
**activate**(): *boolean*
*Inherited from [NodeLayout](nodelayout.md).[activate](nodelayout.md#activate)*
**Returns:** *boolean*
___
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof FlexLayoutSignals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### addWidget
**addWidget**(`childWidget`: [NodeWidget](nodewidget.md)any, `childFlexNode?`: [FlexNode](../globals.md#flexnode)): *void*
*Overrides [NodeLayout](nodelayout.md).[addWidget](nodelayout.md#abstract-addwidget)*
**Parameters:**
Name | Type |
------ | ------ |
`childWidget` | [NodeWidget](nodewidget.md)any |
`childFlexNode?` | [FlexNode](../globals.md#flexnode) |
**Returns:** *void*
___
### inherits
**inherits**(`className`: string): *boolean*
*Inherited from [NodeObject](nodeobject.md).[inherits](nodeobject.md#inherits)*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### insertChildBefore
**insertChildBefore**(`childWidget`: [NodeWidget](nodewidget.md)any, `beforeChildWidget`: [NodeWidget](nodewidget.md)any, `childFlexNode?`: [FlexNode](../globals.md#flexnode), `beforeChildFlexNode?`: [FlexNode](../globals.md#flexnode)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`childWidget` | [NodeWidget](nodewidget.md)any |
`beforeChildWidget` | [NodeWidget](nodewidget.md)any |
`childFlexNode?` | [FlexNode](../globals.md#flexnode) |
`beforeChildFlexNode?` | [FlexNode](../globals.md#flexnode) |
**Returns:** *void*
___
### invalidate
**invalidate**(): *void*
*Inherited from [NodeLayout](nodelayout.md).[invalidate](nodelayout.md#invalidate)*
**Returns:** *void*
___
### objectName
**objectName**(): *string*
*Inherited from [NodeObject](nodeobject.md).[objectName](nodeobject.md#objectname)*
**Returns:** *string*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
*Inherited from [NodeObject](nodeobject.md).[property](nodeobject.md#property)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof FlexLayoutSignals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### removeWidget
**removeWidget**(`childWidget`: [NodeWidget](nodewidget.md)any, `childFlexNode?`: [FlexNode](../globals.md#flexnode)): *void*
*Overrides [NodeLayout](nodelayout.md).[removeWidget](nodelayout.md#abstract-removewidget)*
**Parameters:**
Name | Type |
------ | ------ |
`childWidget` | [NodeWidget](nodewidget.md)any |
`childFlexNode?` | [FlexNode](../globals.md#flexnode) |
**Returns:** *void*
___
### setFlexNode
**setFlexNode**(`flexNode`: [FlexNode](../globals.md#flexnode)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`flexNode` | [FlexNode](../globals.md#flexnode) |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
*Inherited from [NodeObject](nodeobject.md).[setObjectName](nodeobject.md#setobjectname)*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
*Inherited from [NodeObject](nodeobject.md).[setProperty](nodeobject.md#setproperty)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*
___
### update
**update**(): *void*
*Inherited from [NodeLayout](nodelayout.md).[update](nodelayout.md#update)*
**Returns:** *void*

View File

@ -0,0 +1,364 @@
---
id: "nodelayout"
title: "NodeLayout"
sidebar_label: "NodeLayout"
---
> Abstract class to add functionalities common to all Layout.
*This class implements all methods, properties of Qt's [QLayout class](https://doc.qt.io/qt-5/qlayout.html) so that it can be inherited by all layouts**
`NodeLayout` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all layout's easily. Additionally it helps in typechecking process.
### Example
```javascript
const {
NodeLayout,
NodeWidget,
FlexLayout,
GridLayout,
QPushButton,
QWidget
} = require("@nodegui/nodegui");
// addChildToLayout can accept any layout since it expects NodeLayout
const addChildToLayout = (layout: NodeLayout, widget: NodeWidget) => {
layout.addWidget(widget);
};
addChildToLayout(new FlexLayout(), new QPushButton());
addChildToLayout(new GridLayout(), new QWidget());
```
## Type parameters
**Signals**: *[QLayoutSignals](../globals.md#qlayoutsignals)*
## Hierarchy
↳ [NodeObject](nodeobject.md)Signals
↳ **NodeLayout**
↳ [FlexLayout](flexlayout.md)
↳ [QBoxLayout](qboxlayout.md)
↳ [QGridLayout](qgridlayout.md)
## Index
### Constructors
* [constructor](nodelayout.md#constructor)
### Properties
* [native](nodelayout.md#abstract-native)
* [nodeChildren](nodelayout.md#nodechildren)
* [nodeParent](nodelayout.md#optional-nodeparent)
* [type](nodelayout.md#type)
### Methods
* [activate](nodelayout.md#activate)
* [addEventListener](nodelayout.md#addeventlistener)
* [addWidget](nodelayout.md#abstract-addwidget)
* [inherits](nodelayout.md#inherits)
* [invalidate](nodelayout.md#invalidate)
* [objectName](nodelayout.md#objectname)
* [property](nodelayout.md#property)
* [removeEventListener](nodelayout.md#removeeventlistener)
* [removeWidget](nodelayout.md#abstract-removewidget)
* [setNodeParent](nodelayout.md#setnodeparent)
* [setObjectName](nodelayout.md#setobjectname)
* [setProperty](nodelayout.md#setproperty)
* [update](nodelayout.md#update)
## Constructors
### constructor
\+ **new NodeLayout**(`native`: [NativeElement](../globals.md#nativeelement)): *[NodeLayout](nodelayout.md)*
*Inherited from [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[NodeLayout](nodelayout.md)*
## Properties
### `Abstract` native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Inherited from [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
___
### type
**type**: *string* = "layout"
## Methods
### activate
**activate**(): *boolean*
**Returns:** *boolean*
___
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof Signals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### `Abstract` addWidget
**addWidget**(`childWidget`: [NodeWidget](nodewidget.md)any, ...`args`: any[]): *void*
**Parameters:**
Name | Type |
------ | ------ |
`childWidget` | [NodeWidget](nodewidget.md)any |
`...args` | any[] |
**Returns:** *void*
___
### inherits
**inherits**(`className`: string): *boolean*
*Inherited from [NodeObject](nodeobject.md).[inherits](nodeobject.md#inherits)*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### invalidate
**invalidate**(): *void*
**Returns:** *void*
___
### objectName
**objectName**(): *string*
*Inherited from [NodeObject](nodeobject.md).[objectName](nodeobject.md#objectname)*
**Returns:** *string*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
*Inherited from [NodeObject](nodeobject.md).[property](nodeobject.md#property)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof Signals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### `Abstract` removeWidget
**removeWidget**(`childWidget`: [NodeWidget](nodewidget.md)any): *void*
**Parameters:**
Name | Type |
------ | ------ |
`childWidget` | [NodeWidget](nodewidget.md)any |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
*Inherited from [NodeObject](nodeobject.md).[setObjectName](nodeobject.md#setobjectname)*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
*Inherited from [NodeObject](nodeobject.md).[setProperty](nodeobject.md#setproperty)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*
___
### update
**update**(): *void*
**Returns:** *void*

View File

@ -0,0 +1,270 @@
---
id: "nodeobject"
title: "NodeObject"
sidebar_label: "NodeObject"
---
## Type parameters
**Signals**: *[QObjectSignals](../interfaces/qobjectsignals.md)*
## Hierarchy
↳ [EventWidget](eventwidget.md)Signals
↳ **NodeObject**
↳ [QObject](qobject.md)
↳ [QMovie](qmovie.md)
↳ [NodeLayout](nodelayout.md)
↳ [YogaWidget](yogawidget.md)
↳ [QAction](qaction.md)
↳ [QSystemTrayIcon](qsystemtrayicon.md)
↳ [QShortcut](qshortcut.md)
## Index
### Constructors
* [constructor](nodeobject.md#constructor)
### Properties
* [native](nodeobject.md#abstract-native)
* [nodeChildren](nodeobject.md#nodechildren)
* [nodeParent](nodeobject.md#optional-nodeparent)
### Methods
* [addEventListener](nodeobject.md#addeventlistener)
* [inherits](nodeobject.md#inherits)
* [objectName](nodeobject.md#objectname)
* [property](nodeobject.md#property)
* [removeEventListener](nodeobject.md#removeeventlistener)
* [setNodeParent](nodeobject.md#setnodeparent)
* [setObjectName](nodeobject.md#setobjectname)
* [setProperty](nodeobject.md#setproperty)
## Constructors
### constructor
\+ **new NodeObject**(`native`: [NativeElement](../globals.md#nativeelement)): *[NodeObject](nodeobject.md)*
*Inherited from [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[NodeObject](nodeobject.md)*
## Properties
### `Abstract` native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Inherited from [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof Signals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### inherits
**inherits**(`className`: string): *boolean*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### objectName
**objectName**(): *string*
**Returns:** *string*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof Signals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*

View File

@ -0,0 +1,905 @@
---
id: "nodewidget"
title: "NodeWidget"
sidebar_label: "NodeWidget"
---
> Abstract class to add functionalities common to all Widgets.
*This class implements all methods, properties of Qt's [QWidget class](https://doc.qt.io/qt-5/qwidget.html) so that it can be inherited by all widgets**
`NodeWidget` is an abstract class and hence no instances of the same should be created. It exists so that we can add similar functionalities to all widget's easily. Additionally it helps in type checking process. If you wish to create a `div` like widget use [QWidget](api/QWidget.md) instead.
*NodeWidget is the base class for all widgets.**
### Example
```javascript
const {
NodeWidget,
QPushButton,
QWidget,
QRadioButton
} = require("@nodegui/nodegui");
// showWidget can accept any widget since it expects NodeWidget
const showWidget = (widget: NodeWidget) => {
widget.show();
};
showWidget(new QPushButton());
showWidget(new QWidget());
showWidget(new QRadioButton());
```
All Widgets should extend from NodeWidget
Implement all native QWidget methods here so that all widgets get access to those aswell
## Type parameters
**Signals**: *[QWidgetSignals](../interfaces/qwidgetsignals.md)*
## Hierarchy
↳ [YogaWidget](yogawidget.md)Signals
↳ **NodeWidget**
↳ [QWidget](qwidget.md)
↳ [QAbstractScrollArea](qabstractscrollarea.md)
↳ [QAbstractSlider](qabstractslider.md)
↳ [QAbstractButton](qabstractbutton.md)
↳ [QLabel](qlabel.md)
↳ [QFileDialog](qfiledialog.md)
↳ [QLineEdit](qlineedit.md)
↳ [QMenu](qmenu.md)
↳ [QMenuBar](qmenubar.md)
↳ [QMainWindow](qmainwindow.md)
↳ [QProgressBar](qprogressbar.md)
↳ [QComboBox](qcombobox.md)
↳ [QSpinBox](qspinbox.md)
↳ [QStackedWidget](qstackedwidget.md)
↳ [QTabWidget](qtabwidget.md)
↳ [QGroupBox](qgroupbox.md)
## Index
### Constructors
* [constructor](nodewidget.md#constructor)
### Properties
* [_rawInlineStyle](nodewidget.md#_rawinlinestyle)
* [layout](nodewidget.md#optional-layout)
* [native](nodewidget.md#abstract-native)
* [nodeChildren](nodewidget.md#nodechildren)
* [nodeParent](nodewidget.md#optional-nodeparent)
* [type](nodewidget.md#type)
### Methods
* [activateWindow](nodewidget.md#activatewindow)
* [addEventListener](nodewidget.md#addeventlistener)
* [adjustSize](nodewidget.md#adjustsize)
* [close](nodewidget.md#close)
* [geometry](nodewidget.md#geometry)
* [getFlexNode](nodewidget.md#getflexnode)
* [hasMouseTracking](nodewidget.md#hasmousetracking)
* [hide](nodewidget.md#hide)
* [inherits](nodewidget.md#inherits)
* [isEnabled](nodewidget.md#isenabled)
* [isVisible](nodewidget.md#isvisible)
* [lower](nodewidget.md#lower)
* [move](nodewidget.md#move)
* [objectName](nodewidget.md#objectname)
* [pos](nodewidget.md#pos)
* [property](nodewidget.md#property)
* [raise](nodewidget.md#raise)
* [removeEventListener](nodewidget.md#removeeventlistener)
* [repaint](nodewidget.md#repaint)
* [resize](nodewidget.md#resize)
* [setAttribute](nodewidget.md#setattribute)
* [setContextMenuPolicy](nodewidget.md#setcontextmenupolicy)
* [setCursor](nodewidget.md#setcursor)
* [setEnabled](nodewidget.md#setenabled)
* [setFixedSize](nodewidget.md#setfixedsize)
* [setFlexNodeSizeControlled](nodewidget.md#setflexnodesizecontrolled)
* [setGeometry](nodewidget.md#setgeometry)
* [setInlineStyle](nodewidget.md#setinlinestyle)
* [setLayout](nodewidget.md#setlayout)
* [setMaximumSize](nodewidget.md#setmaximumsize)
* [setMinimumSize](nodewidget.md#setminimumsize)
* [setMouseTracking](nodewidget.md#setmousetracking)
* [setNodeParent](nodewidget.md#setnodeparent)
* [setObjectName](nodewidget.md#setobjectname)
* [setProperty](nodewidget.md#setproperty)
* [setStyleSheet](nodewidget.md#setstylesheet)
* [setWindowFlag](nodewidget.md#setwindowflag)
* [setWindowIcon](nodewidget.md#setwindowicon)
* [setWindowOpacity](nodewidget.md#setwindowopacity)
* [setWindowState](nodewidget.md#setwindowstate)
* [setWindowTitle](nodewidget.md#setwindowtitle)
* [show](nodewidget.md#show)
* [showFullScreen](nodewidget.md#showfullscreen)
* [showMaximized](nodewidget.md#showmaximized)
* [showMinimized](nodewidget.md#showminimized)
* [showNormal](nodewidget.md#shownormal)
* [size](nodewidget.md#size)
* [styleSheet](nodewidget.md#stylesheet)
* [testAttribute](nodewidget.md#testattribute)
* [update](nodewidget.md#update)
* [updateGeometry](nodewidget.md#updategeometry)
* [windowOpacity](nodewidget.md#windowopacity)
* [windowState](nodewidget.md#windowstate)
* [windowTitle](nodewidget.md#windowtitle)
## Constructors
### constructor
\+ **new NodeWidget**(`native`: [NativeElement](../globals.md#nativeelement)): *[NodeWidget](nodewidget.md)*
*Inherited from [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[NodeWidget](nodewidget.md)*
## Properties
### _rawInlineStyle
**_rawInlineStyle**: *string* = ""
___
### `Optional` layout
**layout**? : *[NodeLayout](nodelayout.md)Signals*
___
### `Abstract` native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Inherited from [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
___
### type
**type**: *string* = "widget"
## Methods
### activateWindow
**activateWindow**(): *void*
**Returns:** *void*
___
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof Signals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### adjustSize
**adjustSize**(): *void*
**Returns:** *void*
___
### close
**close**(): *boolean*
**Returns:** *boolean*
___
### geometry
**geometry**(): *[QRect](qrect.md)*
**Returns:** *[QRect](qrect.md)*
___
### getFlexNode
**getFlexNode**(): *[FlexNode](../globals.md#flexnode)*
*Inherited from [YogaWidget](yogawidget.md).[getFlexNode](yogawidget.md#getflexnode)*
**Returns:** *[FlexNode](../globals.md#flexnode)*
___
### hasMouseTracking
**hasMouseTracking**(): *boolean*
**Returns:** *boolean*
___
### hide
**hide**(): *void*
**Returns:** *void*
___
### inherits
**inherits**(`className`: string): *boolean*
*Inherited from [NodeObject](nodeobject.md).[inherits](nodeobject.md#inherits)*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### isEnabled
**isEnabled**(): *boolean*
**Returns:** *boolean*
___
### isVisible
**isVisible**(): *boolean*
**Returns:** *boolean*
___
### lower
**lower**(): *void*
**Returns:** *void*
___
### move
**move**(`x`: number, `y`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`x` | number |
`y` | number |
**Returns:** *void*
___
### objectName
**objectName**(): *string*
*Inherited from [NodeObject](nodeobject.md).[objectName](nodeobject.md#objectname)*
**Returns:** *string*
___
### pos
**pos**(): *object*
**Returns:** *object*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
*Inherited from [NodeObject](nodeobject.md).[property](nodeobject.md#property)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### raise
**raise**(): *void*
**Returns:** *void*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof Signals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### repaint
**repaint**(): *void*
**Returns:** *void*
___
### resize
**resize**(`width`: number, `height`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`width` | number |
`height` | number |
**Returns:** *void*
___
### setAttribute
**setAttribute**(`attribute`: [WidgetAttribute](../enums/widgetattribute.md), `switchOn`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`attribute` | [WidgetAttribute](../enums/widgetattribute.md) |
`switchOn` | boolean |
**Returns:** *void*
___
### setContextMenuPolicy
**setContextMenuPolicy**(`contextMenuPolicy`: [ContextMenuPolicy](../enums/contextmenupolicy.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`contextMenuPolicy` | [ContextMenuPolicy](../enums/contextmenupolicy.md) |
**Returns:** *void*
___
### setCursor
**setCursor**(`cursor`: [CursorShape](../enums/cursorshape.md) | [QCursor](qcursor.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`cursor` | [CursorShape](../enums/cursorshape.md) &#124; [QCursor](qcursor.md) |
**Returns:** *void*
___
### setEnabled
**setEnabled**(`enabled`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`enabled` | boolean |
**Returns:** *void*
___
### setFixedSize
**setFixedSize**(`width`: number, `height`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`width` | number |
`height` | number |
**Returns:** *void*
___
### setFlexNodeSizeControlled
**setFlexNodeSizeControlled**(`isSizeControlled`: boolean): *void*
*Inherited from [YogaWidget](yogawidget.md).[setFlexNodeSizeControlled](yogawidget.md#setflexnodesizecontrolled)*
sets whether the widget's size is controlled by someone else (for example a window's size is controlled by its frame when dragged).
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`isSizeControlled` | boolean | |
**Returns:** *void*
___
### setGeometry
**setGeometry**(`x`: number, `y`: number, `w`: number, `h`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`x` | number |
`y` | number |
`w` | number |
`h` | number |
**Returns:** *void*
___
### setInlineStyle
**setInlineStyle**(`style`: string): *void*
**Parameters:**
Name | Type |
------ | ------ |
`style` | string |
**Returns:** *void*
___
### setLayout
**setLayout**(`parentLayout`: [NodeLayout](nodelayout.md)Signals): *void*
**Parameters:**
Name | Type |
------ | ------ |
`parentLayout` | [NodeLayout](nodelayout.md)Signals |
**Returns:** *void*
___
### setMaximumSize
**setMaximumSize**(`maxw`: number, `maxh`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`maxw` | number |
`maxh` | number |
**Returns:** *void*
___
### setMinimumSize
**setMinimumSize**(`minw`: number, `minh`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`minw` | number |
`minh` | number |
**Returns:** *void*
___
### setMouseTracking
**setMouseTracking**(`isMouseTracked`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`isMouseTracked` | boolean |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
*Overrides [NodeObject](nodeobject.md).[setObjectName](nodeobject.md#setobjectname)*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
*Inherited from [NodeObject](nodeobject.md).[setProperty](nodeobject.md#setproperty)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*
___
### setStyleSheet
**setStyleSheet**(`styleSheet`: string): *void*
**Parameters:**
Name | Type |
------ | ------ |
`styleSheet` | string |
**Returns:** *void*
___
### setWindowFlag
**setWindowFlag**(`windowType`: [WindowType](../enums/windowtype.md), `switchOn`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`windowType` | [WindowType](../enums/windowtype.md) |
`switchOn` | boolean |
**Returns:** *void*
___
### setWindowIcon
**setWindowIcon**(`icon`: [QIcon](qicon.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`icon` | [QIcon](qicon.md) |
**Returns:** *void*
___
### setWindowOpacity
**setWindowOpacity**(`opacity`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`opacity` | number |
**Returns:** *void*
___
### setWindowState
**setWindowState**(`state`: [WindowState](../enums/windowstate.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`state` | [WindowState](../enums/windowstate.md) |
**Returns:** *void*
___
### setWindowTitle
**setWindowTitle**(`title`: string): *void*
**Parameters:**
Name | Type |
------ | ------ |
`title` | string |
**Returns:** *void*
___
### show
**show**(): *void*
**Returns:** *void*
___
### showFullScreen
**showFullScreen**(): *void*
**Returns:** *void*
___
### showMaximized
**showMaximized**(): *void*
**Returns:** *void*
___
### showMinimized
**showMinimized**(): *void*
**Returns:** *void*
___
### showNormal
**showNormal**(): *void*
**Returns:** *void*
___
### size
**size**(): *[QSize](qsize.md)*
**Returns:** *[QSize](qsize.md)*
___
### styleSheet
**styleSheet**(): *string*
**Returns:** *string*
___
### testAttribute
**testAttribute**(`attribute`: [WidgetAttribute](../enums/widgetattribute.md)): *boolean*
**Parameters:**
Name | Type |
------ | ------ |
`attribute` | [WidgetAttribute](../enums/widgetattribute.md) |
**Returns:** *boolean*
___
### update
**update**(): *void*
**Returns:** *void*
___
### updateGeometry
**updateGeometry**(): *void*
**Returns:** *void*
___
### windowOpacity
**windowOpacity**(): *number*
**Returns:** *number*
___
### windowState
**windowState**(): *number*
**Returns:** *number*
___
### windowTitle
**windowTitle**(): *string*
**Returns:** *string*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,474 @@
---
id: "qaction"
title: "QAction"
sidebar_label: "QAction"
---
> The QAction class provides an abstract user interface action that can be inserted into widgets.
**This class is a JS wrapper around Qt's [QAction class](https://doc.qt.io/qt-5/qaction.html)**
### Example
```javascript
const { QAction, QMenu } = require("@nodegui/nodegui");
const menu = new QMenu();
const menuAction = new QAction();
menuAction.setText("subAction");
menuAction.addEventListener("triggered", () => {
console.log("Action clicked");
});
menu.addAction(menuAction);
```
## Hierarchy
↳ [NodeObject](nodeobject.md)[QActionSignals](../interfaces/qactionsignals.md)
↳ **QAction**
## Index
### Constructors
* [constructor](qaction.md#constructor)
### Properties
* [icon](qaction.md#optional-icon)
* [menu](qaction.md#optional-menu)
* [native](qaction.md#native)
* [nodeChildren](qaction.md#nodechildren)
* [nodeParent](qaction.md#optional-nodeparent)
### Methods
* [addEventListener](qaction.md#addeventlistener)
* [inherits](qaction.md#inherits)
* [isCheckable](qaction.md#ischeckable)
* [isChecked](qaction.md#ischecked)
* [isSeparator](qaction.md#isseparator)
* [objectName](qaction.md#objectname)
* [property](qaction.md#property)
* [removeEventListener](qaction.md#removeeventlistener)
* [setCheckable](qaction.md#setcheckable)
* [setChecked](qaction.md#setchecked)
* [setEnabled](qaction.md#setenabled)
* [setIcon](qaction.md#seticon)
* [setMenu](qaction.md#setmenu)
* [setNodeParent](qaction.md#setnodeparent)
* [setObjectName](qaction.md#setobjectname)
* [setProperty](qaction.md#setproperty)
* [setSeparator](qaction.md#setseparator)
* [setShortcut](qaction.md#setshortcut)
* [setShortcutContext](qaction.md#setshortcutcontext)
* [setText](qaction.md#settext)
## Constructors
### constructor
\+ **new QAction**(): *[QAction](qaction.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Returns:** *[QAction](qaction.md)*
\+ **new QAction**(`native`: [NativeElement](../globals.md#nativeelement)): *[QAction](qaction.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QAction](qaction.md)*
\+ **new QAction**(`parent`: [NodeWidget](nodewidget.md)any): *[QAction](qaction.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`parent` | [NodeWidget](nodewidget.md)any |
**Returns:** *[QAction](qaction.md)*
## Properties
### `Optional` icon
**icon**? : *[QIcon](qicon.md)*
___
### `Optional` menu
**menu**? : *[QMenu](qmenu.md)*
___
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof QActionSignals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### inherits
**inherits**(`className`: string): *boolean*
*Inherited from [NodeObject](nodeobject.md).[inherits](nodeobject.md#inherits)*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### isCheckable
**isCheckable**(): *boolean*
**Returns:** *boolean*
___
### isChecked
**isChecked**(): *boolean*
**Returns:** *boolean*
___
### isSeparator
**isSeparator**(): *boolean*
**Returns:** *boolean*
___
### objectName
**objectName**(): *string*
*Inherited from [NodeObject](nodeobject.md).[objectName](nodeobject.md#objectname)*
**Returns:** *string*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
*Inherited from [NodeObject](nodeobject.md).[property](nodeobject.md#property)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof QActionSignals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### setCheckable
**setCheckable**(`isCheckable`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`isCheckable` | boolean |
**Returns:** *void*
___
### setChecked
**setChecked**(`isChecked`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`isChecked` | boolean |
**Returns:** *void*
___
### setEnabled
**setEnabled**(`enabled`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`enabled` | boolean |
**Returns:** *void*
___
### setIcon
**setIcon**(`icon`: [QIcon](qicon.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`icon` | [QIcon](qicon.md) |
**Returns:** *void*
___
### setMenu
**setMenu**(`menu`: [QMenu](qmenu.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`menu` | [QMenu](qmenu.md) |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
*Inherited from [NodeObject](nodeobject.md).[setObjectName](nodeobject.md#setobjectname)*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
*Inherited from [NodeObject](nodeobject.md).[setProperty](nodeobject.md#setproperty)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*
___
### setSeparator
**setSeparator**(`isSeparator`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`isSeparator` | boolean |
**Returns:** *void*
___
### setShortcut
**setShortcut**(`keysequence`: [QKeySequence](qkeysequence.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`keysequence` | [QKeySequence](qkeysequence.md) |
**Returns:** *void*
___
### setShortcutContext
**setShortcutContext**(`shortcutContext`: [ShortcutContext](../enums/shortcutcontext.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`shortcutContext` | [ShortcutContext](../enums/shortcutcontext.md) |
**Returns:** *void*
___
### setText
**setText**(`text`: string): *void*
**Parameters:**
Name | Type |
------ | ------ |
`text` | string |
**Returns:** *void*

View File

@ -0,0 +1,193 @@
---
id: "qapplication"
title: "QApplication"
sidebar_label: "QApplication"
---
> QApplication is the root object for the entire application. It manages app level settings.
**This class is a JS wrapper around Qt's [QApplication class](https://doc.qt.io/qt-5/qapplication.html)**
The QApplication class manages the GUI application's control flow and main settings. In NodeGui you will never create an instance of it manually. NodeGui's internal runtime `Qode` does it for you on app start. You can access the initialised QApplication though if needed.
### Example
```js
const { QApplication } = require("@nodegui/nodegui");
const qApp = QApplication.instance();
qApp.quit();
```
## Hierarchy
* [Component](component.md)
↳ **QApplication**
## Index
### Constructors
* [constructor](qapplication.md#constructor)
### Properties
* [native](qapplication.md#native)
* [nodeChildren](qapplication.md#nodechildren)
* [nodeParent](qapplication.md#optional-nodeparent)
### Methods
* [exec](qapplication.md#exec)
* [exit](qapplication.md#exit)
* [processEvents](qapplication.md#processevents)
* [quit](qapplication.md#quit)
* [quitOnLastWindowClosed](qapplication.md#quitonlastwindowclosed)
* [setNodeParent](qapplication.md#setnodeparent)
* [setQuitOnLastWindowClosed](qapplication.md#setquitonlastwindowclosed)
* [clipboard](qapplication.md#static-clipboard)
* [instance](qapplication.md#static-instance)
* [style](qapplication.md#static-style)
## Constructors
### constructor
\+ **new QApplication**(): *[QApplication](qapplication.md)*
**Returns:** *[QApplication](qapplication.md)*
\+ **new QApplication**(`native`: [NativeElement](../globals.md#nativeelement)): *[QApplication](qapplication.md)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QApplication](qapplication.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### exec
**exec**(): *number*
**Returns:** *number*
___
### exit
**exit**(`exitCode`: number): *number*
**Parameters:**
Name | Type |
------ | ------ |
`exitCode` | number |
**Returns:** *number*
___
### processEvents
**processEvents**(): *void*
**Returns:** *void*
___
### quit
**quit**(): *number*
**Returns:** *number*
___
### quitOnLastWindowClosed
**quitOnLastWindowClosed**(): *boolean*
**Returns:** *boolean*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setQuitOnLastWindowClosed
**setQuitOnLastWindowClosed**(`quit`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`quit` | boolean |
**Returns:** *void*
___
### `Static` clipboard
**clipboard**(): *[QClipboard](qclipboard.md)*
**Returns:** *[QClipboard](qclipboard.md)*
___
### `Static` instance
**instance**(): *[QApplication](qapplication.md)*
**Returns:** *[QApplication](qapplication.md)*
___
### `Static` style
**style**(): *[QStyle](qstyle.md)*
**Returns:** *[QStyle](qstyle.md)*

View File

@ -0,0 +1,478 @@
---
id: "qboxlayout"
title: "QBoxLayout"
sidebar_label: "QBoxLayout"
---
## Hierarchy
↳ [NodeLayout](nodelayout.md)[QBoxLayoutSignals](../globals.md#qboxlayoutsignals)
↳ **QBoxLayout**
## Index
### Constructors
* [constructor](qboxlayout.md#constructor)
### Properties
* [childLayouts](qboxlayout.md#childlayouts)
* [native](qboxlayout.md#native)
* [nodeChildren](qboxlayout.md#nodechildren)
* [nodeParent](qboxlayout.md#optional-nodeparent)
* [type](qboxlayout.md#type)
### Methods
* [activate](qboxlayout.md#activate)
* [addEventListener](qboxlayout.md#addeventlistener)
* [addLayout](qboxlayout.md#addlayout)
* [addSpacing](qboxlayout.md#addspacing)
* [addStretch](qboxlayout.md#addstretch)
* [addStrut](qboxlayout.md#addstrut)
* [addWidget](qboxlayout.md#addwidget)
* [direction](qboxlayout.md#direction)
* [inherits](qboxlayout.md#inherits)
* [insertLayout](qboxlayout.md#insertlayout)
* [insertWidget](qboxlayout.md#insertwidget)
* [invalidate](qboxlayout.md#invalidate)
* [objectName](qboxlayout.md#objectname)
* [property](qboxlayout.md#property)
* [removeEventListener](qboxlayout.md#removeeventlistener)
* [removeWidget](qboxlayout.md#removewidget)
* [setDirection](qboxlayout.md#setdirection)
* [setNodeParent](qboxlayout.md#setnodeparent)
* [setObjectName](qboxlayout.md#setobjectname)
* [setProperty](qboxlayout.md#setproperty)
* [update](qboxlayout.md#update)
## Constructors
### constructor
\+ **new QBoxLayout**(`dir`: [Direction](../enums/direction.md)): *[QBoxLayout](qboxlayout.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`dir` | [Direction](../enums/direction.md) |
**Returns:** *[QBoxLayout](qboxlayout.md)*
\+ **new QBoxLayout**(`dir`: [Direction](../enums/direction.md), `parent`: [NodeWidget](nodewidget.md)any): *[QBoxLayout](qboxlayout.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`dir` | [Direction](../enums/direction.md) |
`parent` | [NodeWidget](nodewidget.md)any |
**Returns:** *[QBoxLayout](qboxlayout.md)*
## Properties
### childLayouts
**childLayouts**: *Set[NodeLayout](nodelayout.md)any*
___
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
___
### type
**type**: *string* = "layout"
*Inherited from [NodeLayout](nodelayout.md).[type](nodelayout.md#type)*
## Methods
### activate
**activate**(): *boolean*
*Inherited from [NodeLayout](nodelayout.md).[activate](nodelayout.md#activate)*
**Returns:** *boolean*
___
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof QBoxLayoutSignals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### addLayout
**addLayout**(`layout`: [NodeLayout](nodelayout.md)any, `stretch`: number): *void*
**Parameters:**
Name | Type | Default |
------ | ------ | ------ |
`layout` | [NodeLayout](nodelayout.md)any | - |
`stretch` | number | 0 |
**Returns:** *void*
___
### addSpacing
**addSpacing**(`size`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`size` | number |
**Returns:** *void*
___
### addStretch
**addStretch**(`stretch`: number): *void*
**Parameters:**
Name | Type | Default |
------ | ------ | ------ |
`stretch` | number | 0 |
**Returns:** *void*
___
### addStrut
**addStrut**(`size`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`size` | number |
**Returns:** *void*
___
### addWidget
**addWidget**(`widget`: [NodeWidget](nodewidget.md)any, `stretch`: number): *void*
*Overrides [NodeLayout](nodelayout.md).[addWidget](nodelayout.md#abstract-addwidget)*
**Parameters:**
Name | Type | Default |
------ | ------ | ------ |
`widget` | [NodeWidget](nodewidget.md)any | - |
`stretch` | number | 0 |
**Returns:** *void*
___
### direction
**direction**(): *[Direction](../enums/direction.md)*
**Returns:** *[Direction](../enums/direction.md)*
___
### inherits
**inherits**(`className`: string): *boolean*
*Inherited from [NodeObject](nodeobject.md).[inherits](nodeobject.md#inherits)*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### insertLayout
**insertLayout**(`index`: number, `layout`: [NodeLayout](nodelayout.md)any, `stretch`: number): *void*
**Parameters:**
Name | Type | Default |
------ | ------ | ------ |
`index` | number | - |
`layout` | [NodeLayout](nodelayout.md)any | - |
`stretch` | number | 0 |
**Returns:** *void*
___
### insertWidget
**insertWidget**(`index`: number, `widget`: [NodeWidget](nodewidget.md)any, `stretch`: number): *void*
**Parameters:**
Name | Type | Default |
------ | ------ | ------ |
`index` | number | - |
`widget` | [NodeWidget](nodewidget.md)any | - |
`stretch` | number | 0 |
**Returns:** *void*
___
### invalidate
**invalidate**(): *void*
*Inherited from [NodeLayout](nodelayout.md).[invalidate](nodelayout.md#invalidate)*
**Returns:** *void*
___
### objectName
**objectName**(): *string*
*Inherited from [NodeObject](nodeobject.md).[objectName](nodeobject.md#objectname)*
**Returns:** *string*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
*Inherited from [NodeObject](nodeobject.md).[property](nodeobject.md#property)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof QBoxLayoutSignals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### removeWidget
**removeWidget**(`widget`: [NodeWidget](nodewidget.md)any): *void*
*Overrides [NodeLayout](nodelayout.md).[removeWidget](nodelayout.md#abstract-removewidget)*
**Parameters:**
Name | Type |
------ | ------ |
`widget` | [NodeWidget](nodewidget.md)any |
**Returns:** *void*
___
### setDirection
**setDirection**(`dir`: [Direction](../enums/direction.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`dir` | [Direction](../enums/direction.md) |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
*Inherited from [NodeObject](nodeobject.md).[setObjectName](nodeobject.md#setobjectname)*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
*Inherited from [NodeObject](nodeobject.md).[setProperty](nodeobject.md#setproperty)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*
___
### update
**update**(): *void*
*Inherited from [NodeLayout](nodelayout.md).[update](nodelayout.md#update)*
**Returns:** *void*

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,144 @@
---
id: "qclipboard"
title: "QClipboard"
sidebar_label: "QClipboard"
---
> The QClipboard class provides access to the window system clipboard.
**This class is a JS wrapper around Qt's [QClipboard class](https://doc.qt.io/qt-5/QClipboard.html)**
### Example
```javascript
const {
QClipboard,
QClipboardMode,
QApplication
} = require("@nodegui/nodegui");
const clipboard = QApplication.clipboard();
const text = clipboard.text(QClipboardMode.Clipboard);
```
## Hierarchy
* [Component](component.md)
↳ **QClipboard**
## Index
### Constructors
* [constructor](qclipboard.md#constructor)
### Properties
* [native](qclipboard.md#native)
* [nodeChildren](qclipboard.md#nodechildren)
* [nodeParent](qclipboard.md#optional-nodeparent)
### Methods
* [clear](qclipboard.md#clear)
* [setNodeParent](qclipboard.md#setnodeparent)
* [setText](qclipboard.md#settext)
* [text](qclipboard.md#text)
## Constructors
### constructor
\+ **new QClipboard**(`native`: [NativeElement](../globals.md#nativeelement)): *[QClipboard](qclipboard.md)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QClipboard](qclipboard.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### clear
**clear**(`mode`: [QClipboardMode](../enums/qclipboardmode.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`mode` | [QClipboardMode](../enums/qclipboardmode.md) |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setText
**setText**(`text`: string, `mode`: [QClipboardMode](../enums/qclipboardmode.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`text` | string |
`mode` | [QClipboardMode](../enums/qclipboardmode.md) |
**Returns:** *void*
___
### text
**text**(`mode`: [QClipboardMode](../enums/qclipboardmode.md)): *string*
**Parameters:**
Name | Type |
------ | ------ |
`mode` | [QClipboardMode](../enums/qclipboardmode.md) |
**Returns:** *string*

View File

@ -0,0 +1,229 @@
---
id: "qcolor"
title: "QColor"
sidebar_label: "QColor"
---
## Hierarchy
* [Component](component.md)
↳ **QColor**
## Index
### Constructors
* [constructor](qcolor.md#constructor)
### Properties
* [native](qcolor.md#native)
* [nodeChildren](qcolor.md#nodechildren)
* [nodeParent](qcolor.md#optional-nodeparent)
### Methods
* [alpha](qcolor.md#alpha)
* [blue](qcolor.md#blue)
* [green](qcolor.md#green)
* [red](qcolor.md#red)
* [setAlpha](qcolor.md#setalpha)
* [setBlue](qcolor.md#setblue)
* [setGreen](qcolor.md#setgreen)
* [setNodeParent](qcolor.md#setnodeparent)
* [setRed](qcolor.md#setred)
* [fromQVariant](qcolor.md#static-fromqvariant)
## Constructors
### constructor
\+ **new QColor**(): *[QColor](qcolor.md)*
**Returns:** *[QColor](qcolor.md)*
\+ **new QColor**(`nativeElement`: [NativeElement](../globals.md#nativeelement)): *[QColor](qcolor.md)*
**Parameters:**
Name | Type |
------ | ------ |
`nativeElement` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QColor](qcolor.md)*
\+ **new QColor**(`colorString`: string): *[QColor](qcolor.md)*
**Parameters:**
Name | Type |
------ | ------ |
`colorString` | string |
**Returns:** *[QColor](qcolor.md)*
\+ **new QColor**(`color`: [GlobalColor](../enums/globalcolor.md)): *[QColor](qcolor.md)*
**Parameters:**
Name | Type |
------ | ------ |
`color` | [GlobalColor](../enums/globalcolor.md) |
**Returns:** *[QColor](qcolor.md)*
\+ **new QColor**(`r?`: undefined | number, `g?`: undefined | number, `b?`: undefined | number, `a?`: undefined | number): *[QColor](qcolor.md)*
**Parameters:**
Name | Type |
------ | ------ |
`r?` | undefined &#124; number |
`g?` | undefined &#124; number |
`b?` | undefined &#124; number |
`a?` | undefined &#124; number |
**Returns:** *[QColor](qcolor.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### alpha
**alpha**(): *number*
**Returns:** *number*
___
### blue
**blue**(): *number*
**Returns:** *number*
___
### green
**green**(): *number*
**Returns:** *number*
___
### red
**red**(): *number*
**Returns:** *number*
___
### setAlpha
**setAlpha**(`value`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`value` | number |
**Returns:** *void*
___
### setBlue
**setBlue**(`value`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`value` | number |
**Returns:** *void*
___
### setGreen
**setGreen**(`value`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`value` | number |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setRed
**setRed**(`value`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`value` | number |
**Returns:** *void*
___
### `Static` fromQVariant
**fromQVariant**(`variant`: [QVariant](qvariant.md)): *[QColor](qcolor.md)*
**Parameters:**
Name | Type |
------ | ------ |
`variant` | [QVariant](qvariant.md) |
**Returns:** *[QColor](qcolor.md)*

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,132 @@
---
id: "qcursor"
title: "QCursor"
sidebar_label: "QCursor"
---
> The QCursor class provides scalable icons in different modes and states.
**This class is a JS wrapper around Qt's [QCursor class](https://doc.qt.io/qt-5/qcursor.html)**
### Example
```javascript
const { QCursor } = require("@nodegui/nodegui");
const cursor = new QCursor();
```
## Hierarchy
* [Component](component.md)
↳ **QCursor**
## Index
### Constructors
* [constructor](qcursor.md#constructor)
### Properties
* [native](qcursor.md#native)
* [nodeChildren](qcursor.md#nodechildren)
* [nodeParent](qcursor.md#optional-nodeparent)
### Methods
* [pos](qcursor.md#pos)
* [setNodeParent](qcursor.md#setnodeparent)
* [setPos](qcursor.md#setpos)
## Constructors
### constructor
\+ **new QCursor**(): *[QCursor](qcursor.md)*
**Returns:** *[QCursor](qcursor.md)*
\+ **new QCursor**(`native`: [NativeElement](../globals.md#nativeelement)): *[QCursor](qcursor.md)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QCursor](qcursor.md)*
\+ **new QCursor**(`shape`: [CursorShape](../enums/cursorshape.md)): *[QCursor](qcursor.md)*
**Parameters:**
Name | Type |
------ | ------ |
`shape` | [CursorShape](../enums/cursorshape.md) |
**Returns:** *[QCursor](qcursor.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### pos
**pos**(): *object*
**Returns:** *object*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setPos
**setPos**(`x`: number, `y`: number): *void*
**Parameters:**
Name | Type |
------ | ------ |
`x` | number |
`y` | number |
**Returns:** *void*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,153 @@
---
id: "qfontdatabase"
title: "QFontDatabase"
sidebar_label: "QFontDatabase"
---
## Hierarchy
* [Component](component.md)
↳ **QFontDatabase**
## Index
### Constructors
* [constructor](qfontdatabase.md#constructor)
### Properties
* [native](qfontdatabase.md#native)
* [nodeChildren](qfontdatabase.md#nodechildren)
* [nodeParent](qfontdatabase.md#optional-nodeparent)
### Methods
* [bold](qfontdatabase.md#bold)
* [italic](qfontdatabase.md#italic)
* [setNodeParent](qfontdatabase.md#setnodeparent)
* [weight](qfontdatabase.md#weight)
* [addApplicationFont](qfontdatabase.md#static-addapplicationfont)
* [removeApplicationFont](qfontdatabase.md#static-removeapplicationfont)
## Constructors
### constructor
\+ **new QFontDatabase**(): *[QFontDatabase](qfontdatabase.md)*
**Returns:** *[QFontDatabase](qfontdatabase.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### bold
**bold**(`family`: string, `style`: string): *boolean*
**Parameters:**
Name | Type |
------ | ------ |
`family` | string |
`style` | string |
**Returns:** *boolean*
___
### italic
**italic**(`family`: string, `style`: string): *boolean*
**Parameters:**
Name | Type |
------ | ------ |
`family` | string |
`style` | string |
**Returns:** *boolean*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### weight
**weight**(`family`: string, `style`: string): *number*
**Parameters:**
Name | Type |
------ | ------ |
`family` | string |
`style` | string |
**Returns:** *number*
___
### `Static` addApplicationFont
**addApplicationFont**(`fileName`: string): *number*
**Parameters:**
Name | Type |
------ | ------ |
`fileName` | string |
**Returns:** *number*
___
### `Static` removeApplicationFont
**removeApplicationFont**(`id`: number): *boolean*
**Parameters:**
Name | Type |
------ | ------ |
`id` | number |
**Returns:** *boolean*

View File

@ -0,0 +1,370 @@
---
id: "qgridlayout"
title: "QGridLayout"
sidebar_label: "QGridLayout"
---
> The QGridLayout class lays out widgets in a grid.
**This class is a JS wrapper around Qt's [QGridLayout](https://doc.qt.io/qt-5/qgridlayout.html)**
### Example
```javascript
const { QGridLayout, QWidget, QLabel } = require("@nodegui/nodegui");
const view = new QWidget();
const layout = new QGridLayout();
view.setLayout(layout);
const label = new QLabel();
label.setText("label1");
const label2 = new QLabel();
label2.setText("label2");
layout.addWidget(label);
layout.addWidget(label2);
```
## Hierarchy
↳ [NodeLayout](nodelayout.md)[QGridLayoutSignals](../globals.md#qgridlayoutsignals)
↳ **QGridLayout**
## Index
### Constructors
* [constructor](qgridlayout.md#constructor)
### Properties
* [native](qgridlayout.md#native)
* [nodeChildren](qgridlayout.md#nodechildren)
* [nodeParent](qgridlayout.md#optional-nodeparent)
* [type](qgridlayout.md#type)
### Methods
* [activate](qgridlayout.md#activate)
* [addEventListener](qgridlayout.md#addeventlistener)
* [addWidget](qgridlayout.md#addwidget)
* [inherits](qgridlayout.md#inherits)
* [invalidate](qgridlayout.md#invalidate)
* [objectName](qgridlayout.md#objectname)
* [property](qgridlayout.md#property)
* [removeEventListener](qgridlayout.md#removeeventlistener)
* [removeWidget](qgridlayout.md#removewidget)
* [setNodeParent](qgridlayout.md#setnodeparent)
* [setObjectName](qgridlayout.md#setobjectname)
* [setProperty](qgridlayout.md#setproperty)
* [update](qgridlayout.md#update)
## Constructors
### constructor
\+ **new QGridLayout**(): *[QGridLayout](qgridlayout.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Returns:** *[QGridLayout](qgridlayout.md)*
\+ **new QGridLayout**(`parent`: [NodeWidget](nodewidget.md)any): *[QGridLayout](qgridlayout.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`parent` | [NodeWidget](nodewidget.md)any |
**Returns:** *[QGridLayout](qgridlayout.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
___
### type
**type**: *string* = "layout"
*Inherited from [NodeLayout](nodelayout.md).[type](nodelayout.md#type)*
## Methods
### activate
**activate**(): *boolean*
*Inherited from [NodeLayout](nodelayout.md).[activate](nodelayout.md#activate)*
**Returns:** *boolean*
___
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof QGridLayoutSignals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### addWidget
**addWidget**(`widget`: [NodeWidget](nodewidget.md)any, `row`: number, `col`: number, `rowSpan`: number, `colSpan`: number): *void*
*Overrides [NodeLayout](nodelayout.md).[addWidget](nodelayout.md#abstract-addwidget)*
**Parameters:**
Name | Type | Default |
------ | ------ | ------ |
`widget` | [NodeWidget](nodewidget.md)any | - |
`row` | number | 0 |
`col` | number | 0 |
`rowSpan` | number | 1 |
`colSpan` | number | 1 |
**Returns:** *void*
___
### inherits
**inherits**(`className`: string): *boolean*
*Inherited from [NodeObject](nodeobject.md).[inherits](nodeobject.md#inherits)*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### invalidate
**invalidate**(): *void*
*Inherited from [NodeLayout](nodelayout.md).[invalidate](nodelayout.md#invalidate)*
**Returns:** *void*
___
### objectName
**objectName**(): *string*
*Inherited from [NodeObject](nodeobject.md).[objectName](nodeobject.md#objectname)*
**Returns:** *string*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
*Inherited from [NodeObject](nodeobject.md).[property](nodeobject.md#property)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof QGridLayoutSignals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### removeWidget
**removeWidget**(`widget`: [NodeWidget](nodewidget.md)any): *void*
*Overrides [NodeLayout](nodelayout.md).[removeWidget](nodelayout.md#abstract-removewidget)*
**Parameters:**
Name | Type |
------ | ------ |
`widget` | [NodeWidget](nodewidget.md)any |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
*Inherited from [NodeObject](nodeobject.md).[setObjectName](nodeobject.md#setobjectname)*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
*Inherited from [NodeObject](nodeobject.md).[setProperty](nodeobject.md#setproperty)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*
___
### update
**update**(): *void*
*Inherited from [NodeLayout](nodelayout.md).[update](nodelayout.md#update)*
**Returns:** *void*

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,174 @@
---
id: "qicon"
title: "QIcon"
sidebar_label: "QIcon"
---
> The QIcon class provides scalable icons in different modes and states.
**This class is a JS wrapper around Qt's [QIcon class](https://doc.qt.io/qt-5/qicon.html)**
### Example
```javascript
const { QIcon } = require("@nodegui/nodegui");
const imageUrl = "path/to/png";
const icon = new QIcon(imageUrl);
```
## Hierarchy
* [Component](component.md)
↳ **QIcon**
## Index
### Constructors
* [constructor](qicon.md#constructor)
### Properties
* [native](qicon.md#native)
* [nodeChildren](qicon.md#nodechildren)
* [nodeParent](qicon.md#optional-nodeparent)
### Methods
* [cacheKey](qicon.md#cachekey)
* [isMask](qicon.md#ismask)
* [pixmap](qicon.md#pixmap)
* [setIsMask](qicon.md#setismask)
* [setNodeParent](qicon.md#setnodeparent)
* [fromQVariant](qicon.md#static-fromqvariant)
## Constructors
### constructor
\+ **new QIcon**(): *[QIcon](qicon.md)*
**Returns:** *[QIcon](qicon.md)*
\+ **new QIcon**(`native`: [NativeElement](../globals.md#nativeelement)): *[QIcon](qicon.md)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QIcon](qicon.md)*
\+ **new QIcon**(`filePath`: string): *[QIcon](qicon.md)*
**Parameters:**
Name | Type |
------ | ------ |
`filePath` | string |
**Returns:** *[QIcon](qicon.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### cacheKey
**cacheKey**(): *number*
**Returns:** *number*
___
### isMask
**isMask**(): *boolean*
**Returns:** *boolean*
___
### pixmap
**pixmap**(`width`: number, `height`: number, `mode?`: [QIconMode](../enums/qiconmode.md), `state?`: [QIconState](../enums/qiconstate.md)): *[QPixmap](qpixmap.md)*
**Parameters:**
Name | Type |
------ | ------ |
`width` | number |
`height` | number |
`mode?` | [QIconMode](../enums/qiconmode.md) |
`state?` | [QIconState](../enums/qiconstate.md) |
**Returns:** *[QPixmap](qpixmap.md)*
___
### setIsMask
**setIsMask**(`isMask`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`isMask` | boolean |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### `Static` fromQVariant
**fromQVariant**(`variant`: [QVariant](qvariant.md)): *[QIcon](qicon.md)*
**Parameters:**
Name | Type |
------ | ------ |
`variant` | [QVariant](qvariant.md) |
**Returns:** *[QIcon](qicon.md)*

View File

@ -0,0 +1,87 @@
---
id: "qkeyevent"
title: "QKeyEvent"
sidebar_label: "QKeyEvent"
---
## Hierarchy
* **QKeyEvent**
## Index
### Constructors
* [constructor](qkeyevent.md#constructor)
### Properties
* [native](qkeyevent.md#native)
### Methods
* [count](qkeyevent.md#count)
* [isAutoRepeat](qkeyevent.md#isautorepeat)
* [key](qkeyevent.md#key)
* [modifiers](qkeyevent.md#modifiers)
* [text](qkeyevent.md#text)
## Constructors
### constructor
\+ **new QKeyEvent**(`event`: [NativeElement](../globals.md#nativeelement)): *[QKeyEvent](qkeyevent.md)*
**Parameters:**
Name | Type |
------ | ------ |
`event` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QKeyEvent](qkeyevent.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
## Methods
### count
**count**(): *number*
**Returns:** *number*
___
### isAutoRepeat
**isAutoRepeat**(): *boolean*
**Returns:** *boolean*
___
### key
**key**(): *number*
**Returns:** *number*
___
### modifiers
**modifiers**(): *number*
**Returns:** *number*
___
### text
**text**(): *string*
**Returns:** *string*

View File

@ -0,0 +1,106 @@
---
id: "qkeysequence"
title: "QKeySequence"
sidebar_label: "QKeySequence"
---
> The QKeySequence class encapsulates a key sequence as used by shortcuts. .
**This class is a JS wrapper around Qt's [QKeySequence class](https://doc.qt.io/qt-5/qkeysequence.html)**
### Example
```javascript
const { QKeySequence } = require("@nodegui/nodegui");
const keySequence = new QKeySequence(`Ctrl+L`);
```
## Hierarchy
* [Component](component.md)
↳ **QKeySequence**
## Index
### Constructors
* [constructor](qkeysequence.md#constructor)
### Properties
* [native](qkeysequence.md#native)
* [nodeChildren](qkeysequence.md#nodechildren)
* [nodeParent](qkeysequence.md#optional-nodeparent)
### Methods
* [count](qkeysequence.md#count)
* [setNodeParent](qkeysequence.md#setnodeparent)
## Constructors
### constructor
\+ **new QKeySequence**(): *[QKeySequence](qkeysequence.md)*
**Returns:** *[QKeySequence](qkeysequence.md)*
\+ **new QKeySequence**(`keySequence`: string): *[QKeySequence](qkeysequence.md)*
**Parameters:**
Name | Type |
------ | ------ |
`keySequence` | string |
**Returns:** *[QKeySequence](qkeysequence.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
## Methods
### count
**count**(): *number*
**Returns:** *number*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,990 @@
---
id: "qmenu"
title: "QMenu"
sidebar_label: "QMenu"
---
> The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
**This class is a JS wrapper around Qt's [QMenu class](https://doc.qt.io/qt-5/qmenu.html)**
### Example
```javascript
const { QMenu } = require("@nodegui/nodegui");
const menu = new QMenu();
```
## Hierarchy
↳ [NodeWidget](nodewidget.md)[QMenuSignals](../globals.md#qmenusignals)
↳ **QMenu**
## Index
### Constructors
* [constructor](qmenu.md#constructor)
### Properties
* [_rawInlineStyle](qmenu.md#_rawinlinestyle)
* [actions](qmenu.md#actions)
* [layout](qmenu.md#optional-layout)
* [native](qmenu.md#native)
* [nodeChildren](qmenu.md#nodechildren)
* [nodeParent](qmenu.md#optional-nodeparent)
* [type](qmenu.md#type)
### Methods
* [activateWindow](qmenu.md#activatewindow)
* [addAction](qmenu.md#addaction)
* [addEventListener](qmenu.md#addeventlistener)
* [adjustSize](qmenu.md#adjustsize)
* [close](qmenu.md#close)
* [geometry](qmenu.md#geometry)
* [getFlexNode](qmenu.md#getflexnode)
* [hasMouseTracking](qmenu.md#hasmousetracking)
* [hide](qmenu.md#hide)
* [inherits](qmenu.md#inherits)
* [isEnabled](qmenu.md#isenabled)
* [isVisible](qmenu.md#isvisible)
* [lower](qmenu.md#lower)
* [move](qmenu.md#move)
* [objectName](qmenu.md#objectname)
* [pos](qmenu.md#pos)
* [property](qmenu.md#property)
* [raise](qmenu.md#raise)
* [removeEventListener](qmenu.md#removeeventlistener)
* [repaint](qmenu.md#repaint)
* [resize](qmenu.md#resize)
* [setAttribute](qmenu.md#setattribute)
* [setContextMenuPolicy](qmenu.md#setcontextmenupolicy)
* [setCursor](qmenu.md#setcursor)
* [setEnabled](qmenu.md#setenabled)
* [setFixedSize](qmenu.md#setfixedsize)
* [setFlexNodeSizeControlled](qmenu.md#setflexnodesizecontrolled)
* [setGeometry](qmenu.md#setgeometry)
* [setInlineStyle](qmenu.md#setinlinestyle)
* [setLayout](qmenu.md#setlayout)
* [setMaximumSize](qmenu.md#setmaximumsize)
* [setMinimumSize](qmenu.md#setminimumsize)
* [setMouseTracking](qmenu.md#setmousetracking)
* [setNodeParent](qmenu.md#setnodeparent)
* [setObjectName](qmenu.md#setobjectname)
* [setProperty](qmenu.md#setproperty)
* [setStyleSheet](qmenu.md#setstylesheet)
* [setTitle](qmenu.md#settitle)
* [setWindowFlag](qmenu.md#setwindowflag)
* [setWindowIcon](qmenu.md#setwindowicon)
* [setWindowOpacity](qmenu.md#setwindowopacity)
* [setWindowState](qmenu.md#setwindowstate)
* [setWindowTitle](qmenu.md#setwindowtitle)
* [show](qmenu.md#show)
* [showFullScreen](qmenu.md#showfullscreen)
* [showMaximized](qmenu.md#showmaximized)
* [showMinimized](qmenu.md#showminimized)
* [showNormal](qmenu.md#shownormal)
* [size](qmenu.md#size)
* [styleSheet](qmenu.md#stylesheet)
* [testAttribute](qmenu.md#testattribute)
* [update](qmenu.md#update)
* [updateGeometry](qmenu.md#updategeometry)
* [windowOpacity](qmenu.md#windowopacity)
* [windowState](qmenu.md#windowstate)
* [windowTitle](qmenu.md#windowtitle)
## Constructors
### constructor
\+ **new QMenu**(): *[QMenu](qmenu.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Returns:** *[QMenu](qmenu.md)*
\+ **new QMenu**(`parent`: [NodeWidget](nodewidget.md)any): *[QMenu](qmenu.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`parent` | [NodeWidget](nodewidget.md)any |
**Returns:** *[QMenu](qmenu.md)*
## Properties
### _rawInlineStyle
**_rawInlineStyle**: *string* = ""
*Inherited from [NodeWidget](nodewidget.md).[_rawInlineStyle](nodewidget.md#_rawinlinestyle)*
___
### actions
**actions**: *Set[QAction](qaction.md)*
___
### `Optional` layout
**layout**? : *[NodeLayout](nodelayout.md)[QMenuSignals](../globals.md#qmenusignals)*
*Inherited from [NodeWidget](nodewidget.md).[layout](nodewidget.md#optional-layout)*
___
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
___
### type
**type**: *string* = "widget"
*Inherited from [NodeWidget](nodewidget.md).[type](nodewidget.md#type)*
## Methods
### activateWindow
**activateWindow**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[activateWindow](nodewidget.md#activatewindow)*
**Returns:** *void*
___
### addAction
**addAction**(`action`: [QAction](qaction.md)): *[QAction](qaction.md)*
**Parameters:**
Name | Type |
------ | ------ |
`action` | [QAction](qaction.md) |
**Returns:** *[QAction](qaction.md)*
___
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof QMenuSignals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### adjustSize
**adjustSize**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[adjustSize](nodewidget.md#adjustsize)*
**Returns:** *void*
___
### close
**close**(): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[close](nodewidget.md#close)*
**Returns:** *boolean*
___
### geometry
**geometry**(): *[QRect](qrect.md)*
*Inherited from [NodeWidget](nodewidget.md).[geometry](nodewidget.md#geometry)*
**Returns:** *[QRect](qrect.md)*
___
### getFlexNode
**getFlexNode**(): *[FlexNode](../globals.md#flexnode)*
*Inherited from [YogaWidget](yogawidget.md).[getFlexNode](yogawidget.md#getflexnode)*
**Returns:** *[FlexNode](../globals.md#flexnode)*
___
### hasMouseTracking
**hasMouseTracking**(): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[hasMouseTracking](nodewidget.md#hasmousetracking)*
**Returns:** *boolean*
___
### hide
**hide**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[hide](nodewidget.md#hide)*
**Returns:** *void*
___
### inherits
**inherits**(`className`: string): *boolean*
*Inherited from [NodeObject](nodeobject.md).[inherits](nodeobject.md#inherits)*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### isEnabled
**isEnabled**(): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[isEnabled](nodewidget.md#isenabled)*
**Returns:** *boolean*
___
### isVisible
**isVisible**(): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[isVisible](nodewidget.md#isvisible)*
**Returns:** *boolean*
___
### lower
**lower**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[lower](nodewidget.md#lower)*
**Returns:** *void*
___
### move
**move**(`x`: number, `y`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[move](nodewidget.md#move)*
**Parameters:**
Name | Type |
------ | ------ |
`x` | number |
`y` | number |
**Returns:** *void*
___
### objectName
**objectName**(): *string*
*Inherited from [NodeObject](nodeobject.md).[objectName](nodeobject.md#objectname)*
**Returns:** *string*
___
### pos
**pos**(): *object*
*Inherited from [NodeWidget](nodewidget.md).[pos](nodewidget.md#pos)*
**Returns:** *object*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
*Inherited from [NodeObject](nodeobject.md).[property](nodeobject.md#property)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### raise
**raise**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[raise](nodewidget.md#raise)*
**Returns:** *void*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof QMenuSignals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### repaint
**repaint**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[repaint](nodewidget.md#repaint)*
**Returns:** *void*
___
### resize
**resize**(`width`: number, `height`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[resize](nodewidget.md#resize)*
**Parameters:**
Name | Type |
------ | ------ |
`width` | number |
`height` | number |
**Returns:** *void*
___
### setAttribute
**setAttribute**(`attribute`: [WidgetAttribute](../enums/widgetattribute.md), `switchOn`: boolean): *void*
*Inherited from [NodeWidget](nodewidget.md).[setAttribute](nodewidget.md#setattribute)*
**Parameters:**
Name | Type |
------ | ------ |
`attribute` | [WidgetAttribute](../enums/widgetattribute.md) |
`switchOn` | boolean |
**Returns:** *void*
___
### setContextMenuPolicy
**setContextMenuPolicy**(`contextMenuPolicy`: [ContextMenuPolicy](../enums/contextmenupolicy.md)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setContextMenuPolicy](nodewidget.md#setcontextmenupolicy)*
**Parameters:**
Name | Type |
------ | ------ |
`contextMenuPolicy` | [ContextMenuPolicy](../enums/contextmenupolicy.md) |
**Returns:** *void*
___
### setCursor
**setCursor**(`cursor`: [CursorShape](../enums/cursorshape.md) | [QCursor](qcursor.md)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setCursor](nodewidget.md#setcursor)*
**Parameters:**
Name | Type |
------ | ------ |
`cursor` | [CursorShape](../enums/cursorshape.md) &#124; [QCursor](qcursor.md) |
**Returns:** *void*
___
### setEnabled
**setEnabled**(`enabled`: boolean): *void*
*Inherited from [NodeWidget](nodewidget.md).[setEnabled](nodewidget.md#setenabled)*
**Parameters:**
Name | Type |
------ | ------ |
`enabled` | boolean |
**Returns:** *void*
___
### setFixedSize
**setFixedSize**(`width`: number, `height`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setFixedSize](nodewidget.md#setfixedsize)*
**Parameters:**
Name | Type |
------ | ------ |
`width` | number |
`height` | number |
**Returns:** *void*
___
### setFlexNodeSizeControlled
**setFlexNodeSizeControlled**(`isSizeControlled`: boolean): *void*
*Inherited from [YogaWidget](yogawidget.md).[setFlexNodeSizeControlled](yogawidget.md#setflexnodesizecontrolled)*
sets whether the widget's size is controlled by someone else (for example a window's size is controlled by its frame when dragged).
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`isSizeControlled` | boolean | |
**Returns:** *void*
___
### setGeometry
**setGeometry**(`x`: number, `y`: number, `w`: number, `h`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setGeometry](nodewidget.md#setgeometry)*
**Parameters:**
Name | Type |
------ | ------ |
`x` | number |
`y` | number |
`w` | number |
`h` | number |
**Returns:** *void*
___
### setInlineStyle
**setInlineStyle**(`style`: string): *void*
*Inherited from [NodeWidget](nodewidget.md).[setInlineStyle](nodewidget.md#setinlinestyle)*
**Parameters:**
Name | Type |
------ | ------ |
`style` | string |
**Returns:** *void*
___
### setLayout
**setLayout**(`parentLayout`: [NodeLayout](nodelayout.md)[QMenuSignals](../globals.md#qmenusignals)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setLayout](nodewidget.md#setlayout)*
**Parameters:**
Name | Type |
------ | ------ |
`parentLayout` | [NodeLayout](nodelayout.md)[QMenuSignals](../globals.md#qmenusignals) |
**Returns:** *void*
___
### setMaximumSize
**setMaximumSize**(`maxw`: number, `maxh`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setMaximumSize](nodewidget.md#setmaximumsize)*
**Parameters:**
Name | Type |
------ | ------ |
`maxw` | number |
`maxh` | number |
**Returns:** *void*
___
### setMinimumSize
**setMinimumSize**(`minw`: number, `minh`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setMinimumSize](nodewidget.md#setminimumsize)*
**Parameters:**
Name | Type |
------ | ------ |
`minw` | number |
`minh` | number |
**Returns:** *void*
___
### setMouseTracking
**setMouseTracking**(`isMouseTracked`: boolean): *void*
*Inherited from [NodeWidget](nodewidget.md).[setMouseTracking](nodewidget.md#setmousetracking)*
**Parameters:**
Name | Type |
------ | ------ |
`isMouseTracked` | boolean |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
*Inherited from [NodeWidget](nodewidget.md).[setObjectName](nodewidget.md#setobjectname)*
*Overrides [NodeObject](nodeobject.md).[setObjectName](nodeobject.md#setobjectname)*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
*Inherited from [NodeObject](nodeobject.md).[setProperty](nodeobject.md#setproperty)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*
___
### setStyleSheet
**setStyleSheet**(`styleSheet`: string): *void*
*Inherited from [NodeWidget](nodewidget.md).[setStyleSheet](nodewidget.md#setstylesheet)*
**Parameters:**
Name | Type |
------ | ------ |
`styleSheet` | string |
**Returns:** *void*
___
### setTitle
**setTitle**(`title`: string): *void*
**Parameters:**
Name | Type |
------ | ------ |
`title` | string |
**Returns:** *void*
___
### setWindowFlag
**setWindowFlag**(`windowType`: [WindowType](../enums/windowtype.md), `switchOn`: boolean): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowFlag](nodewidget.md#setwindowflag)*
**Parameters:**
Name | Type |
------ | ------ |
`windowType` | [WindowType](../enums/windowtype.md) |
`switchOn` | boolean |
**Returns:** *void*
___
### setWindowIcon
**setWindowIcon**(`icon`: [QIcon](qicon.md)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowIcon](nodewidget.md#setwindowicon)*
**Parameters:**
Name | Type |
------ | ------ |
`icon` | [QIcon](qicon.md) |
**Returns:** *void*
___
### setWindowOpacity
**setWindowOpacity**(`opacity`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowOpacity](nodewidget.md#setwindowopacity)*
**Parameters:**
Name | Type |
------ | ------ |
`opacity` | number |
**Returns:** *void*
___
### setWindowState
**setWindowState**(`state`: [WindowState](../enums/windowstate.md)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowState](nodewidget.md#setwindowstate)*
**Parameters:**
Name | Type |
------ | ------ |
`state` | [WindowState](../enums/windowstate.md) |
**Returns:** *void*
___
### setWindowTitle
**setWindowTitle**(`title`: string): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowTitle](nodewidget.md#setwindowtitle)*
**Parameters:**
Name | Type |
------ | ------ |
`title` | string |
**Returns:** *void*
___
### show
**show**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[show](nodewidget.md#show)*
**Returns:** *void*
___
### showFullScreen
**showFullScreen**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[showFullScreen](nodewidget.md#showfullscreen)*
**Returns:** *void*
___
### showMaximized
**showMaximized**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[showMaximized](nodewidget.md#showmaximized)*
**Returns:** *void*
___
### showMinimized
**showMinimized**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[showMinimized](nodewidget.md#showminimized)*
**Returns:** *void*
___
### showNormal
**showNormal**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[showNormal](nodewidget.md#shownormal)*
**Returns:** *void*
___
### size
**size**(): *[QSize](qsize.md)*
*Inherited from [NodeWidget](nodewidget.md).[size](nodewidget.md#size)*
**Returns:** *[QSize](qsize.md)*
___
### styleSheet
**styleSheet**(): *string*
*Inherited from [NodeWidget](nodewidget.md).[styleSheet](nodewidget.md#stylesheet)*
**Returns:** *string*
___
### testAttribute
**testAttribute**(`attribute`: [WidgetAttribute](../enums/widgetattribute.md)): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[testAttribute](nodewidget.md#testattribute)*
**Parameters:**
Name | Type |
------ | ------ |
`attribute` | [WidgetAttribute](../enums/widgetattribute.md) |
**Returns:** *boolean*
___
### update
**update**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[update](nodewidget.md#update)*
**Returns:** *void*
___
### updateGeometry
**updateGeometry**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[updateGeometry](nodewidget.md#updategeometry)*
**Returns:** *void*
___
### windowOpacity
**windowOpacity**(): *number*
*Inherited from [NodeWidget](nodewidget.md).[windowOpacity](nodewidget.md#windowopacity)*
**Returns:** *number*
___
### windowState
**windowState**(): *number*
*Inherited from [NodeWidget](nodewidget.md).[windowState](nodewidget.md#windowstate)*
**Returns:** *number*
___
### windowTitle
**windowTitle**(): *string*
*Inherited from [NodeWidget](nodewidget.md).[windowTitle](nodewidget.md#windowtitle)*
**Returns:** *string*

View File

@ -0,0 +1,999 @@
---
id: "qmenubar"
title: "QMenuBar"
sidebar_label: "QMenuBar"
---
> The QMenuBar class provides a menu widget for use in menu bars, context menus, and other popup menus.
**This class is a JS wrapper around Qt's [QMenuBar class](https://doc.qt.io/qt-5/qmenu.html)**
### Example
```javascript
const { QMenuBar, QMainWindow } = require("@nodegui/nodegui");
const win = new QMainWindow();
const menu = new QMenuBar();
const menuBar = new QMenuBar();
win.setMenuBar(menuBar);
win.show();
global.win = win;
```
## Hierarchy
↳ [NodeWidget](nodewidget.md)[QMenuBarSignals](../globals.md#qmenubarsignals)
↳ **QMenuBar**
## Index
### Constructors
* [constructor](qmenubar.md#constructor)
### Properties
* [_rawInlineStyle](qmenubar.md#_rawinlinestyle)
* [layout](qmenubar.md#optional-layout)
* [native](qmenubar.md#native)
* [nodeChildren](qmenubar.md#nodechildren)
* [nodeParent](qmenubar.md#optional-nodeparent)
* [type](qmenubar.md#type)
### Methods
* [activateWindow](qmenubar.md#activatewindow)
* [addEventListener](qmenubar.md#addeventlistener)
* [addMenu](qmenubar.md#addmenu)
* [adjustSize](qmenubar.md#adjustsize)
* [close](qmenubar.md#close)
* [geometry](qmenubar.md#geometry)
* [getFlexNode](qmenubar.md#getflexnode)
* [hasMouseTracking](qmenubar.md#hasmousetracking)
* [hide](qmenubar.md#hide)
* [inherits](qmenubar.md#inherits)
* [isEnabled](qmenubar.md#isenabled)
* [isVisible](qmenubar.md#isvisible)
* [lower](qmenubar.md#lower)
* [move](qmenubar.md#move)
* [objectName](qmenubar.md#objectname)
* [pos](qmenubar.md#pos)
* [property](qmenubar.md#property)
* [raise](qmenubar.md#raise)
* [removeEventListener](qmenubar.md#removeeventlistener)
* [repaint](qmenubar.md#repaint)
* [resize](qmenubar.md#resize)
* [setAttribute](qmenubar.md#setattribute)
* [setContextMenuPolicy](qmenubar.md#setcontextmenupolicy)
* [setCursor](qmenubar.md#setcursor)
* [setEnabled](qmenubar.md#setenabled)
* [setFixedSize](qmenubar.md#setfixedsize)
* [setFlexNodeSizeControlled](qmenubar.md#setflexnodesizecontrolled)
* [setGeometry](qmenubar.md#setgeometry)
* [setInlineStyle](qmenubar.md#setinlinestyle)
* [setLayout](qmenubar.md#setlayout)
* [setMaximumSize](qmenubar.md#setmaximumsize)
* [setMinimumSize](qmenubar.md#setminimumsize)
* [setMouseTracking](qmenubar.md#setmousetracking)
* [setNativeMenuBar](qmenubar.md#setnativemenubar)
* [setNodeParent](qmenubar.md#setnodeparent)
* [setObjectName](qmenubar.md#setobjectname)
* [setProperty](qmenubar.md#setproperty)
* [setStyleSheet](qmenubar.md#setstylesheet)
* [setWindowFlag](qmenubar.md#setwindowflag)
* [setWindowIcon](qmenubar.md#setwindowicon)
* [setWindowOpacity](qmenubar.md#setwindowopacity)
* [setWindowState](qmenubar.md#setwindowstate)
* [setWindowTitle](qmenubar.md#setwindowtitle)
* [show](qmenubar.md#show)
* [showFullScreen](qmenubar.md#showfullscreen)
* [showMaximized](qmenubar.md#showmaximized)
* [showMinimized](qmenubar.md#showminimized)
* [showNormal](qmenubar.md#shownormal)
* [size](qmenubar.md#size)
* [styleSheet](qmenubar.md#stylesheet)
* [testAttribute](qmenubar.md#testattribute)
* [update](qmenubar.md#update)
* [updateGeometry](qmenubar.md#updategeometry)
* [windowOpacity](qmenubar.md#windowopacity)
* [windowState](qmenubar.md#windowstate)
* [windowTitle](qmenubar.md#windowtitle)
## Constructors
### constructor
\+ **new QMenuBar**(): *[QMenuBar](qmenubar.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Returns:** *[QMenuBar](qmenubar.md)*
\+ **new QMenuBar**(`parent`: [NodeWidget](nodewidget.md)any): *[QMenuBar](qmenubar.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`parent` | [NodeWidget](nodewidget.md)any |
**Returns:** *[QMenuBar](qmenubar.md)*
\+ **new QMenuBar**(`native`: [NativeElement](../globals.md#nativeelement)): *[QMenuBar](qmenubar.md)*
*Overrides [EventWidget](eventwidget.md).[constructor](eventwidget.md#constructor)*
**Parameters:**
Name | Type |
------ | ------ |
`native` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QMenuBar](qmenubar.md)*
## Properties
### _rawInlineStyle
**_rawInlineStyle**: *string* = ""
*Inherited from [NodeWidget](nodewidget.md).[_rawInlineStyle](nodewidget.md#_rawinlinestyle)*
___
### `Optional` layout
**layout**? : *[NodeLayout](nodelayout.md)[QMenuBarSignals](../globals.md#qmenubarsignals)*
*Inherited from [NodeWidget](nodewidget.md).[layout](nodewidget.md#optional-layout)*
___
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
*Overrides [Component](component.md).[native](component.md#abstract-native)*
___
### nodeChildren
**nodeChildren**: *Setunknown* = new Set()
*Inherited from [Component](component.md).[nodeChildren](component.md#nodechildren)*
___
### `Optional` nodeParent
**nodeParent**? : *[Component](component.md)*
*Inherited from [Component](component.md).[nodeParent](component.md#optional-nodeparent)*
___
### type
**type**: *string* = "widget"
*Inherited from [NodeWidget](nodewidget.md).[type](nodewidget.md#type)*
## Methods
### activateWindow
**activateWindow**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[activateWindow](nodewidget.md#activatewindow)*
**Returns:** *void*
___
### addEventListener
**addEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Type parameters:**
**SignalType**: *keyof QMenuBarSignals*
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`signalType` | SignalType | SignalType is a signal from the widgets signals interface. |
`callback` | Signals[SignalType] | Corresponding callback for the signal as mentioned in the widget's signal interface |
**Returns:** *void*
void
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener('clicked',(checked)=>console.log("clicked"));
// here clicked is a value from QPushButtonSignals interface
```
**addEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[addEventListener](eventwidget.md#addeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
For example in the case of QPushButton:
```js
const button = new QPushButton();
button.addEventListener(WidgetEventTypes.HoverEnter,()=>console.log("hovered"));
```
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### addMenu
**addMenu**(`menu`: [QMenu](qmenu.md)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`menu` | [QMenu](qmenu.md) |
**Returns:** *void*
___
### adjustSize
**adjustSize**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[adjustSize](nodewidget.md#adjustsize)*
**Returns:** *void*
___
### close
**close**(): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[close](nodewidget.md#close)*
**Returns:** *boolean*
___
### geometry
**geometry**(): *[QRect](qrect.md)*
*Inherited from [NodeWidget](nodewidget.md).[geometry](nodewidget.md#geometry)*
**Returns:** *[QRect](qrect.md)*
___
### getFlexNode
**getFlexNode**(): *[FlexNode](../globals.md#flexnode)*
*Inherited from [YogaWidget](yogawidget.md).[getFlexNode](yogawidget.md#getflexnode)*
**Returns:** *[FlexNode](../globals.md#flexnode)*
___
### hasMouseTracking
**hasMouseTracking**(): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[hasMouseTracking](nodewidget.md#hasmousetracking)*
**Returns:** *boolean*
___
### hide
**hide**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[hide](nodewidget.md#hide)*
**Returns:** *void*
___
### inherits
**inherits**(`className`: string): *boolean*
*Inherited from [NodeObject](nodeobject.md).[inherits](nodeobject.md#inherits)*
**Parameters:**
Name | Type |
------ | ------ |
`className` | string |
**Returns:** *boolean*
___
### isEnabled
**isEnabled**(): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[isEnabled](nodewidget.md#isenabled)*
**Returns:** *boolean*
___
### isVisible
**isVisible**(): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[isVisible](nodewidget.md#isvisible)*
**Returns:** *boolean*
___
### lower
**lower**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[lower](nodewidget.md#lower)*
**Returns:** *void*
___
### move
**move**(`x`: number, `y`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[move](nodewidget.md#move)*
**Parameters:**
Name | Type |
------ | ------ |
`x` | number |
`y` | number |
**Returns:** *void*
___
### objectName
**objectName**(): *string*
*Inherited from [NodeObject](nodeobject.md).[objectName](nodeobject.md#objectname)*
**Returns:** *string*
___
### pos
**pos**(): *object*
*Inherited from [NodeWidget](nodewidget.md).[pos](nodewidget.md#pos)*
**Returns:** *object*
___
### property
**property**(`name`: string): *[QVariant](qvariant.md)*
*Inherited from [NodeObject](nodeobject.md).[property](nodeobject.md#property)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
**Returns:** *[QVariant](qvariant.md)*
___
### raise
**raise**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[raise](nodewidget.md#raise)*
**Returns:** *void*
___
### removeEventListener
**removeEventListener**<**SignalType**>(`signalType`: SignalType, `callback`: Signals[SignalType]): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Type parameters:**
**SignalType**: *keyof QMenuBarSignals*
**Parameters:**
Name | Type |
------ | ------ |
`signalType` | SignalType |
`callback` | Signals[SignalType] |
**Returns:** *void*
**removeEventListener**(`eventType`: [WidgetEventTypes](../enums/widgeteventtypes.md), `callback`: function): *void*
*Inherited from [EventWidget](eventwidget.md).[removeEventListener](eventwidget.md#removeeventlistener)*
**Parameters:**
**eventType**: *[WidgetEventTypes](../enums/widgeteventtypes.md)*
**callback**: *function*
▸ (`event?`: [NativeElement](../globals.md#nativeelement)): *void*
**Parameters:**
Name | Type |
------ | ------ |
`event?` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *void*
___
### repaint
**repaint**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[repaint](nodewidget.md#repaint)*
**Returns:** *void*
___
### resize
**resize**(`width`: number, `height`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[resize](nodewidget.md#resize)*
**Parameters:**
Name | Type |
------ | ------ |
`width` | number |
`height` | number |
**Returns:** *void*
___
### setAttribute
**setAttribute**(`attribute`: [WidgetAttribute](../enums/widgetattribute.md), `switchOn`: boolean): *void*
*Inherited from [NodeWidget](nodewidget.md).[setAttribute](nodewidget.md#setattribute)*
**Parameters:**
Name | Type |
------ | ------ |
`attribute` | [WidgetAttribute](../enums/widgetattribute.md) |
`switchOn` | boolean |
**Returns:** *void*
___
### setContextMenuPolicy
**setContextMenuPolicy**(`contextMenuPolicy`: [ContextMenuPolicy](../enums/contextmenupolicy.md)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setContextMenuPolicy](nodewidget.md#setcontextmenupolicy)*
**Parameters:**
Name | Type |
------ | ------ |
`contextMenuPolicy` | [ContextMenuPolicy](../enums/contextmenupolicy.md) |
**Returns:** *void*
___
### setCursor
**setCursor**(`cursor`: [CursorShape](../enums/cursorshape.md) | [QCursor](qcursor.md)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setCursor](nodewidget.md#setcursor)*
**Parameters:**
Name | Type |
------ | ------ |
`cursor` | [CursorShape](../enums/cursorshape.md) &#124; [QCursor](qcursor.md) |
**Returns:** *void*
___
### setEnabled
**setEnabled**(`enabled`: boolean): *void*
*Inherited from [NodeWidget](nodewidget.md).[setEnabled](nodewidget.md#setenabled)*
**Parameters:**
Name | Type |
------ | ------ |
`enabled` | boolean |
**Returns:** *void*
___
### setFixedSize
**setFixedSize**(`width`: number, `height`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setFixedSize](nodewidget.md#setfixedsize)*
**Parameters:**
Name | Type |
------ | ------ |
`width` | number |
`height` | number |
**Returns:** *void*
___
### setFlexNodeSizeControlled
**setFlexNodeSizeControlled**(`isSizeControlled`: boolean): *void*
*Inherited from [YogaWidget](yogawidget.md).[setFlexNodeSizeControlled](yogawidget.md#setflexnodesizecontrolled)*
sets whether the widget's size is controlled by someone else (for example a window's size is controlled by its frame when dragged).
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`isSizeControlled` | boolean | |
**Returns:** *void*
___
### setGeometry
**setGeometry**(`x`: number, `y`: number, `w`: number, `h`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setGeometry](nodewidget.md#setgeometry)*
**Parameters:**
Name | Type |
------ | ------ |
`x` | number |
`y` | number |
`w` | number |
`h` | number |
**Returns:** *void*
___
### setInlineStyle
**setInlineStyle**(`style`: string): *void*
*Inherited from [NodeWidget](nodewidget.md).[setInlineStyle](nodewidget.md#setinlinestyle)*
**Parameters:**
Name | Type |
------ | ------ |
`style` | string |
**Returns:** *void*
___
### setLayout
**setLayout**(`parentLayout`: [NodeLayout](nodelayout.md)[QMenuBarSignals](../globals.md#qmenubarsignals)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setLayout](nodewidget.md#setlayout)*
**Parameters:**
Name | Type |
------ | ------ |
`parentLayout` | [NodeLayout](nodelayout.md)[QMenuBarSignals](../globals.md#qmenubarsignals) |
**Returns:** *void*
___
### setMaximumSize
**setMaximumSize**(`maxw`: number, `maxh`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setMaximumSize](nodewidget.md#setmaximumsize)*
**Parameters:**
Name | Type |
------ | ------ |
`maxw` | number |
`maxh` | number |
**Returns:** *void*
___
### setMinimumSize
**setMinimumSize**(`minw`: number, `minh`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setMinimumSize](nodewidget.md#setminimumsize)*
**Parameters:**
Name | Type |
------ | ------ |
`minw` | number |
`minh` | number |
**Returns:** *void*
___
### setMouseTracking
**setMouseTracking**(`isMouseTracked`: boolean): *void*
*Inherited from [NodeWidget](nodewidget.md).[setMouseTracking](nodewidget.md#setmousetracking)*
**Parameters:**
Name | Type |
------ | ------ |
`isMouseTracked` | boolean |
**Returns:** *void*
___
### setNativeMenuBar
**setNativeMenuBar**(`nativeMenuBar`: boolean): *void*
**Parameters:**
Name | Type |
------ | ------ |
`nativeMenuBar` | boolean |
**Returns:** *void*
___
### setNodeParent
**setNodeParent**(`parent?`: [Component](component.md)): *void*
*Inherited from [Component](component.md).[setNodeParent](component.md#setnodeparent)*
**Parameters:**
Name | Type |
------ | ------ |
`parent?` | [Component](component.md) |
**Returns:** *void*
___
### setObjectName
**setObjectName**(`objectName`: string): *void*
*Inherited from [NodeWidget](nodewidget.md).[setObjectName](nodewidget.md#setobjectname)*
*Overrides [NodeObject](nodeobject.md).[setObjectName](nodeobject.md#setobjectname)*
**Parameters:**
Name | Type |
------ | ------ |
`objectName` | string |
**Returns:** *void*
___
### setProperty
**setProperty**(`name`: string, `value`: [QVariantType](../globals.md#qvarianttype)): *boolean*
*Inherited from [NodeObject](nodeobject.md).[setProperty](nodeobject.md#setproperty)*
**Parameters:**
Name | Type |
------ | ------ |
`name` | string |
`value` | [QVariantType](../globals.md#qvarianttype) |
**Returns:** *boolean*
___
### setStyleSheet
**setStyleSheet**(`styleSheet`: string): *void*
*Inherited from [NodeWidget](nodewidget.md).[setStyleSheet](nodewidget.md#setstylesheet)*
**Parameters:**
Name | Type |
------ | ------ |
`styleSheet` | string |
**Returns:** *void*
___
### setWindowFlag
**setWindowFlag**(`windowType`: [WindowType](../enums/windowtype.md), `switchOn`: boolean): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowFlag](nodewidget.md#setwindowflag)*
**Parameters:**
Name | Type |
------ | ------ |
`windowType` | [WindowType](../enums/windowtype.md) |
`switchOn` | boolean |
**Returns:** *void*
___
### setWindowIcon
**setWindowIcon**(`icon`: [QIcon](qicon.md)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowIcon](nodewidget.md#setwindowicon)*
**Parameters:**
Name | Type |
------ | ------ |
`icon` | [QIcon](qicon.md) |
**Returns:** *void*
___
### setWindowOpacity
**setWindowOpacity**(`opacity`: number): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowOpacity](nodewidget.md#setwindowopacity)*
**Parameters:**
Name | Type |
------ | ------ |
`opacity` | number |
**Returns:** *void*
___
### setWindowState
**setWindowState**(`state`: [WindowState](../enums/windowstate.md)): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowState](nodewidget.md#setwindowstate)*
**Parameters:**
Name | Type |
------ | ------ |
`state` | [WindowState](../enums/windowstate.md) |
**Returns:** *void*
___
### setWindowTitle
**setWindowTitle**(`title`: string): *void*
*Inherited from [NodeWidget](nodewidget.md).[setWindowTitle](nodewidget.md#setwindowtitle)*
**Parameters:**
Name | Type |
------ | ------ |
`title` | string |
**Returns:** *void*
___
### show
**show**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[show](nodewidget.md#show)*
**Returns:** *void*
___
### showFullScreen
**showFullScreen**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[showFullScreen](nodewidget.md#showfullscreen)*
**Returns:** *void*
___
### showMaximized
**showMaximized**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[showMaximized](nodewidget.md#showmaximized)*
**Returns:** *void*
___
### showMinimized
**showMinimized**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[showMinimized](nodewidget.md#showminimized)*
**Returns:** *void*
___
### showNormal
**showNormal**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[showNormal](nodewidget.md#shownormal)*
**Returns:** *void*
___
### size
**size**(): *[QSize](qsize.md)*
*Inherited from [NodeWidget](nodewidget.md).[size](nodewidget.md#size)*
**Returns:** *[QSize](qsize.md)*
___
### styleSheet
**styleSheet**(): *string*
*Inherited from [NodeWidget](nodewidget.md).[styleSheet](nodewidget.md#stylesheet)*
**Returns:** *string*
___
### testAttribute
**testAttribute**(`attribute`: [WidgetAttribute](../enums/widgetattribute.md)): *boolean*
*Inherited from [NodeWidget](nodewidget.md).[testAttribute](nodewidget.md#testattribute)*
**Parameters:**
Name | Type |
------ | ------ |
`attribute` | [WidgetAttribute](../enums/widgetattribute.md) |
**Returns:** *boolean*
___
### update
**update**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[update](nodewidget.md#update)*
**Returns:** *void*
___
### updateGeometry
**updateGeometry**(): *void*
*Inherited from [NodeWidget](nodewidget.md).[updateGeometry](nodewidget.md#updategeometry)*
**Returns:** *void*
___
### windowOpacity
**windowOpacity**(): *number*
*Inherited from [NodeWidget](nodewidget.md).[windowOpacity](nodewidget.md#windowopacity)*
**Returns:** *number*
___
### windowState
**windowState**(): *number*
*Inherited from [NodeWidget](nodewidget.md).[windowState](nodewidget.md#windowstate)*
**Returns:** *number*
___
### windowTitle
**windowTitle**(): *string*
*Inherited from [NodeWidget](nodewidget.md).[windowTitle](nodewidget.md#windowtitle)*
**Returns:** *string*

View File

@ -0,0 +1,87 @@
---
id: "qmouseevent"
title: "QMouseEvent"
sidebar_label: "QMouseEvent"
---
## Hierarchy
* **QMouseEvent**
## Index
### Constructors
* [constructor](qmouseevent.md#constructor)
### Properties
* [native](qmouseevent.md#native)
### Methods
* [button](qmouseevent.md#button)
* [globalX](qmouseevent.md#globalx)
* [globalY](qmouseevent.md#globaly)
* [x](qmouseevent.md#x)
* [y](qmouseevent.md#y)
## Constructors
### constructor
\+ **new QMouseEvent**(`event`: [NativeElement](../globals.md#nativeelement)): *[QMouseEvent](qmouseevent.md)*
**Parameters:**
Name | Type |
------ | ------ |
`event` | [NativeElement](../globals.md#nativeelement) |
**Returns:** *[QMouseEvent](qmouseevent.md)*
## Properties
### native
**native**: *[NativeElement](../globals.md#nativeelement)*
## Methods
### button
**button**(): *string*
**Returns:** *string*
___
### globalX
**globalX**(): *number*
**Returns:** *number*
___
### globalY
**globalY**(): *number*
**Returns:** *number*
___
### x
**x**(): *number*
**Returns:** *number*
___
### y
**y**(): *number*
**Returns:** *number*

Some files were not shown because too many files have changed in this diff Show More