C++ (Qt)void setValue(int value) (spinBox->setValue(value);)int value() {return spinBox->value();}
C++ (Qt)QWidget *tov = new QWidget;tov_kol *tov = new tov_kol;
C++ (Qt)class MyWidget : public QWidget{private: QSpinBox *spinBox;public: MyWidget(QWidget *parent) { spinBox = new QSpinBox(this); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(spinBox); setLayout(layout); } void setValue(int value) {spinBox->setValue(value);} void value() {return spinBox->value();}};
C++ (Qt)void someFunction(){ myWidget = new MyWidget(this); myWidget->setValue(someValue); myWidget->show();//===================== someValue = myWidget->value();}