Answer the question
In order to leave comments, you need to log in
Why doesn't QGraphicView work correctly?
Form constructor:
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
scene = new QGraphicsScene;
draw();
}
void Widget::draw()
{
ui->graphicsView->setScene(scene);
scene->clear();
scene->addRect(startX,carcassStartY,
maxX*scale,carcassMaxY*scale,
QPen(Qt::red, 0),QBrush(Qt::red));
}
void Widget::on_horizontalSlider_sliderMoved(int position)
{
scale = position;
draw();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question