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
qppdprintdevice.h
Go to the documentation of this file.
1// Copyright (C) 2014 John Layt <jlayt@kde.org>
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 QPPDPRINTDEVICE_H
5#define QPPDPRINTDEVICE_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 for the convenience
12// of internal files. This header file may change from version to version
13// without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qpa/qplatformprintdevice.h>
19
20#include <QtCore/qbytearray.h>
21#include <QtCore/qhash.h>
22#include <QtCore/qmargins.h>
23
24#include <cups/cups.h>
25#include <cups/ppd.h>
26
28
30{
31public:
32 explicit QPpdPrintDevice(const QString &id);
33 virtual ~QPpdPrintDevice();
34
35 bool isValid() const override;
36 bool isDefault() const override;
37
38 QPrint::DeviceState state() const override;
39
40 QPageSize defaultPageSize() const override;
41
43 int resolution) const override;
44
45 int defaultResolution() const override;
46
47 QPrint::InputSlot defaultInputSlot() const override;
48
49 QPrint::OutputBin defaultOutputBin() const override;
50
52
53 QPrint::ColorMode defaultColorMode() const override;
54
58
59protected:
60 void loadPageSizes() const override;
61 void loadResolutions() const override;
62 void loadInputSlots() const override;
63 void loadOutputBins() const override;
64 void loadDuplexModes() const override;
65 void loadColorModes() const override;
66#if QT_CONFIG(mimetype)
67 void loadMimeTypes() const override;
68#endif
69
70private:
71 QString printerOption(const QString &key) const;
72 cups_ptype_e printerTypeFlags() const;
73
74 cups_dest_t *m_cupsDest;
75 ppd_file_t *m_ppd;
76 QByteArray m_cupsName;
77 QByteArray m_cupsInstance;
78 QMarginsF m_customMargins;
79 mutable QHash<QString, QMarginsF> m_printableMargins;
80};
81
83
84#endif // QPPDPRINTDEVICE_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qmargins.h:270
Orientation
This enum type defines the page orientation.
Definition qpagelayout.h:33
\inmodule QtGui
Definition qpagesize.h:22
void loadResolutions() const override
QPrint::InputSlot defaultInputSlot() const override
int defaultResolution() const override
QMarginsF printableMargins(const QPageSize &pageSize, QPageLayout::Orientation orientation, int resolution) const override
QPrint::OutputBin defaultOutputBin() const override
void loadPageSizes() const override
QPageSize defaultPageSize() const override
bool isFeatureAvailable(QPrintDevice::PrintDevicePropertyKey key, const QVariant &params) const override
void loadInputSlots() const override
QPrint::DeviceState state() const override
void loadDuplexModes() const override
QPpdPrintDevice(const QString &id)
QPrint::ColorMode defaultColorMode() const override
void loadColorModes() const override
QPrint::DuplexMode defaultDuplexMode() const override
void loadOutputBins() const override
virtual ~QPpdPrintDevice()
bool isDefault() const override
bool isValid() const override
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
ColorMode
Definition qprint_p.h:72
DuplexMode
Definition qprint_p.h:64
DeviceState
Definition qprint_p.h:56
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint64 key
void ** params
const char property[13]
Definition qwizard.cpp:101
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)