DrawSketchHandler: mechanism to update the cursor

This commit is contained in:
Abdullah Tahiri
2022-05-16 15:29:32 +02:00
parent f16c3f36a9
commit 2cf0c49955
2 changed files with 10 additions and 5 deletions

View File

@@ -54,7 +54,6 @@
#include "ViewProviderSketch.h"
#include "CommandConstraints.h"
using namespace SketcherGui;
using namespace Sketcher;
@@ -230,10 +229,7 @@ void DrawSketchHandler::activate(ViewProviderSketch * vp)
{
sketchgui = vp;
auto cursorstring = getCrosshairCursorString();
if(cursorstring != QString::fromLatin1("None"))
setCrosshairCursor(cursorstring);
updateCursor();
this->preActivated();
this->activated();
@@ -426,6 +422,14 @@ void DrawSketchHandler::addCursorTail( std::vector<QPixmap> &pixmaps ) {
}
}
void DrawSketchHandler::updateCursor()
{
auto cursorstring = getCrosshairCursorString();
if(cursorstring != QString::fromLatin1("None"))
setCrosshairCursor(cursorstring);
}
void DrawSketchHandler::applyCursor(void)
{
applyCursor(actCursor);

View File

@@ -162,6 +162,7 @@ protected:
void setSvgCursor(const QString &svgName, int x, int y,
const std::map<unsigned long, unsigned long>& colorMapping = std::map<unsigned long, unsigned long>());
void addCursorTail(std::vector<QPixmap> &pixmaps);
void updateCursor();
void unsetCursor(void);
void applyCursor(void);
void applyCursor(QCursor &newCursor);