Esempio n. 1
0
void KstObject::setTag(const KstObjectTag& tag) {
  if (tag == _tag) {
    return;
  }

  _tag = tag;
  setObjectName(_tag.tagString());

  emit tagChanged();
}
Esempio n. 2
0
void FilterBar::reset()
{
	m_lineEdit->setText(""); // m_data->isFiltering will be set to false;
	m_lineEdit->clearFocus();
	changeFilter();
	if (m_tagsBox->currentItem() != 0) {
		m_tagsBox->setCurrentItem(0);
		tagChanged(0);
	}
	hide();
	emit newFilter(*m_data);
}
Esempio n. 3
0
void SamView::addTestConfiguration(TestConfigurationWidget* config)
{
  connect(config, SIGNAL(destroyed()), this, SLOT(testConfigurationRemoved()));
  connect(config, SIGNAL(tagChanged()), this, SLOT(testConfigTagChanged()));
  connect(config, SIGNAL(changed()), this, SLOT(setDirty()));
  testConfigurations << config;
  ui.vlTestConfigurations->addWidget(config);

  TestResultWidget *result = new TestResultWidget(config, this);
  connect(result, SIGNAL(testComplete()), this, SLOT(subTestComplete()));
  connect(result, SIGNAL(testAborted()), this, SLOT(subTestAborted()));
  connect(result, SIGNAL(testStarted()), this, SLOT(subTestStarted()));
  connect(result, SIGNAL(destroyed()), this, SLOT(testResultRemoved()));
  testResults << result;
  ui.twTestResults->addTab(result, config->tag());
  setDirty();
}
Esempio n. 4
0
void FilterBar::filterState(State *state)
{
	int index = 0;

	for (QMap<int, State*>::Iterator it = m_statesMap.begin(); it != m_statesMap.end(); ++it)
		if (it.data() == state) {
			index = it.key();
			break;
		}
	if (index <= 0)
		return;

	if (m_tagsBox->currentItem() != index) {
		m_tagsBox->setCurrentIndex(index);
		tagChanged(index);
	}
}
Esempio n. 5
0
void FilterBar::setFilterData(const FilterData &data)
{
	m_lineEdit->setText(data.string);

	int index = 0;
	switch (data.tagFilterType) {
		default:
		case FilterData::DontCareTagsFilter: index = 0; break;
		case FilterData::NotTaggedFilter:    index = 1; break;
		case FilterData::TaggedFilter:       index = 2; break;
		case FilterData::TagFilter:          filterTag(data.tag);     return;
		case FilterData::StateFilter:        filterState(data.state); return;
	}

	if (m_tagsBox->currentItem() != index) {
		m_tagsBox->setCurrentIndex(index);
		tagChanged(index);
	}
}
void KstViewLabel::setupConnections() {
  for (KstScalarMap::iterator i = _scalarsUsed.begin(); i != _scalarsUsed.end(); ++i) {
    disconnect(i.data(), SIGNAL(tagChanged()), this, SLOT(reparse()));
    connect(i.data(), SIGNAL(tagChanged()), this, SLOT(reparse()));
  } 
  for (KstStringMap::iterator i = _stringsUsed.begin(); i != _stringsUsed.end(); ++i) {
    disconnect(i.data(), SIGNAL(tagChanged()), this, SLOT(reparse()));
    connect(i.data(), SIGNAL(tagChanged()), this, SLOT(reparse()));
  } 
  for (KstVectorMap::iterator i = _vectorsUsed.begin(); i != _vectorsUsed.end(); ++i) {
    disconnect(i.data(), SIGNAL(tagChanged()), this, SLOT(reparse()));
    connect(i.data(), SIGNAL(tagChanged()), this, SLOT(reparse()));
  } 
}
Esempio n. 7
0
TagFilterWidget::TagFilterWidget(TagFilter* filter, QWidget* parent) :
	QWidget(parent),
	filter_(filter),
	rows_(1)
{
	int fontHeight = qMin(fontMetrics().height(), 24);
	baseSize_ = fontHeight + 8;
	setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	resize(100, baseSize_);

	resetButton_ = new QToolButton(this);
	resetButton_->setToolTip("Reset");
	resetButton_->setIcon(QIcon(":/close-8.png"));
	resetButton_->setAutoRaise(true);

	connect(resetButton_,
			SIGNAL(clicked(bool)),
			filter_,
			SLOT(reset()));

	connect(filter_,
			SIGNAL(tagAdded(QString,TagFilter::Action)),
			SLOT(onTagAdded(QString,TagFilter::Action)));

	connect(filter_,
			SIGNAL(tagChanged(QString,TagFilter::Action)),
			SLOT(onTagChanged(QString,TagFilter::Action)));

	connect(filter_,
			SIGNAL(tagRemoved(QString)),
			SLOT(onTagRemoved(QString)));

	connect(filter_,
			SIGNAL(filterEmpty()),
			SLOT(onFilterEmpty()));

	updateLayout();
}
RecordsFilterModel::RecordsFilterModel(TagFilter* filter, QObject* parent) :
	ListFilterModel(parent),
	filter_(filter)
{
	connect(filter_,
			SIGNAL(modeChanged(TagFilter::Mode)),
			SLOT(updateFilter()));

	connect(filter_,
			SIGNAL(tagAdded(QString,TagFilter::Action)),
			SLOT(updateFilter()));

	connect(filter_,
			SIGNAL(tagChanged(QString,TagFilter::Action)),
			SLOT(updateFilter()));

	connect(filter_,
			SIGNAL(tagRemoved(QString)),
			SLOT(updateFilter()));

	connect(filter_,
			SIGNAL(filterEmpty()),
			SLOT(updateFilter()));
}