I draw a number of lines with certain shapes on the GraphicsView. I need to reduce and increase the entire scene, but at the same time it is necessary to leave the line thickness unchanged. When I do as in this example on the line, the line becomes almost invisible. It must be always the same thickness. Maybe someone will tell or direct on the correct solution of this problem?
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), scene_(new QGraphicsScene()) { ui->setupUi(this); ui->graphicsView->setScene(scene_); scene_->addLine(0, 0, 300, 100); ui->graphicsView->scale(0.1, 0.1); }
addLinemany times, the performance will be very bad. It is better to draw throughQPainerPath/QPolygon- Bearded Beaver