Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwindowsprintersupport.cpp
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
// Qt-Security score:significant reason:default
4
5
#
include
"qwindowsprintersupport_p.h"
6
7
#
ifndef
QT_NO_PRINTER
8
9
#
include
"qwindowsprintdevice_p.h"
10
11
#
include
<
QtCore
/
QStringList
>
12
#
include
<
private
/
qprintengine_win_p
.
h
>
13
#
include
<
private
/
qprintdevice_p
.
h
>
14
15
#
define
QT_STATICPLUGIN
16
#
include
<
qpa
/
qplatformprintplugin
.
h
>
17
18
QT_BEGIN_NAMESPACE
19
20
using
namespace
Qt::StringLiterals;
21
22
QWindowsPrinterSupport::QWindowsPrinterSupport()
23
: QPlatformPrinterSupport()
24
{
25
}
26
27
QWindowsPrinterSupport::~QWindowsPrinterSupport()
28
{
29
}
30
31
QPrintEngine *QWindowsPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode,
const
QString &deviceId)
32
{
33
return
new
QWin32PrintEngine(printerMode, deviceId);
34
}
35
36
QPaintEngine *QWindowsPrinterSupport::createPaintEngine(QPrintEngine *engine, QPrinter::PrinterMode printerMode)
37
{
38
Q_UNUSED(printerMode);
39
return
static_cast
<QWin32PrintEngine *>(engine);
40
}
41
42
QPrintDevice QWindowsPrinterSupport::createPrintDevice(
const
QString &id)
43
{
44
return
QPlatformPrinterSupport::createPrintDevice(
new
QWindowsPrintDevice(id));
45
}
46
47
QStringList QWindowsPrinterSupport::availablePrintDeviceIds()
const
48
{
49
return
QWindowsPrintDevice::availablePrintDeviceIds();
50
}
51
52
QString QWindowsPrinterSupport::defaultPrintDeviceId()
const
53
{
54
return
QWindowsPrintDevice::defaultPrintDeviceId();
55
}
56
57
class
QWindowsPrinterSupportPlugin
:
public
QPlatformPrinterSupportPlugin
58
{
59
Q_OBJECT
60
Q_PLUGIN_METADATA(IID QPlatformPrinterSupportFactoryInterface_iid FILE
"windows.json"
)
61
62
public
:
63
QPlatformPrinterSupport
*
create
(
const
QString
&)
override
;
64
};
65
66
QPlatformPrinterSupport *
QWindowsPrinterSupportPlugin
::create(
const
QString &key)
67
{
68
if
(key.compare(key,
"windowsprintsupport"_L1
, Qt::CaseInsensitive) == 0)
69
return
new
QWindowsPrinterSupport;
70
return
nullptr
;
71
}
72
73
QT_END_NAMESPACE
74
75
#
include
"qwindowsprintersupport.moc"
76
77
#
endif
// QT_NO_PRINTER
QWindowsPrinterSupportPlugin
Definition
qwindowsprintersupport.cpp:58
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtbase
src
printsupport
platform
windows
qwindowsprintersupport.cpp
Generated on
for Qt by
1.14.0