Pyqt5 attribute veya int attribute hatası

Yazdığım programda slider in bağlı olduğu def i selfsiz yazınca bir hata almıyorum ama slideri haraket ettirince def in içinden “AttributeError: ‘int’ object has no attribute ‘slider’” hatasını alıyorum. Bunun olmaması için slideri defe bağlarken self. ile bağlamalıyım sanırım bu sefer de “AttributeError: ‘Window’ object has no attribute ‘sliderValue_1’” hatası alıyorum. Kodun sadece ilgili alanınını hazırladığımda program çalıştı yani sorun ana kodta
ve kodun ana hali de burada slider 476. satırda ve def te 528.

ilgili kod:

from PyQt5 import QtGui
from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QSlider, QLabel
import sys
from PyQt5.QtCore import Qt


class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.title = "PyQt5 Slider"
        self.top = 200
        self.left = 500
        self.width = 400
        self.height = 300

        self.slider = QSlider(self)
        self.slider.setStyleSheet("border:none ;");
        self.slider.setGeometry(132,488,125,30)
        self.slider.setOrientation(Qt.Horizontal)
        self.slider.setTickPosition(QSlider.TicksBelow)
        self.slider.setTickInterval(1)
        self.slider.setMinimum(0)
        self.slider.setMaximum(9)
        self.slider.valueChanged[int].connect(self.sliderValue_1)

        self.show()
    def sliderValue_1(self):
        print(str(self.slider.value()))


App = QApplication(sys.argv)
window = Window()
sys.exit(App.exec())

ve ana kod:

from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import *

import sys

class Window_3(QWidget):
    def __init__(self):
        super().__init__()
        self.title = "Information"
        self.setWindowTitle(self.title)
        self.setGeometry(328, 127, 160, 170)
        Window_3.setFixedSize(self,160,170)

        label_2 = QLabel("First, the first two color",self)
        label_2.setFont(QFont("Times",12))
        label_2.setGeometry(5,2,150,12)

        label_3 = QLabel("value are written",self)
        label_3.setFont(QFont("Times",12))
        label_3.setGeometry(5,25,150,12)

        button_14 = QLabel("in order. Then zero is ",self)
        button_14.setFont(QFont("Times",12))
        button_14.setGeometry(5,42,150,12)

        label_5 = QLabel("added to the right side of",self)
        label_5.setFont(QFont("Times",12))
        label_5.setGeometry(5,59,150,18)

        label_6 = QLabel("the number by the third",self)
        label_6.setFont(QFont("Times",12))
        label_6.setGeometry(5,82,150,18)

        label_7 = QLabel("color value. Forth color",self)
        label_7.setFont(QFont("Times",12))
        label_7.setGeometry(5,105,150,12)

        label_8 = QLabel("determines tolerance of",self)
        label_8.setFont(QFont("Times",12))
        label_8.setGeometry(5,128,150,12)

        label_9 = QLabel("general resistor value.",self)
        label_9.setFont(QFont("Times",12))
        label_9.setGeometry(5,146,150,18)

class Window_2(QWidget):
    def __init__(self):
        super().__init__()
        self.title = "Resistor Value Colors Table"
        self.setWindowTitle(self.title)
        self.setGeometry(300, 50, 300, 300)
        Window_2.setFixedSize(self,300,300)

        button_11 = QPushButton("",self)
        pixmap_11 = QPixmap("resistor_value_colors.png")
        button_11.setIconSize(QSize(300,300))
        button_11.setIcon(QIcon(pixmap_11))
        button_11.setGeometry(0,0,300,300)
        button_11.setStyleSheet("border: none;")

        self.thirdWindow = Window_3()

        def info_1():
            self.thirdWindow.show()

        button_12 = QPushButton("",self)
        pixmap_12 = QPixmap("info.png")
        button_12.setIconSize(QSize(16,16))
        button_12.setIcon(QIcon(pixmap_12))
        button_12.setGeometry(10,50,16,16)
        button_12.setStyleSheet("border: none;")
        button_12.clicked.connect(info_1)

class Window(QWidget):
    def __init__(self):
        super().__init__()

        #About window settings and related to opening other windows
        def part_1():
            self.title = "Resistor Value Calculator"
            self.setWindowTitle(self.title)
            self.formIcon = "220_ohm_resistor.png"
            self.setWindowIcon(QtGui.QIcon(self.formIcon))
            self.setGeometry(0, 0, 300, 500)
            Window.setFixedSize(self,300,575)


            def constant():
                button_1 = QPushButton("",self)
                button_1.setGeometry(30,31,75,47)
                pixmap_1 = QPixmap("resistor_left.png")
                button_1.setIcon(QIcon(pixmap_1))
                button_1.setIconSize(QSize(75,47))
                button_1.setStyleSheet("border: none;")

                button_3 = QPushButton("",self)
                button_3.setGeometry(94,31,50,47)
                pixmap_3 = QPixmap("resistor_2.color.png")
                button_3.setIcon(QIcon(pixmap_3))
                button_3.setIconSize(QSize(50,37))
                button_3.setStyleSheet("border: none;")

                button_5 = QPushButton("",self)
                button_5.setGeometry(123,31,50,47)
                pixmap_5 = QPixmap("resistor_4.color.png")
                button_5.setIcon(QIcon(pixmap_5))
                button_5.setIconSize(QSize(50,37))
                button_5.setStyleSheet("border: none;")

                button_7 = QPushButton("",self)
                button_7.setGeometry(151,31,50,47)
                pixmap_7 = QPixmap("resistor_6.color.png")
                button_7.setIcon(QIcon(pixmap_7))
                button_7.setIconSize(QSize(50,37))
                button_7.setStyleSheet("border: none;")

                button_9 = QPushButton("",self)
                button_9.setGeometry(191,31,75,47)
                pixmap_9 = QPixmap("resistor_8.color.png")
                button_9.setIcon(QIcon(pixmap_9))
                button_9.setIconSize(QSize(75,47))
                button_9.setStyleSheet("border: none;")

            constant()

            button_2 = QPushButton("",self)
            button_2.setGeometry(82,31,50,47)
            pixmap_2 = QPixmap("RC1_V0.png")
            button_2.setIcon(QIcon(pixmap_2))
            button_2.setIconSize(QSize(50,47))
            button_2.setStyleSheet("border: none;")

            button_4 = QPushButton("",self)
            button_4.setGeometry(107,31,50,47)
            pixmap_4 = QPixmap("RC2_V0.png")
            button_4.setIcon(QIcon(pixmap_4))
            button_4.setIconSize(QSize(50,37))
            button_4.setStyleSheet("border: none;")

            button_6 = QPushButton("",self)
            button_6.setGeometry(139,31,50,47)
            pixmap_6 = QPixmap("RC2_V1.png")
            button_6.setIcon(QIcon(pixmap_6))
            button_6.setIconSize(QSize(50,37))
            button_6.setStyleSheet("border: none;")

            button_8 = QPushButton("",self)
            button_8.setGeometry(181,31,12,47)
            pixmap_8 = QPixmap("RC1_V0.png")
            button_8.setIcon(QIcon(pixmap_8))
            button_8.setIconSize(QSize(12,47))
            button_8.setStyleSheet("border: none;")

            label_1 = QLabel("1000000000",self)
            label_1.setGeometry(90,85,40,30)
            label_1.setStyleSheet("background-color: #EFE4B0;"
                                  "border:none;"
                                  "background-color: #EFE4B0;"
                                  "border-style: outset;"
                                  "border-width: 2px;"
                                  "border-radius: 10px;"
                                  "border-color: black;"
                                  "min-width: 10em;"
                                  "padding: 6px;");

            label_1.setFont(QFont("Times",14))

            button_9 = QPushButton("",self)
            pixmap_9 = QPixmap("Omega.png")
            button_9.setIcon(QIcon(pixmap_9))
            button_9.setIconSize(QSize(20,20))
            button_9.setGeometry(205,90,20,20)
            button_9.setStyleSheet("border: none;")

            self.secondWindow = Window_2()

            def table():
                self.secondWindow.show()

            button_10 = QPushButton("",self)
            pixmap_10 = QPixmap("table_icon.png")
            button_10.setIcon(QIcon(pixmap_10))
            button_10.setIconSize(QSize(26,26))
            button_10.setGeometry(243,105,26,26)
            button_10.setStyleSheet("border: none;")
            button_10.clicked.connect(table)

        part_1()
        #About first big button
        def part_2_1():
            button_13 = QPushButton(#"            Enter Resistor Value            ",
            self)
            button_13.setFont(QFont("Times",12))
            button_13.setStyleSheet("color: black ;"
                                     "border:none;"
                                     "background-color: #EFE4B0;"
                                     "border-style: outset;"
                                     "border-width: 2px;"
                                     "border-radius: 30px;"
                                     "border-color: black;"
                                     "min-width: 10em;"
                                     "padding: 6px;");
            button_13.setGeometry(30,150,240,190)

            button_14 = QPushButton("Enter Resistor Value",button_13)
            button_14.setFont(QFont("Times",12))
            button_14.setStyleSheet("color: black ;"
                                     "background-color: #CD853F;"
                                     "border-style: outset;"
                                     "border-width: 2px;"
                                     "border-radius: 10px;"
                                     "border-color: black;"
                                     "min-width: 10em;"
                                     "padding: 6px;");
            button_14.setGeometry(45,0,50,28)

            button_15 = QPushButton("",self)
            button_15.setStyleSheet("color: black ;"
                                     "background-color: #CD853F;"
                                     "border-style: outset;"
                                     "border-width: 2px;"
                                     "border-radius: 10px;"
                                     "border-color: black;"
                                     "padding: 6px;");
            button_15.setGeometry(35,180,110,130)

            button_16 = QPushButton("",self)
            button_16.setStyleSheet("color: black ;"
                                    "background-color: #CD853F;"
                                     "border-style: outset;"
                                     "border-width: 2px;"
                                     "border-radius: 10px;"
                                     "border-color: black;"
                                     "padding: 6px;");
            button_16.setGeometry(155,180,110,130)

            button_17 = QPushButton("",button_15)
            button_17.setStyleSheet("color: black ;"
                                    "background-color: #EFE4B0;"
                                     "border-style: outset;"
                                     "border-width: 2px;"
                                     "border-radius: 10px;"
                                     "border-color: black;"
                                     "padding: 6px;");
            button_17.setGeometry(5,5,100,80)

            button_20 = QPushButton("resistor value",button_17)
            button_20.setFont(QFont("Times",12))
            button_20.setStyleSheet("color: black ;"
                                    "border:none;");
            button_20.setGeometry(3,33,95,26)

            button_19 = QPushButton("numbers of",button_17)
            button_19.setFont(QFont("Times",12))
            button_19.setStyleSheet("color: black ;"
                                    "border:none;");
            button_19.setGeometry(8,18,78,24)

            button_18 = QPushButton("First two ",button_17)
            button_18.setFont(QFont("Times",12))
            button_18.setStyleSheet("color: black ;"
                                    "border:none;");
            button_18.setGeometry(2,2,95,23)

            self.spinbox_1 = QSpinBox(self)
            self.spinbox_1.setRange(0,99)
            self.spinbox_1.setFont(QFont("Times",12))
            self.spinbox_1.setStyleSheet("background-color: #EFE4B0;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;"
                                    "padding: 6px;");
            self.spinbox_1.setGeometry(65,263,50,30)
            self.spinbox_1.valueChanged.connect(spinChanged_1)

            button_21 = QPushButton("",button_16)
            button_21.setStyleSheet("color: black ;"
                                    "background-color: #EFE4B0;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;"
                                    "padding: 6px;");
            button_21.setGeometry(5,5,100,80)

            button_25 = QPushButton("digets",button_21)
            button_25.setFont(QFont("Times",12))
            button_25.setStyleSheet("color: black ;"
                                    "background-color: #EFE4B0;"
                                    "border-style: outset;"
                                    "border:none;"
                                    "border-radius: 10px;");
            button_25.setGeometry(5,49,93,29)

            button_24 = QPushButton("the first two",button_21)
            button_24.setFont(QFont("Times",12))
            button_24.setStyleSheet("color: black ;"
                                    "background-color: #EFE4B0;"
                                    "border-style: outset;"
                                    "border:none;"
                                    "border-radius: 10px;");
            button_24.setGeometry(5,36,93,23)

            button_23 = QPushButton("of zeros after",button_21)
            button_23.setFont(QFont("Times",12))
            button_23.setStyleSheet("color: black ;"
                                    "background-color: #EFE4B0;"
                                    "border-style: outset;"
                                    "border:none;"
                                    "border-radius: 10px;");
            button_23.setGeometry(5,19,93,23)

            button_22 = QPushButton("The number ",button_21)
            button_22.setFont(QFont("Times",12))
            button_22.setStyleSheet("color: black ;"
                                    "background-color: #EFE4B0;"
                                    "border-style: outset;"
                                    "border:none;"
                                    "border-radius: 10px;");
            button_22.setGeometry(5,2,93,23)

            self.spinbox_2 = QSpinBox(self)
            self.spinbox_2.setRange(0,9)
            self.spinbox_2.setFont(QFont("Times",12))
            self.spinbox_2.setStyleSheet("background-color: #EFE4B0;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;"
                                    "padding: 6px;");
            self.spinbox_2.setGeometry(185,263,50,30)
            self.spinbox_2.valueChanged.connect(spinChanged_2)

            button_27 = QPushButton("Apply",self)
            button_27.setFont(QFont("Times",12))
            button_27.setStyleSheet("color: black ;"
                                    "background-color: #CD853F;"
                                     "border-style: outset;"
                                     "border-width: 2px;"
                                     "border-radius: 10px;"
                                     "border-color: black;");
            button_27.setGeometry(112,312,80,28)
            # button_27.clicked.connect(B27_Reader)

        def spinChanged_1():
            value_1 = self.spinbox_1.value()

        def spinChanged_2():
            value_2 = self.spinbox_2.value()

        part_2_1()
        # About second big button
        def part_2_2():

            button_26 = QPushButton("",self)
            button_26.setFont(QFont("Times",12))
            button_26.setStyleSheet("color: black ;"
                                    "border:none;"
                                    "background-color: #EFE4B0;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 30px;"
                                    "border-color: black;"
                                    "min-width: 10em;"
                                    "padding: 6px;");
            button_26.setGeometry(30,360,240,190)

            button_28 = QPushButton("First color:",self)
            button_28.setFont(QFont("Times",12))
            button_28.setStyleSheet("color: black ;"
                                    "border:none;"
                                    "background-color: #CD853F;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;");
            button_28.setGeometry(35,390,90,30)

            button_29 = QPushButton("Second color:",self)
            button_29.setFont(QFont("Times",12))
            button_29.setStyleSheet("color: black ;"
                                    "border:none;"
                                    "background-color: #CD853F;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;");
            button_29.setGeometry(35,440,90,30)

            button_30 = QPushButton("Third color:",self)
            button_30.setFont(QFont("Times",12))
            button_30.setStyleSheet("color: black ;"
                                    "border:none;"
                                    "background-color: #CD853F;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;");
            button_30.setGeometry(35,490,90,30)

            button_31 = QPushButton("",self)
            button_31.setFont(QFont("Times",12))
            pixmap_14 = QPixmap("All_Colors_For_Slider.png")
            button_31.setIcon(QIcon(pixmap_14))
            button_31.setIconSize(QSize(132,25))
            button_31.setStyleSheet("color: black ;"
                                    "border: none"
                                    "background-color: #CD853F;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;");
            button_31.setGeometry(128,400,132,20)

            button_32 = QPushButton("",self)
            button_32.setFont(QFont("Times",12))
            button_32.setIconSize(QSize(130,20))
            button_32.setStyleSheet("color: black ;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 5px;"
                                    "border-color: black;");
            button_32.setGeometry(128,402,132,16)

            button_33 = QPushButton("",self)
            button_33.setFont(QFont("Times",12))
            pixmap_15 = QPixmap("All_Colors_For_Slider.png")
            button_33.setIcon(QIcon(pixmap_15))
            button_33.setIconSize(QSize(132,25))
            button_33.setStyleSheet("color: black ;"
                                    "border: none"
                                    "background-color: #CD853F;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;");
            button_33.setGeometry(128,450,132,20)

            button_34 = QPushButton("",self)
            button_34.setFont(QFont("Times",12))
            button_34.setIconSize(QSize(130,20))
            button_34.setStyleSheet("color: black ;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 5px;"
                                    "border-color: black;");
            button_34.setGeometry(128,452,132,16)

            button_35= QPushButton("",self)
            button_35.setFont(QFont("Times",12))
            pixmap_16 = QPixmap("All_Colors_For_Slider.png")
            button_35.setIcon(QIcon(pixmap_16))
            button_35.setIconSize(QSize(132,25))
            button_35.setStyleSheet("color: black ;"
                                    "border: none"
                                    "background-color: #CD853F;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 10px;"
                                    "border-color: black;");
            button_35.setGeometry(128,500,132,20)

            button_36 = QPushButton("",self)
            button_36.setFont(QFont("Times",12))
            button_36.setIconSize(QSize(130,20))
            button_36.setStyleSheet("color: black ;"
                                    "border-style: outset;"
                                    "border-width: 2px;"
                                    "border-radius: 5px;"
                                    "border-color: black;");
            button_36.setGeometry(128,502,132,16)

            self.slider = QSlider(self)
            self.slider.setStyleSheet("border:none ;");
            self.slider.setGeometry(132,488,125,30)
            self.slider.setOrientation(Qt.Horizontal)
            self.slider.setTickPosition(QSlider.TicksBelow)
            self.slider.setTickInterval(1)
            self.slider.setMinimum(0)
            self.slider.setMaximum(9)
            self.slider.valueChanged[int].connect(self.sliderValue_1)

            self.slider_2 = QSlider(self)
            self.slider_2.setStyleSheet("border:none ;");
            self.slider_2.setGeometry(132,438,125,30)
            self.slider_2.setOrientation(Qt.Horizontal)
            self.slider_2.setTickPosition(QSlider.TicksBelow)
            self.slider_2.setTickInterval(1)
            self.slider_2.setMinimum(0)
            self.slider_2.setMaximum(9)
            self.slider_2.valueChanged.connect(sliderValue_2)

            self.slider_3 = QSlider(self)
            self.slider_3.setStyleSheet("border:none ;");
            self.slider_3.setGeometry(132,388,125,30)
            self.slider_3.setOrientation(Qt.Horizontal)
            self.slider_3.setTickPosition(QSlider.TicksBelow)
            self.slider_3.setTickInterval(1)
            self.slider_3.setMinimum(0)
            self.slider_3.setMaximum(9)
            self.slider_3.valueChanged.connect(sliderValue_3)

            button_37 = QPushButton("Apply",self)
            button_37.setFont(QFont("Times",12))
            button_37.setStyleSheet("color: black ;"
                                    "background-color: #CD853F;"
                                     "border-style: outset;"
                                     "border-width: 2px;"
                                     "border-radius: 10px;"
                                     "border-color: black;");
            button_37.setGeometry(112,522,80,28)

            button_38 = QPushButton("Enter Resistor Colors",button_26)
            button_38.setFont(QFont("Times",12))
            button_38.setStyleSheet("color: black ;"
                                     "background-color: #CD853F;"
                                     "border-style: outset;"
                                     "border-width: 2px;"
                                     "border-radius: 10px;"
                                     "border-color: black;"
                                     "min-width: 10em;"
                                     "padding: 6px;");
            button_38.setGeometry(45,0,50,28)

        def sliderValue_1(self):
            print(str(self.slider.value()))

        def sliderValue_2(self):
            print("a")

        def sliderValue_3(self):
            print("a")

        part_2_2()

        self.show()


if __name__ == "__main__":
    App = QApplication(sys.argv)
    window = Window()
    sys.exit(App.exec())