No member named _is_QWidget? #147
-
|
I am probably missing something obvious, but when I try to add a QHBoxLayout to my QMainWindow I get the error var ret = try alloc.create(AppMainWindow);
ret.w = qt6.QMainWindow.New2();
const programButtons = qt6.QHBoxLayout.New2();
ret.w.SetCentralWidget(programButtons);I've also tried const programButtons = qt6.QHBoxLayout.New(ret.w);
ret.w.SetCentralWidget(programButtons);Anyone know what I've missed? I've added |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi! Thanks for the interest! The issue is that |
Beta Was this translation helpful? Give feedback.
Hi! Thanks for the interest!
The issue is that
QMainWindow::setCentralWidgetexpects a parameter of typeQWidgetor one that inherits from it. QHBoxLayout does not inherit from QWidget which is why you are seeing that error. If you were to use an object of the type QPushButton for example, that should work just fine.