6#include <QtCore/qmetaobject.h>
12
13
14
16 : m_proxying(proxying), source(iodevice)
26 const QIOPipe *parentPipe = qobject_cast<QIOPipe *>(source);
27 if (parentPipe && parentPipe->d_func()->m_proxying)
33 QObjectPrivate::connect(source, &QIODevice::readyRead,
this, &QIOPipePrivate::_q_onReadyRead);
39 QByteArray ba = source->readAll();
50 auto isNull = [](
const auto &cp) {
return cp ==
nullptr; };
51 childPipes.removeIf(isNull);
52 for (
const auto &cp : std::as_const(childPipes))
53 cp->d_func()->pushData(ba);
55 for (
auto &buffer : readBuffers)
80 if (childPipes.contains(childPipe))
82 childPipes.append(childPipe);
87 childPipes.removeOne(childPipe);
93 this->d_func()->initialize();
94 if (!parent->isOpen() && !parent->open(QIODevice::ReadOnly)) {
95 qWarning() <<
"QIOPipe: Failed to open " << parent;
111 static const OpenMode supportedOpenMode = ReadOnly;
112 if (!(mode & supportedOpenMode)) {
113 qFatal(
"Unsupported open mode");
117 return QIODevice::open(mode);
128 d->setReadChannelCount(qMax(count, 1));
134 d->addChildPipe(childPipe);
138
139
140
141
142
143
144
145
146
159 qFatal(
"QIOPipe is a read-only device");
165#include "moc_qiopipe_p.cpp"
\inmodule QtCore \reentrant
~QIOPipePrivate() override
void pumpData(const QByteArray &ba)
void pushData(const QByteArray &ba)
QIOPipe(QIODevice *parent, Mode mode=EndPipe)
qint64 readData(char *data, qint64 maxlen) override
\reimp
bool isSequential() const override
Returns true if this device is sequential; otherwise returns false.
void setReadChannelCount(int count)
bool open(OpenMode openMode) override
void addChildPipe(QIOPipe *childPipe)
qint64 writeData(const char *data, qint64 len) override
Writes up to maxSize bytes from data to the device.
Combined button and popup list for selecting options.