jerous86 / nimqt

Qt bindings for nim
GNU General Public License v2.0
101 stars 7 forks source link

loadUi does not work if the widget is not named rootWg #27

Closed InventorXtreme closed 1 year ago

InventorXtreme commented 1 year ago

The code:


import nimqt
import nimqt/[load_ui,qboxlayout]

nimqt.init
let app = newQApplication(commandLineParams())

# We use `curFileDir`, defined in nimqt/load_ui to get the directory of *this* file.
# loadUi works best with absolute paths.
var win:ptr QWidget
win.loadUi("/home/inventorx/t.ui", createConnections=true)

win.show()
discard app.exec()

which is a direct copy of the example loading UI files code, but with rootWg replaced with win does not compile and gives an Error: undeclared identifier: 'rootWg'" error on compile.

This does not seem like intended behavior.

jerous86 commented 1 year ago

Indeed not intended behavior. It should be fixed in the latest commit. Thanks for reporting

InventorXtreme commented 1 year ago

I checked and verified that it works properly now. Thank you for the fix.