KSaneCore
pagesizeoption.cpp
29 if (optionTopLeftX == nullptr || optionTopLeftY == nullptr || optionBottomRightX == nullptr || optionBottomRightY == nullptr) {
34 connect(optionTopLeftX, &BaseOption::valueChanged, this, &PageSizeOption::optionTopLeftXUpdated);
35 connect(optionTopLeftY, &BaseOption::valueChanged, this, &PageSizeOption::optionTopLeftYUpdated);
36 connect(optionBottomRightX, &BaseOption::valueChanged, this, &PageSizeOption::optionBottomRightXUpdated);
37 connect(optionBottomRightY, &BaseOption::valueChanged, this, &PageSizeOption::optionBottomRightYUpdated);
143 if (m_currentIndex > 0 && m_currentIndex < m_availableSizes.size() && m_optionTopLeftX->value().toDouble() != 0) {
151 if (m_currentIndex > 0 && m_currentIndex < m_availableSizes.size() && m_optionTopLeftY->value().toDouble() != 0) {
160 && !qFuzzyCompare(ensureMilliMeter(m_optionBottomRightX, m_optionBottomRightX->value().toDouble()),
161 (m_availableSizes.at(m_currentIndex).pageSize.width() + m_availableSizes.at(m_currentIndex).wiggleRoom.width()))) {
170 && !qFuzzyCompare(ensureMilliMeter(m_optionBottomRightY, m_optionBottomRightY->value().toDouble()),
171 (m_availableSizes.at(m_currentIndex).pageSize.height() + m_availableSizes.at(m_currentIndex).wiggleRoom.width()))) {
209 QSizeF currentSize = QSizeF(ensureMilliMeter(m_optionBottomRightX, m_optionBottomRightX->value().toDouble()),
228 /* some SANE backends set the maximum value of bottom right X and Y to the current page width and height values
229 * set current values of these option to maximum if available, such that we detect possible page sizes correctly
230 * see https://gitlab.com/sane-project/backends/-/issues/730 and https://bugs.kde.org/show_bug.cgi?id=476838 */
239 QPageSize::A3, QPageSize::A4, QPageSize::A5, QPageSize::A6, QPageSize::Letter, QPageSize::Legal, QPageSize::Tabloid,
240 QPageSize::B3, QPageSize::B4, QPageSize::B5, QPageSize::B6, QPageSize::C5E, QPageSize::Comm10E, QPageSize::DLE,
241 QPageSize::Executive, QPageSize::Folio, QPageSize::Ledger, QPageSize::JisB3, QPageSize::JisB4, QPageSize::JisB5, QPageSize::JisB6,
244 m_availableSizes.append({QPageSize::name(QPageSize::Custom), QPageSize::size(QPageSize::Custom, QPageSize::Millimeter), QSizeF(0, 0)});
246 double maxScannerWidth = ensureMilliMeter(m_optionBottomRightX, m_optionBottomRightX->maximumValue().toDouble());
247 double maxScannerHeight = ensureMilliMeter(m_optionBottomRightY, m_optionBottomRightY->maximumValue().toDouble());
259 {QPageSize::name(sizeCode), size, QSizeF(qMin(maxScannerWidth - size.width(), 0.0), qMin(maxScannerHeight - size.height(), 0.0))});
272 m_availableSizes.append({i18nc("Page size landscape", "Landscape %1", QPageSize::name(sizeCode)),
274 QSizeF(qMin(maxScannerWidth - size.width(), 0.0), qMin(maxScannerHeight - size.height(), 0.0))});
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
const_reference at(qsizetype i) const const
void clear()
void reserve(qsizetype size)
QString
Custom
Millimeter
QString name() const const
QString name(PageSizeId pageSizeId)
QSizeF size(PageSizeId pageSizeId, Unit units)
qreal height() const const
void transpose()
qreal width() const const
const QChar at(qsizetype position) const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
QString toString() const const
int userType() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 12:03:20 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri May 2 2025 12:03:20 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.