nodeguy/src/lib/QtWidgets/QTimeEdit.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
1019 B
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 [QTimeEdit class](https://doc.qt.io/qt-5/qtimeedit.html)**
A `QTimeEdit` a widget for editing times based on the QDateTimeEdit widget
### Example
```javascript
const { QTimeEdit } = require("@nodegui/nodegui");
const timeEdit = new QTimeEdit();
// must be implemented
```
*/
export class QTimeEdit extends NodeDateTimeEdit {
native: NativeElement;
constructor();
constructor(parent: NodeWidget<any>);
constructor(parent?: NodeWidget<any>) {
let native;
if (parent) {
native = new addon.QTimeEdit(parent.native);
} else {
native = new addon.QTimeEdit();
}
super(native);
this.native = native;
this.setNodeParent(parent);
}
}