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
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
8#include <QtCore/private/qohoslogger_p.h>
9
11
12QOhosPrinterSupport::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
26QOhosPrinterSupport::~QOhosPrinterSupport()
27{
29}
30
31QPrintEngine *QOhosPrinterSupport::createNativePrintEngine(QPrinter::PrinterMode printerMode, const QString &deviceId)
32{
33 auto __dbg = make_QCScopedDebug("QOhosPrinterSupport::createNativePrintEngine");
34 return new QOhosPdfPrintEngine(printerMode, deviceId);
35}
36
37QPaintEngine *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
44QPrintDevice QOhosPrinterSupport::createPrintDevice(const QString &id)
45{
46 auto __dbg = make_QCScopedDebug("QOhosPrinterSupport::createPrintDevice");
47 return QPlatformPrinterSupport::createPrintDevice(new QOhosPrintDevice(id));
48}
49
50QStringList QOhosPrinterSupport::availablePrintDeviceIds() const
51{
52 auto __dbg = make_QCScopedDebug("QOhosPrinterSupport::availablePrintDeviceIds");
53 return QOhosPrintDevice::availablePrintDeviceIds();
54}
55
56QString QOhosPrinterSupport::defaultPrintDeviceId() const
57{
58 auto __dbg = make_QCScopedDebug("QOhosPrinterSupport::defaultPrintDeviceId");
59 return QOhosPrintDevice::defaultPrintDeviceId();
60}
61
62QT_END_NAMESPACE
Combined button and popup list for selecting options.