#include "widget.h"
#include "./ui_widget.h"
#include <QGraphicsScene>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    auto scene = new QGraphicsScene(this);
    ui->territory->setScene(scene);
    circle = new QGraphicsEllipseItem(0,0,20,20);
    scene->addItem(circle);
    connect(ui->p2Slider_x,&QSlider::valueChanged, this, &Widget::newXPosition);
    connect(ui->p2Slider_y,&QSlider::valueChanged, this, &Widget::newYPosition);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::newXPosition(int x){
    circle->setX(x);
}
void Widget::newYPosition(int y){
    circle->setY(y);
}
