bool QListView::qt_emit( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: selectionChanged(); break;
    case 1: selectionChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 2: currentChanged((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 3: clicked((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 4: clicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 5: pressed((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 6: pressed((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 7: doubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 8: doubleClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 9: returnPressed((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 10: spacePressed((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 11: rightButtonClicked((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 12: rightButtonPressed((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 13: mouseButtonPressed((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3)),(int)static_QUType_int.get(_o+4)); break;
    case 14: mouseButtonClicked((int)static_QUType_int.get(_o+1),(QListViewItem*)static_QUType_ptr.get(_o+2),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+3)),(int)static_QUType_int.get(_o+4)); break;
    case 15: contextMenuRequested((QListViewItem*)static_QUType_ptr.get(_o+1),(const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+2)),(int)static_QUType_int.get(_o+3)); break;
    case 16: onItem((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 17: onViewport(); break;
    case 18: expanded((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 19: collapsed((QListViewItem*)static_QUType_ptr.get(_o+1)); break;
    case 20: dropped((QDropEvent*)static_QUType_ptr.get(_o+1)); break;
    case 21: itemRenamed((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2),(const QString&)static_QUType_QString.get(_o+3)); break;
    case 22: itemRenamed((QListViewItem*)static_QUType_ptr.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    default:
	return QScrollView::qt_emit(_id,_o);
    }
    return TRUE;
}
/**
 * @brief GridWidget::keyPressEvent
 * @param keyevent
 */
void GridWidget::keyPressEvent(QKeyEvent *keyevent){
    if ((keyevent->key() == Qt::Key_Space) && (!keyevent->isAutoRepeat())){

        emit spacePressed(streamWidget_->pixmap(),pixmap());

    }

    if ((keyevent->key() == Qt::Key_Escape) && (!keyevent->isAutoRepeat())){

        screenPts_.clear();
        framePoints_.clear();
        this->setVisible(false);
        emit gridDestroyed();

    }

}
Beispiel #3
0
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
// keyboard handling
// ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 
void FileListView::keyPressEvent( QKeyEvent* keyEvent )
{
    // implementing our needs
    Qt::KeyboardModifiers   keyboardModifier    = keyEvent->modifiers();
    Qt::Key                 pressedKey          = static_cast<Qt::Key>( keyEvent->key() );

    if( Qt::NoModifier == keyboardModifier )
    {
        switch( pressedKey )
        {
            case Qt::Key_Escape:    emit escPressed();      break;

            case Qt::Key_Period:    emit consolePressed();  break;

            case Qt::Key_F1 :       emit f01keyPressed();   break;
            case Qt::Key_F2 :       emit f02keyPressed();   break;
            case Qt::Key_F3 :       emit f03keyPressed();   break;
            case Qt::Key_F4 :       emit f04keyPressed();   break;
            case Qt::Key_F5 :       emit f05keyPressed();   break;
            case Qt::Key_F6 :       emit f06keyPressed();   break;
            case Qt::Key_F7 :       emit f07keyPressed();   break;
            case Qt::Key_F8 :       emit f08keyPressed();   break;
            case Qt::Key_F9 :       emit f09keyPressed();   break;
            case Qt::Key_F10:       emit f10keyPressed();   break;
            case Qt::Key_F11:       emit f11keyPressed();   break;
            case Qt::Key_F12:       emit f12keyPressed();   break;

            case Qt::Key_Print:     emit printPressed();    break;
            case Qt::Key_Pause:     emit pausePressed();    break;

            case Qt::Key_Tab:       emit tabPressed();      break;
            case Qt::Key_CapsLock:  emit capsLockPressed(); break;
            case Qt::Key_Shift:     emit leftShiftPressed();break;
            case Qt::Key_Control:   emit leftCtrlPressed(); break;

            case Qt::Key_Insert:    emit insertPressed();   break;
            case Qt::Key_Delete:    emit deletePressed();   break;
            case Qt::Key_Home:      emit homePressed();     break;
            case Qt::Key_End:       emit endPressed();      break;
            case Qt::Key_PageUp:    emit pageUpPressed();   break;
            case Qt::Key_PageDown:  emit pageDownPressed(); break;

            case Qt::Key_Backspace: emit backspacePressed();break;
            case Qt::Key_Return:    emit enterPressed();    break;
            case Qt::Key_Space:     emit spacePressed();    break;

            default:                keyEvent->ignore();     break;
        }
    }

    else if( Qt::AltModifier == keyboardModifier )
    {
        switch( pressedKey )
        {
            case Qt::Key_0: emit alt0Pressed(); break;
            case Qt::Key_1: emit alt1Pressed(); break;
            case Qt::Key_2: emit alt2Pressed(); break;
            case Qt::Key_3: emit alt3Pressed(); break;
            case Qt::Key_4: emit alt4Pressed(); break;
            case Qt::Key_5: emit alt5Pressed(); break;
            case Qt::Key_6: emit alt6Pressed(); break;
            case Qt::Key_7: emit alt7Pressed(); break;
            case Qt::Key_8: emit alt8Pressed(); break;
            case Qt::Key_9: emit alt9Pressed(); break;
            default:        keyEvent->ignore(); break;
        }
    }

    else if( Qt::ControlModifier == keyboardModifier )
    {
        switch( pressedKey )
        {
            case Qt::Key_0: emit ctrl0Pressed(); break;
            case Qt::Key_1: emit ctrl1Pressed(); break;
            case Qt::Key_2: emit ctrl2Pressed(); break;
            case Qt::Key_3: emit ctrl3Pressed(); break;
            case Qt::Key_4: emit ctrl4Pressed(); break;
            case Qt::Key_5: emit ctrl5Pressed(); break;
            case Qt::Key_6: emit ctrl6Pressed(); break;
            case Qt::Key_7: emit ctrl7Pressed(); break;
            case Qt::Key_8: emit ctrl8Pressed(); break;
            case Qt::Key_9: emit ctrl9Pressed(); break;
            default:        keyEvent->ignore();  break;
        }
    }

    else if( Qt::ShiftModifier == keyboardModifier )
    {
        switch( pressedKey )
        {
            case Qt::Key_0: emit shift0Pressed(); break;
            case Qt::Key_1: emit shift1Pressed(); break;
            case Qt::Key_2: emit shift2Pressed(); break;
            case Qt::Key_3: emit shift3Pressed(); break;
            case Qt::Key_4: emit shift4Pressed(); break;
            case Qt::Key_5: emit shift5Pressed(); break;
            case Qt::Key_6: emit shift6Pressed(); break;
            case Qt::Key_7: emit shift7Pressed(); break;
            case Qt::Key_8: emit shift8Pressed(); break;
            case Qt::Key_9: emit shift9Pressed(); break;
            default:        keyEvent->ignore();   break;
        }
    }

    else if( Qt::KeypadModifier == keyboardModifier )
    {
        switch( pressedKey )
        {
            case Qt::Key_Minus:     emit numpadMinusPressed();      break;
            case Qt::Key_Plus:      emit numpadPlusPressed();       break;
            case Qt::Key_Slash:     emit numpadSlashPressed();      break;
            case Qt::Key_Asterisk:  emit numpadAsteriskPressed();   break;
            default:                keyEvent->ignore();             break;
        }
    }

    // allowing the default behaviour
    QListView::keyPressEvent( keyEvent );
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    nbonglet=0;
    mesonglets = new Onglet();
    ui->setupUi(this);
    QVBoxLayout* l = new QVBoxLayout();
    ui->centralWidget->setLayout(l);;
    l->addWidget(mesonglets);
    l->addWidget(ui->frame);
    mesonglets->setMaximumHeight(24);
    mesonglets->setTabsClosable(true);

    nouvelOnglet();

    QObject::connect(ui->num0,SIGNAL(clicked()),this,SLOT(num0Pressed()));
    QObject::connect(ui->num1,SIGNAL(clicked()),this,SLOT(num1Pressed()));
    QObject::connect(ui->num2,SIGNAL(clicked()),this,SLOT(num2Pressed()));
    QObject::connect(ui->num3,SIGNAL(clicked()),this,SLOT(num3Pressed()));
    QObject::connect(ui->num4,SIGNAL(clicked()),this,SLOT(num4Pressed()));
    QObject::connect(ui->num5,SIGNAL(clicked()),this,SLOT(num5Pressed()));
    QObject::connect(ui->num6,SIGNAL(clicked()),this,SLOT(num6Pressed()));
    QObject::connect(ui->num7,SIGNAL(clicked()),this,SLOT(num7Pressed()));
    QObject::connect(ui->num8,SIGNAL(clicked()),this,SLOT(num8Pressed()));
    QObject::connect(ui->num9,SIGNAL(clicked()),this,SLOT(num9Pressed()));
    QObject::connect(ui->sinButton,SIGNAL(clicked()),this,SLOT(SINPressed()));
    QObject::connect(ui->sinhButton,SIGNAL(clicked()),this,SLOT(SINHPressed()));
    QObject::connect(ui->cosButton,SIGNAL(clicked()),this,SLOT(COSPressed()));
    QObject::connect(ui->coshButton,SIGNAL(clicked()),this,SLOT(COSHPressed()));
    QObject::connect(ui->tanButton,SIGNAL(clicked()),this,SLOT(TANPressed()));
    QObject::connect(ui->tanhButton,SIGNAL(clicked()),this,SLOT(TANHPressed()));
    QObject::connect(ui->lnButton,SIGNAL(clicked()),this,SLOT(LNPressed()));
    QObject::connect(ui->logButton,SIGNAL(clicked()),this,SLOT(LOGPressed()));
    QObject::connect(ui->cubeButton,SIGNAL(clicked()),this,SLOT(CUBEPressed()));
    QObject::connect(ui->sqrButton,SIGNAL(clicked()),this,SLOT(SQRPressed()));
    QObject::connect(ui->sqrtButton,SIGNAL(clicked()),this,SLOT(SQRTPressed()));
    QObject::connect(ui->invButton,SIGNAL(clicked()),this,SLOT(INVPressed()));
    QObject::connect(ui->factButton,SIGNAL(clicked()),this,SLOT(FACTPressed()));
    QObject::connect(ui->addButton,SIGNAL(clicked()),this,SLOT(ADDPressed()));
    QObject::connect(ui->minusButton,SIGNAL(clicked()),this,SLOT(MINUSPressed()));
    QObject::connect(ui->multiplyButton,SIGNAL(clicked()),this,SLOT(MULTPressed()));
    QObject::connect(ui->divButton,SIGNAL(clicked()),this,SLOT(DIVPressed()));
    QObject::connect(ui->powButton,SIGNAL(clicked()),this,SLOT(POWPressed()));
    QObject::connect(ui->modButton,SIGNAL(clicked()),this,SLOT(MODPressed()));
    QObject::connect(ui->signButton,SIGNAL(clicked()),this,SLOT(SIGNPressed()));
    QObject::connect(ui->spaceButton,SIGNAL(clicked()),this,SLOT(spacePressed()));
    QObject::connect(ui->ratioButton,SIGNAL(clicked()),this,SLOT(ratioClicked()));
    QObject::connect(ui->realButton,SIGNAL(clicked()),this,SLOT(realClicked()));
    QObject::connect(ui->integerButton,SIGNAL(clicked()),this,SLOT(integerClicked()));
    QObject::connect(ui->degreButton,SIGNAL(clicked()),this,SLOT(degreClicked()));
    QObject::connect(ui->radianButton,SIGNAL(clicked()),this,SLOT(radianClicked()));
    QObject::connect(ui->trueComplexButton,SIGNAL(clicked()),this,SLOT(trueComplexClicked()));
    QObject::connect(ui->falseComplexButton,SIGNAL(clicked()),this,SLOT(falseComplexClicked()));
    QObject::connect(mesonglets,SIGNAL(tabCloseRequested(int)),this,SLOT(fermerOnglet(int)));
    QObject::connect(ui->actionNouvel_Onglet,SIGNAL(triggered()),this,SLOT(nouvelOnglet()));
    QObject::connect(ui->pointButton,SIGNAL(clicked()),this,SLOT(pointPressed()));
    QObject::connect(ui->slashButton,SIGNAL(clicked()),this,SLOT(slashPressed()));
    QObject::connect(ui->dollarButton,SIGNAL(clicked()),this,SLOT(dollarPressed()));
    QObject::connect(ui->quoteButton,SIGNAL(clicked()),this,SLOT(quotePressed()));
    QObject::connect(mesonglets,SIGNAL(currentChanged(int)),this,SLOT(changerOnglet(int)));
    QObject::connect(ui->evalButton,SIGNAL(clicked()),this,SLOT(evalPressed()));
    QObject::connect(ui->action_Quit,SIGNAL(triggered()),this,SLOT(Quitter()));
    QObject::connect(ui->actionAnnuler,SIGNAL(triggered()),this,SLOT(annuler()));
    QObject::connect(ui->actionR_tablir,SIGNAL(triggered()),this,SLOT(retablir()));

}