From eb9fb1bc4706b727d01f1cc452e4fd60e0b43fcd Mon Sep 17 00:00:00 2001 From: IKhonakhbeeva <43929571+IKhonakhbeeva@users.noreply.github.com> Date: Thu, 12 May 2022 23:23:23 +0700 Subject: [PATCH] Set/move robot start position from the context menu (#1505) * Fix text for read-only flags * Add button to set robot start position under current robot pos * Fix read-only sensors behavior * Use QT IFW 4.3 * Delete vanished translations * Clean the code --- .../twoDModel/engine/view/twoDModelWidget.h | 1 + .../twoDModel/src/engine/items/imageItem.cpp | 34 +++---------------- .../twoDModel/src/engine/items/imageItem.h | 5 +-- .../src/engine/view/parts/robotItemPopup.cpp | 12 +++++-- .../src/engine/view/parts/robotItemPopup.h | 5 +++ .../src/engine/view/scene/twoDModelScene.cpp | 5 +-- .../src/engine/view/twoDModelWidget.cpp | 9 +++++ .../interpreter/details/autoconfigurer.h | 3 +- .../src/interpreter/blockInterpreter.cpp | 2 +- .../interpreter/details/autoconfigurer.cpp | 14 +++++--- .../src/ui/exerciseExportDialog.cpp | 10 +++--- .../fr/plugins/robots/interpreterCore_fr.ts | 27 +++++++++------ .../fr/plugins/robots/twoDModel_fr.ts | 13 ++++--- qrtranslations/fr/qrutils_fr.ts | 2 +- .../ru/plugins/robots/interpreterCore_ru.ts | 27 +++++++++------ .../ru/plugins/robots/twoDModel_ru.ts | 13 ++++--- qrtranslations/ru/qrutils_ru.ts | 2 +- qrutils/graphicsUtils/abstractItem.cpp | 7 +++- qrutils/graphicsUtils/abstractItem.h | 1 + 19 files changed, 110 insertions(+), 82 deletions(-) diff --git a/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h b/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h index 55b3c11fa3..0a34e36f3e 100644 --- a/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h +++ b/plugins/robots/common/twoDModel/include/twoDModel/engine/view/twoDModelWidget.h @@ -166,6 +166,7 @@ private slots: void toggleDetailsVisibility(); void returnToStartMarker(); + void setStartMarker(); void trainingModeChanged(bool enabled); diff --git a/plugins/robots/common/twoDModel/src/engine/items/imageItem.cpp b/plugins/robots/common/twoDModel/src/engine/items/imageItem.cpp index 030d361c90..44fa2367ac 100644 --- a/plugins/robots/common/twoDModel/src/engine/items/imageItem.cpp +++ b/plugins/robots/common/twoDModel/src/engine/items/imageItem.cpp @@ -174,6 +174,7 @@ void ImageItem::setBackgroundRole(bool background) { mBackgroundRole = background; if (!isSelected()) { + setEditable(!mBackgroundRole); setFlag(ItemIsSelectable, !mBackgroundRole); } setZValue(background ? ZValue::Background : ZValue::Picture); @@ -190,6 +191,7 @@ QVariant ImageItem::itemChange(QGraphicsItem::GraphicsItemChange change, const Q emit selectedChanged(value.toBool()); if (!value.toBool() && isBackground()) { setFlag(ItemIsSelectable, false); + setEditable(false); unsetCursor(); } } @@ -197,7 +199,7 @@ QVariant ImageItem::itemChange(QGraphicsItem::GraphicsItemChange change, const Q return AbstractItem::itemChange(change, value); } -void ImageItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) +void ImageItem::updateCursor(QGraphicsSceneHoverEvent *event) { if (isSelected() || !isBackground()) { if (resizeArea().contains(event->pos())) { @@ -205,41 +207,13 @@ void ImageItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) } else { unsetCursor(); } - // TODO: Why not AstractItem::hoverMoveEvent() - QGraphicsItem::hoverMoveEvent(event); - } -} - -void ImageItem::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - if (isSelected() || !isBackground()) { - AbstractItem::mousePressEvent(event); - } else { - event->accept(); - } -} - -void ImageItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) -{ - if (isSelected() || !isBackground()) { - AbstractItem::mouseMoveEvent(event); - } else { - event->accept(); - } -} - -void ImageItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - if (isSelected() || !isBackground()) { - AbstractItem::mouseReleaseEvent(event); - } else { - event->accept(); } } void ImageItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { if (isBackground()) { + setEditable(true); setFlag(ItemIsSelectable); } AbstractItem::mousePressEvent(event); diff --git a/plugins/robots/common/twoDModel/src/engine/items/imageItem.h b/plugins/robots/common/twoDModel/src/engine/items/imageItem.h index bf380e89cd..954c7f0cb2 100644 --- a/plugins/robots/common/twoDModel/src/engine/items/imageItem.h +++ b/plugins/robots/common/twoDModel/src/engine/items/imageItem.h @@ -81,10 +81,7 @@ class ImageItem : public graphicsUtils::AbstractItem void internalImageChanged(); protected: - void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override; - void mousePressEvent(QGraphicsSceneMouseEvent *event) override; - void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override; - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; + void updateCursor(QGraphicsSceneHoverEvent *event) override; void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override; private: diff --git a/plugins/robots/common/twoDModel/src/engine/view/parts/robotItemPopup.cpp b/plugins/robots/common/twoDModel/src/engine/view/parts/robotItemPopup.cpp index 4c666fabf4..fac58c3933 100644 --- a/plugins/robots/common/twoDModel/src/engine/view/parts/robotItemPopup.cpp +++ b/plugins/robots/common/twoDModel/src/engine/view/parts/robotItemPopup.cpp @@ -58,9 +58,10 @@ bool RobotItemPopup::attachTo(const QList &items) void RobotItemPopup::initWidget() { QGridLayout * const layout = new QGridLayout(this); - layout->addWidget(initFollowButton(), 0, 0); + layout->addWidget(initFollowButton(), 0, 0, Qt::AlignCenter); layout->addWidget(initReturnButton(), 0, 1); - layout->addWidget(initSpinBox(), 1, 0, 1, 2); + layout->addWidget(initSpinBox(), 1, 0); + layout->addWidget(initSetStartButton(), 1, 1); updateDueToLayout(); } @@ -84,6 +85,13 @@ QWidget *RobotItemPopup::initReturnButton() return mReturnButton; } +QWidget *RobotItemPopup::initSetStartButton() +{ + mSetStartButton = initButton(":/icons/2d_target.png", tr("Move start position here")); + connect(mSetStartButton, &QAbstractButton::clicked, this, &RobotItemPopup::setRobotPositionClicked); + return mSetStartButton; +} + QAbstractButton *RobotItemPopup::initButton(const QString &icon, const QString &toolTip) { QPushButton * const result = new QPushButton(QIcon(icon), QString(), this); diff --git a/plugins/robots/common/twoDModel/src/engine/view/parts/robotItemPopup.h b/plugins/robots/common/twoDModel/src/engine/view/parts/robotItemPopup.h index ce72c4641d..6855cd9d1a 100644 --- a/plugins/robots/common/twoDModel/src/engine/view/parts/robotItemPopup.h +++ b/plugins/robots/common/twoDModel/src/engine/view/parts/robotItemPopup.h @@ -41,6 +41,9 @@ class RobotItemPopup : public graphicsUtils::ItemPopup /// Emitted when user clicked restore robot position button. void restoreRobotPositionClicked(); + /// Emitted when user clicked set robot position here button. + void setRobotPositionClicked(); + private: bool suits(QGraphicsItem *item) override; bool attachTo(QGraphicsItem *item) override; @@ -51,10 +54,12 @@ class RobotItemPopup : public graphicsUtils::ItemPopup QWidget *initReturnButton(); QAbstractButton *initButton(const QString &icon, const QString &toolTip); QWidget *initSpinBox(); + QWidget *initSetStartButton(); QAbstractButton *mFollowButton {}; // Takes ownership QAbstractButton *mReturnButton {}; // Takes ownership QSpinBox *mSpinBox {}; // Takes ownership + QAbstractButton *mSetStartButton {}; // Takes ownership RobotItem *mCurrentItem {}; // Does not take ownership }; diff --git a/plugins/robots/common/twoDModel/src/engine/view/scene/twoDModelScene.cpp b/plugins/robots/common/twoDModel/src/engine/view/scene/twoDModelScene.cpp index ad2ce6b57d..4974909d42 100644 --- a/plugins/robots/common/twoDModel/src/engine/view/scene/twoDModelScene.cpp +++ b/plugins/robots/common/twoDModel/src/engine/view/scene/twoDModelScene.cpp @@ -564,8 +564,9 @@ void TwoDModelScene::pasteItemsFromClipboard() mController->execute(command); for (auto &&id : newIds) { - findItem(id)->setSelected(true); - findItem(id)->setPos(findItem(id)->pos() + QPointF(20, 20)); + const auto & item = findItem(id); + item->setSelected(true); + item->moveBy(20, 20); findItem(id)->savePos(); } } diff --git a/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp b/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp index e5eccac7c2..04ab29f426 100644 --- a/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp +++ b/plugins/robots/common/twoDModel/src/engine/view/twoDModelWidget.cpp @@ -48,6 +48,7 @@ #include "src/engine/items/ellipseItem.h" #include "src/engine/items/stylusItem.h" #include "src/engine/items/imageItem.h" +#include "src/engine/items/startPosition.h" #include "src/engine/commands/changePropertyCommand.h" #include "src/engine/commands/loadWorldCommand.h" @@ -336,6 +337,7 @@ void TwoDModelWidget::connectUiButtons() , this, &TwoDModelWidget::onMultiselectionCursorActionTriggered); connect(mRobotItemPopup, &RobotItemPopup::restoreRobotPositionClicked, this, &TwoDModelWidget::returnToStartMarker); + connect(mRobotItemPopup, &RobotItemPopup::setRobotPositionClicked, this, &TwoDModelWidget::setStartMarker); connect(mUi->initialStateButton, &QAbstractButton::clicked, this, &TwoDModelWidget::returnToStartMarker); connect(mUi->toggleDetailsButton, &QAbstractButton::clicked, this, &TwoDModelWidget::toggleDetailsVisibility); @@ -401,6 +403,13 @@ void TwoDModelWidget::returnToStartMarker() saveWorldModelToRepo(); } +void TwoDModelWidget::setStartMarker() +{ + for (auto &&model : mModel.robotModels()) { + model->startPositionMarker()->setPos(model->robotCenter()); + model->startPositionMarker()->setRotation(mScene->robot(*model)->rotation()); + } +} void TwoDModelWidget::trainingModeChanged(bool enabled) { mUi->trainingModeButton->setToolTip(enabled diff --git a/plugins/robots/interpreters/interpreterCore/include/interpreterCore/interpreter/details/autoconfigurer.h b/plugins/robots/interpreters/interpreterCore/include/interpreterCore/interpreter/details/autoconfigurer.h index 0ac0db6039..17f14fd37d 100644 --- a/plugins/robots/interpreters/interpreterCore/include/interpreterCore/interpreter/details/autoconfigurer.h +++ b/plugins/robots/interpreters/interpreterCore/include/interpreterCore/interpreter/details/autoconfigurer.h @@ -15,7 +15,6 @@ #pragma once #include -#include #include #include "blocksTable.h" @@ -36,6 +35,7 @@ class Autoconfigurer : public kitBase::DevicesConfigurationProvider /// @param blocksTable - contains "code-behind" objects for blocks. /// @param errorReporter - error reporter to report errors to. Autoconfigurer(const qReal::GraphicalModelAssistInterface &graphicalModelApi + , const qReal::LogicalModelAssistInterface &logicalModelApi , BlocksTable &blocksTable , qReal::ErrorReporterInterface &errorReporter); @@ -46,6 +46,7 @@ class Autoconfigurer : public kitBase::DevicesConfigurationProvider private: const qReal::GraphicalModelAssistInterface &mGraphicalModelApi; + const qReal::LogicalModelAssistInterface &mLogicalModelApi; BlocksTable &mBlocksTable; qReal::ErrorReporterInterface &mErrorReporter; }; diff --git a/plugins/robots/interpreters/interpreterCore/src/interpreter/blockInterpreter.cpp b/plugins/robots/interpreters/interpreterCore/src/interpreter/blockInterpreter.cpp index 8f4fdaa338..198afa2d1e 100644 --- a/plugins/robots/interpreters/interpreterCore/src/interpreter/blockInterpreter.cpp +++ b/plugins/robots/interpreters/interpreterCore/src/interpreter/blockInterpreter.cpp @@ -48,7 +48,7 @@ BlockInterpreter::BlockInterpreter(const GraphicalModelAssistInterface &graphica , mState(idle) , mRobotModelManager(robotModelManager) , mBlocksTable(new details::BlocksTable(blocksFactoryManager, robotModelManager)) - , mAutoconfigurer(mGraphicalModelApi, *mBlocksTable, *mInterpretersInterface.errorReporter()) + , mAutoconfigurer(mGraphicalModelApi, mLogicalModelApi, *mBlocksTable, *mInterpretersInterface.errorReporter()) , mLanguageToolbox(languageToolbox) { // Other components may want to subscribe to allDevicesConfigured() signal because diff --git a/plugins/robots/interpreters/interpreterCore/src/interpreter/details/autoconfigurer.cpp b/plugins/robots/interpreters/interpreterCore/src/interpreter/details/autoconfigurer.cpp index 139ab1311d..917be49155 100644 --- a/plugins/robots/interpreters/interpreterCore/src/interpreter/details/autoconfigurer.cpp +++ b/plugins/robots/interpreters/interpreterCore/src/interpreter/details/autoconfigurer.cpp @@ -24,9 +24,11 @@ using namespace qReal; using namespace kitBase::robotModel; Autoconfigurer::Autoconfigurer(const GraphicalModelAssistInterface &graphicalModelApi + , const LogicalModelAssistInterface &logicalModelApi , BlocksTable &blocksTable , qReal::ErrorReporterInterface &errorReporter) : mGraphicalModelApi(graphicalModelApi) + , mLogicalModelApi(logicalModelApi) , mBlocksTable(blocksTable) , mErrorReporter(errorReporter) { @@ -48,13 +50,17 @@ bool Autoconfigurer::configure(QList const &diagrams, const QString & for (const PortInfo &port : usedDevices.keys()) { const DeviceInfo device = usedDevices[port]; const DeviceInfo existingDevice = currentConfiguration(robotId, port); - if (!existingDevice.isNull() && !existingDevice.isA(device)) { + if (existingDevice.isA(device)) { + // Do nothing + } else if (!mLogicalModelApi.mutableLogicalRepoApi() + .metaInformation("twoDModelSensorsReadOnly").toBool() && existingDevice.isNull()) { + mErrorReporter.addInformation(QObject::tr("%2 has been auto configured to "\ + "port %1").arg(port.name(), device.friendlyName()), child); + deviceConfigurationChanged(robotId, port, device, Reason::automaticConfiguration); + } else { mErrorReporter.addError(QObject::tr("Sensor on port %1 does not correspond to blocks "\ "on the diagram.").arg(port.name()), child); return false; - } else if (existingDevice.isNull()) { - /// @todo: Do it loudly, user must notice it - deviceConfigurationChanged(robotId, port, device, Reason::automaticConfiguration); } } } diff --git a/plugins/robots/interpreters/interpreterCore/src/ui/exerciseExportDialog.cpp b/plugins/robots/interpreters/interpreterCore/src/ui/exerciseExportDialog.cpp index cce6406806..1bb0bb2e91 100644 --- a/plugins/robots/interpreters/interpreterCore/src/ui/exerciseExportDialog.cpp +++ b/plugins/robots/interpreters/interpreterCore/src/ui/exerciseExportDialog.cpp @@ -30,11 +30,11 @@ ExerciseExportDialog::ExerciseExportDialog(QWidget *parent) setModal(true); setWindowTitle(tr("Select non-modifiable parts of exercize")); - mWorldReadOnlyCheckBox.reset(new QCheckBox(tr("2d model world is read only"))); - mSensorsReadOnlyCheckBox.reset(new QCheckBox(tr("Sensors are read only"))); - mRobotPositionReadOnlyCheckBox.reset(new QCheckBox(tr("2d model robot position is read only"))); - mRobotSetupReadOnlyCheckBox.reset(new QCheckBox(tr("Motors to wheels binding is read only"))); - mSimulationSettingsReadOnlyCheckBox.reset(new QCheckBox(tr("2d model simulation settings are read only"))); + mWorldReadOnlyCheckBox.reset(new QCheckBox(tr("2D model world is read-only"))); + mSensorsReadOnlyCheckBox.reset(new QCheckBox(tr("Sensors are read-only"))); + mRobotPositionReadOnlyCheckBox.reset(new QCheckBox(tr("2D model robot position is read-only"))); + mRobotSetupReadOnlyCheckBox.reset(new QCheckBox(tr("Motors to wheels binding is read-only"))); + mSimulationSettingsReadOnlyCheckBox.reset(new QCheckBox(tr("2D model simulation settings are read-only"))); mWorldReadOnlyCheckBox->setChecked(qReal::SettingsManager::value("worldReadOnlyDefault").toBool()); mSensorsReadOnlyCheckBox->setChecked(qReal::SettingsManager::value("sensorsReadOnlyDefault").toBool()); diff --git a/qrtranslations/fr/plugins/robots/interpreterCore_fr.ts b/qrtranslations/fr/plugins/robots/interpreterCore_fr.ts index a523632ffa..c0a2d2ee39 100644 --- a/qrtranslations/fr/plugins/robots/interpreterCore_fr.ts +++ b/qrtranslations/fr/plugins/robots/interpreterCore_fr.ts @@ -258,7 +258,12 @@ temps - + + %2 has been auto configured to port %1 + + + + Sensor on port %1 does not correspond to blocks on the diagram. @@ -436,28 +441,28 @@ - 2d model world is read only - Le monde 2D ne peut pas être modifié + 2D model world is read-only + Le monde 2D ne peut pas être modifié - Sensors are read only - La position et la configuration des capteurs ne peuvent pas être modifiées + Sensors are read-only + La position et la configuration des capteurs ne peuvent pas être modifiées - 2d model robot position is read only - La position du début ne peut pas être modifié en 2D + 2D model robot position is read-only + La position du début ne peut pas être modifié en 2D - Motors to wheels binding is read only - La correspondance des ports et des moteurs n'est pas modifiable + Motors to wheels binding is read-only + La correspondance des ports et des moteurs n'est pas modifiable - 2d model simulation settings are read only - La configuration de simulation du modèle 2d ne peut pas être modifiée + 2D model simulation settings are read-only + La configuration de simulation du modèle 2d ne peut pas être modifiée diff --git a/qrtranslations/fr/plugins/robots/twoDModel_fr.ts b/qrtranslations/fr/plugins/robots/twoDModel_fr.ts index a3a56c8e19..c80bb123b6 100644 --- a/qrtranslations/fr/plugins/robots/twoDModel_fr.ts +++ b/qrtranslations/fr/plugins/robots/twoDModel_fr.ts @@ -625,7 +625,7 @@ twoDModel::view::RobotItemPopup - + Camera folowing robot: %1 Suivre le robot : %1 @@ -644,6 +644,11 @@ Return robot to the initial position Retourner le robot à la position initiale + + + Move start position here + + Marker thickness @@ -661,7 +666,7 @@ twoDModel::view::TwoDModelScene - + Select images @@ -694,7 +699,7 @@ twoDModel::view::TwoDModelWidget - + Warning Attention @@ -712,7 +717,7 @@ Annuler - + Training mode: solution will not be checked diff --git a/qrtranslations/fr/qrutils_fr.ts b/qrtranslations/fr/qrutils_fr.ts index 4a1d47057a..1ee6809a51 100644 --- a/qrtranslations/fr/qrutils_fr.ts +++ b/qrtranslations/fr/qrutils_fr.ts @@ -88,7 +88,7 @@ Division entière par zéro - + Remove Supprimer diff --git a/qrtranslations/ru/plugins/robots/interpreterCore_ru.ts b/qrtranslations/ru/plugins/robots/interpreterCore_ru.ts index f381d741d2..823a1acd47 100644 --- a/qrtranslations/ru/plugins/robots/interpreterCore_ru.ts +++ b/qrtranslations/ru/plugins/robots/interpreterCore_ru.ts @@ -179,7 +179,12 @@ Файл сохранения TRIK Studio (*.qrs) - + + %2 has been auto configured to port %1 + %2 был автоматически сгонфигурирован на порту %1 + + + Sensor on port %1 does not correspond to blocks on the diagram. Выставленный на порту %1 сенсор не соответствует блокам на диаграмме. @@ -323,28 +328,28 @@ - 2d model world is read only - Двумерная модель неизменяема + 2D model world is read-only + Двумерная модель неизменяема - Sensors are read only - Положение и конфигурация сенсоров неизменяемы + Sensors are read-only + Положение и конфигурация сенсоров неизменяемы - 2d model robot position is read only - Начальное положение робота в двумерной модели неизменяемо + 2D model robot position is read-only + Начальное положение робота в двумерной модели неизменяемо - Motors to wheels binding is read only - Соответствие портов моторов и колёс неизменяемо + Motors to wheels binding is read-only + Соответствие портов моторов и колёс неизменяемо - 2d model simulation settings are read only - Настройки симуляции двумерной модели (физика, шумы и т.д.) неизменяемы + 2D model simulation settings are read-only + Настройки симуляции двумерной модели (физика, шумы и т.д.) неизменяемы diff --git a/qrtranslations/ru/plugins/robots/twoDModel_ru.ts b/qrtranslations/ru/plugins/robots/twoDModel_ru.ts index 8c4e82e454..4df7869abc 100644 --- a/qrtranslations/ru/plugins/robots/twoDModel_ru.ts +++ b/qrtranslations/ru/plugins/robots/twoDModel_ru.ts @@ -964,7 +964,7 @@ twoDModel::view::RobotItemPopup - + Camera folowing robot: %1 Следовать за роботом: %1 @@ -983,6 +983,11 @@ Return robot to the initial position Вернуть робота в исходное положение + + + Move start position here + Передвинуть стартовое положение робота сюда + Marker thickness @@ -1004,7 +1009,7 @@ Выберите картинку - + Select images Выберите картинки @@ -1037,7 +1042,7 @@ twoDModel::view::TwoDModelWidget - + Warning Предупреждение @@ -1055,7 +1060,7 @@ Отмена - + Training mode: solution will not be checked Режим тренировки: решение не будет проверяться diff --git a/qrtranslations/ru/qrutils_ru.ts b/qrtranslations/ru/qrutils_ru.ts index a6d60e9ce9..400fbf98d5 100644 --- a/qrtranslations/ru/qrutils_ru.ts +++ b/qrtranslations/ru/qrutils_ru.ts @@ -92,7 +92,7 @@ Целичисленное деление на ноль - + Remove Удалить diff --git a/qrutils/graphicsUtils/abstractItem.cpp b/qrutils/graphicsUtils/abstractItem.cpp index c437c56671..e1d5c0109f 100644 --- a/qrutils/graphicsUtils/abstractItem.cpp +++ b/qrutils/graphicsUtils/abstractItem.cpp @@ -501,13 +501,18 @@ void AbstractItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event) } void AbstractItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) +{ + updateCursor(event); + QGraphicsItem::hoverMoveEvent(event); +} + +void AbstractItem::updateCursor(QGraphicsSceneHoverEvent *event) { if (resizeArea().contains(event->pos())) { setCursor(mResizeCursor); } else { setCursor(mHoverCursor); } - QGraphicsItem::hoverMoveEvent(event); } void AbstractItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) diff --git a/qrutils/graphicsUtils/abstractItem.h b/qrutils/graphicsUtils/abstractItem.h index 487b5a341d..a92242f2a3 100644 --- a/qrutils/graphicsUtils/abstractItem.h +++ b/qrutils/graphicsUtils/abstractItem.h @@ -185,6 +185,7 @@ class QRUTILS_EXPORT AbstractItem : public QGraphicsObject void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override; void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override; + virtual void updateCursor(QGraphicsSceneHoverEvent *event); void copyTo(AbstractItem * const other) const; qreal alignedCoordinate(qreal coord, const int indexGrid) const; void setXYWithDragState(const QPointF pos);