From 1b447a7f9553792f6c3207090a916a803aa0cc8b Mon Sep 17 00:00:00 2001 From: Kakul Gupta Date: Sun, 18 Aug 2019 20:12:11 +0200 Subject: [PATCH] Added documentation --- docs/api/QIcon.md | 32 ++++++++++++++++++++++++++++++++ docs/api/QPushButton.md | 8 +++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 docs/api/QIcon.md diff --git a/docs/api/QIcon.md b/docs/api/QIcon.md new file mode 100644 index 000000000..2a6cd1e08 --- /dev/null +++ b/docs/api/QIcon.md @@ -0,0 +1,32 @@ +## Class: 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) diff --git a/docs/api/QPushButton.md b/docs/api/QPushButton.md index 0419b6b50..0674e7c3b 100644 --- a/docs/api/QPushButton.md +++ b/docs/api/QPushButton.md @@ -45,4 +45,10 @@ Sets the given text to the button. Sets whether the button border is raised. -- `isFlat` boolean \ No newline at end of file +- `isFlat` boolean + +#### `button.setIcon(icon)` + +Sets an icon in the button. + +- `icon` QIcon \ No newline at end of file