diff options
Diffstat (limited to 'examples/sql/books/bookwindow.py')
-rw-r--r-- | examples/sql/books/bookwindow.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/sql/books/bookwindow.py b/examples/sql/books/bookwindow.py index 0eb5fecad..7f9e0f94b 100644 --- a/examples/sql/books/bookwindow.py +++ b/examples/sql/books/bookwindow.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause from PySide6.QtWidgets import (QAbstractItemView, QDataWidgetMapper, - QHeaderView, QMainWindow, QMessageBox) + QHeaderView, QMainWindow, QMessageBox) from PySide6.QtGui import QKeySequence from PySide6.QtSql import QSqlRelation, QSqlRelationalTableModel, QSqlTableModel from PySide6.QtCore import Qt, Slot @@ -58,7 +58,7 @@ class BookWindow(QMainWindow, Ui_BookWindow): # Lock and prohibit resizing of the width of the rating column: self.bookTable.horizontalHeader().setSectionResizeMode(model.fieldIndex("rating"), - QHeaderView.ResizeToContents) + QHeaderView.ResizeToContents) mapper = QDataWidgetMapper(self) mapper.setModel(model) @@ -75,24 +75,24 @@ class BookWindow(QMainWindow, Ui_BookWindow): self.bookTable.setCurrentIndex(model.index(0, 0)) self.create_menubar() - def showError(err): + def showError(self, err): QMessageBox.critical(self, "Unable to initialize Database", - f"Error initializing database: {err.text()}") + f"Error initializing database: {err.text()}") def create_menubar(self): file_menu = self.menuBar().addMenu(self.tr("&File")) quit_action = file_menu.addAction(self.tr("&Quit")) - quit_action.triggered.connect(qApp.quit) + quit_action.triggered.connect(qApp.quit) # noqa: F821 help_menu = self.menuBar().addMenu(self.tr("&Help")) about_action = help_menu.addAction(self.tr("&About")) about_action.setShortcut(QKeySequence.HelpContents) about_action.triggered.connect(self.about) aboutQt_action = help_menu.addAction("&About Qt") - aboutQt_action.triggered.connect(qApp.aboutQt) + aboutQt_action.triggered.connect(qApp.aboutQt) # noqa: F821 @Slot() def about(self): QMessageBox.about(self, self.tr("About Books"), - self.tr("<p>The <b>Books</b> example shows how to use Qt SQL classes " - "with a model/view framework.")) + self.tr("<p>The <b>Books</b> example shows how to use Qt SQL classes " + "with a model/view framework.")) |