QPrinterInfo: Remove deprecated methods
Change-Id: I5089bc23308a4348dc21122dfa000d5ca6e3938d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
311d7a609c
commit
fcc25b11bb
@ -313,51 +313,6 @@ QPageSize QPrinterInfo::maximumPhysicalPageSize() const
|
|||||||
return QPageSize(d->m_printDevice.maximumPhysicalPageSize(), QString(), QPageSize::ExactMatch);
|
return QPageSize(d->m_printDevice.maximumPhysicalPageSize(), QString(), QPageSize::ExactMatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(5,3)
|
|
||||||
/*!
|
|
||||||
\obsolete Use supportedPageSizes() instead.
|
|
||||||
|
|
||||||
Returns a list of supported paper sizes by the printer.
|
|
||||||
|
|
||||||
Not all printer drivers support this query, so the list may be empty.
|
|
||||||
|
|
||||||
\since 4.4
|
|
||||||
*/
|
|
||||||
|
|
||||||
QList<QPrinter::PaperSize> QPrinterInfo::supportedPaperSizes() const
|
|
||||||
{
|
|
||||||
Q_D(const QPrinterInfo);
|
|
||||||
QList<QPrinter::PaperSize> list;
|
|
||||||
const QList<QPageSize> supportedPageSizes = d->m_printDevice.supportedPageSizes();
|
|
||||||
list.reserve(supportedPageSizes.size());
|
|
||||||
for (const QPageSize &pageSize : supportedPageSizes)
|
|
||||||
list.append(QPrinter::PaperSize(pageSize.id()));
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\obsolete Use supportedPageSizes() instead.
|
|
||||||
|
|
||||||
Returns a list of all the paper names supported by the driver with the
|
|
||||||
corresponding size in millimeters.
|
|
||||||
|
|
||||||
Not all printer drivers support this query, so the list may be empty.
|
|
||||||
|
|
||||||
\since 5.1
|
|
||||||
*/
|
|
||||||
|
|
||||||
QList<QPair<QString, QSizeF> > QPrinterInfo::supportedSizesWithNames() const
|
|
||||||
{
|
|
||||||
Q_D(const QPrinterInfo);
|
|
||||||
QList<QPair<QString, QSizeF> > list;
|
|
||||||
const QList<QPageSize> supportedPageSizes = d->m_printDevice.supportedPageSizes();
|
|
||||||
list.reserve(supportedPageSizes.size());
|
|
||||||
for (const QPageSize &pageSize : supportedPageSizes)
|
|
||||||
list.append(qMakePair(pageSize.name(), pageSize.size(QPageSize::Millimeter)));
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
#endif // QT_DEPRECATED_SINCE(5,3)
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns a list of resolutions supported by this printer.
|
Returns a list of resolutions supported by this printer.
|
||||||
|
|
||||||
|
@ -83,11 +83,6 @@ public:
|
|||||||
QPageSize minimumPhysicalPageSize() const;
|
QPageSize minimumPhysicalPageSize() const;
|
||||||
QPageSize maximumPhysicalPageSize() const;
|
QPageSize maximumPhysicalPageSize() const;
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(5,3)
|
|
||||||
QT_DEPRECATED QList<QPrinter::PaperSize> supportedPaperSizes() const;
|
|
||||||
QT_DEPRECATED QList<QPair<QString, QSizeF> > supportedSizesWithNames() const;
|
|
||||||
#endif // QT_DEPRECATED_SINCE(5,3)
|
|
||||||
|
|
||||||
QList<int> supportedResolutions() const;
|
QList<int> supportedResolutions() const;
|
||||||
|
|
||||||
QPrinter::DuplexMode defaultDuplexMode() const;
|
QPrinter::DuplexMode defaultDuplexMode() const;
|
||||||
|
@ -302,12 +302,6 @@ void tst_QPrinterInfo::testConstructors()
|
|||||||
QCOMPARE(copy1.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize());
|
QCOMPARE(copy1.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize());
|
||||||
QCOMPARE(copy1.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize());
|
QCOMPARE(copy1.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize());
|
||||||
QCOMPARE(copy1.supportedPageSizes(), printers.at(i).supportedPageSizes());
|
QCOMPARE(copy1.supportedPageSizes(), printers.at(i).supportedPageSizes());
|
||||||
#if QT_DEPRECATED_SINCE(5, 3)
|
|
||||||
QT_WARNING_PUSH
|
|
||||||
QT_WARNING_DISABLE_DEPRECATED
|
|
||||||
QCOMPARE(copy1.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames());
|
|
||||||
QT_WARNING_POP
|
|
||||||
#endif
|
|
||||||
QCOMPARE(copy1.supportedResolutions(), printers.at(i).supportedResolutions());
|
QCOMPARE(copy1.supportedResolutions(), printers.at(i).supportedResolutions());
|
||||||
QCOMPARE(copy1.defaultDuplexMode(), printers.at(i).defaultDuplexMode());
|
QCOMPARE(copy1.defaultDuplexMode(), printers.at(i).defaultDuplexMode());
|
||||||
QCOMPARE(copy1.supportedDuplexModes(), printers.at(i).supportedDuplexModes());
|
QCOMPARE(copy1.supportedDuplexModes(), printers.at(i).supportedDuplexModes());
|
||||||
@ -328,12 +322,6 @@ QT_WARNING_POP
|
|||||||
QCOMPARE(copy2.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize());
|
QCOMPARE(copy2.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize());
|
||||||
QCOMPARE(copy2.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize());
|
QCOMPARE(copy2.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize());
|
||||||
QCOMPARE(copy2.supportedPageSizes(), printers.at(i).supportedPageSizes());
|
QCOMPARE(copy2.supportedPageSizes(), printers.at(i).supportedPageSizes());
|
||||||
#if QT_DEPRECATED_SINCE(5, 3)
|
|
||||||
QT_WARNING_PUSH
|
|
||||||
QT_WARNING_DISABLE_DEPRECATED
|
|
||||||
QCOMPARE(copy2.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames());
|
|
||||||
QT_WARNING_POP
|
|
||||||
#endif
|
|
||||||
QCOMPARE(copy2.supportedResolutions(), printers.at(i).supportedResolutions());
|
QCOMPARE(copy2.supportedResolutions(), printers.at(i).supportedResolutions());
|
||||||
QCOMPARE(copy2.defaultDuplexMode(), printers.at(i).defaultDuplexMode());
|
QCOMPARE(copy2.defaultDuplexMode(), printers.at(i).defaultDuplexMode());
|
||||||
QCOMPARE(copy2.supportedDuplexModes(), printers.at(i).supportedDuplexModes());
|
QCOMPARE(copy2.supportedDuplexModes(), printers.at(i).supportedDuplexModes());
|
||||||
|
Loading…
Reference in New Issue
Block a user