K
K
Kirill H2017-01-31 19:18:02
Qt
Kirill H, 2017-01-31 19:18:02

How to remove background offset?

There is an image of a background, the size of which matches the size of the window, it is necessary that it be centered, but for some reason it is drawn with a shift to the left and up by half its own length. That is, instead of getting up in size, the window is filled with four copies of it with an offset. How to fix it?

QGraphicsScene scene;
QGraphicsView view(&scene);
view->setBackgroundBrush(QPixmap(":/images/bg.jpg"));

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2017-01-31
@KirillHelm

www.qtcentre.org/threads/63818-Qt-QGraphicsView-Ba...

V
Vlad, 2017-02-01
@Result007

Can manually set the position to (0;0) ? If the parent is the main window of course.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question