bool LocationManagementEditHelper::eventFilter(QObject *obj, QEvent *ev)
{
	QListView *view = qobject_cast<QListView*>(obj);
	if(!view)
		return false;

	if(ev->type() == QEvent::Show) {
		last_uuid = 0;
		qDebug() << "EventFilter: " << last_uuid;
	}

	if(ev->type() == QEvent::KeyPress) {
		QKeyEvent *keyEv = (QKeyEvent*) ev;
		if(keyEv->key() == Qt::Key_Return) {
			handleActivation(view->currentIndex());
			view->hide();
			return true;
		}
	}
	return false;
}
Esempio n. 2
0
LogBrowser::LogBrowser(QWidget *parent)
  : QWidget(parent)
  , m_nextID(0)
  , m_actorFilterActive(false)
  , m_actorFilterCheck(0)
{
    m_log = new LogModel(this);
    m_log->setResultType(Log::MostRecentSubjects);

    QSortFilterProxyModel *filter = new QSortFilterProxyModel(this);
    filter->setSourceModel(m_log);
    filter->setSortCaseSensitivity(Qt::CaseInsensitive);
    filter->setDynamicSortFilter(true);
    filter->setFilterKeyColumn(0);

    QLineEdit *searchBox = new QLineEdit(this);
    searchBox->setPlaceholderText(tr("Search"));
    connect(searchBox, SIGNAL(textEdited(QString)), filter, SLOT(setFilterFixedString(QString)));


    QListView *view = new QListView(this);
    view->setResizeMode(QListView::Adjust);
    connect(view, SIGNAL(activated(QModelIndex)), this, SLOT(handleActivation(QModelIndex)));

    m_logView = view;
    m_logView->setModel(filter);


    QVBoxLayout *layout = new QVBoxLayout(this);
    m_filterLayout = new QHBoxLayout(this);
    layout->addWidget(searchBox);
    layout->addLayout(m_filterLayout);
    layout->addWidget(m_logView);

    m_actionMapper = new QSignalMapper(this);
    connect(m_actionMapper, SIGNAL(mapped(int)), this, SLOT(applyFilter(int)));

    DataModel::Event emptyEvent;
    addEventFilter(DataModel::EventList() << emptyEvent, "All")->setChecked(true);
}
Esempio n. 3
0
/**
 * Reactivation handler.
 */
TableStreamerContext::ActivationReturnCode
ElasticContext::handleReactivation(TableStreamType streamType)
{
    return handleActivation(streamType);
}
void STATE5::tick() { 
        StateMachine::tick();
    	handleActivation();
    	handleExits();
}