Exemple #1
0
void QG_GraphicView::mouseDoubleClickEvent(QMouseEvent* e)
{
    switch(e->button())
    {
        default:
            break;
        case Qt::MiddleButton:
            setCurrentAction(new RS_ActionZoomAuto(*container, *this));
            break;
        case Qt::LeftButton:
            if (menus.contains("Double-Click"))
            {
                killAllActions();
                menus["Double-Click"]->popup(mapToGlobal(e->pos()));
            }
            break;
    }
    e->accept();
}
Exemple #2
0
/**
 * Called by Qt when the user closes this MDI window.
 */
void QC_MDIWindow::closeEvent(QCloseEvent* ce) {

    auto view = getGraphicView();
    view->killAllActions();

    RS_DEBUG->print("QC_MDIWindow::closeEvent begin");
    if (forceClosing) {
        ce->accept();

        return;
    }

    if (closeMDI(false)) {
        ce->accept();
    } else {
        ce->ignore();
    }

    RS_DEBUG->print("QC_MDIWindow::closeEvent end");
}
Exemple #3
0
/**
 * Destructor.
 */
RS_EventHandler::~RS_EventHandler() {
    RS_DEBUG->print("RS_EventHandler::~RS_EventHandler");
    if (defaultAction!=NULL) {
        defaultAction->finish();
        delete defaultAction;
        defaultAction = NULL;
    }

    killAllActions();

    RS_DEBUG->print("RS_EventHandler::~RS_EventHandler: Deleting all actions..");
    for (int i=0; i<RS_MAXACTIONS; ++i) {
        if (currentActions[i]!=NULL) {
            currentActions[i]->setFinished();
            //delete currentActions[i];
            //currentActions[i] = NULL;
        }
    }
    cleanUp();
    RS_DEBUG->print("RS_EventHandler::~RS_EventHandler: Deleting all actions..: OK");

    RS_DEBUG->print("RS_EventHandler::~RS_EventHandler: OK");
}
void RS_EventHandler::set_action(QAction* q_action)
{
    real_action = q_action;
    right_click_quits = true;
    killAllActions();
}