Not seeing error; experienced eyes needed

Rich Shepard rshepard at appl-ecosys.com
Thu Apr 22 00:33:13 BST 2021


On Wed, 21 Apr 2021, Rich Shepard wrote:

Code attached.

Mea culpa!

Rich
-------------- next part --------------
#!/usr/bin/env python3

import sys

from PyQt5 import QtWidgets as qtw
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc

class TestWindow(qtw.QWidget):
    def __init__(self):
        super().__init__()
        bio = qtw.QWidget(windowTitle='Test')

        # Methods
        def save(self):
            pass

        def cancel(self):
            pass
                
        # Layout
        self.group1 = qtw.QHBoxLayout()
        self.setLayout(self.group1)

        #self.row1 = qtw.QVBoxLayout()
        #self.setLayout(self.row1)

        self.button_row = qtw.QVBoxLayout()
        self.setLayout(self.button_row)
        
        self.savebutton = qtw.QPushButton(
            'Save',
            clicked=self.save
        )
        self.cancelbutton = qtw.QPushButton(
            'Cancel',
            clicked=self.cancel
        )

        # Place widgets on layouts
        
        self.button_row.addWidget(self.savebutton)
        self.button_row.addWidget(self.cancelbutton)
        self.group1.addWidget(self.button_row)
        
        self.show()

if __name__ == '__main__':
    app = qtw.QApplication(sys.argv)
    bio = TestWindow()
    sys.exit(app.exec())       


More information about the PyQt mailing list