reverting demo (#242)

This commit is contained in:
Atul R 2019-12-04 00:30:36 +01:00 committed by GitHub
parent bae4776747
commit c691d6a8d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,40 +1,50 @@
import { QWidget, QMainWindow, FlexLayout, QGridLayout, QLabel } from './index';
import { QWidget, QMainWindow, FlexLayout, QLabel } from './index';
import { QScrollArea } from './lib/QtWidgets/QScrollArea';
const scrollArea = new QScrollArea();
scrollArea.setObjectName('scrollArea');
scrollArea.setWidgetResizable(true);
// scrollArea.resize(500, 500);
const win = new QMainWindow();
const center = new QWidget();
center.setObjectName('center');
const label = new QLabel();
label.setObjectName('label');
const scrollArea = new QScrollArea();
label.setText(`
Hellloooooo123
Hellloooooo
`);
😱😱😱😱😱😱😱😱😱😱😱😱😱😱😱😱😱😱😱
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
Hellloooooo
`);
center.setInlineStyle(`border: 3px solid blue;`);
label.setInlineStyle(`border: 2px solid green;padding: 10;flex:1;font-family: "Sans serif";`);
// center.setLayout(new QGridLayout());
label.setInlineStyle(`border: 2px solid green;padding: 10;font-family: "Sans serif";`);
scrollArea.setWidget(label);
center.setLayout(new FlexLayout());
center.layout?.addWidget(label);
scrollArea.setWidget(center);
console.log('SHOW scrollArea');
scrollArea.show();
console.log('SET TEXT');
setTimeout(() => {
label.setText(`Heloo
Heloo
Jello
Hoell
jaksjd
asjdkajdk
aksjdkajsdkja
ajksjdakjsd
jkasjdkajd
ajksdjakjs`);
}, 3000);
center.layout?.addWidget(scrollArea);
win.setCentralWidget(center);
win.show();
scrollArea.setInlineStyle(`flex: 1;`);
(global as any).scrollArea = scrollArea;
(global as any).win = win;