2018-08-27 08:50:40 +00:00
|
|
|
#include "graphicscontainerwidget.h"
|
|
|
|
|
2018-11-15 14:33:56 +00:00
|
|
|
GraphicsContainerWidget::GraphicsContainerWidget()
|
2018-08-27 08:50:40 +00:00
|
|
|
{
|
2019-08-08 11:24:33 +00:00
|
|
|
setMouseTracking(true);
|
2018-08-27 08:50:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2018-11-15 14:33:56 +00:00
|
|
|
if (m_graphicsWidget) {
|
|
|
|
m_graphicsWidget->inputWheelEventFromOtherWidget(event);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-10-25 07:03:51 +00:00
|
|
|
if (m_modelWidget)
|
|
|
|
m_modelWidget->inputWheelEventFromOtherWidget(event);
|
|
|
|
}
|
|
|
|
|
2018-11-15 14:33:56 +00:00
|
|
|
void GraphicsContainerWidget::setGraphicsWidget(SkeletonGraphicsWidget *graphicsWidget)
|
2018-08-27 08:50:40 +00:00
|
|
|
{
|
|
|
|
m_graphicsWidget = graphicsWidget;
|
|
|
|
}
|
2018-10-25 07:03:51 +00:00
|
|
|
|
|
|
|
void GraphicsContainerWidget::setModelWidget(ModelWidget *modelWidget)
|
|
|
|
{
|
|
|
|
m_modelWidget = modelWidget;
|
|
|
|
}
|