Visual fixes for ff6901e
This commit is contained in:
parent
ff6901e3a9
commit
e7fafdc1e2
4 changed files with 7 additions and 5 deletions
|
|
@ -19,7 +19,7 @@
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>808</width>
|
<width>808</width>
|
||||||
<height>503</height>
|
<height>679</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ RegistrationDialog::RegistrationDialog(QWidget *parent) :
|
||||||
|
|
||||||
upvm = new UserProfessionViewModel(this);
|
upvm = new UserProfessionViewModel(this);
|
||||||
ui->userProfessions->setModel(upvm);
|
ui->userProfessions->setModel(upvm);
|
||||||
|
ui->userProfessions->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
|
|
||||||
connect(ui->userProfessions->selectionModel(),
|
connect(ui->userProfessions->selectionModel(),
|
||||||
&QItemSelectionModel::selectionChanged,
|
&QItemSelectionModel::selectionChanged,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ void ProfessionsViewModel::invalidateData() {
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
QStandardItemModel::setHeaderData(0, Qt::Orientation::Horizontal, "Professions");
|
|
||||||
QStandardItem *rootNode = invisibleRootItem();
|
QStandardItem *rootNode = invisibleRootItem();
|
||||||
foreach (auto prof, Database::instance()->professions()) {
|
foreach (auto prof, Database::instance()->professions()) {
|
||||||
QStandardItem *profNode = new QStandardItem("Profession: " + prof.title());
|
QStandardItem *profNode = new QStandardItem("Profession: " + prof.title());
|
||||||
|
|
@ -23,9 +22,11 @@ void ProfessionsViewModel::invalidateData() {
|
||||||
up = uProf;
|
up = uProf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QStandardItem *workerRank = new QStandardItem(tr("%1 rank").arg(up.getRank()));
|
QStandardItem *workerUID = new QStandardItem("UID: " + worker->uID().toString());
|
||||||
QStandardItem *acqDateNode = new QStandardItem(
|
QStandardItem *workerRank = new QStandardItem(tr("Rank: %1").arg(up.getRank()));
|
||||||
|
QStandardItem *acqDateNode = new QStandardItem("Acquisition date: " +
|
||||||
up.getAcquiredDate().toString(Qt::DateFormat::SystemLocaleShortDate));
|
up.getAcquiredDate().toString(Qt::DateFormat::SystemLocaleShortDate));
|
||||||
|
workerNode->appendRow(workerUID);
|
||||||
workerNode->appendRow(workerRank);
|
workerNode->appendRow(workerRank);
|
||||||
workerNode->appendRow(acqDateNode);
|
workerNode->appendRow(acqDateNode);
|
||||||
if (worker->getCurrentProfession() == prof.pID()) {
|
if (worker->getCurrentProfession() == prof.pID()) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ QVariant UserProfessionViewModel::headerData(int section,
|
||||||
case 0:
|
case 0:
|
||||||
return QString("Profession");
|
return QString("Profession");
|
||||||
case 1:
|
case 1:
|
||||||
return QString("Date of acquirement");
|
return QString("Acquisition date");
|
||||||
case 2:
|
case 2:
|
||||||
return QString("Rank");
|
return QString("Rank");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue