source: observatorio/simulacion/SimEscenariosEconomicos-Qtgui/svgPanel.C

simulacion
Last change on this file was 6c79fb4, checked in by Alejandro <amujica@…>, 10 years ago

Muestra el indice de dependencia de productos importados en el modulo de precios

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2  Copyright (C) 2012
3  Alejandro Mujica (amujica@cenditel.gob.ve)
4  Erwin Paredes (eparedes@cenditel.gob.ve)
5  José Ruiz (jruiz@cenditel.gob.ve)
6  Rodolfo Rangel (rrangel@cenditel.gob.ve)
7  Julie Vera (jvera@cenditel.gob.ve)
8
9  CENDITEL Fundación Centro Nacional de Desarrollo e Investigación en
10  Tecnologías Libres
11
12  Este programa es software libre; Usted puede usarlo bajo los términos de la
13  licencia de software GPL versión 2.0 de la Free Software Foundation.
14
15  Este programa se distribuye con la esperanza de que sea útil, pero SIN
16  NINGUNA GARANTÍA; tampoco las implícitas garantías de MERCANTILIDAD o
17  ADECUACIÓN A UN PROPÓSITO PARTICULAR.
18  Consulte la licencia GPL para más detalles. Usted debe recibir una copia
19  de la GPL junto con este programa; si no, escriba a la Free Software
20  Foundation Inc. 51 Franklin Street,5 Piso, Boston, MA 02110-1301, USA.
21*/
22
23/*
24  Este archivo contiene la implementación de la clase SvgPanel.
25
26  Autor: Alejandro J. Mujica
27  Fecha:
28*/
29
30# include <QMouseEvent>
31# include <QDragMoveEvent>
32
33# include <svgPanel.H>
34
35void SvgPanel::mousePressEvent(QMouseEvent * evt) {
36
37    sourcePoint = mapToGlobal(evt->pos());
38    emit signalMousePressed();
39}
40
41void SvgPanel::mouseMoveEvent(QMouseEvent * evt) {
42
43    setCursor(QCursor(Qt::ClosedHandCursor));
44    moving = true;
45    QPoint diff = mapToGlobal(evt->pos()) - sourcePoint;
46    emit signalMouseMoved(diff);
47}
48
49void SvgPanel::mouseReleaseEvent(QMouseEvent * evt) {
50
51    setCursor(QCursor());
52
53    if (not moving)
54        emit signalMouseClicked(evt->pos());
55
56    moving = false;
57}
58
59SvgPanel::SvgPanel(QWidget * parent)
60    : QSvgWidget(parent), moving(false) {
61
62    // Empty
63}
Note: See TracBrowser for help on using the repository browser.