Fixes docs

This commit is contained in:
Atul R 2019-08-24 12:35:04 +02:00
parent 95a60496e6
commit 53345e1511
3 changed files with 86 additions and 0 deletions

View File

@ -43,6 +43,10 @@
- [QApplication (Application)](api/QApplication.md)
- [QMainWindow (Window)](api/QMainWindow.md)
- [QWidget (View)](api/QWidget.md)
- [QSpinBox ()](api/QSpinBox.md)
- [QAbstractScrollArea ()](api/QAbstractScrollArea.md)
- [QScrollArea ()](api/QScrollArea.md)
- [QPlainTextEdit (TextEdit)](api/QPlainTextEdit.md)
- [QLabel (Text/Image)](api/QLabel.md)
- [QPushButton (Button)](api/QPushButton.md)
- [QRadioButton (RadioButton)](api/QRadioButton.md)
@ -51,6 +55,7 @@
- [QProgressBar (ProgressBar)](api/QProgressBar.md)
- [FlexLayout](api/FlexLayout.md)
- [QPixmap](api/QPixmap.md)
- [QIcon](api/QIcon.md)
- [Qt Enums](api/QtEnums.md)
### Internal Modules

View File

@ -0,0 +1,35 @@
## Class: 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 scoll 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 scollarea 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).

46
docs/api/QScrollArea.md Normal file
View File

@ -0,0 +1,46 @@
## Class: 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.