Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qohosprintersupport.cpp
Go to the documentation of this file.
1
// Copyright (C) 2025 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
#
include
"qohosnativeprint.h"
5
#
include
"qohospdfprintengine.h"
6
#
include
"qohosprintdevice.h"
7
#
include
"qohosprintersupport.h"
8
#
include
<
QtCore
/
private
/
qohoslogger_p
.
h
>
9
10
QT_BEGIN_NAMESPACE
11
12
QOhosPrinterSupport::QOhosPrinterSupport()
13
: QPlatformPrinterSupport()
14
{
15
qOhosDebug(QtForOhos) <<
"Creating OHOS print support plugin"
;
16
if
(!QOhosNativePrint::initializePrintService()) {
17
qOhosCritical(QtForOhos)
18
<<
"Failed to initialize native Print Service during OHOS print support plugin initialization"
;
19
}
20
if
(!QOhosNativePrint::launchPrinterManager()) {
21
qOhosCritical(QtForOhos)
22
<<
"Failed to launch Printer Manager during OHOS print support plugin initialization"
;
23
}
24
}
25
26
QOhosPrinterSupport::~QOhosPrinterSupport()
27
{
28
QOhosNativePrint
::
releasePrintService
(
)
;
29
}
30
31
QPrintEngine *QOhosPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode,
const
QString &deviceId)
32
{
33
auto
__dbg = make_QCScopedDebug(
"QOhosPrinterSupport::createNativePrintEngine"
);
34
return
new
QOhosPdfPrintEngine
(printerMode, deviceId);
35
}
36
37
QPaintEngine *QOhosPrinterSupport::createPaintEngine(QPrintEngine *engine, QPrinter::PrinterMode printerMode)
38
{
39
Q_UNUSED(printerMode)
40
auto
__dbg = make_QCScopedDebug(
"QOhosPrinterSupport::createPaintEngine"
);
41
return
static_cast
<
QOhosPdfPrintEngine
*>(engine);
42
}
43
44
QPrintDevice QOhosPrinterSupport::createPrintDevice(
const
QString &id)
45
{
46
auto
__dbg = make_QCScopedDebug(
"QOhosPrinterSupport::createPrintDevice"
);
47
return
QPlatformPrinterSupport::createPrintDevice(
new
QOhosPrintDevice(id));
48
}
49
50
QStringList QOhosPrinterSupport::availablePrintDeviceIds()
const
51
{
52
auto
__dbg = make_QCScopedDebug(
"QOhosPrinterSupport::availablePrintDeviceIds"
);
53
return
QOhosPrintDevice::availablePrintDeviceIds();
54
}
55
56
QString QOhosPrinterSupport::defaultPrintDeviceId()
const
57
{
58
auto
__dbg = make_QCScopedDebug(
"QOhosPrinterSupport::defaultPrintDeviceId"
);
59
return
QOhosPrintDevice::defaultPrintDeviceId();
60
}
61
62
QT_END_NAMESPACE
QOhosPdfPrintEngine
Definition
qohospdfprintengine.h:22
QOhosNativePrint
Definition
qohosnativeprint.cpp:14
QOhosNativePrint::releasePrintService
bool releasePrintService()
Definition
qohosnativeprint.cpp:239
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
plugins
printsupport
ohos
qohosprintersupport.cpp
Generated on
for Qt by
1.18.0