Closed matkuki closed 1 year ago
Yes, I know. I mentioned this particular example also at the end of the README.md :)
For example, due to recursive module imports not being supported, not all methods are possible, as types inside the method parameter list or return type would result in a loop (e.g. QLayoutItem::widget() is not available, due to the module dependency QLayoutItem -> QWidget -> QLayout -> QLayoutItem)
If it is really required, a solution is to write the imports manually in your own source code. Something like (untested):
import nimqt/[qwidget,qlayoutitem]
proc widget*(this: ptr QLayoutItem): ptr QWidget {.header:headerFile, importcpp:"#.widget(@)".}
But I don't know how to solve this easily in an automatic way. So I'm waiting for nim to add support for recursive module imports. :)
Ah, right, I forgot. The workaround works for me, thanks 👍👍👍
Hi,
Is there another way to get the widget reference from a
QLayoutItem
, as there is seems to be nowidget
method for it? https://doc.qt.io/qt-5/qlayoutitem.html#widgetRegards