qode icon indicating copy to clipboard operation
qode copied to clipboard

Question: What's wrong with my env?

Open lightness opened this issue 4 years ago • 2 comments

Hi. First of all thanks for such interesting idea! 🚀

I just stuck with small issue when trying out starter project (https://docs.nodegui.org/docs/guides/tutorial/#trying-out-the-starter-project)

When I running npm start webpack works well, but then I don't see any window. I see qode application in the Dock, but not window.

Probably I miss something. Could you help me with that, please? Thanks!

Env: OS: MacOS Catalina v10.15.3

$ node -v
v10.17.0
$ npm -v
6.13.0
$ npm list @nodegui/qode
[email protected] /Users/nb-078-11b/projects/nodegui-starter
└─┬ @nodegui/[email protected]
  └── @nodegui/[email protected] 

lightness avatar Mar 22 '20 17:03 lightness

Could you post the contents of index.ts file ? @lightness

a7ul avatar Mar 22 '20 17:03 a7ul

Sure @master-atul

import { QMainWindow, QWidget, QLabel, FlexLayout, QPushButton, QIcon } from '@nodegui/nodegui';
import logo from '../assets/logox200.png';

const win = new QMainWindow();
win.setWindowTitle("Hello World");

const centralWidget = new QWidget();
centralWidget.setObjectName("myroot");
const rootLayout = new FlexLayout();
centralWidget.setLayout(rootLayout);

const label = new QLabel();
label.setObjectName("mylabel");
label.setText("Hello");

const button = new QPushButton();
button.setIcon(new QIcon(logo));

const label2 = new QLabel();
label2.setText("World");
label2.setInlineStyle(`
  color: red;
`);

rootLayout.addWidget(label);
rootLayout.addWidget(button);
rootLayout.addWidget(label2);
win.setCentralWidget(centralWidget);
win.setStyleSheet(
  `
    #myroot {
      background-color: #009688;
      height: '100%';
      align-items: 'center';
      justify-content: 'center';
    }
    #mylabel {
      font-size: 16px;
      font-weight: bold;
      padding: 1;
    }
  `
);
win.show();

(global as any).win = win;

lightness avatar Mar 23 '20 08:03 lightness