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
qprinterinfo.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// Qt-Security score:significant reason:default
4
5#ifndef QPRINTERINFO_H
6#define QPRINTERINFO_H
7
8#include <QtPrintSupport/qtprintsupportglobal.h>
9#include <QtPrintSupport/qprinter.h>
10
11#include <QtCore/QList>
12#include <QtGui/qpagesize.h>
13
15
16
17#ifndef QT_NO_PRINTER
20class QDebug;
21class Q_PRINTSUPPORT_EXPORT QPrinterInfo
22{
23public:
24 QPrinterInfo();
25 QPrinterInfo(const QPrinterInfo &other);
26 explicit QPrinterInfo(const QPrinter &printer);
27 ~QPrinterInfo();
28
29 QPrinterInfo &operator=(const QPrinterInfo &other);
30
31 QString printerName() const;
32 QString description() const;
33 QString location() const;
34 QString makeAndModel() const;
35
36 bool isNull() const;
37 bool isDefault() const;
38 bool isRemote() const;
39
40 QPrinter::PrinterState state() const;
41
42 QList<QPageSize> supportedPageSizes() const;
43 QPageSize defaultPageSize() const;
44
45 bool supportsCustomPageSizes() const;
46
47 QPageSize minimumPhysicalPageSize() const;
48 QPageSize maximumPhysicalPageSize() const;
49
50 QList<int> supportedResolutions() const;
51
52 QPrinter::DuplexMode defaultDuplexMode() const;
53 QList<QPrinter::DuplexMode> supportedDuplexModes() const;
54
55 QPrinter::ColorMode defaultColorMode() const;
56 QList<QPrinter::ColorMode> supportedColorModes() const;
57
58 static QStringList availablePrinterNames();
59 static QList<QPrinterInfo> availablePrinters();
60
61 static QString defaultPrinterName();
62 static QPrinterInfo defaultPrinter();
63
64 static QPrinterInfo printerInfo(const QString &printerName);
65
66private:
67 explicit QPrinterInfo(const QString &name);
68
69private:
70 friend class QPlatformPrinterSupport;
71# ifndef QT_NO_DEBUG_STREAM
72 friend Q_PRINTSUPPORT_EXPORT QDebug operator<<(QDebug debug, const QPrinterInfo &);
73# endif
74 Q_DECLARE_PRIVATE(QPrinterInfo)
75 QScopedPointer<QPrinterInfoPrivate, QPrinterInfoPrivateDeleter> d_ptr;
76};
77
78#endif // QT_NO_PRINTER
79
80QT_END_NAMESPACE
81
82#endif // QPRINTERINFO_H
The QPrinterInfo class gives access to information about existing printers.
Q_GLOBAL_STATIC_WITH_ARGS(PermissionStatusHash, g_permissionStatusHash,({ { qMetaTypeId< QCameraPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QMicrophonePermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QBluetoothPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QContactsPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QCalendarPermission >(), Qt::PermissionStatus::Undetermined }, { qMetaTypeId< QLocationPermission >(), Qt::PermissionStatus::Undetermined } }))
static QPlatformPrinterSupport * printerSupport
static void cleanupPrinterSupport()
#define QPlatformPrinterSupportFactoryInterface_iid