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
Bot releases are hidden (Show)
Published by sedwards2009 about 2 years ago
Added:
windowStateChanged
signal to QWindow
horizontalScrollBar()
& verticalScrollBar()
to QAbstractScrollArea
QSize
and QSizeF
Published by sedwards2009 over 2 years ago
Added:
QIcon
gained actualSize()
, addFile()
, addPixmap()
, availableSizes()
, isNull()
, name()
, paint()
, and swap()
methodsPublished by sedwards2009 over 2 years ago
Added:
done()
and accept()
to QDialog
and subclasses and cleaned up the hierarchy situationsizeHintForIndex()
and visualRect()
to QAbstractItemView
Changes:
Published by sedwards2009 over 2 years ago
QAbstractItemDelegate
support to allow plugins to create their own custom item delegates.Published by sedwards2009 over 2 years ago
Added:
QObject.addEventListener()
to receive QEvents
after default processing has happened.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()
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.
Node*
in between classes are gone. Every QObject
is a subclass of QObject
on the JS side just like in Qt C++.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.QObject
methods related to object trees. QObject.parent()
and QObject.children()
return wrappers of the correct subclasses.myWidget.parent() === myWidget.parent()
.On the JavaScript / TypeScript side were these changes:
QObject.children()
QObject.parent()
QObject.delete()
QObject.deleteLater()
NodeObject
, use QObject
instead.NodeWidget
, use QWidget
instead.NodeFrame
, use QFrame
instead.NodeLayout
, use QLayout
instead.NodeDateTimeEdit
, use QDateTimeEdit
instead.NodeDialog
, use QDialog
instead.NodeTextEdit
, use QTextEdit
instead.NodeListView
, use QListView
instead.NodeTableView
, use QTableView
instead.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()
.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.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.
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.
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);
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();
}
}
Published by sedwards2009 over 2 years ago
Features:
QWidget::grab()
#941 (thanks Jake Kerr)Published by sedwards2009 over 2 years ago
Features:
QTimerEvent
and QObject.startTimer()
and QObject.killTimer()
QScreen.grabWindow()
Changes:
QTabBar.setTabButton()
accept nullPublished by sedwards2009 over 2 years ago
Added:
QWindow
QMoveEvent
Published by sedwards2009 over 2 years ago
QLineEdit
Published by sedwards2009 over 2 years ago
Minor fixes and improvements:
QWidget.mapTo()
and QWidget.mapFrom()
QStylePixelMetric
QGridLayout.addWidget()
and QGridLayout.addLayout()
Published by sedwards2009 over 2 years ago
Changes:
QWindow
needed by apps to implement "Custom client-side window decorations".QWidget.winId()
QWindow
can now emit QEvent
based events like normal widgets.QGridLayout.addWidget()
Bug fixes:
QLineEdit.setText()
accept an empty stringPublished by sedwards2009 almost 3 years ago
Fix:
Published by sedwards2009 almost 3 years ago
Fix:
Published by sedwards2009 almost 3 years ago
This only contains changes to how NodeGui is built and installed. Previously, the C++ parts of NodeGui would be compiled at npm install time. Now we are precompiling all of NodeGui including the C++ binaries and they are downloaded during install. You should see faster and more robust installs. The requirement to have a C++ compiler and CMake available just to do JS based development is gone too.
The C++ binary is placed in build/Release
like before. If there are any problems, please open an issue in GitHub.
Published by sedwards2009 almost 3 years ago
ignore this. Just testing the CI/CD setup.
Published by sedwards2009 almost 3 years ago
QWidget
methods and propertiesPublished by sedwards2009 almost 3 years ago
QResizeEvent
classQWidget.setFixedHeight()
, QWidget.setFixedWidth()
, and QWidget.sizeHint()
QWidget.setParent()
Published by sedwards2009 almost 3 years ago
QClipboard
QWindow
and QScreen
and their signals.QDesktopWidget
. (Use QWindow
and QScreen
instead)HandleScope
in the C++ and avoid playing with undefined behaviour.Published by sedwards2009 almost 3 years ago
QSplitter
(thanks NinZine)QWidget
QBrush
as an argument to QPainter.setBrush()
(thanks NinZine)QObjects
which have a parent