##

GraphView.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_GUI_MODEL_GRAPHVIEW_HH_
#define GAZEBO_GUI_MODEL_GRAPHVIEW_HH_
#include "gazebo/gui/qt.h"
namespace gazebo
{
namespace gui
{
class GraphView : public QGraphicsView
{
Q_OBJECT
public: explicit GraphView(QWidget *_parent = 0);
public: virtual ~GraphView() = default;
private: void resizeEvent(QResizeEvent *_event);
private: void scrollContentsBy(int _dx, int _dy);
private: void contextMenuEvent(QContextMenuEvent *_event);
private: void wheelEvent(QWheelEvent *_event);
private: void mouseMoveEvent(QMouseEvent *_event);
private: void mousePressEvent(QMouseEvent *_event);
private: void mouseReleaseEvent(QMouseEvent *_event);
private: void mouseDoubleClickEvent(QMouseEvent *_event);
private: void keyPressEvent(QKeyEvent *_event);
Q_SIGNALS: void customContextMenuRequested(QString _id);
Q_SIGNALS: void itemDoubleClicked(QString _id);
public: QGraphicsItem *lastClickedItem = nullptr;
private: double viewScale;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::GraphView::itemDoubleClicked
void itemDoubleClicked(QString _id)
Qt signal emitted when an item is double clicked.
gazebo::gui::GraphView::GraphView
GraphView(QWidget *_parent=0)
Constructor.
gazebo::gui::GraphView
A view for the graph scene.
Definition: GraphView.hh:28
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::GraphView::lastClickedItem
QGraphicsItem * lastClickedItem
Store which item was clicked last.
Definition: GraphView.hh:85
gazebo::gui::GraphView::~GraphView
virtual ~GraphView()=default
Destructor.
gazebo::gui::GraphView::customContextMenuRequested
void customContextMenuRequested(QString _id)
Qt signal emitted when a context menu event is triggered.