Adds documentation and exports
This commit is contained in:
parent
a7762d0c23
commit
2bcbb38778
@ -30,3 +30,14 @@ QIcon can access all the instance properties defined in [Component](api/Componen
|
|||||||
### Instance Methods
|
### Instance Methods
|
||||||
|
|
||||||
QIcon can access all the instance methods defined in [Component](api/Component.md)
|
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?)`
|
||||||
|
|
||||||
|
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
|
||||||
|
|||||||
@ -5,7 +5,7 @@ export * from "./lib/QtEnums";
|
|||||||
// Gui:
|
// Gui:
|
||||||
export { QApplication } from "./lib/QtGui/QApplication";
|
export { QApplication } from "./lib/QtGui/QApplication";
|
||||||
export { QPixmap } from "./lib/QtGui/QPixmap";
|
export { QPixmap } from "./lib/QtGui/QPixmap";
|
||||||
export { QIcon } from "./lib/QtGui/QIcon";
|
export { QIcon, QIconMode, QIconState } from "./lib/QtGui/QIcon";
|
||||||
export { QCursor } from "./lib/QtGui/QCursor";
|
export { QCursor } from "./lib/QtGui/QCursor";
|
||||||
export { QTextOptionWrapMode } from "./lib/QtGui/QTextOption";
|
export { QTextOptionWrapMode } from "./lib/QtGui/QTextOption";
|
||||||
export { QClipboard, QClipboardMode } from "./lib/QtGui/QClipboard";
|
export { QClipboard, QClipboardMode } from "./lib/QtGui/QClipboard";
|
||||||
|
|||||||
@ -2,8 +2,16 @@ import addon from "../../core/addon";
|
|||||||
import { Component, NativeElement } from "../../core/Component";
|
import { Component, NativeElement } from "../../core/Component";
|
||||||
import { QPixmap } from "../../QtGui/QPixmap";
|
import { QPixmap } from "../../QtGui/QPixmap";
|
||||||
|
|
||||||
export enum QIconMode { Normal, Disabled, Active, Selected }
|
export enum QIconMode {
|
||||||
export enum QIconState { Off, On }
|
Normal,
|
||||||
|
Disabled,
|
||||||
|
Active,
|
||||||
|
Selected
|
||||||
|
}
|
||||||
|
export enum QIconState {
|
||||||
|
Off,
|
||||||
|
On
|
||||||
|
}
|
||||||
|
|
||||||
type arg = string | NativeElement;
|
type arg = string | NativeElement;
|
||||||
export class QIcon extends Component {
|
export class QIcon extends Component {
|
||||||
@ -21,7 +29,7 @@ export class QIcon extends Component {
|
|||||||
width: number,
|
width: number,
|
||||||
height: number,
|
height: number,
|
||||||
mode?: QIconMode,
|
mode?: QIconMode,
|
||||||
state?: QIconState,
|
state?: QIconState
|
||||||
): QPixmap => {
|
): QPixmap => {
|
||||||
let nativePixmap;
|
let nativePixmap;
|
||||||
if (mode && state) {
|
if (mode && state) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user