Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qprinter_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPRINTER_P_H
5#define QPRINTER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18
19#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
20
21#ifndef QT_NO_PRINTER
22
23#include "QtPrintSupport/qprinter.h"
24#include "QtPrintSupport/qprinterinfo.h"
25#include "QtPrintSupport/qprintengine.h"
26#include "QtCore/qpointer.h"
27#include "QtCore/qset.h"
28
29#include <limits.h>
30
32
33class QPrintEngine;
35class QPicture;
36
37class Q_PRINTSUPPORT_EXPORT QPrinterPrivate
38{
39 Q_DECLARE_PUBLIC(QPrinter)
40public:
42 : pdfVersion(QPrinter::PdfVersion_1_4),
43 printEngine(nullptr),
44 paintEngine(nullptr),
45 realPrintEngine(nullptr),
46 realPaintEngine(nullptr),
47#if QT_CONFIG(printpreviewwidget)
48 previewEngine(nullptr),
49#endif
50 q_ptr(printer),
51 printRange(QPrinter::AllPages),
52 use_default_engine(true),
53 validPrinter(false)
54 {
55 }
56
58
59 }
60
61 static QPrinterPrivate *get(QPrinter *printer) {
62 return printer->d_ptr.get();
63 }
64
65 void init(const QPrinterInfo &printer, QPrinter::PrinterMode mode);
66
67 QPrinterInfo findValidPrinter(const QPrinterInfo &printer = QPrinterInfo());
68 void initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
69 void changeEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
70#if QT_CONFIG(printpreviewwidget)
71 QList<const QPicture *> previewPages() const;
72 void setPreviewMode(bool);
73 bool previewMode() const;
74#endif
75
77
83
86#if QT_CONFIG(printpreviewwidget)
87 QPreviewPaintEngine *previewEngine;
88#endif
89
91
93
96
99
100 // Used to remember which properties have been manually set by the user.
101 QSet<QPrintEngine::PrintEnginePropertyKey> m_properties;
102};
103
105
106#endif // QT_NO_PRINTER
107
108#endif // QPRINTER_P_H
PdfVersion
The PdfVersion enum describes the version of the PDF file that is produced by QPrinter or QPdfWriter.
\inmodule QtGui
The QPicture class is a paint device that records and replays QPainter commands.
Definition qpicture.h:19
\reentrant
PrintEnginePropertyKey
This enum is used to communicate properties between the print engine and QPrinter.
The QPrinterInfo class gives access to information about existing printers.
uint use_default_engine
Definition qprinter_p.h:94
QPrinter * q_ptr
Definition qprinter_p.h:90
QPrinter::PdfVersion pdfVersion
Definition qprinter_p.h:80
QPrinter::OutputFormat outputFormat
Definition qprinter_p.h:79
uint had_default_engines
Definition qprinter_p.h:95
QPrinter::PrinterMode printerMode
Definition qprinter_p.h:78
QSet< QPrintEngine::PrintEnginePropertyKey > m_properties
Definition qprinter_p.h:101
QPrintEngine * printEngine
Definition qprinter_p.h:81
QPaintEngine * realPaintEngine
Definition qprinter_p.h:85
QPaintEngine * paintEngine
Definition qprinter_p.h:82
QPrintEngine * realPrintEngine
Definition qprinter_p.h:84
QPrinterPrivate(QPrinter *printer)
Definition qprinter_p.h:41
static QPrinterPrivate * get(QPrinter *printer)
Definition qprinter_p.h:61
uint hasCustomPageMargins
Definition qprinter_p.h:98
QPrinter::PrintRange printRange
Definition qprinter_p.h:92
\reentrant
Definition qprinter.h:28
OutputFormat
The OutputFormat enum is used to describe the format QPrinter should use for printing.
Definition qprinter.h:69
PrinterMode
This enum describes the mode the printer should work in.
Definition qprinter.h:31
PrintRange
Used to specify the print range selection option.
Definition qprinter.h:72
T * get() const noexcept
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum mode
GLuint64 key
GLint GLsizei GLsizei GLenum format
#define QT_CONFIG(feature)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
unsigned int uint
Definition qtypes.h:34
if(qFloatDistance(a, b)<(1<< 7))
[0]
QObject::connect nullptr
args<< 1<< 2;QJSValue threeAgain=fun.call(args);QString fileName="helloworld.qs";QFile scriptFile(fileName);if(!scriptFile.open(QIODevice::ReadOnly)) QTextStream stream(&scriptFile);QString contents=stream.readAll();scriptFile.close();myEngine.evaluate(contents, fileName);myEngine.globalObject().setProperty("myNumber", 123);...QJSValue myNumberPlusOne=myEngine.evaluate("myNumber + 1");QJSValue result=myEngine.evaluate(...);if(result.isError()) qDebug()<< "Uncaught exception at line"<< result.property("lineNumber").toInt()<< ":"<< result.toString();QPushButton *button=new QPushButton;QJSValue scriptButton=myEngine.newQObject(button);myEngine.globalObject().setProperty("button", scriptButton);myEngine.evaluate("button.checkable = true");qDebug()<< scriptButton.property("checkable").toBool();scriptButton.property("show").call();QJSEngine engine;QObject *myQObject=new QObject();myQObject- setProperty)("dynamicProperty", 3)