Cześć mam problem z wyświetleniem okna informacji. Dodałem bibliotekę QMessageBox ale w miejscu wywołanie otrzymuję błąd informujący o braku dopasowanie funkcji wywołania. Może ktoś spotkał się z taką sytuacją.
#include "Bullet.h"
#include <QTimer>
#include <QGraphicsScene>
#include <QDebug>
#include <QGraphicsRectItem>
#include <QtMath>
#include <QMessageBox>
Bullet::Bullet(QGraphicsItem *parent): QObject(), QGraphicsPixmapItem(parent)
{
// draw graphics
setPixmap(QPixmap(":/img/pocisk.png"));
// connect
QTimer *timer = new QTimer();
connect(timer,SIGNAL(timeout()),this,SLOT(move()));
timer->start(10);
}
int Bullet::move(){
double a,b,c,p;
p=qFabs(angle)*30;
int yPosition;
if(player == "playerOne")
{
//right shot
p=1250-p;
a=1600/((-1400 + p)*(-1400 + p));
b=-((1600*(1400 + p))/((-1400 + p)*(-1400 + p)));
c=(700*(1960000 + 400*p + p*p))/((-1400 + p)*(-1400 + p));
yPosition =((a*x()*x()+b*x()+c));
setPos(x()-5,yPosition);
}
//left shot
else {
a=(1600/((100 + p)*(100+p)));
b=-((1600*(-100 + p))/((100 + p)*(100+p)));
c=((100*(70000 - 200*p + 7*p*p))/((100 + p)*(100+p)));
yPosition = ((a*x()*x()+b*x()+c));
setPos(x()+5,yPosition);
}
if(pos().y()>800)
{
scene()->removeItem(this);
delete this;
QMessageBox::information(this,"Gratulation","Win...");//error
return 1;
}
else
{
return 0;
}
}