Ejemplo n.º 1
0
// public static
bool kpTool::containsSingleKeyTrigger (const KKeySequence &seq)
{
    for (int i = 0; i < (int) seq.count (); i++)
    {
        const KKey key = seq.key (i);
        if (keyIsText (key.keyCodeQt ()))
            return true;
    }

    return false;
}
Ejemplo n.º 2
0
bool DOMTreeView::eventFilter(QObject *o, QEvent *e)
{
  if (e->type() == QEvent::AccelOverride) {
    QKeyEvent *ke = static_cast<QKeyEvent *>(e);
    kdDebug(90180) << " acceloverride " << ke->key() << " o " << o->name() << endl;

    if (o == m_listView) {	// DOM tree
      KKey ks = mainWindow()->deleteNodeAction()->shortcut().seq(0).key(0);
      if (ke->key() == ks.keyCodeQt())
        return true;

    } else if (o == nodeAttributes) {
      KKey ks = mainWindow()->deleteAttributeAction()->shortcut().seq(0).key(0);
      if (ke->key() == ks.keyCodeQt())
        return true;

    }

  } else if (e->type() == QEvent::FocusIn) {

    kdDebug(90180) << " focusin o " << o->name() << endl;
    if (o != this) {
      focused_child = o;
    }

  } else if (e->type() == QEvent::FocusOut) {

    kdDebug(90180) << " focusout o " << o->name() << endl;
    if (o != this) {
      focused_child = 0;
    }

  }

  return false;
}