Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

Question: What's wrong with my env? #17

Description

@lightness

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
nodegui-starter@1.0.0 /Users/nb-078-11b/projects/nodegui-starter
└─┬ @nodegui/nodegui@0.16.1
  └── @nodegui/qode@2.0.4 

Activity

  1. a7ul commented on Mar 22, 2020

    @a7ul
    Collaborator

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

  2. lightness commented on Mar 23, 2020

    @lightness
    Author

    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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions