14 {Qt::LeftButton,
"LeftButton"},
15 {Qt::RightButton,
"RightButton"},
16 {Qt::MiddleButton,
"MiddleButton"}};
20 {Qt::NoButton,
"NoButton"},
21 {Qt::AllButtons,
"AllButtons"},
22 {Qt::LeftButton,
"LeftButton"},
23 {Qt::RightButton,
"RightButton"},
24 {Qt::MiddleButton,
"MiddleButton"},
25 {Qt::LeftButton | Qt::RightButton,
"LeftRightButtons"},
26 {Qt::LeftButton | Qt::MiddleButton,
"LeftMiddleButtons"},
27 {Qt::RightButton | Qt::MiddleButton,
"RightMiddleButtons"},
31 {Qt::NoModifier,
"No modifier"},
32 {Qt::ShiftModifier,
"A Shift key"},
33 {Qt::ControlModifier,
"A Ctrl key"},
34 {Qt::AltModifier,
"An Alt key"},
35 {Qt::MetaModifier,
"A Meta key"},
36 {Qt::KeypadModifier,
"A keypad button"},
37 {Qt::GroupSwitchModifier,
"A Mode_switch key"}
265 QPointF point(x_range_start, y_position);
266 double width = x_range_end - x_range_start;
414 "The m_integrationScopeRhombWidth of the fixed rhomboid side cannot be "
418 std::vector<QPointF> points;
426 points.push_back(point);
435 points.push_back(point);
441 points.push_back(point);
447 points.push_back(point);
457 points.push_back(point);
463 points.push_back(point);
469 points.push_back(point);
479 points.push_back(point);
485 points.push_back(point);
491 points.push_back(point);
501 points.push_back(point);
507 points.push_back(point);
513 points.push_back(point);
567 qFatal(
"The height of the fixed rhomboid side cannot be 0.");
570 std::vector<QPointF> points;
579 points.push_back(point);
580 qDebug() <<
"Start point:" << point;
588 points.push_back(point);
594 points.push_back(point);
600 points.push_back(point);
610 points.push_back(point);
616 points.push_back(point);
622 points.push_back(point);
632 points.push_back(point);
638 points.push_back(point);
644 points.push_back(point);
654 points.push_back(point);
660 points.push_back(point);
666 points.push_back(point);
752 "Both m_integrationScopeRhombWidth and m_integrationScopeRhombHeight of "
753 "rhomboid integration scope cannot be 0.");
856 QString text(
"Context:");
858 text += QString(
" data kind: %1").arg(
static_cast<int>(
m_dataKind));
860 text += QString(
" -- isMouseDragging: %1 -- wasMouseDragging: %2")
867 text += QString(
" -- currentDragPoint : (%1, %2)")
871 text += QString(
" -- lastCursorHoveredPoint : (%1, %2)")
878 text +=
" -- Integration scope: ";
882 text += QString(
" -- xRange: (%1, %2)").arg(
m_xRange.lower).arg(
m_xRange.upper);
884 text += QString(
" -- yRange: (%1, %2)").arg(
m_yRange.lower).arg(
m_yRange.upper);
886 text += QString(
" -- wasClickOnXAxis: %1").arg(
m_wasClickOnXAxis ?
"true" :
"false");
887 text += QString(
" -- wasClickOnYAxis: %1").arg(
m_wasClickOnYAxis ?
"true" :
"false");
890 text += QString(
" -- xRegionRangeStart: %1 -- xRegionRangeEnd: %2")
894 text += QString(
" -- yRegionRangeStart: %1 -- yRegionRangeEnd: %2")
898 text += QString(
" -- xDelta: %1 -- yDelta: %2").arg(
m_xDelta).arg(
m_yDelta);
911 text += QString(
" -- keyboardModifiers: ");
945 text += QString(
" -- mouseButtonsAtMouseRelease: %1")
961 text +=
" -- dragging from left to right";
963 text +=
" -- dragging from right to left";
965 text +=
" -- dragging from top to bottom";
967 text +=
" -- dragging from bottom to top";
978 qWarning() <<
"Cannot register class: engine is null";
983 QJSValue jsMetaObject = engine->newQMetaObject(&BasePlotContext::staticMetaObject);
984 engine->globalObject().setProperty(
"BasePlotContext", jsMetaObject);
986 QJSValue enumObject = engine->newObject();
994 engine->globalObject().setProperty(
"DragDirections", enumObject);
double m_xRegionRangeStart
static void registerJsConstructor(QJSEngine *engine)
Qt::MouseButtons m_mouseButtonsAtMousePress
SelectionPolygon m_selectionPolygon
Q_INVOKABLE BasePlotContext(QObject *parent=nullptr)
virtual ~BasePlotContext()
Q_INVOKABLE QString dragDirectionsToString() const
IntegrationScopeBaseCstSPtr msp_integrationScope
DragDirections recordDragDirections()
Enums::DataKind m_dataKind
Q_INVOKABLE BasePlotContext * clone(QObject *parent=nullptr)
Qt::KeyboardModifiers m_keyboardModifiers
void updateIntegrationScope()
Qt::MouseButtons m_lastPressedMouseButton
void updateIntegrationScopeRhombVertical()
void updateIntegrationScopeRhombHorizontal()
bool m_isMeasuringDistance
DragDirections m_dragDirections
double m_integrationScopeRhombHeight
QPointF m_lastCursorHoveredPoint
QPointF m_currentDragPoint
Q_INVOKABLE void initialize(const BasePlotContext &other)
void updateIntegrationScopeRect()
double m_yRegionRangeStart
void updateIntegrationScopeRhomb()
bool m_isRightPseudoButtonKeyPressed
Qt::MouseButtons m_pressedMouseButtons
Qt::MouseButtons m_mouseButtonsAtMouseRelease
bool m_isLeftPseudoButtonKeyPressed
double m_integrationScopeRhombWidth
Qt::MouseButtons m_lastReleasedMouseButton
Q_INVOKABLE QString toString() const
bool m_wasKeyBoardDragging
bool m_isKeyBoardDragging
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::map< Qt::MouseButton, QString > qtMouseButtonMap
std::map< Qt::MouseButtons, QString > qtMouseButtonsMap
std::map< Qt::KeyboardModifier, QString > qtKeyboardModifierMap