• 大小: 1.75MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-30
  • 语言: 其他
  • 标签: 嵌入式  

资源简介

嵌入式系统通常是面向特点应用的,功耗低、体积小、集成度高、成本低,具有较长的生命周期。嵌入式应用系统开发之超市管理系统。

资源截图

代码片段和文件信息

#include se>
#include 
#include 
#include 
#include 
#include “front.h“
#include “ui_front.h“
#include “payment.h“
#include “ui_payment.h“
#include 
front::front(QWidget *parent) :
    QMainWindow(parent)
    ui(new Ui::front)
{
    ui->setupUi(this);
    ui->frame->autoFillBackground();
    //flag1=0;
    //flag2=0;
    total=0;
    sellitems= new QSqlTableModel;
    sellitems->setTable(“tempsell“);
    sellitems->setEditStrategy(QSqlTableModel::OnManualSubmit);
    sellitems->select();
    ui->tableView->setModel(this->sellitems);
    //connect_temp();
    ui->dttime=new QDateTimeEdit(QDateTime::currentDateTime());
    ui->dttime->setDisplayFormat(“yyyy.MM.dd“);
}

front::~front()
{
    delete ui;
}

void front::changeEvent(QEvent *e)
{
    QMainWindow::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void front::on_pushButton_clicked()
{
    payment *pay = new payment();
    pay->show();
    pay->set_paytext(QString::number(total));
    pay->setvalues(ui->le_Inputnumber->text().toInt()sell_numsellitems);
}


void front::on_pb_viewItems_clicked()
{

    {
        this->model = new QSqlQueryModel;
        this->model1 = new QSqlTableModel;

        model1->setTable(“goods“);
        model1->setEditStrategy(QSqlTableModel::OnManualSubmit);
        model1->select();

        goodlist *gl = new goodlist();
        gl->set_tableviewmodel(model1);
        gl->show();
    }
}

void front::on_le_Inputnumber_textChanged(QString )
{
}

void front::on_le_Inputnumber_editingFinished()
{

}

void front::on_le_Itemnum_editingFinished()
{
    QString goodid = ui->le_Inputnumber->text();
    if(goodid!=““)
    {
    model1->setFilter(Qobject::tr(“goodID LIKE ‘%%1%‘“).arg(goodid));
    model1->select();
    QModelIndex index1 = model1->index(04QModelIndex());
    this->price = index1.model()->data(index1Qt::DisplayRole).toDouble();
    }
    this->sell_num = ui->le_Itemnum->text().toInt();
    //flag2=1;
    if((ui->le_Inputnumber->text()!=““)&&(ui->le_Itemnum->text()!=““))
    {
        total += price*sell_num;
        QString re = QString::number(total);
        ui->lb_totalprice->setText(re);
        insert_tempvalue();
        sellitems->select();
        ui->tableView->setModel(sellitems);
        ui->le_Inputnumber->setText(““);
        ui->le_Itemnum->setText(““);
        flag2=0;
    }

}

void front::insert_tempvalue()
{

    int id = sellitems->rowCount()+1;
    QSqlQuery query;
    query.prepare(“insert into tempsell values(????)“);
    query.addBindValue(id);
    query.addBindValue(ui->le_Inputnumber->text().toInt());
    query.addBindValue(price);
    query.addBindValue(sell_num);
    query.exec();
}

void front::on_le_Inputnumber_returnPressed()
{
}

void front::connect_temp()
{
    QSqlQuery query;
    query.exec(“create table tempsell (id int primary key goodI

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        399  2018-05-23 21:03  supermarket\database.h

     文件       3042  2018-05-23 21:09  supermarket\front.cpp

     文件        922  2011-04-11 18:43  supermarket\front.h

     文件      10168  2018-05-25 14:12  supermarket\front.ui

     文件       2947  2011-04-11 13:07  supermarket\goodform.cpp

     文件        491  2011-04-11 11:45  supermarket\goodform.h

     文件       5306  2018-06-04 10:10  supermarket\goodform.ui

     文件        942  2018-05-23 21:09  supermarket\goodlist.cpp

     文件        513  2011-04-13 09:47  supermarket\goodlist.h

     文件       1851  2011-04-10 21:11  supermarket\goodlist.ui

     文件     276971  2011-04-11 14:06  supermarket\image\background.jpg

     文件    1346017  2011-04-11 14:55  supermarket\image\background.png

     文件     183186  2011-04-11 16:30  supermarket\image\background1.png

     文件        100  2011-04-11 16:30  supermarket\image.qrc

     文件        914  2018-05-25 15:56  supermarket\loginform.cpp

     文件        329  2011-04-13 09:58  supermarket\loginform.h

     文件       2676  2018-05-25 15:32  supermarket\loginform.ui

     文件        477  2018-05-23 20:38  supermarket\main.cpp

     文件        968  2011-04-11 16:51  supermarket\mainwindow.cpp

     文件        487  2011-04-11 16:51  supermarket\mainwindow.h

     文件       4377  2018-06-04 09:53  supermarket\mainwindow.ui

     文件      10240  2018-06-04 11:04  supermarket\Market

     文件        918  2018-05-23 20:16  supermarket\market.pro

     文件        932  2018-05-25 15:33  supermarket\market1.pro

     文件      47387  2018-06-05 09:57  supermarket\market1.pro.user

     文件       3610  2018-05-23 21:17  supermarket\payment.cpp

     文件        603  2011-04-11 23:54  supermarket\payment.h

     文件       5246  2018-06-05 09:57  supermarket\payment.ui

     文件       2749  2011-04-11 17:04  supermarket\sellform.cpp

     文件        489  2011-04-10 22:22  supermarket\sellform.h

............此处省略15个文件信息

评论

共有 条评论