Python Forum

Full Version: Using Grid layout and QHBox
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I have built a Grid with 2 rows and 3 columns. On the 2nd row 1st column where I am trying to insert the QHBox I get this error which I am trying to solve:

Error:
TypeError: arguments did not match any overloaded call: addWidget(self, QWidget): argument 1 has unexpected type 'QHBoxLayout' addWidget(self, QWidget, int, int, alignment: Union[Qt.Alignment, Qt.AlignmentFlag] = Qt.Alignment()): argument 1 has unexpected type 'QHBoxLayout' addWidget(self, QWidget, int, int, int, int, alignment: Union[Qt.Alignment, Qt.AlignmentFlag] = Qt.Alignment()): argument 1 has unexpected type 'QHBoxLayout'
Any idea?
By now you should know that you cannot provide an error trace without any code.

My guess is you used addWidget to add a layout to a layout. To add one layout to another layout use addLayout() instead.