Hello everybody
i'll explain my problem:
i make 2 sliders which give a position in function of 2 axes
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this);
...
ui->horizontalSlider->setRange(0,431);
ui->verticalSlider->setRange(0,401);
connect(ui->horizontalSlider, SIGNAL(valueChanged(int)),ui->lcdNumber, SLOT(display(int)));
connect(ui->verticalSlider, SIGNAL(valueChanged(int)),ui->lcdNumber_2, SLOT(display(int)));
i connect them to LCD to check values.
for the screen, for the moment i just have that in an another file :
Screen2DGL::Screen2DGL(){
background = QBrush(QColor(Qt::black));
}
void Screen2DGL:aint(QPainter *painter, QPaintEvent *event){
painter->fillRect(event->rect(), background);
painter->setPen(Qt::white);
painter->drawPoint(200,200);
}
i would like to print a point with the coordinates gaven by the sliders instead of "200, 200" on a 2D screen...
How can i do?
Bookmarks