Beispiel #1
0
void KWCanvasItem::keyPressEvent(QKeyEvent *e)
{
    m_toolProxy->keyPressEvent(e);
    if (! e->isAccepted()) {
        if (e->key() == Qt::Key_Backtab
                || (e->key() == Qt::Key_Tab && (e->modifiers() & Qt::ShiftModifier)))
            focusNextPrevChild(false);
        else if (e->key() == Qt::Key_Tab)
            focusNextPrevChild(true);
    }
}
Beispiel #2
0
void KoPACanvas::keyPressEvent( QKeyEvent *event )
{
    koPAView()->viewMode()->keyPressEvent( event );
    if (! event->isAccepted()) {
        if (event->key() == Qt::Key_Backtab
                || (event->key() == Qt::Key_Tab && (event->modifiers() & Qt::ShiftModifier)))
            focusNextPrevChild(false);
        else if (event->key() == Qt::Key_Tab)
            focusNextPrevChild(true);
    }
}
Beispiel #3
0
void QButton::keyPressEvent( QKeyEvent *e )
{
    switch ( e->key() ) {
    case Key_Enter:
    case Key_Return:
	if ( inherits("QPushButton") )
	    emit clicked();
	else
	    e->ignore();
	break;
    case Key_Space:
	if ( !e->isAutoRepeat() ) {
	    if ( got_a_release )
		setDown( TRUE );
	    else {
		buttonDown = TRUE;
		repaint( FALSE );
	    }
	    if ( inherits("QPushButton") )
		emit pressed();
	    else
		e->ignore();
	}
	break;
    case Key_Up:
    case Key_Left:
#ifndef QT_NO_BUTTONGROUP
	if ( group() )
	    group()->moveFocus( e->key() );
	else
#endif
	    focusNextPrevChild( FALSE );
	break;
    case Key_Right:
    case Key_Down:
#ifndef QT_NO_BUTTONGROUP
	if ( group() )
	    group()->moveFocus( e->key() );
	else
#endif
	    focusNextPrevChild( TRUE );
	break;
    case Key_Escape:
	if ( buttonDown ) {
	    buttonDown = FALSE;
	    update();
	    break;
	}
	// fall through
    default:
	e->ignore();
    }
}
Beispiel #4
0
void QWrapListView::keyPressEvent(QKeyEvent *ke)
{
    if (ke->key() == Qt::Key_Up && currentIndex().row() == 0) {
        focusNextPrevChild(false);
        ke->accept();
    } else if (ke->key() == Qt::Key_Down && currentIndex().row() == model()->rowCount() - 1) {
        focusNextPrevChild(true);
        ke->accept();
    } else if (ke->key() == Qt::Key_Back) {
        setEditFocus(false);
        QListView::keyPressEvent(ke);
    } else
        QListView::keyPressEvent(ke);

}
Beispiel #5
0
void ItemLineEdit::sAlias()
{
  ParameterList params;

  if (queryUsed())
    params.append("sql", _sql);
  else
    params.append("itemType", _type);

  if (!_extraClauses.isEmpty())
    params.append("extraClauses", _extraClauses);

  itemAliasList newdlg(parentWidget(), "", TRUE);
  newdlg.set(params);

  int itemaliasid;
  if ((itemaliasid = newdlg.exec()) != QDialog::Rejected)
  {
    XSqlQuery itemalias;
    itemalias.prepare( "SELECT itemalias_number, itemalias_item_id "
                       "FROM itemalias "
                       "WHERE (itemalias_id=:itemalias_id);" );
    itemalias.bindValue(":itemalias_id", itemaliasid);
    itemalias.exec();
    if (itemalias.first())
    {
      setId(itemalias.value("itemalias_item_id").toInt());
      emit aliasChanged(itemalias.value("itemalias_number").toString());
      focusNextPrevChild(TRUE);
    }
  }
}
Beispiel #6
0
void ItemLineEdit::sSearch()
{
    ParameterList params;
    params.append("item_id", _id);

    if (queryUsed())
        params.append("sql", _sql);
    else
        params.append("itemType", _type);

    if (!_extraClauses.isEmpty())
        params.append("extraClauses", _extraClauses);

    itemSearch newdlg(parentWidget(), "", TRUE);
    newdlg.set(params);

    int id;
    if ((id = newdlg.exec()) != QDialog::Rejected)
    {
        setId(id);

        if (id != -1 && hasFocus())
            focusNextPrevChild(TRUE);
    }
}
Beispiel #7
0
void WoCluster::sWoList()
{
  ParameterList params;
  params.append("wo_id", _woNumber->_id);

  if (_woNumber->_useQuery)
  {
    params.append("sql", _woNumber->_sql);
  }
  else 
    params.append("woType", _woNumber->_woType);

  if (_woNumber->_warehouseid != -1)
    params.append("warehous_id", _woNumber->_warehouseid);

  woList newdlg(parentWidget(), "", TRUE);
  newdlg.set(params);
  
  int id = newdlg.exec();
  setId(id);

  if (id != -1)
  {
    _woNumber->setFocus();
    focusNextPrevChild(TRUE);
  }
}
bool  QAbstractPageSetupDialog_QtDShell::__override_focusNextPrevChild(bool  next0, bool static_call)
{
    if (static_call) {
        return QWidget::focusNextPrevChild((bool )next0);
    } else {
        return focusNextPrevChild((bool )next0);
    }
}
void VBoxLogSearchPanel::hideEvent (QHideEvent *aEvent)
{
    QWidget *focus = QApplication::focusWidget();
    if (focus &&
        focus->parent() == this)
       focusNextPrevChild (true);
    QWidget::hideEvent (aEvent);
}
Beispiel #10
0
bool  QDateEdit_QtDShell::__override_focusNextPrevChild(bool  next0, bool static_call)
{
    if (static_call) {
        return QDateTimeEdit::focusNextPrevChild((bool )next0);
    } else {
        return focusNextPrevChild((bool )next0);
    }
}
Beispiel #11
0
bool  QStatusBar_QtDShell::__override_focusNextPrevChild(bool  next0, bool static_call)
{
    if (static_call) {
        return QWidget::focusNextPrevChild((bool )next0);
    } else {
        return focusNextPrevChild((bool )next0);
    }
}
Beispiel #12
0
void CLineEdit::sSearch()
{
  CRMAcctSearch * newdlg = new CRMAcctSearch(this);
  newdlg->setId(_id);

  int id = newdlg->exec();
  if (id != QDialog::Rejected)
  {
    setId(id);

    if (_autoFocus && id != -1)
      focusNextPrevChild(TRUE);
  }
}
Beispiel #13
0
void CLineEdit::sList()
{
  CRMAcctList * newdlg = new CRMAcctList(this);
  newdlg->setId(_id);

  int id = newdlg->exec();
  setId(id);

  if (_autoFocus && id != -1)
  {
    this->setFocus();
    focusNextPrevChild(TRUE);
  }
}
Beispiel #14
0
bool VisualizationsEditor::handleKeyPress(QKeyEvent *e)
{
    bool handled = false;
    QStringList actions;
    handled = GetMythMainWindow()->TranslateKeyPress("qt", e, actions);

    for (int i = 0; i < actions.size() && !handled; i++)
    {
        QString action = actions[i];

        if (action == "LEFT")
        {
            handled = true;
            focusNextPrevChild(false);
        }
        else if (action == "RIGHT")
        {
            handled = true;
            focusNextPrevChild(true);
        }
    }

    return handled;
}
Beispiel #15
0
void VendorLineEdit::sList()
{
  CRMAcctList * newdlg = new CRMAcctList(this);
  newdlg->setId(_id);
  newdlg->setShowInactive(_type != __activeVendors);

  int newId = newdlg->exec();
  setId(newId);

  if (newId != -1)
  {
    setFocus();
    focusNextPrevChild(TRUE);
  }
}
Beispiel #16
0
void VendorLineEdit::sSearch()
{
  CRMAcctSearch * newdlg = new CRMAcctSearch(this);
  newdlg->setId(_id);
  newdlg->setShowInactive(_type != __activeVendors);

  int id = newdlg->exec();

  if (id != QDialog::Rejected)
  {
    setId(id);

    if (id != -1)
      focusNextPrevChild(TRUE);
  }
}
Beispiel #17
0
void PlanOrdCluster::sList()
{
  ParameterList params;
  params.append("planord_id", _number->_id);

  plannedOrderList newdlg(parentWidget(), "", TRUE);
  newdlg.set(params);

  int id = newdlg.exec();
  setId(id);

  if (id != -1)
  {
    _number->setFocus();
    focusNextPrevChild(TRUE);
  }
}
Beispiel #18
0
void ProjectCluster::sProjectList()
{
  ParameterList params;
  params.append("id", _prjNumber->_id);
  params.append("type", _prjNumber->_prjType);

  projectList newdlg(parentWidget(), "", TRUE);
  newdlg.set(params);
  
  int id = newdlg.exec();
  setId(id);

  if (id != -1)
  {
    _prjNumber->setFocus();
    focusNextPrevChild(TRUE);
  }
}
Beispiel #19
0
void ShiptoCluster::sList()
{
  ParameterList params;
  params.append("cust_id", _shiptoNumber->_custid);
  params.append("shipto_id", _shiptoNumber->_id);

  shipToList newdlg(parentWidget(), "", TRUE);
  newdlg.set(params);

  int id = newdlg.exec();
  _shiptoNumber->setId(id);

  if (id != -1)
  {
    _shiptoNumber->setFocus();
    focusNextPrevChild(TRUE);
  }
}
Beispiel #20
0
bool KisOpenGLCanvas2::callFocusNextPrevChild(bool next)
{
    return focusNextPrevChild(next);
}
Beispiel #21
0
bool DhQGLWidget::DvhfocusNextPrevChild(bool x1) {
  return focusNextPrevChild(x1);
}
Beispiel #22
0
bool DhQScrollArea::DvhfocusNextPrevChild(bool x1) {
  return focusNextPrevChild(x1);
}
Beispiel #23
0
void WoLineEdit::sParse()
{
  if (!_parsed)
  {
    if (text().stripWhiteSpace().length() == 0)
      setId(-1);

    else if (_useQuery)
    {
      XSqlQuery wo;
      wo.prepare(_sql);
      wo.exec();
      if (wo.findFirst("wonumber", text().stripWhiteSpace().upper()) != -1)
      {
        setId(wo.value("wo_id").toInt());
        return;
      }
    }

    else if (text().contains('-'))
    {
      int soNumber = text().left(text().find('-')).toInt();
      int subNumber = text().right(text().length() - text().find('-') - 1).toInt();
 //     bool statusCheck = FALSE;
      QString sql = QString( "SELECT wo_id "
                             "FROM wo "
                             "WHERE ((wo_number=%1)"
                             " AND (wo_subnumber=%2)" )
                    .arg(soNumber)
                    .arg(subNumber);

  //  Add in the Status checks
      QStringList statuses;
      if (_woType & cWoOpen)
        statuses << "(wo_status='O')";

      if (_woType & cWoExploded)
        statuses << "(wo_status='E')";

      if (_woType & cWoReleased)
        statuses << "(wo_status='R')";

      if (_woType & cWoIssued)
        statuses << "(wo_status='I')";

      if (_woType & cWoClosed)
        statuses << "(wo_status='C')";

      if(!statuses.isEmpty())
        sql += " AND (" + statuses.join(" OR ") + ")";

      sql += ")";

      XSqlQuery wo(sql);

      if (wo.first())
        setId(wo.value("wo_id").toInt());
      else
        setId(-1);
    }

    else
    {
      bool statusCheck = FALSE;
      QString sql = QString( "SELECT wo_id, wo_number "
                             "FROM wo "
                             "WHERE ((wo_number=%1)")
                    .arg(text().toInt());

//  Add in the Status checks
      if (_woType)
      {
	sql += " AND (";

	if (_woType & cWoOpen)
	{
	  sql += "(wo_status='O')";
	  statusCheck = TRUE;
	}

	if (_woType & cWoExploded)
	{
	  if (statusCheck)
	    sql += " OR ";
	  sql += "(wo_status='E')";
	  statusCheck = TRUE;
	}

	if (_woType & cWoReleased)
	{
	  if (statusCheck)
	    sql += " OR ";
	  sql += "(wo_status='R')";
	  statusCheck = TRUE;
	}

	if (_woType & cWoIssued)
	{
	  if (statusCheck)
	    sql += " OR ";
	  sql += "(wo_status='I')";
	  statusCheck = TRUE;
	}

	if (_woType & cWoClosed)
	{
	  if (statusCheck)
	    sql += " OR ";
	  sql += "(wo_status='C')";
	}

	sql += ")";
      }
      sql += ");";

      XSqlQuery wo(sql);

      if (wo.first())
      {
        if (wo.size() == 1)
          setId(wo.value("wo_id").toInt());
        else
        {
          setId(-1);
          setText(wo.value("wo_number").toString() + "-");
          focusNextPrevChild(FALSE);
          home(FALSE);
          end(FALSE);
        }
      }
      else
        setId(-1);
    }
  }
}
Beispiel #24
0
bool DhQPushButton::DvhfocusNextPrevChild(bool x1) {
  return focusNextPrevChild(x1);
}
bool DhQAbstractSpinBox::DvhfocusNextPrevChild(bool x1) {
  return focusNextPrevChild(x1);
}
Beispiel #26
0
void ItemLineEdit::sParse()
{
    if (!_parsed)
    {
        _parsed = TRUE;

        if (text().length() == 0)
        {
            setId(-1);
            return;
        }

        else if (_useValidationQuery)
        {
            XSqlQuery item;
            item.prepare("SELECT item_id FROM item WHERE (item_number = :searchString);");
            item.bindValue(":searchString", text().stripWhiteSpace().upper());
            item.exec();
            if (item.first())
            {
                int itemid = item.value("item_id").toInt();
                item.prepare(_validationSql);
                item.bindValue(":item_id", itemid);
                item.exec();
                if (item.first())
                {
                    setId(itemid);
                    return;
                }
            }
        }

        else if (_useQuery)
        {
            XSqlQuery item;
            item.prepare(_sql);
            item.exec();
            if (item.findFirst("item_number", text().stripWhiteSpace().upper()) != -1)
            {
                setId(item.value("item_id").toInt());
                return;
            }
        }
        else
        {
            XSqlQuery item;

            QString pre( "SELECT DISTINCT item_id" );

            QStringList clauses;
            clauses = _extraClauses;
            clauses << "(item_number=:searchString)";

            item.prepare(buildItemLineEditQuery(pre, clauses, QString::null, _type));
            item.bindValue(":searchString", text().stripWhiteSpace().upper());
            item.exec();
            if (item.first())
            {
                setId(item.value("item_id").toInt());
                return;
            }
        }

        setId(-1);
        focusNextPrevChild(FALSE);
        QMessageBox::warning( this, tr("Invalid Item Number"),
                              tr( "<p>The Item Number you entered is Invalid.</p>") );
    }
}
Beispiel #27
0
bool DhQSlider::DvhfocusNextPrevChild(bool x1) {
  return focusNextPrevChild(x1);
}
Beispiel #28
0
/*! \reimp */
void QAbstractButton::keyPressEvent(QKeyEvent *e)
{
    Q_D(QAbstractButton);
    bool next = true;
    switch (e->key()) {
    case Qt::Key_Enter:
    case Qt::Key_Return:
        e->ignore();
        break;
    case Qt::Key_Select:
    case Qt::Key_Space:
        if (!e->isAutoRepeat()) {
            setDown(true);
            repaint(); //flush paint event before invoking potentially expensive operation
            QApplication::flush();
            d->emitPressed();
        }
        break;
    case Qt::Key_Up:
    case Qt::Key_Left:
        next = false;
    // fall through
    case Qt::Key_Right:
    case Qt::Key_Down:
#ifdef QT_KEYPAD_NAVIGATION
        if ((QApplication::keypadNavigationEnabled()
                && (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right))
                || (!QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional
                    || (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down))) {
            e->ignore();
            return;
        }
#endif
        QWidget *pw;
        if (d->autoExclusive
#ifndef QT_NO_BUTTONGROUP
                || d->group
#endif
#ifndef QT_NO_ITEMVIEWS
                || ((pw = parentWidget()) && qobject_cast<QAbstractItemView *>(pw->parentWidget()))
#endif
           ) {
            // ### Using qobject_cast to check if the parent is a viewport of
            // QAbstractItemView is a crude hack, and should be revisited and
            // cleaned up when fixing task 194373. It's here to ensure that we
            // keep compatibility outside QAbstractItemView.
            d->moveFocus(e->key());
            if (hasFocus()) // nothing happend, propagate
                e->ignore();
        } else {
            focusNextPrevChild(next);
        }
        break;
    case Qt::Key_Escape:
        if (d->down) {
            setDown(false);
            repaint(); //flush paint event before invoking potentially expensive operation
            QApplication::flush();
            d->emitReleased();
            break;
        }
    // fall through
    default:
        e->ignore();
    }
}
Beispiel #29
0
bool DhQGroupBox::DvhfocusNextPrevChild(bool x1) {
  return focusNextPrevChild(x1);
}
bool KisQPainterCanvas::callFocusNextPrevChild(bool next)
{
    return focusNextPrevChild(next);
}