не могу решить проблему с отступами "expected an indented block after function definition on line..." после класса Main.window
Не могу решить проблему с отступом, все выглядит как положено, однако подсвечивается красный курсор после строки class MainWindow(QtWidgets.QWidget, Ui_Form):
class Ui_Form(object):
def setupUi(self, Form):
class MainWindow(QtWidgets.QWidget, Ui_Form):
def __init__(self):
super().__init__()
self.setupUi(self)
self.comboBox.currentIndexChanged.connect(self.update_spinbox_value)
self.layout = QtWidgets.QVBoxLayout(self)
self.image_label = QtWidgets.QLabel(self)
self.image_label.setAlignment(QtCore.Qt.AlignCenter)
self.image_label.setFixedSize(600, 400)
self.layout.addWidget(self.image_label)
self.layout.setContentsMargins(625, 80, 0, 700)
self.comboBox.currentIndexChanged.connect(self.update_image)
def update_spinbox_value(self, index):
if index == 0:
self.spinBox_2.setValue(0.8) # Присвоение вероятности каждой засаде
elif index == 1:
self.spinBox_2.setValue(0.75)
elif index == 2:
self.spinBox_2.setValue(0.7)
elif index == 3:
self.spinBox_2.setValue(0.65)
elif index == 4:
self.spinBox_2.setValue(0.6)
elif index == 5:
self.spinBox_2.setValue(0.55)
elif index == 6:
self.spinBox_2.setValue(0.5)
Источник: Stack Overflow на русском