Fixed issue #497. Printed document size as info.
--HG-- branch : develop
This commit is contained in:
parent
8a02129e24
commit
d57cddd84b
|
@ -62,7 +62,13 @@ MainWindowsNoGUI::MainWindowsNoGUI(QWidget *parent)
|
||||||
shadows(QList<QGraphicsItem *>()), scenes(QList<QGraphicsScene *>()), details(QList<QList<QGraphicsItem *> >()),
|
shadows(QList<QGraphicsItem *>()), scenes(QList<QGraphicsScene *>()), details(QList<QList<QGraphicsItem *> >()),
|
||||||
undoAction(nullptr), redoAction(nullptr), actionDockWidgetToolOptions(nullptr), actionDockWidgetGroups(nullptr),
|
undoAction(nullptr), redoAction(nullptr), actionDockWidgetToolOptions(nullptr), actionDockWidgetGroups(nullptr),
|
||||||
curFile(QString()),
|
curFile(QString()),
|
||||||
isLayoutStale(true), margins(), paperSize(), isTiled(false)
|
isLayoutStale(true),
|
||||||
|
margins(),
|
||||||
|
paperSize(),
|
||||||
|
isTiled(false),
|
||||||
|
isAutoCrop(false),
|
||||||
|
isUnitePages(false)
|
||||||
|
|
||||||
{
|
{
|
||||||
InitTempLayoutScene();
|
InitTempLayoutScene();
|
||||||
}
|
}
|
||||||
|
@ -130,6 +136,8 @@ bool MainWindowsNoGUI::LayoutSettings(VLayoutGenerator& lGenerator)
|
||||||
PrepareSceneList();
|
PrepareSceneList();
|
||||||
margins = lGenerator.GetFields();
|
margins = lGenerator.GetFields();
|
||||||
paperSize = QSizeF(lGenerator.GetPaperWidth(), lGenerator.GetPaperHeight());
|
paperSize = QSizeF(lGenerator.GetPaperWidth(), lGenerator.GetPaperHeight());
|
||||||
|
isAutoCrop = lGenerator.GetAutoCrop();
|
||||||
|
isUnitePages = lGenerator.IsUnitePages();
|
||||||
isLayoutStale = false;
|
isLayoutStale = false;
|
||||||
if (VApplication::IsGUIMode())
|
if (VApplication::IsGUIMode())
|
||||||
{
|
{
|
||||||
|
@ -913,7 +921,16 @@ void MainWindowsNoGUI::SetPrinterSettings(QPrinter *printer, const PrintType &pr
|
||||||
|
|
||||||
if (not isTiled)
|
if (not isTiled)
|
||||||
{
|
{
|
||||||
const QSizeF size = QSizeF(FromPixel(paperSize.width(), Unit::Mm), FromPixel(paperSize.height(), Unit::Mm));
|
QSizeF size = QSizeF(FromPixel(paperSize.width(), Unit::Mm), FromPixel(paperSize.height(), Unit::Mm));
|
||||||
|
if (isAutoCrop || isUnitePages)
|
||||||
|
{
|
||||||
|
auto *paper = qgraphicsitem_cast<QGraphicsRectItem *>(papers.at(0));
|
||||||
|
if (paper)
|
||||||
|
{
|
||||||
|
size = QSizeF(FromPixel(paperSize.width(), Unit::Mm), FromPixel(paper->rect().height(), Unit::Mm));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const QPrinter::PageSize pSZ = FindTemplate(size);
|
const QPrinter::PageSize pSZ = FindTemplate(size);
|
||||||
if (pSZ == QPrinter::Custom)
|
if (pSZ == QPrinter::Custom)
|
||||||
{
|
{
|
||||||
|
|
|
@ -103,6 +103,8 @@ private:
|
||||||
Q_DISABLE_COPY(MainWindowsNoGUI)
|
Q_DISABLE_COPY(MainWindowsNoGUI)
|
||||||
|
|
||||||
bool isTiled;
|
bool isTiled;
|
||||||
|
bool isAutoCrop;
|
||||||
|
bool isUnitePages;
|
||||||
|
|
||||||
void CreateShadows();
|
void CreateShadows();
|
||||||
void CreateScenes();
|
void CreateScenes();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user