Skip to content

Commit

Permalink
Merge pull request #22 from ChrisHal/experimental
Browse files Browse the repository at this point in the history
New Feature: user can set time reference for rel. times
  • Loading branch information
ChrisHal authored Jun 27, 2022
2 parents a493304 + 91a9156 commit b940f55
Show file tree
Hide file tree
Showing 10 changed files with 352 additions and 76 deletions.
2 changes: 0 additions & 2 deletions QtPMbrowser/DlgSelectParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/

#include "DlgSelectParameters.h"
//#include "ui_DlgSelectParameters.h"
//#include "PMparameters.h"

DlgSelectParameters::DlgSelectParameters(QWidget *parent)
: QDialog(parent)
Expand Down
16 changes: 11 additions & 5 deletions QtPMbrowser/DlgSelectParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,30 @@ class DlgSelectParameters : public QDialog
void storeParams();

private:
static constexpr int chkbox_width = 40;
template<std::size_t Nrows> void populateGrid(QGridLayout* grid,
const std::array<PMparameter, Nrows>& ar)
{
for (int i = 0; i < int(ar.size()); ++i) {
auto chk1 = new QCheckBox("export");
auto chk1 = new QCheckBox();// ("export");
chk1->setChecked(ar[i].exportIBW);
auto chk2 = new QCheckBox("print");
chk1->setMinimumWidth(chkbox_width);
chk1->setMaximumWidth(chkbox_width);
auto chk2 = new QCheckBox();// ("print");
chk2->setChecked(ar[i].print);
chk2->setMinimumWidth(chkbox_width);
chk2->setMaximumWidth(chkbox_width);
auto lb = new QLabel(ar[i].name);
grid->addWidget(chk1, i, 0, Qt::AlignLeft | Qt::AlignVCenter);
grid->addWidget(chk2, i, 1, Qt::AlignLeft | Qt::AlignVCenter);
grid->addWidget(lb, i, 2, Qt::AlignLeft | Qt::AlignVCenter);
grid->addWidget(chk1, i, 0);// , Qt::AlignLeft | Qt::AlignVCenter);
grid->addWidget(chk2, i, 1);// , Qt::AlignLeft | Qt::AlignVCenter);
grid->addWidget(lb, i, 2);// , Qt::AlignLeft | Qt::AlignVCenter);
}
grid->addItem(new QSpacerItem(0, 0), static_cast<int>(ar.size()), 0, 1, 3);
grid->setRowStretch(static_cast<int>(ar.size()), 1);
grid->setColumnStretch(0, 0);
grid->setColumnStretch(1, 0);
grid->setColumnStretch(2, 1);
grid->setHorizontalSpacing(1);
}

template<std::size_t Nrows> void readFromGrid(QGridLayout* grid,
Expand Down
Loading

0 comments on commit b940f55

Please sign in to comment.