nodeguy/src/lib/QtWidgets/QDateEdit.ts
feng8848 c47f788094
Add QScrollBar and other improvements (#383)
* Add QScrollBar and other improvements

* Add Windows plugin export

* Fixes QDateEdit and QTimeEdit.

Co-authored-by: Atul R <atulanand94@gmail.com>
2020-02-07 20:22:49 +01:00

39 lines
1.0 KiB
TypeScript

import addon from '../utils/addon';
import { NodeWidget } from './QWidget';
import { NativeElement } from '../core/Component';
import { NodeDateTimeEdit } from './QDateTimeEdit';
/**
> Creates a widget to edit dates with spin box layout. WIP!
* **This class is a JS wrapper around Qt's [QDateEdit class](https://doc.qt.io/qt-5/qdateedit.html)**
A `QDateEdit` provides a widget for editing dates based on the QDateTimeEdit widget.
### Example
```javascript
const { QDateEdit } = require("@nodegui/nodegui");
const dateEdit = new QDateEdit();
// must be implemented
```
*/
export class QDateEdit extends NodeDateTimeEdit {
native: NativeElement;
constructor();
constructor(parent: NodeWidget<any>);
constructor(parent?: NodeWidget<any>) {
let native;
if (parent) {
native = new addon.QDateEdit(parent.native);
} else {
native = new addon.QDateEdit();
}
super(native);
this.native = native;
this.setNodeParent(parent);
}
}