⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 advanced.cpp

📁 嵌入式Qt下的一个计算器源码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
        InputWidgetLayout->addWidget(PBSquare, fromRow+4, fromCol);        InputWidgetLayout->addWidget(PBPow, fromRow+4, fromCol+1);        InputWidgetLayout->addWidget(PBLog, fromRow+3, fromCol);        InputWidgetLayout->addWidget(PBOneOverX, fromRow+3, fromCol+2);    }    connect (PBMR, SIGNAL(clicked()), this, SLOT(MRClicked()));    connect (PBMC, SIGNAL(clicked()), this, SLOT(MCClicked()));    connect (PBMPlus, SIGNAL(clicked()), this, SLOT(MPlusClicked()));    connect (PBC, SIGNAL(clicked()), this, SLOT(CClicked()));    connect (PBPi, SIGNAL(clicked()), this, SLOT(PiClicked()));    connect (PBE, SIGNAL(clicked()), this, SLOT(EClicked()));    connect (PBInverse, SIGNAL(clicked()), this, SLOT(InverseClicked()));    connect (PBSin, SIGNAL(clicked()), this, SLOT(SinDegClicked()));    connect (PBCos, SIGNAL(clicked()), this, SLOT(CosDegClicked()));    connect (PBTan, SIGNAL(clicked()), this, SLOT(TanDegClicked()));    connect (PBOneOverX, SIGNAL(clicked()), this, SLOT(OneOverXClicked()));    connect (PBLn, SIGNAL(clicked()), this, SLOT(LnClicked()));    connect (PBLog, SIGNAL(clicked()), this, SLOT(LogClicked()));    connect (PBFactorial, SIGNAL(clicked()), this, SLOT(FactorialClicked()));    connect (PBSquare, SIGNAL(clicked()), this, SLOT(SquareClicked()));    connect (PBPow, SIGNAL(clicked()), this, SLOT(PowClicked()));}FormAdvanced::~FormAdvanced() {    delete PBPi;    delete PBC;    delete PBMR;    delete PBMC;    delete PBMPlus;    delete PBSin;    delete PBCos;    delete PBTan;    delete PBOneOverX;    delete PBLn;    delete PBFactorial;    delete PBSquare;    delete PBPow;    delete PBLog;    delete degree;    delete gradians;    delete radians;}void FormAdvanced::showEvent ( QShowEvent *e ) {    systemEngine->setAccType("Double"); // No tr        QWidget::showEvent(e);}void FormAdvanced::MCClicked() {    systemEngine->memoryReset();}void FormAdvanced::MRClicked() {    systemEngine->memoryRecall();}void FormAdvanced::MPlusClicked() {    systemEngine->memorySave();}void FormAdvanced::CClicked() {    systemEngine->dualReset();}void FormAdvanced::DelClicked() {    systemEngine->delChar();}void FormAdvanced::SinDegClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aSinDeg"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("SinDeg"); // No tr}void FormAdvanced::CosDegClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aCosDeg"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("CosDeg"); // No tr}void FormAdvanced::TanDegClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aTanDeg"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("TanDeg"); // No tr}void FormAdvanced::SinRadClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aSinRad"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("SinRad"); // No tr}void FormAdvanced::CosRadClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aCosRad"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("CosRad"); // No tr}void FormAdvanced::TanRadClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aTanRad"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("TanRad"); // No tr}void FormAdvanced::SinGraClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aSinGra"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("SinGra"); // No tr}void FormAdvanced::CosGraClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aCosGra"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("CosGra"); // No tr}void FormAdvanced::TanGraClicked() {    if (IsInverse) {        systemEngine->pushInstruction("aTanGra"); // no tr        InverseClicked();    }    else        systemEngine->pushInstruction("TanGra"); // No tr}void FormAdvanced::OneOverXClicked() {    systemEngine->pushInstruction("One over x"); // No tr}void FormAdvanced::LnClicked() {    if (IsInverse) {        systemEngine->pushInstruction("Exp"); //no tr        InverseClicked();    }    else        systemEngine->pushInstruction("Ln"); // No tr}void FormAdvanced::LogClicked() {    systemEngine->pushInstruction("Log"); //no tr}void FormAdvanced::FactorialClicked() {    systemEngine->pushInstruction("Factorial"); // No tr}void FormAdvanced::SquareClicked() {    if (IsInverse) {        systemEngine->pushInstruction("Square root"); // No tr        InverseClicked();    }    else        systemEngine->pushInstruction("Square"); // No tr}void FormAdvanced::PowClicked() {    if (IsInverse) {        systemEngine->pushInstruction("X root Y"); //no tr        InverseClicked();    }    else        systemEngine->pushInstruction("Pow"); // No tr}void FormAdvanced::PiClicked() {    systemEngine->push(QString("3.14159265358979323846")); // No tr}void FormAdvanced::EClicked() {    systemEngine->push(QString("2.71828182845904523536")); // No tr}void FormAdvanced::InverseClicked() {    IsInverse = ! IsInverse;    if (IsInverse) {        PBSin->setText(tr("ASin"));        PBCos->setText(tr("ACos"));        PBTan->setText(tr("ATan"));    } else {        PBSin->setText(tr("Sin"));        PBCos->setText(tr("Cos"));        PBTan->setText(tr("Tan"));    }    PBSquare->setInversed( IsInverse );    PBPow->setInversed( IsInverse );    PBLn->setInversed( IsInverse );}void FormAdvanced::DegreeMode(bool on) {    if (on) {        radians->setChecked(false);        gradians->setChecked(false);        PBSin->disconnect();        PBCos->disconnect();        PBTan->disconnect();        connect (PBSin, SIGNAL(clicked()), this, SLOT(SinDegClicked()));        connect (PBCos, SIGNAL(clicked()), this, SLOT(CosDegClicked()));        connect (PBTan, SIGNAL(clicked()), this, SLOT(TanDegClicked()));    }}void FormAdvanced::RadiansMode(bool on) {    if (on) {        degree->setChecked(false);        gradians->setChecked(false);        PBSin->disconnect();        PBCos->disconnect();        PBTan->disconnect();        connect (PBSin, SIGNAL(clicked()), this, SLOT(SinRadClicked()));        connect (PBCos, SIGNAL(clicked()), this, SLOT(CosRadClicked()));        connect (PBTan, SIGNAL(clicked()), this, SLOT(TanRadClicked()));    }}void FormAdvanced::GradiansMode(bool on) {    if (on) {        radians->setChecked(false);        degree->setChecked(false);        PBSin->disconnect();        PBCos->disconnect();        PBTan->disconnect();        connect (PBSin, SIGNAL(clicked()), this, SLOT(SinGraClicked()));        connect (PBCos, SIGNAL(clicked()), this, SLOT(CosGraClicked()));        connect (PBTan, SIGNAL(clicked()), this, SLOT(TanGraClicked()));    }}#endif //ENABLE_SCIENCE

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -