My layout understanding needs improvement

Vincent Vande Vyvre vincent.vande.vyvre at telenet.be
Thu Apr 22 18:27:54 BST 2021


On 22/04/21 18:22, Rich Shepard wrote:
> My test code (really attached this time) displays when run, but with this
> message on the console:
> $ python test.py QWidget::setLayout: Attempting to set QLayout "" on 
> TestWindow "", which already has a
> layout
>
> In my newness to PyQt I do not see where I've duplicated an unnecessary
> layout call. I need to learn this to move on to better presenting the
> displayed layout.
>
> Thanks in advance,
>
> Rich

There's two layouts on the main widget:

         group1 = qtw.QVBoxLayout()
         self.setLayout(group1)                      # 1

         button_row = qtw.QHBoxLayout()
         self.setLayout(button_row)               # 2 ! Remove this line.

Vincent



More information about the PyQt mailing list