QSqlTableModel* CashAccountTableModel::createModel(int year) { QSqlTableModel* model = new QSqlTableModel(); model->setTable("CashAccount"); selectYear(model, year); return model; }
Donations::Donations(QWidget *parent) : QWidget(parent) { setupUi(this); connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(searchData())); connect(dateUntil, SIGNAL(dateChanged(QDate)), this, SLOT(searchData())); connect(btnExport, SIGNAL(clicked()), this, SLOT(exportData())); connect(btnEmail, SIGNAL(clicked()), this, SLOT(sendEmail())); connect(sectionList, SIGNAL(currentIndexChanged(int)), this, SLOT(selectSection())); connect(yearList, SIGNAL(itemSelectionChanged()), this, SLOT(selectYear())); tableModel = new QSqlQueryModel(tableView); donationsModel = new QSqlQueryModel(donationsTable); fileImport = false; loadData(); loadSectionDonations(); }
void CashImportHandler::refresh() { selectYear(m_year); qDebug() << QString("Refresh: Selected row count: %1").arg(m_cashProxyModel->rowCount()); }