L
linuxping
Unregistered / Unconfirmed
GUEST, unregistred user!
比如,自己定义了C++类:
#ifndef PROXYWIDGET_H
#define PROXYWIDGET_H
#include <QGraphicsProxyWidget.h>
#include <QTimeLine.h>
class ProxyWidget : public QGraphicsProxyWidget
{
Q_OBJECT
public:
ProxyWidget(QGraphicsItem *parent, Qt::WindowFlags wFlags=0);
virtual ~ProxyWidget();
QRectF boundingRect() const;
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
private slots:
void updateStep(qreal step);
void stateChanged(QTimeLine::state);
void zoomIn();
void zoomOut();
private:
QTimeLine *timeLine;
bool popupShown;
};
#endif // PROXYWIDGET_H
然后写一个dll:
ProxyWidget getProxyWidget (QGraphicsItem *parent{
return new ProxyWidget (parent);
}
delphi如何调用这个函数,如何获得这个对象,如何使用这个对象?
#ifndef PROXYWIDGET_H
#define PROXYWIDGET_H
#include <QGraphicsProxyWidget.h>
#include <QTimeLine.h>
class ProxyWidget : public QGraphicsProxyWidget
{
Q_OBJECT
public:
ProxyWidget(QGraphicsItem *parent, Qt::WindowFlags wFlags=0);
virtual ~ProxyWidget();
QRectF boundingRect() const;
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
private slots:
void updateStep(qreal step);
void stateChanged(QTimeLine::state);
void zoomIn();
void zoomOut();
private:
QTimeLine *timeLine;
bool popupShown;
};
#endif // PROXYWIDGET_H
然后写一个dll:
ProxyWidget getProxyWidget (QGraphicsItem *parent{
return new ProxyWidget (parent);
}
delphi如何调用这个函数,如何获得这个对象,如何使用这个对象?