QCAD
Open Source 2D CAD
REventHandler Class Reference

Event handler class. More...

#include <REventHandler.h>

Inheritance diagram for REventHandler:
EventHandler

Public Slots

void dragEnter (QDragEnterEvent *event)
 
void horizontalScrolled (double pos)
 
void updateSnapInfo (QPainter *painter, RSnap *snap, RSnapRestriction *restriction)
 Called on every repaint of a view to update snap related information. More...
 
void updateTextLabel (QPainter *painter, const RTextLabel &textLabel)
 Handles drop into the drawing area. More...
 
void verticalScrolled (double pos)
 
void viewportChanged ()
 Called whenever the current viewport changed through panning or zooming. More...
 

Public Member Functions

void drawInfoLabel (QPainter *painter, const RTextLabel &textLabel)
 
void drawSnapLabel (QPainter *painter, const RVector &pos, const RVector &posRestriction, const QString &text)
 
 REventHandler (QWidget *widget=NULL, RDocumentInterface *documentInterface=NULL)
 Copyright (c) 2011-2017 by Andrew Mustun. More...
 

Static Public Member Functions

static QList< QUrl > getUrlsFromMimeData (QMimeData *mimeData)
 
static bool isUrl (const QString &urlString)
 

Private Attributes

RDocumentInterfacedocumentInterface
 
RGraphicsViewgraphicsView
 
RRulerQthruler
 
QScrollBar * hsb
 
RRulerQtvruler
 
QScrollBar * vsb
 
QWidget * widget
 

Detailed Description

Event handler class.

For each new document that is created or opened, an event handler is created to handle various events for the life time of the document.

Scriptable:
This class is available in script environments.

Constructor & Destructor Documentation

REventHandler::REventHandler ( QWidget *  widget = NULL,
RDocumentInterface di = NULL 
)

Copyright (c) 2011-2017 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD. Event handler for scroll, drag and drop, snap info.

Member Function Documentation

void REventHandler::dragEnter ( QDragEnterEvent *  event)
slot
void REventHandler::drawInfoLabel ( QPainter *  painter,
const RTextLabel textLabel 
)
void REventHandler::drawSnapLabel ( QPainter *  painter,
const RVector pos,
const RVector posRestriction,
const QString &  text 
)
QList< QUrl > REventHandler::getUrlsFromMimeData ( QMimeData *  mimeData)
static
void REventHandler::horizontalScrolled ( double  pos)
slot
bool REventHandler::isUrl ( const QString &  urlString)
static
void REventHandler::updateSnapInfo ( QPainter *  painter,
RSnap snap,
RSnapRestriction restriction 
)
slot

Called on every repaint of a view to update snap related information.

Parameters
painterQPainter for the view in screen coordinates.
snapCurrent snap.
void REventHandler::updateTextLabel ( QPainter *  painter,
const RTextLabel textLabel 
)
slot

Handles drop into the drawing area.

Parameters
eventQDropEvent
void REventHandler::verticalScrolled ( double  pos)
slot
void REventHandler::viewportChanged ( )
slot

Called whenever the current viewport changed through panning or zooming.

Updates the scroll bars, rulers, etc.

Member Data Documentation

RDocumentInterface* REventHandler::documentInterface
private
RGraphicsView* REventHandler::graphicsView
private
RRulerQt* REventHandler::hruler
private
QScrollBar* REventHandler::hsb
private
RRulerQt* REventHandler::vruler
private
QScrollBar* REventHandler::vsb
private
QWidget* REventHandler::widget
private

The documentation for this class was generated from the following files: