Added documentation

This commit is contained in:
Kakul Gupta 2019-08-18 20:12:11 +02:00
parent 432b7701f4
commit 1b447a7f95
2 changed files with 39 additions and 1 deletions

32
docs/api/QIcon.md Normal file
View File

@ -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)

View File

@ -45,4 +45,10 @@ Sets the given text to the button.
Sets whether the button border is raised.
- `isFlat` boolean
- `isFlat` boolean
#### `button.setIcon(icon)`
Sets an icon in the button.
- `icon` QIcon