void KNStatusFilterWidget::clear() { enR->setChecked(false); enN->setChecked(false); enUS->setChecked(false); enNS->setChecked(false); rCom->setValue(true); nCom->setValue(true); nsCom->setValue(true); usCom->setValue(true); for(int i = 0; i < 4; i++) slotEnabled(i); }
void KNStatusFilterWidget::setFilter(KNStatusFilter &f) { enR->setChecked(f.data.at(EN_R)); rCom->setValue(f.data.at(DAT_R)); enN->setChecked(f.data.at(EN_N)); nCom->setValue(f.data.at(DAT_N)); enUS->setChecked(f.data.at(EN_US)); usCom->setValue(f.data.at(DAT_US)); enNS->setChecked(f.data.at(EN_NS)); nsCom->setValue(f.data.at(DAT_NS)); for(int i = 0; i < 4; i++) slotEnabled(i); }
KNRangeFilterWidget::KNRangeFilterWidget(const QString& value, int min, int max, QWidget* parent, const QString &unit) : QGroupBox(value, parent) { enabled=new QCheckBox(this); val1=new KIntSpinBox(min, max, 1, min, 10, this); val1->setSuffix(unit); val2=new KIntSpinBox(min, max, 1, min, 10, this); val2->setSuffix(unit); op1=new QComboBox(this); op1->insertItem("<"); op1->insertItem("<="); op1->insertItem("="); op1->insertItem(">="); op1->insertItem(">"); op2=new QComboBox(this); op2->insertItem(""); op2->insertItem("<"); op2->insertItem("<="); des=new QLabel(value, this); des->setAlignment(AlignCenter); QGridLayout *topL=new QGridLayout(this, 2,6, 8,5 ); topL->addRowSpacing(0, fontMetrics().lineSpacing()-4); topL->addWidget(enabled,1,0, Qt::AlignHCenter); topL->addColSpacing(0, 30); topL->addWidget(val1,1,1); topL->addWidget(op1,1,2); topL->addWidget(des,1,3); topL->addColSpacing(3, 45); topL->addWidget(op2,1,4); topL->addWidget(val2,1,5); topL->setColStretch(1,1); topL->setColStretch(5,1); connect(op1, SIGNAL(activated(int)), SLOT(slotOp1Changed(int))); connect(op2, SIGNAL(activated(int)), SLOT(slotOp2Changed(int))); connect(enabled, SIGNAL(toggled(bool)), SLOT(slotEnabled(bool))); slotEnabled(false); }