From 1ec4d298984d90672354e7864e35af4100285525 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 28 Apr 2021 10:39:36 +0200 Subject: Examples: Use new form of super() Task-number: PYSIDE-1112 Change-Id: Ifcb4da974bdcad7af536404fffdbffc585d3d167 Reviewed-by: Christian Tismer --- examples/widgets/animation/animatedtiles/animatedtiles.py | 4 ++-- examples/widgets/animation/appchooser/appchooser.py | 2 +- examples/widgets/animation/easing/easing.py | 6 +++--- examples/widgets/animation/states/states.py | 2 +- examples/widgets/codeeditor/codeeditor.py | 2 +- examples/widgets/dialogs/classwizard/listchooser.py | 13 ++++++------- examples/widgets/dialogs/extension/extension.py | 2 +- examples/widgets/dialogs/findfiles/findfiles.py | 2 +- examples/widgets/dialogs/standarddialogs/standarddialogs.py | 4 ++-- examples/widgets/draganddrop/draggabletext/draggabletext.py | 4 ++-- examples/widgets/effects/lighting.py | 2 +- examples/widgets/gallery/widgetgallery.py | 2 +- .../widgets/graphicsview/collidingmice/collidingmice.py | 2 +- examples/widgets/graphicsview/diagramscene/diagramscene.py | 10 +++++----- examples/widgets/graphicsview/elasticnodes/elasticnodes.py | 6 +++--- examples/widgets/imageviewer/imageviewer.py | 2 +- examples/widgets/itemviews/addressbook/adddialogwidget.py | 2 +- examples/widgets/itemviews/addressbook/addressbook.py | 2 +- examples/widgets/itemviews/addressbook/addresswidget.py | 2 +- examples/widgets/itemviews/addressbook/newaddresstab.py | 2 +- examples/widgets/itemviews/addressbook/tablemodel.py | 2 +- .../itemviews/basicfiltermodel/basicsortfiltermodel.py | 2 +- examples/widgets/itemviews/fetchmore/fetchmore.py | 4 ++-- examples/widgets/itemviews/stardelegate/stardelegate.py | 2 +- examples/widgets/itemviews/stardelegate/stareditor.py | 2 +- examples/widgets/layouts/basiclayouts/basiclayouts.py | 2 +- examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py | 2 +- examples/widgets/layouts/flowlayout/flowlayout.py | 4 ++-- examples/widgets/mainwindows/application/application.py | 2 +- examples/widgets/mainwindows/dockwidgets/dockwidgets.py | 2 +- examples/widgets/mainwindows/mdi/mdi.py | 4 ++-- examples/widgets/painting/basicdrawing/basicdrawing.py | 4 ++-- .../widgets/painting/concentriccircles/concentriccircles.py | 4 ++-- examples/widgets/richtext/orderform/orderform.py | 4 ++-- examples/widgets/state-machine/eventtrans/eventtrans.py | 2 +- examples/widgets/state-machine/factstates/factstates.py | 6 +++--- examples/widgets/state-machine/pingpong/pingpong.py | 6 +++--- examples/widgets/state-machine/rogue/rogue.py | 6 +++--- examples/widgets/state-machine/trafficlight/trafficlight.py | 6 +++--- examples/widgets/systray/window.py | 2 +- examples/widgets/tetrix/tetrix.py | 4 ++-- examples/widgets/threads/thread_signals.py | 2 +- examples/widgets/tutorials/addressbook/part1.py | 2 +- examples/widgets/tutorials/addressbook/part2.py | 2 +- examples/widgets/tutorials/addressbook/part3.py | 2 +- examples/widgets/tutorials/addressbook/part4.py | 2 +- examples/widgets/tutorials/addressbook/part5.py | 4 ++-- examples/widgets/tutorials/addressbook/part6.py | 4 ++-- examples/widgets/tutorials/addressbook/part7.py | 4 ++-- 49 files changed, 83 insertions(+), 84 deletions(-) (limited to 'examples/widgets') diff --git a/examples/widgets/animation/animatedtiles/animatedtiles.py b/examples/widgets/animation/animatedtiles/animatedtiles.py index 75458c002..d9198c89a 100644 --- a/examples/widgets/animation/animatedtiles/animatedtiles.py +++ b/examples/widgets/animation/animatedtiles/animatedtiles.py @@ -60,7 +60,7 @@ import animatedtiles_rc # composition and delegate the property. class Pixmap(QObject): def __init__(self, pix): - super(Pixmap, self).__init__() + super().__init__() self.pixmap_item = QGraphicsPixmapItem(pix) self.pixmap_item.setCacheMode(QGraphicsItem.DeviceCoordinateCache) @@ -78,7 +78,7 @@ class Button(QGraphicsWidget): pressed = Signal() def __init__(self, pixmap, parent=None): - super(Button, self).__init__(parent) + super().__init__(parent) self._pix = pixmap diff --git a/examples/widgets/animation/appchooser/appchooser.py b/examples/widgets/animation/appchooser/appchooser.py index 66903b6c5..046da7243 100644 --- a/examples/widgets/animation/appchooser/appchooser.py +++ b/examples/widgets/animation/appchooser/appchooser.py @@ -56,7 +56,7 @@ class Pixmap(QGraphicsWidget): clicked = Signal() def __init__(self, pix, parent=None): - super(Pixmap, self).__init__(parent) + super().__init__(parent) self.orig = QPixmap(pix) self.p = QPixmap(pix) diff --git a/examples/widgets/animation/easing/easing.py b/examples/widgets/animation/easing/easing.py index b3d6f0dff..83d2e3666 100644 --- a/examples/widgets/animation/easing/easing.py +++ b/examples/widgets/animation/easing/easing.py @@ -61,7 +61,7 @@ class PathType(IntEnum): class Animation(QPropertyAnimation): def __init__(self, target, prop): - super(Animation, self).__init__(target, prop) + super().__init__(target, prop) self.set_path_type(PathType.LINEAR_PATH) def set_path_type(self, pathType): @@ -99,7 +99,7 @@ class Animation(QPropertyAnimation): # composition and delegate the property. class Pixmap(QObject): def __init__(self, pix): - super(Pixmap, self).__init__() + super().__init__() self.pixmap_item = QGraphicsPixmapItem(pix) self.pixmap_item.setCacheMode(QGraphicsItem.DeviceCoordinateCache) @@ -115,7 +115,7 @@ class Pixmap(QObject): class Window(QWidget): def __init__(self, parent=None): - super(Window, self).__init__(parent) + super().__init__(parent) self._iconSize = QSize(64, 64) self._scene = QGraphicsScene() diff --git a/examples/widgets/animation/states/states.py b/examples/widgets/animation/states/states.py index 2150e1f81..4e9343e13 100644 --- a/examples/widgets/animation/states/states.py +++ b/examples/widgets/animation/states/states.py @@ -59,7 +59,7 @@ import states_rc class Pixmap(QGraphicsObject): def __init__(self, pix): - super(Pixmap, self).__init__() + super().__init__() self.p = QPixmap(pix) diff --git a/examples/widgets/codeeditor/codeeditor.py b/examples/widgets/codeeditor/codeeditor.py index 9e0ac5b23..f5f119000 100644 --- a/examples/widgets/codeeditor/codeeditor.py +++ b/examples/widgets/codeeditor/codeeditor.py @@ -57,7 +57,7 @@ class LineNumberArea(QWidget): class CodeEditor(QPlainTextEdit): def __init__(self): - QPlainTextEdit.__init__(self) + super().__init__() self.line_number_area = LineNumberArea(self) self.blockCountChanged[int].connect(self.update_line_number_area_width) diff --git a/examples/widgets/dialogs/classwizard/listchooser.py b/examples/widgets/dialogs/classwizard/listchooser.py index 8b6f0d020..baad72d5e 100644 --- a/examples/widgets/dialogs/classwizard/listchooser.py +++ b/examples/widgets/dialogs/classwizard/listchooser.py @@ -58,7 +58,7 @@ FUNCTION_PATTERN = r'^\w+\([\w ,]*\)$' class ValidatingInputDialog(QDialog): """A dialog for text input with a regular expression validation.""" def __init__(self, label, pattern, parent=None): - super(ValidatingInputDialog, self).__init__(parent) + super().__init__(parent) layout = QVBoxLayout(self) self._form_layout = QFormLayout() @@ -111,8 +111,7 @@ class ValidatingInputDialog(QDialog): class FunctionSignatureDialog(ValidatingInputDialog): """A dialog for input of function signatures.""" def __init__(self, name, parent=None): - super(FunctionSignatureDialog, self).__init__(name, FUNCTION_PATTERN, - parent) + super().__init__(name, FUNCTION_PATTERN, parent) self.text = '()' self.cursor_position = 0 @@ -120,7 +119,7 @@ class FunctionSignatureDialog(ValidatingInputDialog): class PropertyDialog(ValidatingInputDialog): """A dialog for input of a property name and type.""" def __init__(self, parent=None): - super(PropertyDialog, self).__init__('&Name:', r'^\w+$', parent) + super().__init__('&Name:', r'^\w+$', parent) self.setWindowTitle('Add a Property') self._type_combo = QComboBox() self._type_combo.addItems(DEFAULT_TYPES) @@ -134,7 +133,7 @@ class ListChooser(QGroupBox): """A widget for editing a list of strings with a customization point for creating the strings.""" def __init__(self, title, parent=None): - super(ListChooser, self).__init__(title, parent) + super().__init__(title, parent) main_layout = QHBoxLayout(self) self._list = QListWidget(self) self._list.currentItemChanged.connect(self._current_item_changed) @@ -188,7 +187,7 @@ class ListChooser(QGroupBox): class SignalChooser(ListChooser): """A widget for editing a list of signal function signatures.""" def __init__(self, parent=None): - super(SignalChooser, self).__init__('Signals', parent) + super().__init__('Signals', parent) def _create_new_item(self): dialog = FunctionSignatureDialog('&Signal signature:', self) @@ -201,7 +200,7 @@ class SignalChooser(ListChooser): class PropertyChooser(ListChooser): """A widget for editing a list of properties as a string of 'type name'.""" def __init__(self, parent=None): - super(PropertyChooser, self).__init__('Properties', parent) + super().__init__('Properties', parent) def _create_new_item(self): dialog = PropertyDialog(self) diff --git a/examples/widgets/dialogs/extension/extension.py b/examples/widgets/dialogs/extension/extension.py index 00222a6d2..c053a7c8f 100644 --- a/examples/widgets/dialogs/extension/extension.py +++ b/examples/widgets/dialogs/extension/extension.py @@ -53,7 +53,7 @@ from PySide6.QtWidgets import (QApplication, QCheckBox, QDialog, class FindDialog(QDialog): def __init__(self, parent=None): - super(FindDialog, self).__init__(parent) + super().__init__(parent) label = QLabel("Find &what:") line_edit = QLineEdit() diff --git a/examples/widgets/dialogs/findfiles/findfiles.py b/examples/widgets/dialogs/findfiles/findfiles.py index 7ddb6907c..779954edc 100644 --- a/examples/widgets/dialogs/findfiles/findfiles.py +++ b/examples/widgets/dialogs/findfiles/findfiles.py @@ -56,7 +56,7 @@ from PySide6.QtWidgets import (QAbstractItemView, QApplication, QComboBox, class Window(QDialog): def __init__(self, parent=None): - super(Window, self).__init__(parent) + super().__init__(parent) self._browse_button = self.create_button("&Browse...", self.browse) self._find_button = self.create_button("&Find", self.find) diff --git a/examples/widgets/dialogs/standarddialogs/standarddialogs.py b/examples/widgets/dialogs/standarddialogs/standarddialogs.py index 80849bcb0..934714237 100644 --- a/examples/widgets/dialogs/standarddialogs/standarddialogs.py +++ b/examples/widgets/dialogs/standarddialogs/standarddialogs.py @@ -57,7 +57,7 @@ class DialogOptionsWidget(QGroupBox): """Widget displaying a number of check boxes representing the dialog options.""" def __init__(self, parent=None): - super(DialogOptionsWidget, self).__init__(parent) + super().__init__(parent) self._layout = QVBoxLayout(self) self._mapping = {} @@ -81,7 +81,7 @@ class Dialog(QDialog): "button will activate the detected escape button (if any).

" def __init__(self, parent=None): - super(Dialog, self).__init__(parent) + super().__init__(parent) self._open_files_path = '' diff --git a/examples/widgets/draganddrop/draggabletext/draggabletext.py b/examples/widgets/draganddrop/draggabletext/draggabletext.py index 5da27c450..efe35e8ce 100644 --- a/examples/widgets/draganddrop/draggabletext/draggabletext.py +++ b/examples/widgets/draganddrop/draggabletext/draggabletext.py @@ -51,7 +51,7 @@ import draggabletext_rc class DragLabel(QLabel): def __init__(self, text, parent): - super(DragLabel, self).__init__(text, parent) + super().__init__(text, parent) self.setAutoFillBackground(True) self.setFrameShape(QFrame.Panel) @@ -83,7 +83,7 @@ class DragLabel(QLabel): class DragWidget(QWidget): def __init__(self, parent=None): - super(DragWidget, self).__init__(parent) + super().__init__(parent) dictionary_file = QFile(':/dictionary/words.txt') dictionary_file.open(QIODevice.ReadOnly) diff --git a/examples/widgets/effects/lighting.py b/examples/widgets/effects/lighting.py index e319b5f66..44856b20b 100644 --- a/examples/widgets/effects/lighting.py +++ b/examples/widgets/effects/lighting.py @@ -53,7 +53,7 @@ from PySide6.QtWidgets import (QApplication, QFrame, QGraphicsDropShadowEffect, class Lighting(QGraphicsView): def __init__(self, parent=None): - super(Lighting, self).__init__(parent) + super().__init__(parent) self.angle = 0.0 self.m_scene = QGraphicsScene() diff --git a/examples/widgets/gallery/widgetgallery.py b/examples/widgets/gallery/widgetgallery.py index d46095386..6cebd5382 100644 --- a/examples/widgets/gallery/widgetgallery.py +++ b/examples/widgets/gallery/widgetgallery.py @@ -147,7 +147,7 @@ class WidgetGallery(QDialog): """Dialog displaying a gallery of Qt Widgets""" def __init__(self): - super(WidgetGallery, self).__init__() + super().__init__() self.setWindowIcon(QIcon(':/qt-project.org/logos/pysidelogo.png')) self._progress_bar = self.create_progress_bar() diff --git a/examples/widgets/graphicsview/collidingmice/collidingmice.py b/examples/widgets/graphicsview/collidingmice/collidingmice.py index b22517617..58cae55be 100644 --- a/examples/widgets/graphicsview/collidingmice/collidingmice.py +++ b/examples/widgets/graphicsview/collidingmice/collidingmice.py @@ -67,7 +67,7 @@ class Mouse(QGraphicsItem): 83 + adjust) def __init__(self): - super(Mouse, self).__init__() + super().__init__() self.angle = 0.0 self.speed = 0.0 diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.py b/examples/widgets/graphicsview/diagramscene/diagramscene.py index c6f0b725b..492a9d25b 100644 --- a/examples/widgets/graphicsview/diagramscene/diagramscene.py +++ b/examples/widgets/graphicsview/diagramscene/diagramscene.py @@ -61,7 +61,7 @@ import diagramscene_rc class Arrow(QGraphicsLineItem): def __init__(self, startItem, endItem, parent=None, scene=None): - super(Arrow, self).__init__(parent, scene) + super().__init__(parent, scene) self._arrow_head = QPolygonF() @@ -160,7 +160,7 @@ class DiagramTextItem(QGraphicsTextItem): selected_change = Signal(QGraphicsItem) def __init__(self, parent=None, scene=None): - super(DiagramTextItem, self).__init__(parent, scene) + super().__init__(parent, scene) self.setFlag(QGraphicsItem.ItemIsMovable) self.setFlag(QGraphicsItem.ItemIsSelectable) @@ -185,7 +185,7 @@ class DiagramItem(QGraphicsPolygonItem): Step, Conditional, StartEnd, Io = range(4) def __init__(self, diagram_type, contextMenu, parent=None, scene=None): - super(DiagramItem, self).__init__(parent, scene) + super().__init__(parent, scene) self.arrows = [] @@ -268,7 +268,7 @@ class DiagramScene(QGraphicsScene): item_selected = Signal(QGraphicsItem) def __init__(self, itemMenu, parent=None): - super(DiagramScene, self).__init__(parent) + super().__init__(parent) self._my_item_menu = itemMenu self._my_mode = self.MoveItem @@ -396,7 +396,7 @@ class MainWindow(QMainWindow): insert_text_button = 10 def __init__(self): - super(MainWindow, self).__init__() + super().__init__() self.create_actions() self.create_menus() diff --git a/examples/widgets/graphicsview/elasticnodes/elasticnodes.py b/examples/widgets/graphicsview/elasticnodes/elasticnodes.py index f374f0180..549a27259 100644 --- a/examples/widgets/graphicsview/elasticnodes/elasticnodes.py +++ b/examples/widgets/graphicsview/elasticnodes/elasticnodes.py @@ -61,7 +61,7 @@ class Edge(QGraphicsItem): type = QGraphicsItem.UserType + 2 def __init__(self, sourceNode, destNode): - QGraphicsItem.__init__(self) + super().__init__() self._arrow_size = 10.0 self._source_point = QPointF() @@ -160,7 +160,7 @@ class Node(QGraphicsItem): type = QGraphicsItem.UserType + 1 def __init__(self, graphWidget): - QGraphicsItem.__init__(self) + super().__init__() self.graph = weakref.ref(graphWidget) self._edge_list = [] @@ -275,7 +275,7 @@ class Node(QGraphicsItem): class GraphWidget(QGraphicsView): def __init__(self): - QGraphicsView.__init__(self) + super().__init__() self._timer_id = 0 diff --git a/examples/widgets/imageviewer/imageviewer.py b/examples/widgets/imageviewer/imageviewer.py index b18c365af..8da12bd9d 100644 --- a/examples/widgets/imageviewer/imageviewer.py +++ b/examples/widgets/imageviewer/imageviewer.py @@ -65,7 +65,7 @@ shows how to use QPainter to print an image.

class ImageViewer(QMainWindow): def __init__(self, parent=None): - super(ImageViewer, self).__init__(parent) + super().__init__(parent) self._scale_factor = 1.0 self._first_file_dialog = True self._image_label = QLabel() diff --git a/examples/widgets/itemviews/addressbook/adddialogwidget.py b/examples/widgets/itemviews/addressbook/adddialogwidget.py index 017bb9650..bf2dd679d 100644 --- a/examples/widgets/itemviews/addressbook/adddialogwidget.py +++ b/examples/widgets/itemviews/addressbook/adddialogwidget.py @@ -48,7 +48,7 @@ class AddDialogWidget(QDialog): """ A dialog to add a new address to the addressbook. """ def __init__(self, parent=None): - super(AddDialogWidget, self).__init__(parent) + super().__init__(parent) name_label = QLabel("Name") address_label = QLabel("Address") diff --git a/examples/widgets/itemviews/addressbook/addressbook.py b/examples/widgets/itemviews/addressbook/addressbook.py index c105a9542..1b689f2ee 100644 --- a/examples/widgets/itemviews/addressbook/addressbook.py +++ b/examples/widgets/itemviews/addressbook/addressbook.py @@ -49,7 +49,7 @@ from addresswidget import AddressWidget class MainWindow(QMainWindow): def __init__(self, parent=None): - super(MainWindow, self).__init__(parent) + super().__init__(parent) self._address_widget = AddressWidget() self.setCentralWidget(self._address_widget) diff --git a/examples/widgets/itemviews/addressbook/addresswidget.py b/examples/widgets/itemviews/addressbook/addresswidget.py index 07fc53234..d16f70f42 100644 --- a/examples/widgets/itemviews/addressbook/addresswidget.py +++ b/examples/widgets/itemviews/addressbook/addresswidget.py @@ -63,7 +63,7 @@ class AddressWidget(QTabWidget): def __init__(self, parent=None): """ Initialize the AddressWidget. """ - super(AddressWidget, self).__init__(parent) + super().__init__(parent) self._table_model = TableModel() self._new_address_tab = NewAddressTab() diff --git a/examples/widgets/itemviews/addressbook/newaddresstab.py b/examples/widgets/itemviews/addressbook/newaddresstab.py index 6833eaf4a..8a2a0ceb6 100644 --- a/examples/widgets/itemviews/addressbook/newaddresstab.py +++ b/examples/widgets/itemviews/addressbook/newaddresstab.py @@ -53,7 +53,7 @@ class NewAddressTab(QWidget): send_details = Signal(str, str) def __init__(self, parent=None): - super(NewAddressTab, self).__init__(parent) + super().__init__(parent) description_label = QLabel("There are no contacts in your address book." "\nClick Add to add new contacts.") diff --git a/examples/widgets/itemviews/addressbook/tablemodel.py b/examples/widgets/itemviews/addressbook/tablemodel.py index 9cf79f208..ec8e3e9e4 100644 --- a/examples/widgets/itemviews/addressbook/tablemodel.py +++ b/examples/widgets/itemviews/addressbook/tablemodel.py @@ -45,7 +45,7 @@ from PySide6.QtCore import (Qt, QAbstractTableModel, QModelIndex) class TableModel(QAbstractTableModel): def __init__(self, addresses=None, parent=None): - super(TableModel, self).__init__(parent) + super().__init__(parent) if addresses is None: self.addresses = [] diff --git a/examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py b/examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py index 3e1e3f9ed..657b9637b 100644 --- a/examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py +++ b/examples/widgets/itemviews/basicfiltermodel/basicsortfiltermodel.py @@ -56,7 +56,7 @@ FIXED_STRING = 2 class Window(QWidget): def __init__(self): - super(Window, self).__init__() + super().__init__() self._proxy_model = QSortFilterProxyModel() self._proxy_model.setDynamicSortFilter(True) diff --git a/examples/widgets/itemviews/fetchmore/fetchmore.py b/examples/widgets/itemviews/fetchmore/fetchmore.py index 194cc4e88..1ee4d8635 100644 --- a/examples/widgets/itemviews/fetchmore/fetchmore.py +++ b/examples/widgets/itemviews/fetchmore/fetchmore.py @@ -65,7 +65,7 @@ class FileListModel(QAbstractListModel): number_populated = Signal(str, int, int, int) def __init__(self, parent=None): - super(FileListModel, self).__init__(parent) + super().__init__(parent) self._path = '' self._file_count = 0 @@ -130,7 +130,7 @@ class FileListModel(QAbstractListModel): class Window(QWidget): def __init__(self, parent=None): - super(Window, self).__init__(parent) + super().__init__(parent) self._model = FileListModel(self) self._model.set_dir_path(QDir.rootPath()) diff --git a/examples/widgets/itemviews/stardelegate/stardelegate.py b/examples/widgets/itemviews/stardelegate/stardelegate.py index 847727267..e4c4bae12 100644 --- a/examples/widgets/itemviews/stardelegate/stardelegate.py +++ b/examples/widgets/itemviews/stardelegate/stardelegate.py @@ -52,7 +52,7 @@ class StarDelegate(QStyledItemDelegate): """ def __init__(self, parent=None): - super(StarDelegate, self).__init__(parent) + super().__init__(parent) def paint(self, painter, option, index): """ Paint the items in the table. diff --git a/examples/widgets/itemviews/stardelegate/stareditor.py b/examples/widgets/itemviews/stardelegate/stareditor.py index ef6235247..226552cc0 100644 --- a/examples/widgets/itemviews/stardelegate/stareditor.py +++ b/examples/widgets/itemviews/stardelegate/stareditor.py @@ -57,7 +57,7 @@ class StarEditor(QWidget): """ Initialize the editor object, making sure we can watch mouse events. """ - super(StarEditor, self).__init__(parent) + super().__init__(parent) self.setMouseTracking(True) self.setAutoFillBackground(True) diff --git a/examples/widgets/layouts/basiclayouts/basiclayouts.py b/examples/widgets/layouts/basiclayouts/basiclayouts.py index 27ab35fb1..1a0288209 100644 --- a/examples/widgets/layouts/basiclayouts/basiclayouts.py +++ b/examples/widgets/layouts/basiclayouts/basiclayouts.py @@ -57,7 +57,7 @@ class Dialog(QDialog): num_buttons = 4 def __init__(self): - super(Dialog, self).__init__() + super().__init__() self.create_menu() self.create_horizontal_group_box() diff --git a/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py b/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py index 88f118dc2..fc57e011f 100644 --- a/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py +++ b/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py @@ -50,7 +50,7 @@ from PySide6.QtWidgets import (QApplication, QDialog, QLayout, QGridLayout, class Dialog(QDialog): def __init__(self): - super(Dialog, self).__init__() + super().__init__() self._rotable_widgets = [] diff --git a/examples/widgets/layouts/flowlayout/flowlayout.py b/examples/widgets/layouts/flowlayout/flowlayout.py index 1eae372a1..959f80a0e 100644 --- a/examples/widgets/layouts/flowlayout/flowlayout.py +++ b/examples/widgets/layouts/flowlayout/flowlayout.py @@ -50,7 +50,7 @@ from PySide6.QtWidgets import (QApplication, QLayout, QPushButton, class Window(QWidget): def __init__(self): - super(Window, self).__init__() + super().__init__() flow_layout = FlowLayout(self) flow_layout.addWidget(QPushButton("Short")) @@ -64,7 +64,7 @@ class Window(QWidget): class FlowLayout(QLayout): def __init__(self, parent=None): - super(FlowLayout, self).__init__(parent) + super().__init__(parent) if parent is not None: self.setContentsMargins(QMargins(0, 0, 0, 0)) diff --git a/examples/widgets/mainwindows/application/application.py b/examples/widgets/mainwindows/application/application.py index e61c6acb8..d355a7cb2 100644 --- a/examples/widgets/mainwindows/application/application.py +++ b/examples/widgets/mainwindows/application/application.py @@ -53,7 +53,7 @@ import application_rc class MainWindow(QMainWindow): def __init__(self): - super(MainWindow, self).__init__() + super().__init__() self._cur_file = '' diff --git a/examples/widgets/mainwindows/dockwidgets/dockwidgets.py b/examples/widgets/mainwindows/dockwidgets/dockwidgets.py index c4cef14e6..0ef54f37b 100644 --- a/examples/widgets/mainwindows/dockwidgets/dockwidgets.py +++ b/examples/widgets/mainwindows/dockwidgets/dockwidgets.py @@ -56,7 +56,7 @@ import dockwidgets_rc class MainWindow(QMainWindow): def __init__(self): - super(MainWindow, self).__init__() + super().__init__() self._text_edit = QTextEdit() self.setCentralWidget(self._text_edit) diff --git a/examples/widgets/mainwindows/mdi/mdi.py b/examples/widgets/mainwindows/mdi/mdi.py index b10ecbef3..7027d32cc 100644 --- a/examples/widgets/mainwindows/mdi/mdi.py +++ b/examples/widgets/mainwindows/mdi/mdi.py @@ -59,7 +59,7 @@ class MdiChild(QTextEdit): sequence_number = 1 def __init__(self): - super(MdiChild, self).__init__() + super().__init__() self.setAttribute(Qt.WA_DeleteOnClose) self._is_untitled = True @@ -169,7 +169,7 @@ class MdiChild(QTextEdit): class MainWindow(QMainWindow): def __init__(self): - super(MainWindow, self).__init__() + super().__init__() self._mdi_area = QMdiArea() self._mdi_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) diff --git a/examples/widgets/painting/basicdrawing/basicdrawing.py b/examples/widgets/painting/basicdrawing/basicdrawing.py index 724b43ad9..e08ce061d 100644 --- a/examples/widgets/painting/basicdrawing/basicdrawing.py +++ b/examples/widgets/painting/basicdrawing/basicdrawing.py @@ -63,7 +63,7 @@ class RenderArea(QWidget): Pie, Path, Text, Pixmap = range(13) def __init__(self, parent=None): - super(RenderArea, self).__init__(parent) + super().__init__(parent) self.pen = QPen() self.brush = QBrush() @@ -170,7 +170,7 @@ id_role = Qt.UserRole class Window(QWidget): def __init__(self): - super(Window, self).__init__() + super().__init__() self._render_area = RenderArea() diff --git a/examples/widgets/painting/concentriccircles/concentriccircles.py b/examples/widgets/painting/concentriccircles/concentriccircles.py index 0596a32e2..dbba93b58 100644 --- a/examples/widgets/painting/concentriccircles/concentriccircles.py +++ b/examples/widgets/painting/concentriccircles/concentriccircles.py @@ -50,7 +50,7 @@ from PySide6.QtWidgets import (QApplication, QFrame, QGridLayout, QLabel, class CircleWidget(QWidget): def __init__(self, parent=None): - super(CircleWidget, self).__init__(parent) + super().__init__(parent) self._float_based = False self.antialiased = False @@ -98,7 +98,7 @@ class CircleWidget(QWidget): class Window(QWidget): def __init__(self): - super(Window, self).__init__() + super().__init__() aliased_label = self.create_label("Aliased") antialiased_label = self.create_label("Antialiased") diff --git a/examples/widgets/richtext/orderform/orderform.py b/examples/widgets/richtext/orderform/orderform.py index e8be602c2..323be365d 100644 --- a/examples/widgets/richtext/orderform/orderform.py +++ b/examples/widgets/richtext/orderform/orderform.py @@ -57,7 +57,7 @@ from PySide6.QtPrintSupport import QAbstractPrintDialog, QPrintDialog, QPrinter class MainWindow(QMainWindow): def __init__(self): - super(MainWindow, self).__init__() + super().__init__() file_menu = QMenu("&File", self) new_action = file_menu.addAction("&New...") @@ -219,7 +219,7 @@ class MainWindow(QMainWindow): class DetailsDialog(QDialog): def __init__(self, title, parent): - super(DetailsDialog, self).__init__(parent) + super().__init__(parent) self.items = ("T-shirt", "Badge", "Reference book", "Coffee cup") diff --git a/examples/widgets/state-machine/eventtrans/eventtrans.py b/examples/widgets/state-machine/eventtrans/eventtrans.py index a014d9356..8fe67ace8 100644 --- a/examples/widgets/state-machine/eventtrans/eventtrans.py +++ b/examples/widgets/state-machine/eventtrans/eventtrans.py @@ -47,7 +47,7 @@ from PySide6.QtStateMachine import QEventTransition, QState, QStateMachine class MainWindow(QMainWindow): def __init__(self): - super(MainWindow, self).__init__() + super().__init__() button = QPushButton(self) button.setGeometry(QRect(100, 100, 100, 100)) diff --git a/examples/widgets/state-machine/factstates/factstates.py b/examples/widgets/state-machine/factstates/factstates.py index dfde45781..47cf4d841 100644 --- a/examples/widgets/state-machine/factstates/factstates.py +++ b/examples/widgets/state-machine/factstates/factstates.py @@ -49,7 +49,7 @@ from PySide6.QtStateMachine import (QFinalState, QSignalTransition, QState, class Factorial(QObject): x_changed = Signal(int) def __init__(self): - super(Factorial, self).__init__() + super().__init__() self.xval = -1 self.facval = 1 def get_x(self): @@ -68,7 +68,7 @@ class Factorial(QObject): class FactorialLoopTransition(QSignalTransition): def __init__(self, fact): - super(FactorialLoopTransition, self).__init__(fact, SIGNAL('x_changed(int)')) + super().__init__(fact, SIGNAL('x_changed(int)')) self.fact = fact def eventTest(self, e): if not super(FactorialLoopTransition, self).eventTest(e): @@ -82,7 +82,7 @@ class FactorialLoopTransition(QSignalTransition): class FactorialDoneTransition(QSignalTransition): def __init__(self, fact): - super(FactorialDoneTransition, self).__init__(fact, SIGNAL('x_changed(int)')) + super().__init__(fact, SIGNAL('x_changed(int)')) self.fact = fact def eventTest(self, e): if not super(FactorialDoneTransition, self).eventTest(e): diff --git a/examples/widgets/state-machine/pingpong/pingpong.py b/examples/widgets/state-machine/pingpong/pingpong.py index f2e1f59f7..12de2bb69 100644 --- a/examples/widgets/state-machine/pingpong/pingpong.py +++ b/examples/widgets/state-machine/pingpong/pingpong.py @@ -47,14 +47,14 @@ from PySide6.QtStateMachine import QAbstractTransition, QState, QStateMachine class PingEvent(QEvent): def __init__(self): - super(PingEvent, self).__init__(QEvent.Type(QEvent.User+2)) + super().__init__(QEvent.Type(QEvent.User+2)) class PongEvent(QEvent): def __init__(self): - super(PongEvent, self).__init__(QEvent.Type(QEvent.User+3)) + super().__init__(QEvent.Type(QEvent.User+3)) class Pinger(QState): def __init__(self, parent): - super(Pinger, self).__init__(parent) + super().__init__(parent) def onEntry(self, e): self.p = PingEvent() self.machine().postEvent(self.p) diff --git a/examples/widgets/state-machine/rogue/rogue.py b/examples/widgets/state-machine/rogue/rogue.py index c214b897b..67caef1f0 100644 --- a/examples/widgets/state-machine/rogue/rogue.py +++ b/examples/widgets/state-machine/rogue/rogue.py @@ -49,7 +49,7 @@ from PySide6.QtStateMachine import (QEventTransition, QFinalState, class MovementTransition(QEventTransition): def __init__(self, window): - super(MovementTransition, self).__init__(window, QEvent.KeyPress) + super().__init__(window, QEvent.KeyPress) self.window = window def eventTest(self, event): if event.type() == QEvent.StateMachineWrapped and \ @@ -71,7 +71,7 @@ class MovementTransition(QEventTransition): class Custom(QState): def __init__(self, parent, mw): - super(Custom, self).__init__(parent) + super().__init__(parent) self.mw = mw def onEntry(self, e): @@ -79,7 +79,7 @@ class Custom(QState): class MainWindow(QMainWindow): def __init__(self): - super(MainWindow, self).__init__() + super().__init__() self.pX = 5 self.pY = 5 self.width = 35 diff --git a/examples/widgets/state-machine/trafficlight/trafficlight.py b/examples/widgets/state-machine/trafficlight/trafficlight.py index d642261e9..e807d7388 100644 --- a/examples/widgets/state-machine/trafficlight/trafficlight.py +++ b/examples/widgets/state-machine/trafficlight/trafficlight.py @@ -48,7 +48,7 @@ from PySide6.QtStateMachine import QFinalState, QState, QStateMachine class LightWidget(QWidget): def __init__(self, color): - super(LightWidget, self).__init__() + super().__init__() self.color = color self._on_val = False def is_on(self): @@ -76,7 +76,7 @@ class LightWidget(QWidget): class TrafficLightWidget(QWidget): def __init__(self): - super(TrafficLightWidget, self).__init__() + super().__init__() vbox = QVBoxLayout(self) self._red_light = LightWidget(Qt.red) vbox.addWidget(self._red_light) @@ -105,7 +105,7 @@ def create_light_state(light, duration, parent=None): class TrafficLight(QWidget): def __init__(self): - super(TrafficLight, self).__init__() + super().__init__() vbox = QVBoxLayout(self) widget = TrafficLightWidget() vbox.addWidget(widget) diff --git a/examples/widgets/systray/window.py b/examples/widgets/systray/window.py index 4a92857d8..828aebecd 100644 --- a/examples/widgets/systray/window.py +++ b/examples/widgets/systray/window.py @@ -51,7 +51,7 @@ import rc_systray class Window(QDialog): def __init__(self, parent=None): - super(Window, self).__init__(parent) + super().__init__(parent) self._icon_group_box = QGroupBox() self._icon_label = QLabel() diff --git a/examples/widgets/tetrix/tetrix.py b/examples/widgets/tetrix/tetrix.py index cc2ad0b56..6103afd18 100644 --- a/examples/widgets/tetrix/tetrix.py +++ b/examples/widgets/tetrix/tetrix.py @@ -65,7 +65,7 @@ class Piece(IntEnum): class TetrixWindow(QWidget): def __init__(self): - super(TetrixWindow, self).__init__() + super().__init__() self.board = TetrixBoard() @@ -129,7 +129,7 @@ class TetrixBoard(QFrame): lines_removed_changed = Signal(int) def __init__(self, parent=None): - super(TetrixBoard, self).__init__(parent) + super().__init__(parent) self.timer = QBasicTimer() self.nextPieceLabel = None diff --git a/examples/widgets/threads/thread_signals.py b/examples/widgets/threads/thread_signals.py index 6a3b0ee08..60daac198 100644 --- a/examples/widgets/threads/thread_signals.py +++ b/examples/widgets/threads/thread_signals.py @@ -47,7 +47,7 @@ from PySide6.QtWidgets import QApplication, QPushButton, QVBoxLayout, QWidget # Create a basic window with a layout and a button class MainForm(QWidget): def __init__(self): - QWidget.__init__(self) + super().__init__() self.setWindowTitle("My Form") self.layout = QVBoxLayout() self.button = QPushButton("Click me!") diff --git a/examples/widgets/tutorials/addressbook/part1.py b/examples/widgets/tutorials/addressbook/part1.py index cf8847b2c..1970b31a7 100644 --- a/examples/widgets/tutorials/addressbook/part1.py +++ b/examples/widgets/tutorials/addressbook/part1.py @@ -50,7 +50,7 @@ from PySide6.QtWidgets import (QApplication, QGridLayout, class AddressBook(QWidget): def __init__(self, parent=None): - super(AddressBook, self).__init__(parent) + super().__init__(parent) name_label = QLabel("Name:") self._name_line = QLineEdit() diff --git a/examples/widgets/tutorials/addressbook/part2.py b/examples/widgets/tutorials/addressbook/part2.py index 963c84b9a..fe823742f 100644 --- a/examples/widgets/tutorials/addressbook/part2.py +++ b/examples/widgets/tutorials/addressbook/part2.py @@ -80,7 +80,7 @@ class SortedDict(dict): class AddressBook(QWidget): def __init__(self, parent=None): - super(AddressBook, self).__init__(parent) + super().__init__(parent) self.contacts = SortedDict() self._old_name = '' diff --git a/examples/widgets/tutorials/addressbook/part3.py b/examples/widgets/tutorials/addressbook/part3.py index 80e76f46e..c5ff6e732 100644 --- a/examples/widgets/tutorials/addressbook/part3.py +++ b/examples/widgets/tutorials/addressbook/part3.py @@ -80,7 +80,7 @@ class SortedDict(dict): class AddressBook(QWidget): def __init__(self, parent=None): - super(AddressBook, self).__init__(parent) + super().__init__(parent) self.contacts = SortedDict() self._old_name = '' diff --git a/examples/widgets/tutorials/addressbook/part4.py b/examples/widgets/tutorials/addressbook/part4.py index 389b2e47c..b28b1953c 100644 --- a/examples/widgets/tutorials/addressbook/part4.py +++ b/examples/widgets/tutorials/addressbook/part4.py @@ -82,7 +82,7 @@ class AddressBook(QWidget): NavigationMode, AddingMode, EditingMode = range(3) def __init__(self, parent=None): - super(AddressBook, self).__init__(parent) + super().__init__(parent) self.contacts = SortedDict() self._old_name = '' diff --git a/examples/widgets/tutorials/addressbook/part5.py b/examples/widgets/tutorials/addressbook/part5.py index c01821417..5d8918870 100644 --- a/examples/widgets/tutorials/addressbook/part5.py +++ b/examples/widgets/tutorials/addressbook/part5.py @@ -83,7 +83,7 @@ class AddressBook(QWidget): NavigationMode, AddingMode, EditingMode = range(3) def __init__(self, parent=None): - super(AddressBook, self).__init__(parent) + super().__init__(parent) self.contacts = SortedDict() self._old_name = '' @@ -320,7 +320,7 @@ class AddressBook(QWidget): class FindDialog(QDialog): def __init__(self, parent=None): - super(FindDialog, self).__init__(parent) + super().__init__(parent) find_label = QLabel("Enter the name of a contact:") self._line_edit = QLineEdit() diff --git a/examples/widgets/tutorials/addressbook/part6.py b/examples/widgets/tutorials/addressbook/part6.py index 2bf694672..aae863ead 100644 --- a/examples/widgets/tutorials/addressbook/part6.py +++ b/examples/widgets/tutorials/addressbook/part6.py @@ -83,7 +83,7 @@ class AddressBook(QWidget): NavigationMode, AddingMode, EditingMode = range(3) def __init__(self, parent=None): - super(AddressBook, self).__init__(parent) + super().__init__(parent) self.contacts = SortedDict() self._old_name = '' @@ -383,7 +383,7 @@ class AddressBook(QWidget): class FindDialog(QDialog): def __init__(self, parent=None): - super(FindDialog, self).__init__(parent) + super().__init__(parent) find_label = QLabel("Enter the name of a contact:") self._line_edit = QLineEdit() diff --git a/examples/widgets/tutorials/addressbook/part7.py b/examples/widgets/tutorials/addressbook/part7.py index 8378030ce..89f5b3467 100644 --- a/examples/widgets/tutorials/addressbook/part7.py +++ b/examples/widgets/tutorials/addressbook/part7.py @@ -83,7 +83,7 @@ class AddressBook(QWidget): NavigationMode, AddingMode, EditingMode = range(3) def __init__(self, parent=None): - super(AddressBook, self).__init__(parent) + super().__init__(parent) self.contacts = SortedDict() self._old_name = '' @@ -435,7 +435,7 @@ class AddressBook(QWidget): class FindDialog(QDialog): def __init__(self, parent=None): - super(FindDialog, self).__init__(parent) + super().__init__(parent) find_label = QLabel("Enter the name of a contact:") self._line_edit = QLineEdit() -- cgit v1.2.3