#include #include "myspinbox.h" using namespace std; MySpinBox::MySpinBox(int ind_tbl, int type, int c, int r ) : QSpinBox() { ind_t = ind_tbl; type_t = type; col = c; row = r; } bool MySpinBox::isSelected(int tbl, int type, int c, int r) { if( (tbl == MySpinBox::its) && (type == MySpinBox::tts) && (c == MySpinBox::cs) && (r == MySpinBox::rs) ) return true; else return false; } void MySpinBox::keyReleaseEvent(QKeyEvent * event) { //При нажатии Enter в этом месте event->key() == Qt::Key_Return if(event->key() == Qt::Key_Return) emit myValueChanged(this->value(), ind_t, col, row); } void MySpinBox::focusInEvent(QFocusEvent * event) { if(event->gotFocus()) { MySpinBox::its = ind_t; MySpinBox::cs = col; MySpinBox::rs = row; MySpinBox::tts = type_t; } } int MySpinBox::its; int MySpinBox::cs; int MySpinBox::rs; int MySpinBox::tts;