Цитата
Error 1 error C2662: 'GraphicDisplay::movingPoint' : cannot convert 'this' pointer from 'const GraphicDisplay' to 'GraphicDisplay &'
class GraphicDisplay : public QDialog, public Ui::GraphicDisplayClass
{
Q_OBJECT
// ........................
signals:
void movingPoint(const QPoint&);
};
/// Добавление нового визира
void GraphicDisplay::appendViewfinder(QFrame::Shape current_shape)
{
VFFrame* finder(new VFFrame(paramsDisplay, current_shape));
finder -> setGraphicDisplay(this);
viewfinderList.append(finder);
viewfinderList.last() -> show();
}
/// Проверка на попадание фокуса на визир
bool GraphicDisplay::isViewfinder(const QPoint& pos) const
{
foreach(VFFrame* pf, viewfinderList)
if(pf -> isViewfinder())
{
emit movingPoint(pos);
return true;
}
return false;
}
class VFFrame: public QFrame
{
Q_OBJECT
private:
GraphicDisplay* _graph; ///< указатель на окно графика
private slots:
void setMovePoint(const QPoint& pnt) { _move_point = pnt; }
public:
void setGraphicDisplay(GraphicDisplay* pGr) { _graph = pGr; }
};
VFFrame::VFFrame(QWidget *parent, const Shape shape): QFrame(parent), _vf_shape(shape), _is_left_pressed(false), _is_viewfinder(false), _move_point(QPoint(0, 0)), _graph(0)
{
connect(_graph, SIGNAL(movingPoint(const QPoint&)), SLOT(setMovePoint(const QPoint&)));
}
Сможете подсказать, как поправить?