Skip to content
Discussion options

You must be logged in to vote

Hi! Thanks for the interest!

The issue is that QMainWindow::setCentralWidget expects a parameter of type QWidget or 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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MartinAskestad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants