Topic: QGraphicsView + QGraphicsScene + QPixmap + QPrinter
Already there is also it invariably: resizable dialogue with QGraphicsView on it and button "Press", on Qt 4.8.2. For QGraphicsView a basis of the deduced information is created QGraphicsScene. On this scene (scene _) it is superimposed as a substrate for all - one QPixmap. And further are added in proper places (NB! Without coming for boundaries QPixmap!!!) Also QGraphicsTextItem'. Further on button click the Press we cause dialogue of a choice of the printer, we receive the printer (printer _) and further in it all scene: QPainter painter; painter.begin (printer _); scene_. render (&painter); painter.end (); like as in essence all works, but... That it is necessary to attach and correct, i.e. - AS it is necessary that it looked and worked: QGraphicsView initially at discovery of all dialogue should be in the sizes sheet 5 on dialogue center. In other words a copy of the upper half of the sheet A4 taken in book orientation. It is no more and not less. Exactly and a point. I.e. if to open dialogue, to take a sheet A4, to cut off on top a half from it and to put to the screen - that the sizes of white cloth QGraphicsView on dialogue and this half of sheet should coincide. Scroll bars should appear only if dialogue so that the sizes of white cloth QGraphicsView become less than this half of a sheet A4. QPixmap loads in itself a picture which attributes set its sizes NOT LESS than this half of a sheet A4. BUT can and to be such that the picture becomes more. For example, it is a situation when the picture is taken from the scanner working at 600/800dpi. Then even small, apparently, the picture at the press 1:1 quits more than we would expect to see. Thereby at loading in QGraphicsScene it QPixmap it is necessary to guarantee that it will be pressed, if it is necessary, and fills exactly all surface sew QGraphicsView which sizes, I remind - are equal to sheet 5. The start picture was is taken in sizes 794px*560px (dpi=96) that guarantees display in 1:1 for sheet 5 on our old monitors. BUT the most part of the necessary pictures go from the scanner working at 600/800dpi. I.e. it is more than pixels, the sizes more. It is necessary to press. Proportions of pictures are equal to proportions of sheet 5. On printer QGraphicsScene should leave as - considering that it is the upper half of a sheet A4. I.e. it is necessary as that to adjust the upper output area on the press. And before the press dialogue of print preview of the press should open. Well and a global question - AS it ? What functions, working methods in Qt help to reach the required purpose?