Python Forum
Using Grid layout and QHBox - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: Using Grid layout and QHBox (/thread-32176.html)



Using Grid layout and QHBox - hobbyist - Jan-26-2021

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?


RE: Using Grid layout and QHBox - deanhystad - Jan-26-2021

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.