Adds documentation and exports

This commit is contained in:
Atul R 2019-09-20 23:18:02 +02:00
parent a7762d0c23
commit 2bcbb38778
3 changed files with 23 additions and 4 deletions

View File

@ -30,3 +30,14 @@ QIcon can access all the instance properties defined in [Component](api/Componen
### 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?)`
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

View File

@ -5,7 +5,7 @@ export * from "./lib/QtEnums";
// Gui:
export { QApplication } from "./lib/QtGui/QApplication";
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 { QTextOptionWrapMode } from "./lib/QtGui/QTextOption";
export { QClipboard, QClipboardMode } from "./lib/QtGui/QClipboard";

View File

@ -2,8 +2,16 @@ import addon from "../../core/addon";
import { Component, NativeElement } from "../../core/Component";
import { QPixmap } from "../../QtGui/QPixmap";
export enum QIconMode { Normal, Disabled, Active, Selected }
export enum QIconState { Off, On }
export enum QIconMode {
Normal,
Disabled,
Active,
Selected
}
export enum QIconState {
Off,
On
}
type arg = string | NativeElement;
export class QIcon extends Component {
@ -21,7 +29,7 @@ export class QIcon extends Component {
width: number,
height: number,
mode?: QIconMode,
state?: QIconState,
state?: QIconState
): QPixmap => {
let nativePixmap;
if (mode && state) {