ошибка spindemo is not defined
import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class spindemo(QWidget):
def
init
(self, parent = None):
super(spindemo,self).
init
(parent)
layout = QVBoxLayout()
self.l1 = QLabel("текущее значение")
self.l1.setAligment(Qt.AlignCenter)
layout = addWidget(self.l1)
self.sp = QSpinBox()
layout = addWidget(self.sp)
self.sp.valueChanged.connect(self.valuechange)
self.setLayout(layout)
self.setWindowTitle(" демонстрация")
def valuechange(self):
self.l1.setText( " Текущее значение :"+ self.sp.value())
def main():
app = QApplication(sys.argv)
ex = spindemo()
ex.show()
sys.exit(app.exec_())
if
name
== '
main
':
main()
```
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.Do you like it? Share on social networks!
- Akiv Doros
- Nov. 12, 2024, 3:58 a.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:50points,
- Rating points-4
- molni99
- Oct. 26, 2024, 1:37 p.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:80points,
- Rating points4
- molni99
- Oct. 26, 2024, 1:29 p.m.
C ++ - Test 004. Pointers, Arrays and Loops
- Result:20points,
- Rating points-10