Isis 3 Programmer Reference
MosaicGraphicsScene.cpp
1#include "MosaicGraphicsScene.h"
2
3#include <QGraphicsSceneMouseEvent>
4
5#include "MosaicSceneWidget.h"
6
7namespace Isis {
8 MosaicGraphicsScene::MosaicGraphicsScene(MosaicSceneWidget *parent) : QGraphicsScene(parent) {
9
10 m_parent = parent;
11 }
12
13 MosaicGraphicsScene::~MosaicGraphicsScene() {
14 }
15
16
17 void MosaicGraphicsScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *contextMenuEvent) {
18 if (selectedItems().count() < 2 ||
19 !qobject_cast<MosaicSceneWidget *>(parent())->contextMenuEvent(contextMenuEvent)) {
20 QGraphicsScene::contextMenuEvent(contextMenuEvent);
21 }
22 }
23
24
25 void MosaicGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) {
26 if (mouseEvent->button() == Qt::RightButton) {
27 //qDebug()<<"MosaicGraphicsScene::mousePressEvent Right Button";
28 // Do nothing on right click... this prevents the loss of selection before a context event
29 if (m_parent->isControlNetToolActive()) {
30 //qDebug()<<"MosaicGraphicsScene::mousePressEvent Right Button cnetTool active";
31 QGraphicsScene::mousePressEvent(mouseEvent);
32 }
33 else {
34 mouseEvent->accept();
35 }
36 }
37 else {
38 QGraphicsScene::mousePressEvent(mouseEvent);
39 }
40 }
41}
42
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16