Skip to content

Commit

Permalink
Fix type hinting in compiled UI files (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlegiantJGC authored May 7, 2024
1 parent 7694ef2 commit 1c58c09
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 77 deletions.
8 changes: 4 additions & 4 deletions src/amulet_editor/application/_splash/_splash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
################################################################################
## Form generated from reading UI file '_splash.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
## Created by: Qt User Interface Compiler version 6.7.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -11,7 +11,7 @@


class Ui_Splash(QDialog):
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
if not self.objectName():
self.setObjectName("Splash")
Expand All @@ -36,10 +36,10 @@ def __init__(self, *args, **kwargs):
self._localise()
QMetaObject.connectSlotsByName(self)

def changeEvent(self, event: QEvent):
def changeEvent(self, event: QEvent) -> None:
super().changeEvent(event)
if event.type() == QEvent.Type.LanguageChange:
self._localise()

def _localise(self):
def _localise(self) -> None:
self.setWindowTitle(QCoreApplication.translate("Splash", "Form", None))
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
################################################################################
## Form generated from reading UI file '_landing_window.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
## Created by: Qt User Interface Compiler version 6.7.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -13,7 +13,7 @@


class Ui_AmuletLandingWindow(QMainWindow):
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
if not self.objectName():
self.setObjectName("AmuletLandingWindow")
Expand Down Expand Up @@ -42,12 +42,12 @@ def __init__(self, *args, **kwargs):
self._localise()
QMetaObject.connectSlotsByName(self)

def changeEvent(self, event: QEvent):
def changeEvent(self, event: QEvent) -> None:
super().changeEvent(event)
if event.type() == QEvent.Type.LanguageChange:
self._localise()

def _localise(self):
def _localise(self) -> None:
self.setWindowTitle(
QCoreApplication.translate("AmuletLandingWindow", "MainWindow", None)
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
################################################################################
## Form generated from reading UI file '_home.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
## Created by: Qt User Interface Compiler version 6.7.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -21,7 +21,7 @@


class Ui_HomePage(QWidget):
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
if not self.objectName():
self.setObjectName("HomePage")
Expand All @@ -33,7 +33,7 @@ def __init__(self, *args, **kwargs):
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)

self.horizontalSpacer_2 = QSpacerItem(
40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum
40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
)
self.horizontalLayout.addItem(self.horizontalSpacer_2)

Expand All @@ -42,7 +42,7 @@ def __init__(self, *args, **kwargs):
self._central_layout.setContentsMargins(50, 50, 50, 50)

self.verticalSpacer_2 = QSpacerItem(
20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
)
self._central_layout.addItem(self.verticalSpacer_2)

Expand Down Expand Up @@ -71,7 +71,7 @@ def __init__(self, *args, **kwargs):
self._central_layout.addWidget(self.lbl_app_version)

self._vertical_spacer = QSpacerItem(
20, 20, QSizePolicy.Minimum, QSizePolicy.Fixed
20, 20, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed
)
self._central_layout.addItem(self._vertical_spacer)

Expand Down Expand Up @@ -111,13 +111,13 @@ def __init__(self, *args, **kwargs):
self._central_layout.addLayout(self.gridLayout)

self.verticalSpacer = QSpacerItem(
20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
)
self._central_layout.addItem(self.verticalSpacer)
self.horizontalLayout.addLayout(self._central_layout)

self.horizontalSpacer = QSpacerItem(
40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum
40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
)
self.horizontalLayout.addItem(self.horizontalSpacer)

Expand All @@ -130,12 +130,12 @@ def __init__(self, *args, **kwargs):
self._localise()
QMetaObject.connectSlotsByName(self)

def changeEvent(self, event: QEvent):
def changeEvent(self, event: QEvent) -> None:
super().changeEvent(event)
if event.type() == QEvent.Type.LanguageChange:
self._localise()

def _localise(self):
def _localise(self) -> None:
self.setWindowTitle(QCoreApplication.translate("HomePage", "Form", None))
self.lbl_app_name.setText(
QCoreApplication.translate("HomePage", "Amulet Editor", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
################################################################################
## Form generated from reading UI file '_open_world.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
## Created by: Qt User Interface Compiler version 6.7.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -21,7 +21,7 @@


class Ui_OpenWorldPage(QWidget):
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
if not self.objectName():
self.setObjectName("OpenWorldPage")
Expand All @@ -38,7 +38,7 @@ def __init__(self, *args, **kwargs):

self.btn_back = QPushButton(self)
self.btn_back.setObjectName("btn_back")
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.btn_back.sizePolicy().hasHeightForWidth())
Expand All @@ -53,7 +53,7 @@ def __init__(self, *args, **kwargs):
self._lyt_header.addWidget(self._lbl_title)

self._horizontal_spacer = QSpacerItem(
30, 30, QSizePolicy.Fixed, QSizePolicy.Minimum
30, 30, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum
)
self._lyt_header.addItem(self._horizontal_spacer)
self._vertical_layout.addLayout(self._lyt_header)
Expand Down Expand Up @@ -93,19 +93,19 @@ def __init__(self, *args, **kwargs):
self._vertical_layout.addLayout(self._lyt_world_directory)

self._vertical_spacer = QSpacerItem(
20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
)
self._vertical_layout.addItem(self._vertical_spacer)

self._localise()
QMetaObject.connectSlotsByName(self)

def changeEvent(self, event: QEvent):
def changeEvent(self, event: QEvent) -> None:
super().changeEvent(event)
if event.type() == QEvent.Type.LanguageChange:
self._localise()

def _localise(self):
def _localise(self) -> None:
self.setWindowTitle(QCoreApplication.translate("OpenWorldPage", "Form", None))
self.btn_back.setText("")
self._lbl_title.setText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
################################################################################
## Form generated from reading UI file '_traceback_dialog.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
## Created by: Qt User Interface Compiler version 6.7.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -21,7 +21,7 @@


class Ui_AmuletTracebackDialog(QDialog):
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
if not self.objectName():
self.setObjectName("AmuletTracebackDialog")
Expand Down Expand Up @@ -53,7 +53,9 @@ def __init__(self, *args, **kwargs):
self._button_layout = QHBoxLayout()
self._button_layout.setObjectName("_button_layout")

self._spacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self._spacer = QSpacerItem(
40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
)
self._button_layout.addItem(self._spacer)

self._copy_button = QPushButton(self)
Expand All @@ -62,7 +64,7 @@ def __init__(self, *args, **kwargs):

self._ok_button_box = QDialogButtonBox(self)
self._ok_button_box.setObjectName("_ok_button_box")
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
Expand All @@ -79,12 +81,12 @@ def __init__(self, *args, **kwargs):
self._ok_button_box.accepted.connect(self.accept)
QMetaObject.connectSlotsByName(self)

def changeEvent(self, event: QEvent):
def changeEvent(self, event: QEvent) -> None:
super().changeEvent(event)
if event.type() == QEvent.Type.LanguageChange:
self._localise()

def _localise(self):
def _localise(self) -> None:
self.setWindowTitle(
QCoreApplication.translate("AmuletTracebackDialog", "window_title", None)
)
Expand Down
18 changes: 9 additions & 9 deletions src/builtin_plugins/amulet_team_home_page/home/home/_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
################################################################################
## Form generated from reading UI file '_home.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
## Created by: Qt User Interface Compiler version 6.7.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -21,7 +21,7 @@


class Ui_HomePage(QWidget):
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
if not self.objectName():
self.setObjectName("HomePage")
Expand All @@ -33,7 +33,7 @@ def __init__(self, *args, **kwargs):
self._layout.setContentsMargins(0, 0, 0, 0)

self._left_spacer = QSpacerItem(
40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum
40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
)
self._layout.addItem(self._left_spacer)

Expand All @@ -42,7 +42,7 @@ def __init__(self, *args, **kwargs):
self._central_layout.setContentsMargins(50, 50, 50, 50)

self._top_spacer = QSpacerItem(
20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
)
self._central_layout.addItem(self._top_spacer)

Expand Down Expand Up @@ -71,7 +71,7 @@ def __init__(self, *args, **kwargs):
self._central_layout.addWidget(self._lbl_app_version)

self._middel_spacer = QSpacerItem(
20, 20, QSizePolicy.Minimum, QSizePolicy.Fixed
20, 20, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed
)
self._central_layout.addItem(self._middel_spacer)

Expand Down Expand Up @@ -111,13 +111,13 @@ def __init__(self, *args, **kwargs):
self._central_layout.addLayout(self._button_layout)

self._bottom_spacer = QSpacerItem(
20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
)
self._central_layout.addItem(self._bottom_spacer)
self._layout.addLayout(self._central_layout)

self._right_spacer = QSpacerItem(
40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum
40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
)
self._layout.addItem(self._right_spacer)

Expand All @@ -130,12 +130,12 @@ def __init__(self, *args, **kwargs):
self._localise()
QMetaObject.connectSlotsByName(self)

def changeEvent(self, event: QEvent):
def changeEvent(self, event: QEvent) -> None:
super().changeEvent(event)
if event.type() == QEvent.Type.LanguageChange:
self._localise()

def _localise(self):
def _localise(self) -> None:
self.setWindowTitle(QCoreApplication.translate("HomePage", "Form", None))
self._lbl_app_name.setText(
QCoreApplication.translate("HomePage", "amulet_editor", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
################################################################################
## Form generated from reading UI file '_open_world.ui'
##
## Created by: Qt User Interface Compiler version 6.5.2
## Created by: Qt User Interface Compiler version 6.7.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
Expand All @@ -20,7 +20,7 @@


class Ui_OpenWorldPage(QWidget):
def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
if not self.objectName():
self.setObjectName("OpenWorldPage")
Expand All @@ -35,7 +35,7 @@ def __init__(self, *args, **kwargs):

self.btn_back = QPushButton(self)
self.btn_back.setObjectName("btn_back")
sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.btn_back.sizePolicy().hasHeightForWidth())
Expand All @@ -50,7 +50,7 @@ def __init__(self, *args, **kwargs):
self._lyt_header.addWidget(self._lbl_title)

self._horizontal_spacer = QSpacerItem(
30, 30, QSizePolicy.Fixed, QSizePolicy.Minimum
30, 30, QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Minimum
)
self._lyt_header.addItem(self._horizontal_spacer)
self.verticalLayout.addLayout(self._lyt_header)
Expand All @@ -75,19 +75,19 @@ def __init__(self, *args, **kwargs):
self.verticalLayout.addLayout(self.horizontalLayout)

self._vertical_spacer = QSpacerItem(
20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding
20, 40, QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
)
self.verticalLayout.addItem(self._vertical_spacer)

self._localise()
QMetaObject.connectSlotsByName(self)

def changeEvent(self, event: QEvent):
def changeEvent(self, event: QEvent) -> None:
super().changeEvent(event)
if event.type() == QEvent.Type.LanguageChange:
self._localise()

def _localise(self):
def _localise(self) -> None:
self.setWindowTitle(QCoreApplication.translate("OpenWorldPage", "Form", None))
self.btn_back.setText("")
self._lbl_title.setText(
Expand Down
Loading

0 comments on commit 1c58c09

Please sign in to comment.