Add View::setCursor()
This commit is contained in:
@@ -172,6 +172,7 @@ public:
|
||||
virtual QScreen *screen() const = 0;
|
||||
virtual void setFocus(Qt::FocusReason) = 0;
|
||||
virtual void setWindowOpacity(double) = 0;
|
||||
virtual void setCursor(Qt::CursorShape) = 0;
|
||||
|
||||
// TODOv2: Check if these two should be in the controller or on view
|
||||
virtual void onLayoutRequest()
|
||||
|
||||
@@ -196,3 +196,8 @@ void ViewWrapper::render(QPainter *)
|
||||
{
|
||||
qFatal("Not implemented");
|
||||
}
|
||||
|
||||
void ViewWrapper::setCursor(Qt::CursorShape)
|
||||
{
|
||||
qFatal("Not implemented");
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
void setWindowOpacity(double) override;
|
||||
void releaseKeyboard() override;
|
||||
void render(QPainter *p) override;
|
||||
void setCursor(Qt::CursorShape) override;
|
||||
|
||||
/// TODOv2: Remove
|
||||
virtual DropArea *asDropArea() const
|
||||
|
||||
@@ -465,7 +465,7 @@ void WidgetResizeHandler::updateCursor(CursorPosition m)
|
||||
void WidgetResizeHandler::setMouseCursor(Qt::CursorShape cursor)
|
||||
{
|
||||
if (m_isTopLevelWindowResizer)
|
||||
mTarget->asQWidget()->setCursor(cursor);
|
||||
mTarget->setCursor(cursor);
|
||||
else
|
||||
qApp->setOverrideCursor(cursor);
|
||||
}
|
||||
@@ -473,7 +473,7 @@ void WidgetResizeHandler::setMouseCursor(Qt::CursorShape cursor)
|
||||
void WidgetResizeHandler::restoreMouseCursor()
|
||||
{
|
||||
if (m_isTopLevelWindowResizer)
|
||||
mTarget->asQWidget()->setCursor(Qt::ArrowCursor);
|
||||
mTarget->setCursor(Qt::ArrowCursor);
|
||||
else
|
||||
qApp->restoreOverrideCursor();
|
||||
}
|
||||
|
||||
@@ -332,6 +332,11 @@ public:
|
||||
qWarning() << Q_FUNC_INFO << "Implement me";
|
||||
}
|
||||
|
||||
void setCursor(Qt::CursorShape shape) override
|
||||
{
|
||||
QQuickItem::setCursor(shape);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool event(QEvent *e) override
|
||||
{
|
||||
|
||||
@@ -250,6 +250,11 @@ public:
|
||||
Base::render(p);
|
||||
}
|
||||
|
||||
void setCursor(Qt::CursorShape shape) override
|
||||
{
|
||||
QWidget::setCursor(shape);
|
||||
}
|
||||
|
||||
virtual QSize parentSize() const override
|
||||
{
|
||||
if (auto p = QWidget::parentWidget())
|
||||
|
||||
Reference in New Issue
Block a user