8#include "stringoption.h"
10#include <QVarLengthArray>
12#include <ksanecore_debug.h>
17StringOption::StringOption(
const SANE_Handle handle,
const int index)
18 : BaseOption(handle, index)
20 m_optionType = Option::TypeString;
23bool StringOption::setValue(
const QVariant &val)
25 if (state() == Option::StateHidden) {
30#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
33 tmp += text.leftRef(m_optDesc->size);
37 Q_EMIT valueChanged(tmp);
42void StringOption::readValue()
44 if (state() == Option::StateHidden) {
52 status = sane_control_option(m_handle, m_index, SANE_ACTION_GET_VALUE, data.data(), &res);
53 if (
status != SANE_STATUS_GOOD) {
59 Q_EMIT valueChanged(m_string);
67int StringOption::valueSize()
const
69 return static_cast<int>(m_optDesc->size);
72QString StringOption::valueAsString()
const
74 if (state() == Option::StateHidden) {
82#include "moc_stringoption.cpp"
Q_SCRIPTABLE CaptureState status()
QString fromUtf8(QByteArrayView str)
QByteArray toLatin1() const const
QStringView left(qsizetype length) const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:19 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.