REventHandler
Class in GUI Module
Header: #include <src/gui/REventHandler.h>
Inherits: QObject
Description
Section titled “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.
\generateScriptShell
Public Functions
Section titled “Public Functions”REventHandler(QWidget *widget=NULL, RDocumentInterface *documentInterface=NULL) |
|
| void | drawInfoLabel(RGraphicsViewWorker *worker, const RTextLabel &textLabel) |
| void | drawSnapLabel(RGraphicsViewWorker *worker, const RVector &pos, const RVector &posRestriction, const QString &text) |
Static Public Functions
Section titled “Static Public Functions”| static QList< QUrl > | getUrlsFromMimeData(QMimeData *mimeData) |
| static bool | isUrl(const QString &urlString) |
Public Slots
Section titled “Public Slots”| void | dragEnter(QDragEnterEvent *event) |
| void | horizontalScrolled(double pos) |
| void | updateSnapInfo(RGraphicsViewWorker *worker, RSnap *snap, RSnapRestriction *restriction)Called on every repaint of a view to update snap related information. |
| void | updateTextLabel(RGraphicsViewWorker *worker, const RTextLabel &textLabel)Handles drop into the drawing area. |
| void | verticalScrolled(double pos) |
| void | viewportChanged()Called whenever the current viewport changed through panning or zooming. |
Private Attributes
Section titled “Private Attributes”| RDocumentInterface * | documentInterface |
| RGraphicsView * | graphicsView |
| RRulerQt * | hruler |
| QScrollBar * | hsb |
| RRulerQt * | vruler |
| QScrollBar * | vsb |
| QWidget * | widget |
Member Documentation
Section titled “Member Documentation”REventHandler
Section titled “REventHandler”REventHandler::REventHandler(QWidget *widget=NULL, RDocumentInterface *documentInterface=NULL)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.
drawInfoLabel
Section titled “drawInfoLabel”void REventHandler::drawInfoLabel(RGraphicsViewWorker *worker, const RTextLabel &textLabel)drawSnapLabel
Section titled “drawSnapLabel”void REventHandler::drawSnapLabel(RGraphicsViewWorker *worker, const RVector &pos, const RVector &posRestriction, const QString &text)getUrlsFromMimeData
Section titled “getUrlsFromMimeData”static QList< QUrl > REventHandler::getUrlsFromMimeData(QMimeData *mimeData)static
static bool REventHandler::isUrl(const QString &urlString)static
dragEnter
Section titled “dragEnter”void REventHandler::dragEnter(QDragEnterEvent *event)horizontalScrolled
Section titled “horizontalScrolled”void REventHandler::horizontalScrolled(double pos)updateSnapInfo
Section titled “updateSnapInfo”void REventHandler::updateSnapInfo(RGraphicsViewWorker *worker, RSnap *snap, RSnapRestriction *restriction)Called on every repaint of a view to update snap related information.
Parameters:
painter: QPainter for the view in screen coordinates.snap: Current snap.
updateTextLabel
Section titled “updateTextLabel”void REventHandler::updateTextLabel(RGraphicsViewWorker *worker, const RTextLabel &textLabel)Handles drop into the drawing area.
Parameters:
event: QDropEvent
verticalScrolled
Section titled “verticalScrolled”void REventHandler::verticalScrolled(double pos)viewportChanged
Section titled “viewportChanged”void REventHandler::viewportChanged()Called whenever the current viewport changed through panning or zooming.
Updates the scroll bars, rulers, etc.
documentInterface
Section titled “documentInterface”RDocumentInterface* REventHandler::documentInterfaceprivate
graphicsView
Section titled “graphicsView”RGraphicsView* REventHandler::graphicsViewprivate
hruler
Section titled “hruler”RRulerQt* REventHandler::hrulerprivate
QScrollBar* REventHandler::hsbprivate
vruler
Section titled “vruler”RRulerQt* REventHandler::vrulerprivate
QScrollBar* REventHandler::vsbprivate
widget
Section titled “widget”QWidget* REventHandler::widgetprivate