Reformating, adding accounts ui dummy
This commit is contained in:
parent
de36fe2a4e
commit
6823b41f24
16 changed files with 551 additions and 31 deletions
|
@ -1,10 +1,43 @@
|
|||
#include "accounts.h"
|
||||
#include "ui_accounts.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
Accounts::Accounts(QWidget *parent) :
|
||||
m_ui(new Ui::Accounts)
|
||||
m_ui(new Ui::Accounts),
|
||||
tableModel()
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->addButton, SIGNAL(clicked(bool)), this, SLOT(onAddButton(bool)));
|
||||
m_ui->tableView->setModel(&tableModel);
|
||||
}
|
||||
|
||||
Accounts::~Accounts() = default;
|
||||
|
||||
void Accounts::onAddButton(bool clicked)
|
||||
{
|
||||
Account* acc = new Account();
|
||||
connect(acc, SIGNAL(accepted()), this, SLOT(onAccountAccepted()));
|
||||
connect(acc, SIGNAL(rejected()), this, SLOT(onAccountRejected()));
|
||||
acc->exec();
|
||||
}
|
||||
|
||||
void Accounts::onAccountAccepted()
|
||||
{
|
||||
Account* acc = static_cast<Account*>(sender());
|
||||
QMap<QString, QVariant> map = acc->value();
|
||||
|
||||
emit newAccount(map);
|
||||
}
|
||||
|
||||
void Accounts::onAccountRejected()
|
||||
{
|
||||
Account* acc = static_cast<Account*>(sender());
|
||||
acc->deleteLater();
|
||||
}
|
||||
|
||||
void Accounts::addAccount(const QMap<QString, QVariant>& map)
|
||||
{
|
||||
tableModel.addAccount(map);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue