shitty table WIP
This commit is contained in:
@@ -39,6 +39,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
model = new CheckQueueTableModel(&checks, this);
|
||||
ui->checkQueueTable->setModel(model);
|
||||
ui->checkQueueTable->viewport()->setAcceptDrops(true);
|
||||
ui->checkQueueTable->setDragDropMode(QAbstractItemView::DragDrop);
|
||||
|
||||
// ui->
|
||||
// connect(this, &MainWindow::deleteCheckFromList, this, &MainWindow::deleteCheckFromListHandler);
|
||||
@@ -236,15 +238,17 @@ void MainWindow::on_parse_button_clicked() {
|
||||
// }
|
||||
|
||||
void MainWindow::on_add_new_check_button_clicked() {
|
||||
Check *new_check = parse_new_check();
|
||||
Check *new_check = new Check();/* parse_new_check();
|
||||
if (new_check == nullptr) {
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
new_check->set_date("123");
|
||||
new_check->set_total(rand() * 1800);
|
||||
|
||||
checks.push_back(*new_check);
|
||||
// checks.push_back(*new_check);
|
||||
|
||||
unsigned int newRowIndex = checks.size();
|
||||
model->insertRow(newRowIndex, 1);
|
||||
model->insertRows(newRowIndex, 1);
|
||||
model->setData(model->index(newRowIndex, 0), QVariant::fromValue(new_check->get_date()));
|
||||
model->setData(model->index(newRowIndex, 1), QVariant::fromValue(new_check->get_total()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user