nodegui

A library for building cross-platform native desktop applications with Node.js and CSS 🚀. React NodeGui : https://react.nodegui.org and Vue NodeGui: https://vue.nodegui.org

MIT License

Downloads
6.6K
Stars
8.8K
Committers
73

Bot releases are visible (Hide)

nodegui - v0.58.0-rc4

Published by sedwards2009 over 1 year ago

Fix RPATH of the binary module on macos

nodegui - v0.58.0-rc3

Published by sedwards2009 almost 2 years ago

  • Added applicationDisplayNameChanged & lastWindowClosed signals to QApplication
nodegui - v0.58.0-rc2

Published by sedwards2009 almost 2 years ago

This release contains a bunch of extra methods for QPainter related to fractional pixels and support for HiDPI rendering.

nodegui - v0.58.0-rc1

Published by sedwards2009 almost 2 years ago

First release candidate with Qt6 upgrade.

nodegui - v0.57.3

Published by sedwards2009 almost 2 years ago

Fixes:

  • Events which were set to fire after the default processing didn't have the event object passed to the handler.
nodegui - v0.57.2

Published by a7ul almost 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/nodegui/nodegui/compare/v0.57.1...v0.57.2

nodegui - v0.57.1

Published by a7ul about 2 years ago

What's Changed

Full Changelog: https://github.com/nodegui/nodegui/compare/v0.57.0...v0.57.1

nodegui - 0.57.0

Published by sedwards2009 about 2 years ago

Added:

  • windowStateChanged signal to QWindow
  • horizontalScrollBar() & verticalScrollBar() to QAbstractScrollArea
  • Many methods to QSize and QSizeF
nodegui - 0.56.0

Published by sedwards2009 over 2 years ago

Added:

  • QIcon gained actualSize(), addFile(), addPixmap(), availableSizes(), isNull(), name(), paint(), and swap() methods
nodegui - 0.55.0

Published by sedwards2009 over 2 years ago

Added:

  • done() and accept() to QDialog and subclasses and cleaned up the hierarchy situation
  • sizeHintForIndex() and visualRect() to QAbstractItemView

Changes:

  • Updated the qode dependency to the latest version to pull in important IO performance related fixes and fixes for Windows.
nodegui - 0.54.0

Published by sedwards2009 over 2 years ago

  • Added basic QAbstractItemDelegate support to allow plugins to create their own custom item delegates.
nodegui - 0.53.0

Published by sedwards2009 over 2 years ago

Added:

  • Option to QObject.addEventListener() to receive QEvents after default processing has happened.
  • Added guide about advanced event handling: https://docs.nodegui.org/docs/guides/advanced-qevent-handling
  • QWidget.contentsRect()
  • QWidget.childAt()
  • QWidget.focusProxy()
  • QWidget.focusWidget()
  • QWidget.isAncestorOf()
  • QWidget.isEnabledTo(()
  • QWidget.isVisibleTo()
  • QWidget.nativeParentWidget()
  • QWidget.nextInFocusChain()
  • QWidget.parentWidget()
  • QWidget.previousInFocusChain()
  • QWidget.setFocusProxy()
  • QWidget.stackUnder()
  • QWidget.window()
nodegui - 0.52.0

Published by sedwards2009 over 2 years ago

This release contains a big update to how NodeGui manages the memory and lifecycle for QObject instances and their subclasses.

Note: These changes are NOT 100% backwards compatible with previous versions of NodeGui.

Highlights

  • JS side object hierarchy is now much closer to the Qt C++ API. Node* in between classes are gone. Every QObject is a subclass of QObject on the JS side just like in Qt C++.
  • Destruction of QObject instances is tracked and propagated to the JS wrappers resulting in fewer complete crashes / segfaults and replacing them with more useful null object exceptions on the JS side.
  • Added QObject methods related to object trees. QObject.parent() and QObject.children() return wrappers of the correct subclasses.
  • Wrappers in JS and on the C++ side are cached and only one is made for each backing C++ object. This results in less memory use, a speed increase, and now wrapper object identity tests are correct. i.e. myWidget.parent() === myWidget.parent().
  • Eliminated most stashing of object references in the JS wrappers. i.e. fewer memory leaks.
  • Added tools for debugging memory problems.

Detailed API Changes

On the JavaScript / TypeScript side were these changes:

  • Added QObject.children()
  • Added QObject.parent()
  • Added QObject.delete()
  • Added QObject.deleteLater()
  • Removed NodeObject, use QObject instead.
  • Removed NodeWidget, use QWidget instead.
  • Removed NodeFrame, use QFrame instead.
  • Removed NodeLayout, use QLayout instead.
  • Removed NodeDateTimeEdit, use QDateTimeEdit instead.
  • Removed NodeDialog, use QDialog instead.
  • Removed NodeTextEdit, use QTextEdit instead.
  • Removed NodeListView, use QListView instead.
  • Removed NodeTableView, use QTableView instead.
  • Removed NodeHeaderView, use QHeaderView instead.
  • QWidget.layout is no longer a property, it is a method like in C++ Qt, i.e. QWidget.layout(). Changing it is done with QWidget.setLayout().
  • The flexbox support in QScrollArea caused some weird bugs but they have been fixed. If you need a flexbox layout inside a QScrollArea then add a single content widget use flexbox on its children.

Upgrade Notes for Application Developers

The biggest change for applications is the removal of Node* classes. Replace mentions of these classes with their normal Qt counterparts. See "Detailed API Changes" above.

Upgrade Notes for Plugin developers

This version is mostly likely not backwards compatible on a binary level. You should update your plugin to require this version of NodeGui and then fix any errors.

There are some changes needed to update wrappers for QObject subclasses.

Registering wrappers

C++ wrapper classes should use the QOBJECT_REGISTER_WRAPPER macro in their init() method to register the mapping from a QObject subclass to a C++ wrapper.

For example, in qdial_wrap.cpp we have:

QOBJECT_REGISTER_WRAPPER(QDial, QDialWrap);

This says that instances of QDial can be wrapped with QDialWrap. This mapping is used by methods such as QObject.parent() and QObject.children() which need to take opaque C++ objects and wrap them before returning them.

The same needs to happen on the JS side too. In the matching wrapper JS class, the JS wrapper needs to be registered with wrapperCache, mapping it to the name of its C++ wrapper counterpart. For QDial this looks like:

const { wrapperCache } = require("@nodegui/nodegui");

// ...
wrapperCache.registerWrapper('QDialWrap', QDial);

Using the C++ Wrapper Cache

Finally, if you have a wrapper which needs to return another QObject instance, you can use the wrapper cache directly and let it choose the correct wrapper or a cached one. The implementation of QObject.parent() demonstrates this:

  Napi::Value parent(const Napi::CallbackInfo& info) {
    Napi::Env env = info.Env();
    QObject* parent = this->instance->parent();
    if (parent) {
      return WrapperCache::instance.getWrapper(env, parent);
    } else {
      return env.Null();
    }
  }
nodegui - 0.51.0

Published by sedwards2009 over 2 years ago

Features:

  • Add QWidget::grab() #941 (thanks Jake Kerr)
nodegui - 0.50.0

Published by sedwards2009 over 2 years ago

Features:

  • Add QTimerEvent and QObject.startTimer() and QObject.killTimer()
  • Add QScreen.grabWindow()

Changes:

  • Make QTabBar.setTabButton() accept null
  • Make it possible to set stylesheets and bypass postcss
nodegui - 0.49.0

Published by sedwards2009 over 2 years ago

Added:

  • Add visibility related methods/event to QWindow
  • Add QMoveEvent
nodegui - 0.48.0

Published by sedwards2009 over 2 years ago

  • Add many of the methods for QLineEdit
nodegui - 0.47.0

Published by sedwards2009 over 2 years ago

Minor fixes and improvements:

  • Add QWidget.mapTo() and QWidget.mapFrom()
  • Fill in more values for QStylePixelMetric
  • Fix the default alignment in QGridLayout.addWidget() and QGridLayout.addLayout()
nodegui - 0.46.0

Published by sedwards2009 over 2 years ago

Changes:

  • Upgraded Qt to v5.15.2.
  • Added some methods to QWindow needed by apps to implement "Custom client-side window decorations".
  • Added QWidget.winId()
  • QWindow can now emit QEvent based events like normal widgets.
  • Added alignment parameter to QGridLayout.addWidget()

Bug fixes:

  • Make QLineEdit.setText() accept an empty string
nodegui - 0.45.4

Published by sedwards2009 almost 3 years ago

Fix:

  • Trigger the Linux code to set position independent binary generation.