Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2851 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information
Henrik Eriksson
committed
Jun 26, 2007
1 parent
78950cf
commit 3009848
Showing
6 changed files
with
124 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef FOCUSRECT_H | ||
#define FOCUSRECT_H | ||
|
||
#include <QGraphicsRectItem> | ||
#include <QBrush> | ||
#include "graphWidget.h" | ||
#include <QMessageBox> | ||
|
||
class FocusRect: public QGraphicsRectItem | ||
{ | ||
|
||
public: | ||
FocusRect(const QRectF& rect, GraphWidget* w): QGraphicsRectItem(rect), widget(w) | ||
{ | ||
setAcceptsHoverEvents(true); | ||
setZValue(-2); | ||
} | ||
|
||
~FocusRect() | ||
{ | ||
} | ||
|
||
void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) | ||
{ | ||
QColor c(0, 255, 0, 50); | ||
QBrush b(c); | ||
setBrush(b); | ||
} | ||
|
||
void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) | ||
{ | ||
QColor c(255, 0, 0, 50); | ||
QBrush b(c); | ||
setBrush(b); | ||
} | ||
|
||
void mousePressEvent ( QGraphicsSceneMouseEvent * event ) | ||
{ | ||
|
||
|
||
widget->zoomIn(rect()); | ||
widget->updatePointSizes(QRect(-1,0,0,0)); | ||
} | ||
|
||
GraphWidget* widget; | ||
|
||
|
||
|
||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters