2018-08-27 08:50:40 +00:00
|
|
|
#include "graphicscontainerwidget.h"
|
|
|
|
|
|
|
|
GraphicsContainerWidget::GraphicsContainerWidget() :
|
|
|
|
m_graphicsWidget(nullptr)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void GraphicsContainerWidget::resizeEvent(QResizeEvent *event)
|
|
|
|
{
|
|
|
|
if (m_graphicsWidget && m_graphicsWidget->size() != event->size())
|
|
|
|
emit containerSizeChanged(event->size());
|
|
|
|
}
|
|
|
|
|
2018-10-25 07:03:51 +00:00
|
|
|
void GraphicsContainerWidget::mousePressEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
if (m_modelWidget)
|
|
|
|
m_modelWidget->inputMousePressEventFromOtherWidget(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GraphicsContainerWidget::mouseMoveEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
if (m_modelWidget)
|
|
|
|
m_modelWidget->inputMouseMoveEventFromOtherWidget(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GraphicsContainerWidget::mouseReleaseEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
if (m_modelWidget)
|
|
|
|
m_modelWidget->inputMouseReleaseEventFromOtherWidget(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GraphicsContainerWidget::wheelEvent(QWheelEvent *event)
|
|
|
|
{
|
|
|
|
if (m_modelWidget)
|
|
|
|
m_modelWidget->inputWheelEventFromOtherWidget(event);
|
|
|
|
}
|
|
|
|
|
2018-08-27 08:50:40 +00:00
|
|
|
void GraphicsContainerWidget::setGraphicsWidget(QWidget *graphicsWidget)
|
|
|
|
{
|
|
|
|
m_graphicsWidget = graphicsWidget;
|
|
|
|
}
|
2018-10-25 07:03:51 +00:00
|
|
|
|
|
|
|
void GraphicsContainerWidget::setModelWidget(ModelWidget *modelWidget)
|
|
|
|
{
|
|
|
|
m_modelWidget = modelWidget;
|
|
|
|
}
|