An item can be added to the model with accepting the NewItemDialog.
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
#include "Dialogs/newitemdialog.h"
|
||||
#include "data/settingshandler.h"
|
||||
#include "genericcore.h"
|
||||
#include "model/tablemodel.h"
|
||||
|
||||
static QString updateTextClean = "Do you want to update the application now?";
|
||||
static QString updateTextDirty = "Do you want to save the tasks & update the application now?";
|
||||
@ -35,6 +36,9 @@ MainWindow::MainWindow(QWidget* parent)
|
||||
restoreGeometry(settings.value("geometry").toByteArray());
|
||||
restoreState(settings.value("windowState").toByteArray());
|
||||
|
||||
m_tableModel = m_core->getModel();
|
||||
ui->tableView->setModel(m_tableModel.get());
|
||||
|
||||
createActions();
|
||||
createHelpMenu();
|
||||
createGuiDialogs();
|
||||
@ -44,9 +48,6 @@ MainWindow::MainWindow(QWidget* parent)
|
||||
connect(this, &MainWindow::displayStatusMessage, this, &MainWindow::showStatusMessage);
|
||||
connect(this, &MainWindow::checkForUpdates, this,
|
||||
&MainWindow::on_actionCheck_for_update_triggered, Qt::QueuedConnection);
|
||||
|
||||
m_tableModel = m_core->getModel();
|
||||
ui->tableView->setModel(m_tableModel.get());
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() { delete ui; }
|
||||
@ -129,8 +130,6 @@ void MainWindow::on_pushButton_clicked() {
|
||||
|
||||
void MainWindow::openNewItemDialog() {
|
||||
showStatusMessage(tr("Invoked 'Edit|New Item'"));
|
||||
qInfo() << "'open new item dialog' action triggered...";
|
||||
|
||||
m_newItemDialog->show();
|
||||
}
|
||||
|
||||
@ -268,4 +267,6 @@ void MainWindow::createHelpMenu() {
|
||||
void MainWindow::createGuiDialogs() {
|
||||
m_newItemDialog = make_unique<NewItemDialog>(this);
|
||||
m_newItemDialog->createContent();
|
||||
connect(m_newItemDialog.get(), &NewItemDialog::addItems, m_tableModel.get(),
|
||||
&TableModel::appendItems);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user