You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crystal 1.0 strengthened checks on abstract def implementations, so the classes Qt::GraphicsSimpleTextItem, Qt::GraphicsPixmapItem, and Qt::GraphicsTextItem will fail there. The reason is that the corresponding C++ method declarations have different default values for the widget argument:
classQGraphicsItem
{
public:virtualvoidpaint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) = 0;
};
classQGraphicsPixmapItem : publicQGraphicsItem
{
public:// no default value for widgetvoidpaint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
};
// ditto for QGraphicsSimpleTextItem and QGraphicsTextItem
Other subclasses like Qt::GraphicsLineItem work because the default values match:
Without these redefinitions, those methods would take a plain widget : Widget argument, and Crystal will complain about missing implementations, e.g. Error: abstract `def Qt::GraphicsItem#paint(painter : Painter, option : ::Pointer(Binding::QStyleOptionGraphicsItem), widget : Widget | ::Nil = nil)` must be implemented by Qt::GraphicsSimpleTextItem.
The text was updated successfully, but these errors were encountered:
Crystal 1.0 strengthened checks on abstract def implementations, so the classes
Qt::GraphicsSimpleTextItem
,Qt::GraphicsPixmapItem
, andQt::GraphicsTextItem
will fail there. The reason is that the corresponding C++ method declarations have different default values for thewidget
argument:Other subclasses like
Qt::GraphicsLineItem
work because the default values match:For now the workaround is to redefine the offending methods whenever the module is included:
Without these redefinitions, those methods would take a plain
widget : Widget
argument, and Crystal will complain about missing implementations, e.g.Error: abstract `def Qt::GraphicsItem#paint(painter : Painter, option : ::Pointer(Binding::QStyleOptionGraphicsItem), widget : Widget | ::Nil = nil)` must be implemented by Qt::GraphicsSimpleTextItem
.The text was updated successfully, but these errors were encountered: