-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instantiate NodeModel in qml #38
Conversation
3d58d92
to
54924fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the "qml: Update block tip in the gui thread" commit (54924fc) is valuable by its own as NodeModel::setBlockTipHeight
emits the blockTipHeightChanged
signal. Maybe put it in its own PR?
Also is it worth to assert(QThread::currentThread() == thread());
in each function which emits signals?
src/qml/pages/stub.qml
Outdated
NodeModel { | ||
id: node_model | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does instantiating an object in QML have performance penalties comparing to instantiating it in C++ code?
54924fc
to
c257c92
Compare
c257c92
to
cf8a278
Compare
eca5252 qml: Update block tip in the gui thread (João Barbosa) Pull request description: This takes commit cf8a278 from #38 and rebases it over changes on master; namely that we've dropped `GUIUtil::ObjectInvoke` in favor of `QMetaObject::invokeMethod`. This avoids non-thread-safe errors. I ran into a segfault here while running some data intensive monkey-code related to blocks, this change prevented it. I'm not going to actually use the code that caused the segfault, just to illustrate that this is useful here anyways. [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/177) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/177) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/177) [](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/177) ACKs for top commit: hebasto: ACK eca5252, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: 9faf9b486af15f29ace20c9cb55ba65f3e20d23f4b7dc58908589f9a104b47cebe575a2a88935ed5f1a2fafc8bc41088084f28803990db64715e235da4c6461f
Based on #37, this change moves
NodeModel
instantiation to QML. It is instanced only whenInitExecutor
is ready.The QML engine is specialized in order to provide access to
interfaces::Node
instance and possible others.A nice follow-up is to improve how
InitExecutor
is exposed in QML.