void ApplicationTimelineEditDialog::LoadTimelineEntries() { this->ui->tableWidget->setRowCount(0); std::list<ApplicationTimelineEntry> entries; this->database->RetrieveTimeline(this->applicationID, entries); this->ui->tableWidget->setRowCount(entries.size()); int row = 0; for(std::list<ApplicationTimelineEntry>::const_iterator it = entries.begin(); it != entries.end(); it++) { this->ui->tableWidget->setItem(row, 0, new QTableWidgetItem(it->ID.c_str())); this->ui->tableWidget->setItem(row, 1, new QTableWidgetItem(it->Timestamp.c_str())); this->ui->tableWidget->setItem(row, 2, new QTableWidgetItem(this->database->GetStatusDesc(it->StatusID).c_str())); this->ui->tableWidget->setItem(row, 3, new QTableWidgetItem(it->Summary.c_str())); QPushButton* editButton = new QPushButton(this->ui->tableWidget); editButton->setObjectName(it->ID.c_str()); editButton->setText("Edit"); this->connect(editButton, SIGNAL(clicked()), SLOT(editButton_clicked())); this->ui->tableWidget->setCellWidget(row, 4, editButton); QPushButton* deleteButton = new QPushButton(this->ui->tableWidget); deleteButton->setObjectName(it->ID.c_str()); deleteButton->setText("Delete"); this->connect(deleteButton, SIGNAL(clicked()), SLOT(deleteButton_clicked())); this->ui->tableWidget->setCellWidget(row, 5, deleteButton); row++; } this->ui->tableWidget->resizeColumnsToContents(); }
AutoStartPage::AutoStartPage(QWidget* parent) : QWidget(parent), ui(new Ui::AutoStartPage) { ui->setupUi(this); connect(ui->addButton, SIGNAL(clicked()), SLOT(addButton_clicked())); connect(ui->editButton, SIGNAL(clicked()), SLOT(editButton_clicked())); connect(ui->deleteButton, SIGNAL(clicked()), SLOT(deleteButton_clicked())); restoreSettings(); }
void CompanyForm::LoadCompanySummaries() { this->companies.clear(); this->database->RetrieveCompanySummaries(this->companies); this->ui->companyTableWidget->setRowCount(0); this->ui->companyTableWidget->setRowCount(this->companies.size()); int row = 0; for(std::list<CompanySummary>::const_iterator it =this->companies.begin(); it != this->companies.end(); it++) { this->ui->companyTableWidget->setItem(row, 0, new QTableWidgetItem(it->ID.c_str())); this->ui->companyTableWidget->setItem(row, 1, new QTableWidgetItem(it->Name.c_str())); this->ui->companyTableWidget->setItem(row, 2, new QTableWidgetItem(it->Type.c_str())); this->ui->companyTableWidget->setItem(row, 3, new QTableWidgetItem(it->City.c_str())); QPushButton* editButton = new QPushButton(this->ui->companyTableWidget); editButton->setObjectName(it->ID.c_str()); editButton->setText("Edit"); this->connect(editButton, SIGNAL(clicked()), SLOT(editButton_clicked())); this->ui->companyTableWidget->setCellWidget(row, 4, editButton); QPushButton* removeButton = new QPushButton(this->ui->companyTableWidget); removeButton->setObjectName(it->ID.c_str()); removeButton->setText("Remove"); this->connect(removeButton, SIGNAL(clicked()), SLOT(removeButton_clicked())); this->ui->companyTableWidget->setCellWidget(row, 5, removeButton); row++; } this->ui->companyNameLabel->setText(""); this->ui->companyTypeLabel->setText(""); this->ui->companyAddressLabel->setText(""); this->ui->companyCityLabel->setText(""); this->ui->notesTextEdit->setPlainText(""); this->ui->viewContactButton->setEnabled(false); this->ui->addContactButton->setEnabled(false); }