19#include <QRadioButton>
22#include "FilterPopup.hpp"
25 : QDialog(parent, f), filter_(filter) {
27 auto *grid =
new QGridLayout();
30 auto slotKindsGroupBox =
new QGroupBox(tr(
"Function calls"));
31 mpiSlotKindCheckBox =
new QCheckBox(tr(
"Show &MPI function calls"));
32 mpiSlotKindCheckBox->setChecked(filter_.
getSlotKinds() & SlotKind::MPI);
33 openMpSlotKindCheckBox =
new QCheckBox(tr(
"Show &OpenMp function calls"));
34 openMpSlotKindCheckBox->setChecked(filter_.
getSlotKinds() & SlotKind::OpenMP);
35 plainSlotKindCheckBox =
new QCheckBox(tr(
"Show &plain function calls"));
36 plainSlotKindCheckBox->setChecked(filter_.
getSlotKinds() & SlotKind::Plain);
38 auto vbox =
new QVBoxLayout();
39 vbox->addWidget(mpiSlotKindCheckBox);
40 vbox->addWidget(openMpSlotKindCheckBox);
41 vbox->addWidget(plainSlotKindCheckBox);
44 slotKindsGroupBox->setLayout(vbox);
46 grid->addWidget(slotKindsGroupBox, 0, 0);
48 auto okButton =
new QPushButton(tr(
"&Ok"));
49 okButton->setDefault(
true);
50 connect(okButton, SIGNAL(clicked()),
this, SLOT(accept()));
51 auto cancelButton =
new QPushButton(tr(
"&Cancel"));
52 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
54 grid->addWidget(cancelButton, 1, 0, Qt::AlignLeft);
55 grid->addWidget(okButton, 1, 1, Qt::AlignRight);
58 connect(
this, SIGNAL(accepted()),
this, SLOT(
updateFilter()));
61 setWindowTitle(tr(
"Set filter"));
66 auto slotKinds =
static_cast<SlotKind
>(
67 SlotKind::Plain * plainSlotKindCheckBox->isChecked() |
68 SlotKind::OpenMP * openMpSlotKindCheckBox->isChecked() |
69 SlotKind::MPI * mpiSlotKindCheckBox->isChecked());
Class containing options to filter the view.
SlotKind getSlotKinds() const
Returns the kinds of slots that should be rendered.
void setSlotKinds(SlotKind slotKinds)
Sets the slots that should be rendered.