void Segment::display(int number) { this->offAll(); switch(number) { case 0: show0(); // delay(500); break; case 1: show1(); // delay(500); break; case 2: show2(); // delay(500); break; case 3: show3(); // delay(500); break; case 4: show4(); // delay(500); break; case 5: show5(); // delay(500); break; case 6: show6(); // delay(500); break; case 7: show7(); // delay(500); break; case 8: show8(); // delay(500); break; case 9: show9(); // delay(500); break; default: showE(); // delay(500); break; } }
Menu::Menu(QWidget *parent) : defaultScreenWidth(480), defaultScreenHeight(800), QMainWindow(parent) { setAttribute(Qt::WA_DeleteOnClose); central = new QWidget(this); central->setObjectName("central"); windowTitle = new QLabel; windowTitle->setScaledContents(true); AButton = new QPushButton(tr("Сложение")); AButton->setFocusPolicy(Qt::NoFocus); connect(AButton, SIGNAL(clicked()), this, SLOT(showA())); BButton = new QPushButton(tr("Вычитание")); BButton->setFocusPolicy(Qt::NoFocus); connect(BButton, SIGNAL(clicked()), this, SLOT(showB())); CButton = new QPushButton(tr("Умножение на число")); CButton->setFocusPolicy(Qt::NoFocus); connect(CButton, SIGNAL(clicked()), this, SLOT(showC())); DButton = new QPushButton(tr("Умножение")); DButton->setFocusPolicy(Qt::NoFocus); connect(DButton, SIGNAL(clicked()), this, SLOT(showD())); EButton = new QPushButton(tr("Транспонирование")); EButton->setFocusPolicy(Qt::NoFocus); connect(EButton, SIGNAL(clicked()), this, SLOT(showE())); FButton = new QPushButton(tr("Определитель")); FButton->setFocusPolicy(Qt::NoFocus); connect(FButton, SIGNAL(clicked()), this, SLOT(showF())); GButton = new QPushButton(tr("Возведение в степень")); GButton->setFocusPolicy(Qt::NoFocus); connect(GButton, SIGNAL(clicked()), this, SLOT(showG())); HButton = new QPushButton(tr("Обратная матрица")); HButton->setFocusPolicy(Qt::NoFocus); connect(HButton, SIGNAL(clicked()), this, SLOT(showH())); IButton = new QPushButton(tr("След")); IButton->setFocusPolicy(Qt::NoFocus); connect(IButton, SIGNAL(clicked()), this, SLOT(showI())); JButton = new QPushButton(tr("Треугольный вид")); JButton->setFocusPolicy(Qt::NoFocus); connect(JButton, SIGNAL(clicked()), this, SLOT(showJ())); KButton = new QPushButton(tr("Ранг")); KButton->setFocusPolicy(Qt::NoFocus); connect(KButton, SIGNAL(clicked()), this, SLOT(showK())); LButton = new QPushButton(tr("Определенность матрицы")); LButton->setFocusPolicy(Qt::NoFocus); connect(LButton, SIGNAL(clicked()), this, SLOT(showL())); settingsButton = new QPushButton(tr("Настройки")); settingsButton->setFocusPolicy(Qt::NoFocus); connect(settingsButton, SIGNAL(clicked()), this, SLOT(showSettings())); scaling(); designInit(); sizeInit(); init(); setCentralWidget(central); setWindowTitle(tr("Матричный калькулятор++")); }