##// END OF EJS Templates
Refactors TestAmdaResultParser...
Refactors TestAmdaResultParser Changes format of ExpectedResults struct to build it with more readability

File last commit:

r1001:ebb8b3d01eee
r1011:ed386af0bc9b
Show More
VisualizationDragWidget.cpp
55 lines | 1.5 KiB | text/x-c | CppLexer
/ gui / src / Visualization / VisualizationDragWidget.cpp
New visualization classes for the drag&drop
r841 #include "Visualization/VisualizationDragWidget.h"
#include "Visualization/VisualizationDragDropContainer.h"
#include <QApplication>
Format changes
r847 #include <QMouseEvent>
New visualization classes for the drag&drop
r841
Basic mouse wheel interactions + mode drag
r1001 #include <SqpApplication.h>
New visualization classes for the drag&drop
r841 struct VisualizationDragWidget::VisualizationDragWidgetPrivate {
Format changes
r847 QPoint m_DragStartPosition;
bool m_DragStartPositionValid = false;
New visualization classes for the drag&drop
r841
Format changes
r847 explicit VisualizationDragWidgetPrivate() {}
New visualization classes for the drag&drop
r841 };
Format changes
r847 VisualizationDragWidget::VisualizationDragWidget(QWidget *parent)
: QWidget{parent}, impl{spimpl::make_unique_impl<VisualizationDragWidgetPrivate>()}
New visualization classes for the drag&drop
r841 {
}
void VisualizationDragWidget::mousePressEvent(QMouseEvent *event)
{
Format changes
r847 if (event->button() == Qt::LeftButton) {
impl->m_DragStartPosition = event->pos();
}
New visualization classes for the drag&drop
r841
Format changes
r847 impl->m_DragStartPositionValid = isDragAllowed();
New visualization classes for the drag&drop
r841
QWidget::mousePressEvent(event);
}
void VisualizationDragWidget::mouseMoveEvent(QMouseEvent *event)
{
Format changes
r847 if (!impl->m_DragStartPositionValid || !isDragAllowed()) {
New visualization classes for the drag&drop
r841 return;
Format changes
r847 }
New visualization classes for the drag&drop
r841
Format changes
r847 if (!(event->buttons() & Qt::LeftButton)) {
New visualization classes for the drag&drop
r841 return;
Format changes
r847 }
New visualization classes for the drag&drop
r841
Basic mouse wheel interactions + mode drag
r1001 if (sqpApp->plotsInteractionMode() == SqpApplication::PlotsInteractionMode::DragAndDrop
|| event->modifiers().testFlag(Qt::AltModifier)) {
New visualization classes for the drag&drop
r841
Basic mouse wheel interactions + mode drag
r1001 if ((event->pos() - impl->m_DragStartPosition).manhattanLength()
< QApplication::startDragDistance()) {
return;
}
New visualization classes for the drag&drop
r841
Basic mouse wheel interactions + mode drag
r1001 emit dragDetected(this, impl->m_DragStartPosition);
}
New visualization classes for the drag&drop
r841
QWidget::mouseMoveEvent(event);
}