00001 #include "accountdialog.h" 00002 #include "../Styles/accountstyle.h" 00003 #include "../Models/accountingmodel.h" 00004 00005 AccountDialog::AccountDialog(QWidget *parent) : QDialog(parent) 00006 { 00007 setupUi(this); 00008 00009 //setStyle(new AccountStyle()); 00010 00011 // will be interesting to see if this causes any problems 00012 setAttribute(Qt::WA_DeleteOnClose, true); 00013 } 00014 00015 void AccountDialog::recalculateSums() 00016 { 00017 AccountingModel *model = (AccountingModel*)accountTableView->model(); 00018 00019 textCredit->setText(QString::number(model->creditSum(), 'f', 2)); 00020 textDebit->setText(QString::number(model->debitSum(), 'f', 2)); 00021 } 00022 00023 void AccountDialog::closeEvent(QCloseEvent *event) 00024 { 00025 event->ignore(); 00026 }