jerous86 / nimqt

Qt bindings for nim
GNU General Public License v2.0
93 stars 6 forks source link

Creating a custom signal and emitting it example? #7

Closed matkuki closed 1 year ago

matkuki commented 1 year ago

Hi,

Are custom signals supported? Is there an example somewhere for creating a custom signal and emitting it?

Regards

jerous86 commented 1 year ago

I haven't thought about custom signals yet, so currently they're not supported. That's something for later. I think the main difficulty here is mapping nim types to c++ types.

matkuki commented 1 year ago

Ok, no problem. Thanks for the information 👍

matkuki commented 1 year ago

Could a signal with just a string (QString) parameter be possible to implement without much hassle? Or could some Nim message passing system be added to the Qt event loop?

jerous86 commented 1 year ago

I'm going to have a look at it on how to implement it :)

matkuki commented 1 year ago

Awesome, thank you 👍👍👍👍

jerous86 commented 1 year ago

I have commited some simple code implementing custom signals and emitting them :) Example can be found in examples/custom_signal.nim -- I think it will satisfy your nimqt needs :)

matkuki commented 1 year ago

Marvelous, works exactly as expected 👍👍👍 Thank you so much 🎉🎉🎉

jerous86 commented 1 year ago

Glad it is working and useful for you. Don't hesitate too submit more feature requests and/or bug reports! :) Also curious to see what you're creating with it :)