Replies: 3 comments
-
|
Hi again!
This was actually something I debated back and forth while designing the API. I included in the README that the methods use PascalCase and that was intentional. If you look at the bindings for C, you'll notice they are lowercase with underscores so it wasn't an oversight. I know the recommendation for Zig but for the library, I thought it would be more readable to have the Qt methods be PascalCase, especially since the namespace structs and enums are all lowercase by default. There are other Zig libraries that have used this convention as well. If I choose to revisit this and change it, it would only be on a major change like Qt 7 but as of today, that is not likely.
If you You should be safe to focus on consuming the libraries. As of now, the Zig releases have not been severely disruptive nor do I really anticipate them to be for these libraries but we'll see how that works out. |
Beta Was this translation helpful? Give feedback.
-
Maybe it's worth mentioning that if anyone has a strong preference for this, the full language features of Zig are available to you so you can do something like: const show = qt6.qwidget.Show;That is perfectly valid. In fact, for the inherited methods, an earlier version of the Zig library used this syntax in place of the full methods that exist now, so something like QPushButton had: pub const Show = qwidget.Show;There were also declarations in each header for the parent classes to support this. Ultimately, I settled on the full methods themselves since I felt they were more readable in place. I placed high value on being able to look through the file of a single class and see the implementation details without having to recursively open other files. It was initially a reluctant tradeoff over file size but long-term, it's proving to be the right decision. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your clarification and it's great that you are looking ahead. Lovely to try this lib out. Cheers. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I just tried some simple code on this qt6 zig binding and found the naming seem to be still in Go style. For example: function names in this lib start with an uppercase while Zig naming convention prefer lowercase. I wonder you meant doing that way?
On other issue, I looked at the Zig issues and breaking changes and see there an issue related to C binding that would affect to this libary: ziglang/zig#20630 . Do you think it will take long to update the
cImportto be integrated into the build part?Beta Was this translation helpful? Give feedback.
All reactions