nodeguy/src/demo.ts
Atul R 07d70e6321
Add more tabwidgets methods (#422)
* add qtabwidget indexOf

* Adds setTabIcon
2020-02-27 01:06:34 +01:00

22 lines
652 B
TypeScript

import { QMainWindow } from './lib/QtWidgets/QMainWindow';
import { QTabWidget } from './lib/QtWidgets/QTabWidget';
import { QLabel } from './lib/QtWidgets/QLabel';
import { QIcon } from './lib/QtGui/QIcon';
const win = new QMainWindow();
const tab = new QTabWidget();
const label = new QLabel();
label.setText('Hello');
const label2 = new QLabel();
label2.setText('LABEL');
tab.addTab(label, new QIcon(), 'I am label tab');
tab.addTab(label2, new QIcon(), 'TAB2');
win.setCentralWidget(tab);
console.log(tab.indexOf(label));
console.log(tab.indexOf(label2));
tab.setTabIcon(tab.indexOf(label2), new QIcon());
win.show();
(global as any).win = win;