Question: I have made a MODEL BASED table which i called profilesTable. Here is my problem, which i cant seem to solve :( 1. I want
I have made a MODEL BASED table which i called profilesTable. Here is my problem, which i cant seem to solve :( 1. I want to be able to insert Data to table 2. I want to be able to select an item from table 3. i want to make the table non editable (so that it can only be edited through code) #include "startpage.h"
#include "ui_startpage.h"
#include "mainwindow.h"
#include
StartPage::StartPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::StartPage)
{ int rows = 5;
int columns = 3;
ui->setupUi(this);
model = new QStandardItemModel (rows ,columns, this); // 5 rows and 3 columns
//Column titles
QStringList names;
names << "Profile Name" << "Temperature" << "Time";
model->setHorizontalHeaderLabels(names);
ui->profilesTable->setModel(model);
//size of virtical and horizontal header
ui->profilesTable->horizontalHeader()->setFixedHeight(30);
ui->profilesTable->verticalHeader()->setFixedWidth(35);
//Adjust the dimensions of table
for(int i = 0; i < rows; i++){ ui->profilesTable->setRowHeight(i,40);
}
for(int i = 0; i < columns; i++){ ui->profilesTable->setColumnWidth(i,110);
}
//Insert Data
for(int i = 0; i < rows; i++)
{ for(int x = 0; x < columns; x++)
{ }
}
}
StartPage::~StartPage()
{ delete ui;
}
void StartPage::setTableData()
{ ProfileOverview profil(this);
}
void StartPage::on_startButton_clicked()
{ emit changePage(Pages::ROAST_PAGE);
}
void StartPage::on_profilesButton_clicked()
{ }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
