shitty table WIP

This commit is contained in:
2025-05-22 01:32:39 +03:00
parent ca52ddf33c
commit c21166fc5b
12 changed files with 220 additions and 72 deletions

View File

@@ -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()));