[][src]Struct qt_core::QIODevice

#[repr(C)]
pub struct QIODevice { /* fields omitted */ }

The QIODevice class is the base interface class of all I/O devices in Qt.

C++ class: QIODevice.

C++ documentation:

The QIODevice class is the base interface class of all I/O devices in Qt.

QIODevice provides both a common implementation and an abstract interface for devices that support reading and writing of blocks of data, such as QFile, QBuffer and QTcpSocket. QIODevice is abstract and can not be instantiated, but it is common to use the interface it defines to provide device-independent I/O features. For example, Qt's XML classes operate on a QIODevice pointer, allowing them to be used with various devices (such as files and buffers).

Before accessing the device, open() must be called to set the correct OpenMode (such as ReadOnly or ReadWrite). You can then write to the device with write() or putChar(), and read by calling either read(), readLine(), or readAll(). Call close() when you are done with the device.

QIODevice distinguishes between two types of devices: random-access devices and sequential devices.

  • Random-access devices support seeking to arbitrary positions using seek(). The current position in the file is available by calling pos(). QFile and QBuffer are examples of random-access devices.
  • Sequential devices don't support seeking to arbitrary positions. The data must be read in one pass. The functions pos() and size() don't work for sequential devices. QTcpSocket and QProcess are examples of sequential devices.

You can use isSequential() to determine the type of device.

QIODevice emits readyRead() when new data is available for reading; for example, if new data has arrived on the network or if additional data is appended to a file that you are reading from. You can call bytesAvailable() to determine the number of bytes that are currently available for reading. It's common to use bytesAvailable() together with the readyRead() signal when programming with asynchronous devices such as QTcpSocket, where fragments of data can arrive at arbitrary points in time. QIODevice emits the bytesWritten() signal every time a payload of data has been written to the device. Use bytesToWrite() to determine the current amount of data waiting to be written.

Certain subclasses of QIODevice, such as QTcpSocket and QProcess, are asynchronous. This means that I/O functions such as write() or read() always return immediately, while communication with the device itself may happen when control goes back to the event loop. QIODevice provides functions that allow you to force these operations to be performed immediately, while blocking the calling thread and without entering the event loop. This allows QIODevice subclasses to be used without an event loop, or in a separate thread:

  • waitForReadyRead() - This function suspends operation in the calling thread until new data is available for reading.
  • waitForBytesWritten() - This function suspends operation in the calling thread until one payload of data has been written to the device.
  • waitFor....() - Subclasses of QIODevice implement blocking functions for device-specific operations. For example, QProcess has a function called waitForStarted() which suspends operation in the calling thread until the process has started.

Calling these functions from the main, GUI thread, may cause your user interface to freeze. Example:

QProcess gzip; gzip.start("gzip", QStringList() << "-c"); if (!gzip.waitForStarted()) return false;

gzip.write("uncompressed data");

QByteArray compressed; while (gzip.waitForReadyRead()) compressed += gzip.readAll();

By subclassing QIODevice, you can provide the same interface to your own I/O devices. Subclasses of QIODevice are only required to implement the protected readData() and writeData() functions. QIODevice uses these functions to implement all its convenience functions, such as getChar(), readLine() and write(). QIODevice also handles access control for you, so you can safely assume that the device is opened in write mode if writeData() is called.

Some subclasses, such as QFile and QTcpSocket, are implemented using a memory buffer for intermediate storing of data. This reduces the number of required device accessing calls, which are often very slow. Buffering makes functions like getChar() and putChar() fast, as they can operate on the memory buffer instead of directly on the device itself. Certain I/O operations, however, don't work well with a buffer. For example, if several users open the same device and read it character by character, they may end up reading the same data when they meant to read a separate chunk each. For this reason, QIODevice allows you to bypass any buffering by passing the Unbuffered flag to open(). When subclassing QIODevice, remember to bypass any buffer you may use when the device is open in Unbuffered mode.

Usually, the incoming data stream from an asynchronous device is fragmented, and chunks of data can arrive at arbitrary points in time. To handle incomplete reads of data structures, use the transaction mechanism implemented by QIODevice. See startTransaction() and related functions for more details.

Some sequential devices support communicating via multiple channels. These channels represent separate streams of data that have the property of independently sequenced delivery. Once the device is opened, you can determine the number of channels by calling the readChannelCount() and writeChannelCount() functions. To switch between channels, call setCurrentReadChannel() and setCurrentWriteChannel(), respectively. QIODevice also provides additional signals to handle asynchronous communication on a per-channel basis.

Methods

impl QIODevice[src]

pub fn ready_read(&self) -> Signal<()>[src]

This signal is emitted once every time new data is available for reading from the device's current read channel. It will only be emitted again once new data is available, such as when a new payload of network data has arrived on your network socket, or when a new block of data has been appended to your device.

Returns a built-in Qt signal QIODevice::readyRead that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted once every time new data is available for reading from the device's current read channel. It will only be emitted again once new data is available, such as when a new payload of network data has arrived on your network socket, or when a new block of data has been appended to your device.

readyRead() is not emitted recursively; if you reenter the event loop or call waitForReadyRead() inside a slot connected to the readyRead() signal, the signal will not be reemitted (although waitForReadyRead() may still return true).

Note for developers implementing classes derived from QIODevice: you should always emit readyRead() when new data has arrived (do not emit it only because there's data still to be read in your buffers). Do not emit readyRead() in other conditions.

See also bytesWritten().

pub fn channel_ready_read(&self) -> Signal<(c_int,)>[src]

This signal is emitted when new data is available for reading from the device. The channel argument is set to the index of the read channel on which the data has arrived. Unlike readyRead(), it is emitted regardless of the current read channel.

Returns a built-in Qt signal QIODevice::channelReadyRead that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when new data is available for reading from the device. The channel argument is set to the index of the read channel on which the data has arrived. Unlike readyRead(), it is emitted regardless of the current read channel.

channelReadyRead() can be emitted recursively - even for the same channel.

This function was introduced in Qt 5.7.

See also readyRead() and channelBytesWritten().

pub fn bytes_written(&self) -> Signal<(i64,)>[src]

This signal is emitted every time a payload of data has been written to the device's current write channel. The bytes argument is set to the number of bytes that were written in this payload.

Returns a built-in Qt signal QIODevice::bytesWritten that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted every time a payload of data has been written to the device's current write channel. The bytes argument is set to the number of bytes that were written in this payload.

bytesWritten() is not emitted recursively; if you reenter the event loop or call waitForBytesWritten() inside a slot connected to the bytesWritten() signal, the signal will not be reemitted (although waitForBytesWritten() may still return true).

See also readyRead().

pub fn channel_bytes_written(&self) -> Signal<(c_int, i64)>[src]

This signal is emitted every time a payload of data has been written to the device. The bytes argument is set to the number of bytes that were written in this payload, while channel is the channel they were written to. Unlike bytesWritten(), it is emitted regardless of the current write channel.

Returns a built-in Qt signal QIODevice::channelBytesWritten that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted every time a payload of data has been written to the device. The bytes argument is set to the number of bytes that were written in this payload, while channel is the channel they were written to. Unlike bytesWritten(), it is emitted regardless of the current write channel.

channelBytesWritten() can be emitted recursively - even for the same channel.

This function was introduced in Qt 5.7.

See also bytesWritten() and channelReadyRead().

pub fn about_to_close(&self) -> Signal<()>[src]

This signal is emitted when the device is about to close. Connect this signal if you have operations that need to be performed before the device closes (e.g., if you have data in a separate buffer that needs to be written to the device).

Returns a built-in Qt signal QIODevice::aboutToClose that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the device is about to close. Connect this signal if you have operations that need to be performed before the device closes (e.g., if you have data in a separate buffer that needs to be written to the device).

pub fn read_channel_finished(&self) -> Signal<()>[src]

This signal is emitted when the input (reading) stream is closed in this device. It is emitted as soon as the closing is detected, which means that there might still be data available for reading with read().

Returns a built-in Qt signal QIODevice::readChannelFinished that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the input (reading) stream is closed in this device. It is emitted as soon as the closing is detected, which means that there might still be data available for reading with read().

This function was introduced in Qt 4.4.

See also atEnd() and read().

pub unsafe fn at_end(&self) -> bool[src]

Returns true if the current read and write position is at the end of the device (i.e. there is no more data available for reading on the device); otherwise returns false.

Calls C++ function: virtual bool QIODevice::atEnd() const.

C++ documentation:

Returns true if the current read and write position is at the end of the device (i.e. there is no more data available for reading on the device); otherwise returns false.

For some devices, atEnd() can return true even though there is more data to read. This special case only applies to devices that generate data in direct response to you calling read() (e.g., /dev or /proc files on Unix and macOS, or console input / stdin on all platforms).

See also bytesAvailable(), read(), and isSequential().

pub unsafe fn bytes_available(&self) -> i64[src]

Returns the number of bytes that are available for reading. This function is commonly used with sequential devices to determine the number of bytes to allocate in a buffer before reading.

Calls C++ function: virtual qint64 QIODevice::bytesAvailable() const.

C++ documentation:

Returns the number of bytes that are available for reading. This function is commonly used with sequential devices to determine the number of bytes to allocate in a buffer before reading.

Subclasses that reimplement this function must call the base implementation in order to include the size of the buffer of QIODevice. Example:

qint64 CustomDevice::bytesAvailable() const { return buffer.size() + QIODevice::bytesAvailable(); }

See also bytesToWrite(), readyRead(), and isSequential().

pub unsafe fn bytes_to_write(&self) -> i64[src]

For buffered devices, this function returns the number of bytes waiting to be written. For devices with no buffer, this function returns 0.

Calls C++ function: virtual qint64 QIODevice::bytesToWrite() const.

C++ documentation:

For buffered devices, this function returns the number of bytes waiting to be written. For devices with no buffer, this function returns 0.

Subclasses that reimplement this function must call the base implementation in order to include the size of the buffer of QIODevice.

See also bytesAvailable(), bytesWritten(), and isSequential().

pub unsafe fn can_read_line(&self) -> bool[src]

Returns true if a complete line of data can be read from the device; otherwise returns false.

Calls C++ function: virtual bool QIODevice::canReadLine() const.

C++ documentation:

Returns true if a complete line of data can be read from the device; otherwise returns false.

Note that unbuffered devices, which have no way of determining what can be read, always return false.

This function is often called in conjunction with the readyRead() signal.

Subclasses that reimplement this function must call the base implementation in order to include the contents of the QIODevice's buffer. Example:

bool CustomDevice::canReadLine() const { return buffer.contains('\n') || QIODevice::canReadLine(); }

See also readyRead() and readLine().

pub unsafe fn close(&mut self)[src]

First emits aboutToClose(), then closes the device and sets its OpenMode to NotOpen. The error string is also reset.

Calls C++ function: virtual void QIODevice::close().

C++ documentation:

First emits aboutToClose(), then closes the device and sets its OpenMode to NotOpen. The error string is also reset.

See also setOpenMode() and OpenMode.

pub unsafe fn commit_transaction(&mut self)[src]

Completes a read transaction.

Calls C++ function: void QIODevice::commitTransaction().

C++ documentation:

Completes a read transaction.

For sequential devices, all data recorded in the internal buffer during the transaction will be discarded.

This function was introduced in Qt 5.7.

See also startTransaction() and rollbackTransaction().

pub unsafe fn current_read_channel(&self) -> c_int[src]

Returns the index of the current read channel.

Calls C++ function: int QIODevice::currentReadChannel() const.

C++ documentation:

Returns the index of the current read channel.

This function was introduced in Qt 5.7.

See also setCurrentReadChannel(), readChannelCount(), and QProcess.

pub unsafe fn current_write_channel(&self) -> c_int[src]

Returns the the index of the current write channel.

Calls C++ function: int QIODevice::currentWriteChannel() const.

C++ documentation:

Returns the the index of the current write channel.

This function was introduced in Qt 5.7.

See also setCurrentWriteChannel() and writeChannelCount().

pub unsafe fn error_string(&self) -> CppBox<QString>[src]

Returns a human-readable description of the last device error that occurred.

Calls C++ function: QString QIODevice::errorString() const.

C++ documentation:

Returns a human-readable description of the last device error that occurred.

See also setErrorString().

pub unsafe fn get_char(&mut self, c: impl CastInto<MutPtr<c_char>>) -> bool[src]

Reads one character from the device and stores it in c. If c is 0, the character is discarded. Returns true on success; otherwise returns false.

Calls C++ function: bool QIODevice::getChar(char* c).

C++ documentation:

Reads one character from the device and stores it in c. If c is 0, the character is discarded. Returns true on success; otherwise returns false.

See also read(), putChar(), and ungetChar().

pub unsafe fn is_open(&self) -> bool[src]

Returns true if the device is open; otherwise returns false. A device is open if it can be read from and/or written to. By default, this function returns false if openMode() returns NotOpen.

Calls C++ function: bool QIODevice::isOpen() const.

C++ documentation:

Returns true if the device is open; otherwise returns false. A device is open if it can be read from and/or written to. By default, this function returns false if openMode() returns NotOpen.

See also openMode() and OpenMode.

pub unsafe fn is_readable(&self) -> bool[src]

Returns true if data can be read from the device; otherwise returns false. Use bytesAvailable() to determine how many bytes can be read.

Calls C++ function: bool QIODevice::isReadable() const.

C++ documentation:

Returns true if data can be read from the device; otherwise returns false. Use bytesAvailable() to determine how many bytes can be read.

This is a convenience function which checks if the OpenMode of the device contains the ReadOnly flag.

See also openMode() and OpenMode.

pub unsafe fn is_sequential(&self) -> bool[src]

Returns true if this device is sequential; otherwise returns false.

Calls C++ function: virtual bool QIODevice::isSequential() const.

C++ documentation:

Returns true if this device is sequential; otherwise returns false.

Sequential devices, as opposed to a random-access devices, have no concept of a start, an end, a size, or a current position, and they do not support seeking. You can only read from the device when it reports that data is available. The most common example of a sequential device is a network socket. On Unix, special files such as /dev/zero and fifo pipes are sequential.

Regular files, on the other hand, do support random access. They have both a size and a current position, and they also support seeking backwards and forwards in the data stream. Regular files are non-sequential.

See also bytesAvailable().

pub unsafe fn is_text_mode_enabled(&self) -> bool[src]

Returns true if the Text flag is enabled; otherwise returns false.

Calls C++ function: bool QIODevice::isTextModeEnabled() const.

C++ documentation:

Returns true if the Text flag is enabled; otherwise returns false.

See also setTextModeEnabled().

pub unsafe fn is_transaction_started(&self) -> bool[src]

Returns true if a transaction is in progress on the device, otherwise false.

Calls C++ function: bool QIODevice::isTransactionStarted() const.

C++ documentation:

Returns true if a transaction is in progress on the device, otherwise false.

This function was introduced in Qt 5.7.

See also startTransaction().

pub unsafe fn is_writable(&self) -> bool[src]

Returns true if data can be written to the device; otherwise returns false.

Calls C++ function: bool QIODevice::isWritable() const.

C++ documentation:

Returns true if data can be written to the device; otherwise returns false.

This is a convenience function which checks if the OpenMode of the device contains the WriteOnly flag.

See also openMode() and OpenMode.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QIODevice::metaObject() const.

pub unsafe fn open(&mut self, mode: QFlags<OpenModeFlag>) -> bool[src]

Opens the device and sets its OpenMode to mode. Returns true if successful; otherwise returns false. This function should be called from any reimplementations of open() or other functions that open the device.

Calls C++ function: virtual bool QIODevice::open(QFlags<QIODevice::OpenModeFlag> mode).

C++ documentation:

Opens the device and sets its OpenMode to mode. Returns true if successful; otherwise returns false. This function should be called from any reimplementations of open() or other functions that open the device.

See also openMode() and OpenMode.

pub unsafe fn open_mode(&self) -> QFlags<OpenModeFlag>[src]

Returns the mode in which the device has been opened; i.e. ReadOnly or WriteOnly.

Calls C++ function: QFlags<QIODevice::OpenModeFlag> QIODevice::openMode() const.

C++ documentation:

Returns the mode in which the device has been opened; i.e. ReadOnly or WriteOnly.

See also setOpenMode() and OpenMode.

pub unsafe fn peek_2a(
    &mut self,
    data: impl CastInto<MutPtr<c_char>>,
    maxlen: i64
) -> i64
[src]

Reads at most maxSize bytes from the device into data, without side effects (i.e., if you call read() after peek(), you will get the same data). Returns the number of bytes read. If an error occurs, such as when attempting to peek a device opened in WriteOnly mode, this function returns -1.

Calls C++ function: qint64 QIODevice::peek(char* data, qint64 maxlen).

C++ documentation:

Reads at most maxSize bytes from the device into data, without side effects (i.e., if you call read() after peek(), you will get the same data). Returns the number of bytes read. If an error occurs, such as when attempting to peek a device opened in WriteOnly mode, this function returns -1.

0 is returned when no more data is available for reading.

Example:

bool isExeFile(QFile *file) { char buf[2]; if (file->peek(buf, sizeof(buf)) == sizeof(buf)) return (buf[0] == 'M' && buf[1] == 'Z'); return false; }

This function was introduced in Qt 4.1.

See also read().

pub unsafe fn peek_1a(&mut self, maxlen: i64) -> CppBox<QByteArray>[src]

This is an overloaded function.

Calls C++ function: QByteArray QIODevice::peek(qint64 maxlen).

C++ documentation:

This is an overloaded function.

Peeks at most maxSize bytes from the device, returning the data peeked as a QByteArray.

Example:

bool isExeFile(QFile *file) { return file->peek(2) == "MZ"; }

This function has no way of reporting errors; returning an empty QByteArray can mean either that no data was currently available for peeking, or that an error occurred.

This function was introduced in Qt 4.1.

See also read().

pub unsafe fn pos(&self) -> i64[src]

For random-access devices, this function returns the position that data is written to or read from. For sequential devices or closed devices, where there is no concept of a "current position", 0 is returned.

Calls C++ function: virtual qint64 QIODevice::pos() const.

C++ documentation:

For random-access devices, this function returns the position that data is written to or read from. For sequential devices or closed devices, where there is no concept of a "current position", 0 is returned.

The current read/write position of the device is maintained internally by QIODevice, so reimplementing this function is not necessary. When subclassing QIODevice, use QIODevice::seek() to notify QIODevice about changes in the device position.

See also isSequential() and seek().

pub unsafe fn put_char(&mut self, c: c_char) -> bool[src]

Writes the character c to the device. Returns true on success; otherwise returns false.

Calls C++ function: bool QIODevice::putChar(char c).

C++ documentation:

Writes the character c to the device. Returns true on success; otherwise returns false.

See also write(), getChar(), and ungetChar().

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QIODevice::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QIODevice::qt_metacast(const char* arg1).

pub unsafe fn read_2a(
    &mut self,
    data: impl CastInto<MutPtr<c_char>>,
    maxlen: i64
) -> i64
[src]

Reads at most maxSize bytes from the device into data, and returns the number of bytes read. If an error occurs, such as when attempting to read from a device opened in WriteOnly mode, this function returns -1.

Calls C++ function: qint64 QIODevice::read(char* data, qint64 maxlen).

C++ documentation:

Reads at most maxSize bytes from the device into data, and returns the number of bytes read. If an error occurs, such as when attempting to read from a device opened in WriteOnly mode, this function returns -1.

0 is returned when no more data is available for reading. However, reading past the end of the stream is considered an error, so this function returns -1 in those cases (that is, reading on a closed socket or after a process has died).

See also readData(), readLine(), and write().

pub unsafe fn read_1a(&mut self, maxlen: i64) -> CppBox<QByteArray>[src]

This is an overloaded function.

Calls C++ function: QByteArray QIODevice::read(qint64 maxlen).

C++ documentation:

This is an overloaded function.

Reads at most maxSize bytes from the device, and returns the data read as a QByteArray.

This function has no way of reporting errors; returning an empty QByteArray can mean either that no data was currently available for reading, or that an error occurred.

pub unsafe fn read_all(&mut self) -> CppBox<QByteArray>[src]

Reads all remaining data from the device, and returns it as a byte array.

Calls C++ function: QByteArray QIODevice::readAll().

C++ documentation:

Reads all remaining data from the device, and returns it as a byte array.

This function has no way of reporting errors; returning an empty QByteArray can mean either that no data was currently available for reading, or that an error occurred.

pub unsafe fn read_channel_count(&self) -> c_int[src]

Returns the number of available read channels if the device is open; otherwise returns 0.

Calls C++ function: int QIODevice::readChannelCount() const.

C++ documentation:

Returns the number of available read channels if the device is open; otherwise returns 0.

This function was introduced in Qt 5.7.

See also writeChannelCount() and QProcess.

pub unsafe fn read_line_2a(
    &mut self,
    data: impl CastInto<MutPtr<c_char>>,
    maxlen: i64
) -> i64
[src]

This function reads a line of ASCII characters from the device, up to a maximum of maxSize - 1 bytes, stores the characters in data, and returns the number of bytes read. If a line could not be read but no error ocurred, this function returns 0. If an error occurs, this function returns the length of what could be read, or -1 if nothing was read.

Calls C++ function: qint64 QIODevice::readLine(char* data, qint64 maxlen).

C++ documentation:

This function reads a line of ASCII characters from the device, up to a maximum of maxSize - 1 bytes, stores the characters in data, and returns the number of bytes read. If a line could not be read but no error ocurred, this function returns 0. If an error occurs, this function returns the length of what could be read, or -1 if nothing was read.

A terminating '\0' byte is always appended to data, so maxSize must be larger than 1.

Data is read until either of the following conditions are met:

  • The first '\n' character is read.
  • maxSize - 1 bytes are read.
  • The end of the device data is detected.

For example, the following code reads a line of characters from a file:

QFile file("box.txt"); if (file.open(QFile::ReadOnly)) { char buf[1024]; qint64 lineLength = file.readLine(buf, sizeof(buf)); if (lineLength != -1) { // the line is available in buf } }

The newline character ('\n') is included in the buffer. If a newline is not encountered before maxSize - 1 bytes are read, a newline will not be inserted into the buffer. On windows newline characters are replaced with '\n'.

This function calls readLineData(), which is implemented using repeated calls to getChar(). You can provide a more efficient implementation by reimplementing readLineData() in your own subclass.

See also getChar(), read(), and write().

pub unsafe fn read_line_1a(&mut self, maxlen: i64) -> CppBox<QByteArray>[src]

This is an overloaded function.

Calls C++ function: QByteArray QIODevice::readLine(qint64 maxlen = …).

C++ documentation:

This is an overloaded function.

Reads a line from the device, but no more than maxSize characters, and returns the result as a byte array.

This function has no way of reporting errors; returning an empty QByteArray can mean either that no data was currently available for reading, or that an error occurred.

pub unsafe fn read_line_0a(&mut self) -> CppBox<QByteArray>[src]

This is an overloaded function.

Calls C++ function: QByteArray QIODevice::readLine().

C++ documentation:

This is an overloaded function.

Reads a line from the device, but no more than maxSize characters, and returns the result as a byte array.

This function has no way of reporting errors; returning an empty QByteArray can mean either that no data was currently available for reading, or that an error occurred.

pub unsafe fn reset(&mut self) -> bool[src]

Seeks to the start of input for random-access devices. Returns true on success; otherwise returns false (for example, if the device is not open).

Calls C++ function: virtual bool QIODevice::reset().

C++ documentation:

Seeks to the start of input for random-access devices. Returns true on success; otherwise returns false (for example, if the device is not open).

Note that when using a QTextStream on a QFile, calling reset() on the QFile will not have the expected result because QTextStream buffers the file. Use the QTextStream::seek() function instead.

See also seek().

pub unsafe fn rollback_transaction(&mut self)[src]

Rolls back a read transaction.

Calls C++ function: void QIODevice::rollbackTransaction().

C++ documentation:

Rolls back a read transaction.

Restores the input stream to the point of the startTransaction() call. This function is commonly used to rollback the transaction when an incomplete read was detected prior to committing the transaction.

This function was introduced in Qt 5.7.

See also startTransaction() and commitTransaction().

pub unsafe fn seek(&mut self, pos: i64) -> bool[src]

For random-access devices, this function sets the current position to pos, returning true on success, or false if an error occurred. For sequential devices, the default behavior is to produce a warning and return false.

Calls C++ function: virtual bool QIODevice::seek(qint64 pos).

C++ documentation:

For random-access devices, this function sets the current position to pos, returning true on success, or false if an error occurred. For sequential devices, the default behavior is to produce a warning and return false.

When subclassing QIODevice, you must call QIODevice::seek() at the start of your function to ensure integrity with QIODevice's built-in buffer.

See also pos() and isSequential().

pub unsafe fn set_current_read_channel(&mut self, channel: c_int)[src]

Sets the current read channel of the QIODevice to the given channel. The current input channel is used by the functions read(), readAll(), readLine(), and getChar(). It also determines which channel triggers QIODevice to emit readyRead().

Calls C++ function: void QIODevice::setCurrentReadChannel(int channel).

C++ documentation:

Sets the current read channel of the QIODevice to the given channel. The current input channel is used by the functions read(), readAll(), readLine(), and getChar(). It also determines which channel triggers QIODevice to emit readyRead().

This function was introduced in Qt 5.7.

See also currentReadChannel(), readChannelCount(), and QProcess.

pub unsafe fn set_current_write_channel(&mut self, channel: c_int)[src]

Sets the current write channel of the QIODevice to the given channel. The current output channel is used by the functions write(), putChar(). It also determines which channel triggers QIODevice to emit bytesWritten().

Calls C++ function: void QIODevice::setCurrentWriteChannel(int channel).

C++ documentation:

Sets the current write channel of the QIODevice to the given channel. The current output channel is used by the functions write(), putChar(). It also determines which channel triggers QIODevice to emit bytesWritten().

This function was introduced in Qt 5.7.

See also currentWriteChannel() and writeChannelCount().

pub unsafe fn set_text_mode_enabled(&mut self, enabled: bool)[src]

If enabled is true, this function sets the Text flag on the device; otherwise the Text flag is removed. This feature is useful for classes that provide custom end-of-line handling on a QIODevice.

Calls C++ function: void QIODevice::setTextModeEnabled(bool enabled).

C++ documentation:

If enabled is true, this function sets the Text flag on the device; otherwise the Text flag is removed. This feature is useful for classes that provide custom end-of-line handling on a QIODevice.

The IO device should be opened before calling this function.

See also isTextModeEnabled(), open(), and setOpenMode().

pub unsafe fn size(&self) -> i64[src]

For open random-access devices, this function returns the size of the device. For open sequential devices, bytesAvailable() is returned.

Calls C++ function: virtual qint64 QIODevice::size() const.

C++ documentation:

For open random-access devices, this function returns the size of the device. For open sequential devices, bytesAvailable() is returned.

If the device is closed, the size returned will not reflect the actual size of the device.

See also isSequential() and pos().

pub unsafe fn start_transaction(&mut self)[src]

Starts a new read transaction on the device.

Calls C++ function: void QIODevice::startTransaction().

C++ documentation:

Starts a new read transaction on the device.

Defines a restorable point within the sequence of read operations. For sequential devices, read data will be duplicated internally to allow recovery in case of incomplete reads. For random-access devices, this function saves the current position. Call commitTransaction() or rollbackTransaction() to finish the transaction.

Note: Nesting transactions is not supported.

This function was introduced in Qt 5.7.

See also commitTransaction() and rollbackTransaction().

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tr(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QIODevice::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QIODevice::trUtf8(const char* s, const char* c, int n).

pub unsafe fn unget_char(&mut self, c: c_char)[src]

Puts the character c back into the device, and decrements the current position unless the position is 0. This function is usually called to "undo" a getChar() operation, such as when writing a backtracking parser.

Calls C++ function: void QIODevice::ungetChar(char c).

C++ documentation:

Puts the character c back into the device, and decrements the current position unless the position is 0. This function is usually called to "undo" a getChar() operation, such as when writing a backtracking parser.

If c was not previously read from the device, the behavior is undefined.

Note: This function is not available while a transaction is in progress.

pub unsafe fn wait_for_bytes_written(&mut self, msecs: c_int) -> bool[src]

For buffered devices, this function waits until a payload of buffered written data has been written to the device and the bytesWritten() signal has been emitted, or until msecs milliseconds have passed. If msecs is -1, this function will not time out. For unbuffered devices, it returns immediately.

Calls C++ function: virtual bool QIODevice::waitForBytesWritten(int msecs).

C++ documentation:

For buffered devices, this function waits until a payload of buffered written data has been written to the device and the bytesWritten() signal has been emitted, or until msecs milliseconds have passed. If msecs is -1, this function will not time out. For unbuffered devices, it returns immediately.

Returns true if a payload of data was written to the device; otherwise returns false (i.e. if the operation timed out, or if an error occurred).

This function can operate without an event loop. It is useful when writing non-GUI applications and when performing I/O operations in a non-GUI thread.

If called from within a slot connected to the bytesWritten() signal, bytesWritten() will not be reemitted.

Reimplement this function to provide a blocking API for a custom device. The default implementation does nothing, and returns false.

Warning: Calling this function from the main (GUI) thread might cause your user interface to freeze.

See also waitForReadyRead().

pub unsafe fn wait_for_ready_read(&mut self, msecs: c_int) -> bool[src]

Blocks until new data is available for reading and the readyRead() signal has been emitted, or until msecs milliseconds have passed. If msecs is -1, this function will not time out.

Calls C++ function: virtual bool QIODevice::waitForReadyRead(int msecs).

C++ documentation:

Blocks until new data is available for reading and the readyRead() signal has been emitted, or until msecs milliseconds have passed. If msecs is -1, this function will not time out.

Returns true if new data is available for reading; otherwise returns false (if the operation timed out or if an error occurred).

This function can operate without an event loop. It is useful when writing non-GUI applications and when performing I/O operations in a non-GUI thread.

If called from within a slot connected to the readyRead() signal, readyRead() will not be reemitted.

Reimplement this function to provide a blocking API for a custom device. The default implementation does nothing, and returns false.

Warning: Calling this function from the main (GUI) thread might cause your user interface to freeze.

See also waitForBytesWritten().

pub unsafe fn write_char_i64(
    &mut self,
    data: impl CastInto<Ptr<c_char>>,
    len: i64
) -> i64
[src]

Writes at most maxSize bytes of data from data to the device. Returns the number of bytes that were actually written, or -1 if an error occurred.

Calls C++ function: qint64 QIODevice::write(const char* data, qint64 len).

C++ documentation:

Writes at most maxSize bytes of data from data to the device. Returns the number of bytes that were actually written, or -1 if an error occurred.

See also read() and writeData().

pub unsafe fn write_char(&mut self, data: impl CastInto<Ptr<c_char>>) -> i64[src]

This is an overloaded function.

Calls C++ function: qint64 QIODevice::write(const char* data).

C++ documentation:

This is an overloaded function.

Writes data from a zero-terminated string of 8-bit characters to the device. Returns the number of bytes that were actually written, or -1 if an error occurred. This is equivalent to

... QIODevice::write(data, qstrlen(data)); ...

This function was introduced in Qt 4.5.

See also read() and writeData().

pub unsafe fn write_q_byte_array(
    &mut self,
    data: impl CastInto<Ref<QByteArray>>
) -> i64
[src]

This is an overloaded function.

Calls C++ function: qint64 QIODevice::write(const QByteArray& data).

C++ documentation:

This is an overloaded function.

Writes the content of byteArray to the device. Returns the number of bytes that were actually written, or -1 if an error occurred.

See also read() and writeData().

pub unsafe fn write_channel_count(&self) -> c_int[src]

Returns the number of available write channels if the device is open; otherwise returns 0.

Calls C++ function: int QIODevice::writeChannelCount() const.

C++ documentation:

Returns the number of available write channels if the device is open; otherwise returns 0.

This function was introduced in Qt 5.7.

See also readChannelCount().

Methods from Deref<Target = QObject>

pub fn destroyed(&self) -> Signal<(*mut QObject,)>[src]

This signal is emitted immediately before the object obj is destroyed, and can not be blocked.

Returns a built-in Qt signal QObject::destroyed that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted immediately before the object obj is destroyed, and can not be blocked.

All the objects's children are destroyed immediately after this signal is emitted.

See also deleteLater() and QPointer.

pub fn object_name_changed(&self) -> Signal<(*const QString,)>[src]

This signal is emitted after the object's name has been changed. The new object name is passed as objectName.

Returns a built-in Qt signal QObject::objectNameChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted after the object's name has been changed. The new object name is passed as objectName.

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

Note: Notifier signal for property objectName.

See also QObject::objectName.

pub fn slot_delete_later(&self) -> Receiver<()>[src]

Schedules this object for deletion.

Returns a built-in Qt slot QObject::deleteLater that can be passed to qt_core::Signal::connect.

C++ documentation:

Schedules this object for deletion.

The object will be deleted when control returns to the event loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the event loop is started. If deleteLater() is called after the main event loop has stopped, the object will not be deleted. Since Qt 4.8, if deleteLater() is called on an object that lives in a thread with no running event loop, the object will be destroyed when the thread finishes.

Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will not perform the deferred deletion; for the object to be deleted, the control must return to the event loop from which deleteLater() was called.

Note: It is safe to call this function more than once; when the first deferred deletion event is delivered, any pending events for the object are removed from the event queue.

See also destroyed() and QPointer.

pub unsafe fn block_signals(&mut self, b: bool) -> bool[src]

If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). If block is false, no such blocking will occur.

Calls C++ function: bool QObject::blockSignals(bool b).

C++ documentation:

If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). If block is false, no such blocking will occur.

The return value is the previous value of signalsBlocked().

Note that the destroyed() signal will be emitted even if the signals for this object have been blocked.

Signals emitted while being blocked are not buffered.

See also signalsBlocked() and QSignalBlocker.

pub unsafe fn children(&self) -> Ref<QListOfQObject>[src]

Returns a list of child objects. The QObjectList class is defined in the <QObject> header file as the following:

Calls C++ function: const QList<QObject*>& QObject::children() const.

C++ documentation:

Returns a list of child objects. The QObjectList class is defined in the <QObject> header file as the following:


  typedef QList<QObject*> QObjectList;

The first child added is the first object in the list and the last child added is the last object in the list, i.e. new children are appended at the end.

Note that the list order changes when QWidget children are raised or lowered. A widget that is raised becomes the last object in the list, and a widget that is lowered becomes the first object in the list.

See also findChild(), findChildren(), parent(), and setParent().

pub unsafe fn delete_later(&mut self)[src]

Schedules this object for deletion.

Calls C++ function: [slot] void QObject::deleteLater().

C++ documentation:

Schedules this object for deletion.

The object will be deleted when control returns to the event loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the event loop is started. If deleteLater() is called after the main event loop has stopped, the object will not be deleted. Since Qt 4.8, if deleteLater() is called on an object that lives in a thread with no running event loop, the object will be destroyed when the thread finishes.

Note that entering and leaving a new event loop (e.g., by opening a modal dialog) will not perform the deferred deletion; for the object to be deleted, the control must return to the event loop from which deleteLater() was called.

Note: It is safe to call this function more than once; when the first deferred deletion event is delivered, any pending events for the object are removed from the event queue.

See also destroyed() and QPointer.

pub unsafe fn disconnect_char_q_object_char(
    &self,
    signal: impl CastInto<Ptr<c_char>>,
    receiver: impl CastInto<Ptr<QObject>>,
    member: impl CastInto<Ptr<c_char>>
) -> bool
[src]

This function overloads disconnect().

Calls C++ function: bool QObject::disconnect(const char* signal = …, const QObject* receiver = …, const char* member = …) const.

C++ documentation:

This function overloads disconnect().

Disconnects signal from method of receiver.

A signal-slot connection is removed when either of the objects involved are destroyed.

Note: This function is thread-safe.

pub unsafe fn disconnect_q_object_char(
    &self,
    receiver: impl CastInto<Ptr<QObject>>,
    member: impl CastInto<Ptr<c_char>>
) -> bool
[src]

This function overloads disconnect().

Calls C++ function: bool QObject::disconnect(const QObject* receiver, const char* member = …) const.

C++ documentation:

This function overloads disconnect().

Disconnects all signals in this object from receiver's method.

A signal-slot connection is removed when either of the objects involved are destroyed.

pub unsafe fn disconnect_char_q_object(
    &self,
    signal: impl CastInto<Ptr<c_char>>,
    receiver: impl CastInto<Ptr<QObject>>
) -> bool
[src]

This function overloads disconnect().

Calls C++ function: bool QObject::disconnect(const char* signal = …, const QObject* receiver = …) const.

C++ documentation:

This function overloads disconnect().

Disconnects signal from method of receiver.

A signal-slot connection is removed when either of the objects involved are destroyed.

Note: This function is thread-safe.

pub unsafe fn disconnect_char(&self, signal: impl CastInto<Ptr<c_char>>) -> bool[src]

This function overloads disconnect().

Calls C++ function: bool QObject::disconnect(const char* signal = …) const.

C++ documentation:

This function overloads disconnect().

Disconnects signal from method of receiver.

A signal-slot connection is removed when either of the objects involved are destroyed.

Note: This function is thread-safe.

pub unsafe fn disconnect(&self) -> bool[src]

This function overloads disconnect().

Calls C++ function: bool QObject::disconnect() const.

C++ documentation:

This function overloads disconnect().

Disconnects signal from method of receiver.

A signal-slot connection is removed when either of the objects involved are destroyed.

Note: This function is thread-safe.

pub unsafe fn disconnect_q_object(
    &self,
    receiver: impl CastInto<Ptr<QObject>>
) -> bool
[src]

This function overloads disconnect().

Calls C++ function: bool QObject::disconnect(const QObject* receiver) const.

C++ documentation:

This function overloads disconnect().

Disconnects all signals in this object from receiver's method.

A signal-slot connection is removed when either of the objects involved are destroyed.

pub unsafe fn dump_object_info_mut(&mut self)[src]

Dumps information about signal connections, etc. for this object to the debug output.

Calls C++ function: void QObject::dumpObjectInfo().

C++ documentation:

Dumps information about signal connections, etc. for this object to the debug output.

Note: before Qt 5.9, this function was not const.

See also dumpObjectTree().

pub unsafe fn dump_object_info(&self)[src]

Dumps information about signal connections, etc. for this object to the debug output.

Calls C++ function: void QObject::dumpObjectInfo() const.

C++ documentation:

Dumps information about signal connections, etc. for this object to the debug output.

Note: before Qt 5.9, this function was not const.

See also dumpObjectTree().

pub unsafe fn dump_object_tree_mut(&mut self)[src]

Dumps a tree of children to the debug output.

Calls C++ function: void QObject::dumpObjectTree().

C++ documentation:

Dumps a tree of children to the debug output.

Note: before Qt 5.9, this function was not const.

See also dumpObjectInfo().

pub unsafe fn dump_object_tree(&self)[src]

Dumps a tree of children to the debug output.

Calls C++ function: void QObject::dumpObjectTree() const.

C++ documentation:

Dumps a tree of children to the debug output.

Note: before Qt 5.9, this function was not const.

See also dumpObjectInfo().

pub unsafe fn dynamic_property_names(&self) -> CppBox<QListOfQByteArray>[src]

Returns the names of all properties that were dynamically added to the object using setProperty().

Calls C++ function: QList<QByteArray> QObject::dynamicPropertyNames() const.

C++ documentation:

Returns the names of all properties that were dynamically added to the object using setProperty().

This function was introduced in Qt 4.2.

pub unsafe fn event(&mut self, event: impl CastInto<MutPtr<QEvent>>) -> bool[src]

This virtual function receives events to an object and should return true if the event e was recognized and processed.

Calls C++ function: virtual bool QObject::event(QEvent* event).

C++ documentation:

This virtual function receives events to an object and should return true if the event e was recognized and processed.

The event() function can be reimplemented to customize the behavior of an object.

Make sure you call the parent event class implementation for all the events you did not handle.

Example:

class MyClass : public QWidget { Q_OBJECT

public: MyClass(QWidget *parent = 0); ~MyClass();

bool event(QEvent* ev) { if (ev->type() == QEvent::PolishRequest) { // overwrite handling of PolishRequest if any doThings(); return true; } else if (ev->type() == QEvent::Show) { // complement handling of Show if any doThings2(); QWidget::event(ev); return true; } // Make sure the rest of events are handled return QWidget::event(ev); } };

See also installEventFilter(), timerEvent(), QCoreApplication::sendEvent(), and QCoreApplication::postEvent().

pub unsafe fn event_filter(
    &mut self,
    watched: impl CastInto<MutPtr<QObject>>,
    event: impl CastInto<MutPtr<QEvent>>
) -> bool
[src]

Filters events if this object has been installed as an event filter for the watched object.

Calls C++ function: virtual bool QObject::eventFilter(QObject* watched, QEvent* event).

C++ documentation:

Filters events if this object has been installed as an event filter for the watched object.

In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.

Example:

class MainWindow : public QMainWindow { public: MainWindow();

protected: bool eventFilter(QObject obj, QEvent ev);

private: QTextEdit *textEdit; };

MainWindow::MainWindow() { textEdit = new QTextEdit; setCentralWidget(textEdit);

textEdit->installEventFilter(this); }

bool MainWindow::eventFilter(QObject obj, QEvent event) { if (obj == textEdit) { if (event->type() == QEvent::KeyPress) { QKeyEvent keyEvent = static_cast<QKeyEvent>(event); qDebug() << "Ate key press" << keyEvent->key(); return true; } else { return false; } } else { // pass the event on to the parent class return QMainWindow::eventFilter(obj, event); } }

Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.

Warning: If you delete the receiver object in this function, be sure to return true. Otherwise, Qt will forward the event to the deleted object and the program might crash.

See also installEventFilter().

pub unsafe fn find_child_q_object_2a(
    &self,
    a_name: impl CastInto<Ref<QString>>,
    options: QFlags<FindChildOption>
) -> MutPtr<QObject>
[src]

Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QObject* QObject::findChild<QObject*>(const QString& aName = …, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

If there is more than one child matching the search, the most direct ancestor is returned. If there are several direct ancestors, it is undefined which one will be returned. In that case, findChildren() should be used.

This example returns a child QPushButton of parentWidget named "button1", even if the button isn't a direct child of the parent:

QPushButton button = parentWidget->findChild<QPushButton >("button1");

This example returns a QListWidget child of parentWidget:

QListWidget list = parentWidget->findChild<QListWidget >();

This example returns a child QPushButton of parentWidget (its direct parent) named "button1":

QPushButton button = parentWidget->findChild<QPushButton >("button1", Qt::FindDirectChildrenOnly);

This example returns a QListWidget child of parentWidget, its direct parent:

QListWidget list = parentWidget->findChild<QListWidget >(QString(), Qt::FindDirectChildrenOnly);

See also findChildren().

pub unsafe fn find_child_q_object_1a(
    &self,
    a_name: impl CastInto<Ref<QString>>
) -> MutPtr<QObject>
[src]

Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QObject* QObject::findChild<QObject*>(const QString& aName = …) const.

C++ documentation:

Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

If there is more than one child matching the search, the most direct ancestor is returned. If there are several direct ancestors, it is undefined which one will be returned. In that case, findChildren() should be used.

This example returns a child QPushButton of parentWidget named "button1", even if the button isn't a direct child of the parent:

QPushButton button = parentWidget->findChild<QPushButton >("button1");

This example returns a QListWidget child of parentWidget:

QListWidget list = parentWidget->findChild<QListWidget >();

This example returns a child QPushButton of parentWidget (its direct parent) named "button1":

QPushButton button = parentWidget->findChild<QPushButton >("button1", Qt::FindDirectChildrenOnly);

This example returns a QListWidget child of parentWidget, its direct parent:

QListWidget list = parentWidget->findChild<QListWidget >(QString(), Qt::FindDirectChildrenOnly);

See also findChildren().

pub unsafe fn find_child_q_object_0a(&self) -> MutPtr<QObject>[src]

Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QObject* QObject::findChild<QObject*>() const.

C++ documentation:

Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

If there is more than one child matching the search, the most direct ancestor is returned. If there are several direct ancestors, it is undefined which one will be returned. In that case, findChildren() should be used.

This example returns a child QPushButton of parentWidget named "button1", even if the button isn't a direct child of the parent:

QPushButton button = parentWidget->findChild<QPushButton >("button1");

This example returns a QListWidget child of parentWidget:

QListWidget list = parentWidget->findChild<QListWidget >();

This example returns a child QPushButton of parentWidget (its direct parent) named "button1":

QPushButton button = parentWidget->findChild<QPushButton >("button1", Qt::FindDirectChildrenOnly);

This example returns a QListWidget child of parentWidget, its direct parent:

QListWidget list = parentWidget->findChild<QListWidget >(QString(), Qt::FindDirectChildrenOnly);

See also findChildren().

pub unsafe fn find_children_q_abstract_animation_q_string_q_flags_find_child_option(
    &self,
    a_name: impl CastInto<Ref<QString>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractAnimation>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractAnimation*> QObject::findChildren<QAbstractAnimation*>(const QString& aName = …, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_animation_q_reg_exp_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegExp>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractAnimation>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractAnimation*> QObject::findChildren<QAbstractAnimation*>(const QRegExp& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_abstract_animation_q_regular_expression_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractAnimation>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractAnimation*> QObject::findChildren<QAbstractAnimation*>(const QRegularExpression& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_abstract_animation_q_string(
    &self,
    a_name: impl CastInto<Ref<QString>>
) -> CppBox<QListOfQAbstractAnimation>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractAnimation*> QObject::findChildren<QAbstractAnimation*>(const QString& aName = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_animation(
    &self
) -> CppBox<QListOfQAbstractAnimation>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractAnimation*> QObject::findChildren<QAbstractAnimation*>() const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_animation_q_reg_exp(
    &self,
    re: impl CastInto<Ref<QRegExp>>
) -> CppBox<QListOfQAbstractAnimation>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractAnimation*> QObject::findChildren<QAbstractAnimation*>(const QRegExp& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_abstract_animation_q_regular_expression(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>
) -> CppBox<QListOfQAbstractAnimation>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractAnimation*> QObject::findChildren<QAbstractAnimation*>(const QRegularExpression& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_abstract_state_q_string_q_flags_find_child_option(
    &self,
    a_name: impl CastInto<Ref<QString>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractState>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractState*> QObject::findChildren<QAbstractState*>(const QString& aName = …, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_state_q_reg_exp_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegExp>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractState>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractState*> QObject::findChildren<QAbstractState*>(const QRegExp& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_abstract_state_q_regular_expression_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractState>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractState*> QObject::findChildren<QAbstractState*>(const QRegularExpression& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_abstract_state_q_string(
    &self,
    a_name: impl CastInto<Ref<QString>>
) -> CppBox<QListOfQAbstractState>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractState*> QObject::findChildren<QAbstractState*>(const QString& aName = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_state(
    &self
) -> CppBox<QListOfQAbstractState>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractState*> QObject::findChildren<QAbstractState*>() const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_state_q_reg_exp(
    &self,
    re: impl CastInto<Ref<QRegExp>>
) -> CppBox<QListOfQAbstractState>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractState*> QObject::findChildren<QAbstractState*>(const QRegExp& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_abstract_state_q_regular_expression(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>
) -> CppBox<QListOfQAbstractState>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractState*> QObject::findChildren<QAbstractState*>(const QRegularExpression& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_abstract_transition_q_string_q_flags_find_child_option(
    &self,
    a_name: impl CastInto<Ref<QString>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractTransition>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractTransition*> QObject::findChildren<QAbstractTransition*>(const QString& aName = …, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_transition_q_reg_exp_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegExp>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractTransition>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractTransition*> QObject::findChildren<QAbstractTransition*>(const QRegExp& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_abstract_transition_q_regular_expression_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQAbstractTransition>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractTransition*> QObject::findChildren<QAbstractTransition*>(const QRegularExpression& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_abstract_transition_q_string(
    &self,
    a_name: impl CastInto<Ref<QString>>
) -> CppBox<QListOfQAbstractTransition>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractTransition*> QObject::findChildren<QAbstractTransition*>(const QString& aName = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_transition(
    &self
) -> CppBox<QListOfQAbstractTransition>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QAbstractTransition*> QObject::findChildren<QAbstractTransition*>() const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_abstract_transition_q_reg_exp(
    &self,
    re: impl CastInto<Ref<QRegExp>>
) -> CppBox<QListOfQAbstractTransition>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractTransition*> QObject::findChildren<QAbstractTransition*>(const QRegExp& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_abstract_transition_q_regular_expression(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>
) -> CppBox<QListOfQAbstractTransition>
[src]

This function overloads findChildren().

Calls C++ function: QList<QAbstractTransition*> QObject::findChildren<QAbstractTransition*>(const QRegularExpression& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_locale_q_string_q_flags_find_child_option(
    &self,
    a_name: impl CastInto<Ref<QString>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQLocale>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QLocale> QObject::findChildren<QLocale>(const QString& aName = …, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_locale_q_reg_exp_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegExp>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQLocale>
[src]

This function overloads findChildren().

Calls C++ function: QList<QLocale> QObject::findChildren<QLocale>(const QRegExp& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_locale_q_regular_expression_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQLocale>
[src]

This function overloads findChildren().

Calls C++ function: QList<QLocale> QObject::findChildren<QLocale>(const QRegularExpression& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_locale_q_string(
    &self,
    a_name: impl CastInto<Ref<QString>>
) -> CppBox<QListOfQLocale>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QLocale> QObject::findChildren<QLocale>(const QString& aName = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_locale(&self) -> CppBox<QListOfQLocale>[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QLocale> QObject::findChildren<QLocale>() const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_locale_q_reg_exp(
    &self,
    re: impl CastInto<Ref<QRegExp>>
) -> CppBox<QListOfQLocale>
[src]

This function overloads findChildren().

Calls C++ function: QList<QLocale> QObject::findChildren<QLocale>(const QRegExp& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_locale_q_regular_expression(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>
) -> CppBox<QListOfQLocale>
[src]

This function overloads findChildren().

Calls C++ function: QList<QLocale> QObject::findChildren<QLocale>(const QRegularExpression& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_object_q_string_q_flags_find_child_option(
    &self,
    a_name: impl CastInto<Ref<QString>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQObject>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QObject*> QObject::findChildren<QObject*>(const QString& aName = …, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_object_q_reg_exp_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegExp>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQObject>
[src]

This function overloads findChildren().

Calls C++ function: QList<QObject*> QObject::findChildren<QObject*>(const QRegExp& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_object_q_regular_expression_q_flags_find_child_option(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>,
    options: QFlags<FindChildOption>
) -> CppBox<QListOfQObject>
[src]

This function overloads findChildren().

Calls C++ function: QList<QObject*> QObject::findChildren<QObject*>(const QRegularExpression& re, QFlags<Qt::FindChildOption> options = …) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn find_children_q_object_q_string(
    &self,
    a_name: impl CastInto<Ref<QString>>
) -> CppBox<QListOfQObject>
[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QObject*> QObject::findChildren<QObject*>(const QString& aName = …) const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_object(&self) -> CppBox<QListOfQObject>[src]

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

Calls C++ function: QList<QObject*> QObject::findChildren<QObject*>() const.

C++ documentation:

Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. Omitting the name argument causes all object names to be matched. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

The following example shows how to find a list of child QWidgets of the specified parentWidget named widgetname:

QList<QWidget > widgets = parentWidget.findChildren<QWidget >("widgetname");

This example returns all QPushButtons that are children of parentWidget:

QList<QPushButton > allPButtons = parentWidget.findChildren<QPushButton >();

This example returns all QPushButtons that are immediate children of parentWidget:

QList<QPushButton > childButtons = parentWidget.findChildren<QPushButton >(QString(), Qt::FindDirectChildrenOnly);

See also findChild().

pub unsafe fn find_children_q_object_q_reg_exp(
    &self,
    re: impl CastInto<Ref<QRegExp>>
) -> CppBox<QListOfQObject>
[src]

This function overloads findChildren().

Calls C++ function: QList<QObject*> QObject::findChildren<QObject*>(const QRegExp& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression regExp, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

pub unsafe fn find_children_q_object_q_regular_expression(
    &self,
    re: impl CastInto<Ref<QRegularExpression>>
) -> CppBox<QListOfQObject>
[src]

This function overloads findChildren().

Calls C++ function: QList<QObject*> QObject::findChildren<QObject*>(const QRegularExpression& re) const.

C++ documentation:

This function overloads findChildren().

Returns the children of this object that can be cast to type T and that have names matching the regular expression re, or an empty list if there are no such objects. The search is performed recursively, unless options specifies the option FindDirectChildrenOnly.

This function was introduced in Qt 5.0.

pub unsafe fn inherits(&self, classname: impl CastInto<Ptr<c_char>>) -> bool[src]

Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.

Calls C++ function: bool QObject::inherits(const char* classname) const.

C++ documentation:

Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.

A class is considered to inherit itself.

Example:

QTimer *timer = new QTimer; // QTimer inherits QObject timer->inherits("QTimer"); // returns true timer->inherits("QObject"); // returns true timer->inherits("QAbstractButton"); // returns false

// QVBoxLayout inherits QObject and QLayoutItem QVBoxLayout *layout = new QVBoxLayout; layout->inherits("QObject"); // returns true layout->inherits("QLayoutItem"); // returns true (even though QLayoutItem is not a QObject)

If you need to determine whether an object is an instance of a particular class for the purpose of casting it, consider using qobject_cast<Type *>(object) instead.

See also metaObject() and qobject_cast().

pub unsafe fn install_event_filter(
    &mut self,
    filter_obj: impl CastInto<MutPtr<QObject>>
)
[src]

Installs an event filter filterObj on this object. For example:

Calls C++ function: void QObject::installEventFilter(QObject* filterObj).

C++ documentation:

Installs an event filter filterObj on this object. For example:


  monitoredObj->installEventFilter(filterObj);

An event filter is an object that receives all events that are sent to this object. The filter can either stop the event or forward it to this object. The event filter filterObj receives events via its eventFilter() function. The eventFilter() function must return true if the event should be filtered, (i.e. stopped); otherwise it must return false.

If multiple event filters are installed on a single object, the filter that was installed last is activated first.

Here's a KeyPressEater class that eats the key presses of its monitored objects:

class KeyPressEater : public QObject { Q_OBJECT ...

protected: bool eventFilter(QObject obj, QEvent event); };

bool KeyPressEater::eventFilter(QObject obj, QEvent event) { if (event->type() == QEvent::KeyPress) { QKeyEvent keyEvent = static_cast<QKeyEvent >(event); qDebug("Ate key press %d", keyEvent->key()); return true; } else { // standard event processing return QObject::eventFilter(obj, event); } }

And here's how to install it on two widgets:

KeyPressEater keyPressEater = new KeyPressEater(this); QPushButton pushButton = new QPushButton(this); QListView *listView = new QListView(this);

pushButton->installEventFilter(keyPressEater); listView->installEventFilter(keyPressEater);

The QShortcut class, for example, uses this technique to intercept shortcut key presses.

Warning: If you delete the receiver object in your eventFilter() function, be sure to return true. If you return false, Qt sends the event to the deleted object and the program will crash.

Note that the filtering object must be in the same thread as this object. If filterObj is in a different thread, this function does nothing. If either filterObj or this object are moved to a different thread after calling this function, the event filter will not be called until both objects have the same thread affinity again (it is not removed).

See also removeEventFilter(), eventFilter(), and event().

pub unsafe fn is_widget_type(&self) -> bool[src]

Returns true if the object is a widget; otherwise returns false.

Calls C++ function: bool QObject::isWidgetType() const.

C++ documentation:

Returns true if the object is a widget; otherwise returns false.

Calling this function is equivalent to calling inherits("QWidget"), except that it is much faster.

pub unsafe fn is_window_type(&self) -> bool[src]

Returns true if the object is a window; otherwise returns false.

Calls C++ function: bool QObject::isWindowType() const.

C++ documentation:

Returns true if the object is a window; otherwise returns false.

Calling this function is equivalent to calling inherits("QWindow"), except that it is much faster.

pub unsafe fn kill_timer(&mut self, id: c_int)[src]

Kills the timer with timer identifier, id.

Calls C++ function: void QObject::killTimer(int id).

C++ documentation:

Kills the timer with timer identifier, id.

The timer identifier is returned by startTimer() when a timer event is started.

See also timerEvent() and startTimer().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Returns a pointer to the meta-object of this object.

Calls C++ function: virtual const QMetaObject* QObject::metaObject() const.

C++ documentation:

Returns a pointer to the meta-object of this object.

A meta-object contains information about a class that inherits QObject, e.g. class name, superclass name, properties, signals and slots. Every QObject subclass that contains the Q_OBJECT macro will have a meta-object.

The meta-object information is required by the signal/slot connection mechanism and the property system. The inherits() function also makes use of the meta-object.

If you have no pointer to an actual object instance but still want to access the meta-object of a class, you can use staticMetaObject.

Example:

QObject *obj = new QPushButton; obj->metaObject()->className(); // returns "QPushButton"

QPushButton::staticMetaObject.className(); // returns "QPushButton"

See also staticMetaObject.

pub unsafe fn move_to_thread(&mut self, thread: impl CastInto<MutPtr<QThread>>)[src]

Changes the thread affinity for this object and its children. The object cannot be moved if it has a parent. Event processing will continue in the targetThread.

Calls C++ function: void QObject::moveToThread(QThread* thread).

C++ documentation:

Changes the thread affinity for this object and its children. The object cannot be moved if it has a parent. Event processing will continue in the targetThread.

To move an object to the main thread, use QApplication::instance() to retrieve a pointer to the current application, and then use QApplication::thread() to retrieve the thread in which the application lives. For example:

myObject->moveToThread(QApplication::instance()->thread());

If targetThread is zero, all event processing for this object and its children stops.

Note that all active timers for the object will be reset. The timers are first stopped in the current thread and restarted (with the same interval) in the targetThread. As a result, constantly moving an object between threads can postpone timer events indefinitely.

A QEvent::ThreadChange event is sent to this object just before the thread affinity is changed. You can handle this event to perform any special processing. Note that any new events that are posted to this object will be handled in the targetThread.

Warning: This function is not thread-safe; the current thread must be same as the current thread affinity. In other words, this function can only "push" an object from the current thread to another thread, it cannot "pull" an object from any arbitrary thread to the current thread.

See also thread().

pub unsafe fn object_name(&self) -> CppBox<QString>[src]

This property holds the name of this object

Calls C++ function: QString QObject::objectName() const.

C++ documentation:

This property holds the name of this object

You can find an object by name (and type) using findChild(). You can find a set of objects with findChildren().

qDebug("MyClass::setPrecision(): (%s) invalid precision %f", qPrintable(objectName()), newPrecision);

By default, this property contains an empty string.

Access functions:

QString objectName() const
void setObjectName(const QString &name)

Notifier signal:

void objectNameChanged(const QString &objectName)[see note below]

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

See also metaObject() and QMetaObject::className().

pub unsafe fn parent(&self) -> MutPtr<QObject>[src]

Returns a pointer to the parent object.

Calls C++ function: QObject* QObject::parent() const.

C++ documentation:

Returns a pointer to the parent object.

See also setParent() and children().

pub unsafe fn property(
    &self,
    name: impl CastInto<Ptr<c_char>>
) -> CppBox<QVariant>
[src]

Returns the value of the object's name property.

Calls C++ function: QVariant QObject::property(const char* name) const.

C++ documentation:

Returns the value of the object's name property.

If no such property exists, the returned variant is invalid.

Information about all available properties is provided through the metaObject() and dynamicPropertyNames().

See also setProperty(), QVariant::isValid(), metaObject(), and dynamicPropertyNames().

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QObject::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QObject::qt_metacast(const char* arg1).

pub unsafe fn remove_event_filter(
    &mut self,
    obj: impl CastInto<MutPtr<QObject>>
)
[src]

Removes an event filter object obj from this object. The request is ignored if such an event filter has not been installed.

Calls C++ function: void QObject::removeEventFilter(QObject* obj).

C++ documentation:

Removes an event filter object obj from this object. The request is ignored if such an event filter has not been installed.

All event filters for this object are automatically removed when this object is destroyed.

It is always safe to remove an event filter, even during event filter activation (i.e. from the eventFilter() function).

See also installEventFilter(), eventFilter(), and event().

pub unsafe fn set_object_name(&mut self, name: impl CastInto<Ref<QString>>)[src]

This property holds the name of this object

Calls C++ function: void QObject::setObjectName(const QString& name).

C++ documentation:

This property holds the name of this object

You can find an object by name (and type) using findChild(). You can find a set of objects with findChildren().

qDebug("MyClass::setPrecision(): (%s) invalid precision %f", qPrintable(objectName()), newPrecision);

By default, this property contains an empty string.

Access functions:

QString objectName() const
void setObjectName(const QString &name)

Notifier signal:

void objectNameChanged(const QString &objectName)[see note below]

Note: This is a private signal. It can be used in signal connections but cannot be emitted by the user.

See also metaObject() and QMetaObject::className().

pub unsafe fn set_parent(&mut self, parent: impl CastInto<MutPtr<QObject>>)[src]

Makes the object a child of parent.

Calls C++ function: void QObject::setParent(QObject* parent).

C++ documentation:

Makes the object a child of parent.

See also parent() and children().

pub unsafe fn set_property(
    &mut self,
    name: impl CastInto<Ptr<c_char>>,
    value: impl CastInto<Ref<QVariant>>
) -> bool
[src]

Sets the value of the object's name property to value.

Calls C++ function: bool QObject::setProperty(const char* name, const QVariant& value).

C++ documentation:

Sets the value of the object's name property to value.

If the property is defined in the class using Q_PROPERTY then true is returned on success and false otherwise. If the property is not defined using Q_PROPERTY, and therefore not listed in the meta-object, it is added as a dynamic property and false is returned.

Information about all available properties is provided through the metaObject() and dynamicPropertyNames().

Dynamic properties can be queried again using property() and can be removed by setting the property value to an invalid QVariant. Changing the value of a dynamic property causes a QDynamicPropertyChangeEvent to be sent to the object.

Note: Dynamic properties starting with "_q_" are reserved for internal purposes.

See also property(), metaObject(), dynamicPropertyNames(), and QMetaProperty::write().

pub unsafe fn signals_blocked(&self) -> bool[src]

Returns true if signals are blocked; otherwise returns false.

Calls C++ function: bool QObject::signalsBlocked() const.

C++ documentation:

Returns true if signals are blocked; otherwise returns false.

Signals are not blocked by default.

See also blockSignals() and QSignalBlocker.

pub unsafe fn start_timer_2a(
    &mut self,
    interval: c_int,
    timer_type: TimerType
) -> c_int
[src]

Starts a timer and returns a timer identifier, or returns zero if it could not start a timer.

Calls C++ function: int QObject::startTimer(int interval, Qt::TimerType timerType = …).

C++ documentation:

Starts a timer and returns a timer identifier, or returns zero if it could not start a timer.

A timer event will occur every interval milliseconds until killTimer() is called. If interval is 0, then the timer event occurs once every time there are no more window system events to process.

The virtual timerEvent() function is called with the QTimerEvent event parameter class when a timer event occurs. Reimplement this function to get timer events.

If multiple timers are running, the QTimerEvent::timerId() can be used to find out which timer was activated.

Example:

class MyObject : public QObject { Q_OBJECT

public: MyObject(QObject *parent = 0);

protected: void timerEvent(QTimerEvent *event); };

MyObject::MyObject(QObject *parent) : QObject(parent) { startTimer(50); // 50-millisecond timer startTimer(1000); // 1-second timer startTimer(60000); // 1-minute timer

using namespace std::chrono; startTimer(milliseconds(50)); startTimer(seconds(1)); startTimer(minutes(1));

// since C++14 we can use std::chrono::duration literals, e.g.: startTimer(100ms); startTimer(5s); startTimer(2min); startTimer(1h); }

void MyObject::timerEvent(QTimerEvent *event) { qDebug() << "Timer ID:" << event->timerId(); }

Note that QTimer's accuracy depends on the underlying operating system and hardware. The timerType argument allows you to customize the accuracy of the timer. See Qt::TimerType for information on the different timer types. Most platforms support an accuracy of 20 milliseconds; some provide more. If Qt is unable to deliver the requested number of timer events, it will silently discard some.

The QTimer class provides a high-level programming interface with single-shot timers and timer signals instead of events. There is also a QBasicTimer class that is more lightweight than QTimer and less clumsy than using timer IDs directly.

See also timerEvent(), killTimer(), and QTimer::singleShot().

pub unsafe fn start_timer_1a(&mut self, interval: c_int) -> c_int[src]

Starts a timer and returns a timer identifier, or returns zero if it could not start a timer.

Calls C++ function: int QObject::startTimer(int interval).

C++ documentation:

Starts a timer and returns a timer identifier, or returns zero if it could not start a timer.

A timer event will occur every interval milliseconds until killTimer() is called. If interval is 0, then the timer event occurs once every time there are no more window system events to process.

The virtual timerEvent() function is called with the QTimerEvent event parameter class when a timer event occurs. Reimplement this function to get timer events.

If multiple timers are running, the QTimerEvent::timerId() can be used to find out which timer was activated.

Example:

class MyObject : public QObject { Q_OBJECT

public: MyObject(QObject *parent = 0);

protected: void timerEvent(QTimerEvent *event); };

MyObject::MyObject(QObject *parent) : QObject(parent) { startTimer(50); // 50-millisecond timer startTimer(1000); // 1-second timer startTimer(60000); // 1-minute timer

using namespace std::chrono; startTimer(milliseconds(50)); startTimer(seconds(1)); startTimer(minutes(1));

// since C++14 we can use std::chrono::duration literals, e.g.: startTimer(100ms); startTimer(5s); startTimer(2min); startTimer(1h); }

void MyObject::timerEvent(QTimerEvent *event) { qDebug() << "Timer ID:" << event->timerId(); }

Note that QTimer's accuracy depends on the underlying operating system and hardware. The timerType argument allows you to customize the accuracy of the timer. See Qt::TimerType for information on the different timer types. Most platforms support an accuracy of 20 milliseconds; some provide more. If Qt is unable to deliver the requested number of timer events, it will silently discard some.

The QTimer class provides a high-level programming interface with single-shot timers and timer signals instead of events. There is also a QBasicTimer class that is more lightweight than QTimer and less clumsy than using timer IDs directly.

See also timerEvent(), killTimer(), and QTimer::singleShot().

pub unsafe fn thread(&self) -> MutPtr<QThread>[src]

Returns the thread in which the object lives.

Calls C++ function: QThread* QObject::thread() const.

C++ documentation:

Returns the thread in which the object lives.

See also moveToThread().

Trait Implementations

impl Deref for QIODevice[src]

type Target = QObject

The resulting type after dereferencing.

fn deref(&self) -> &QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QIODevice* ptr).

impl DerefMut for QIODevice[src]

fn deref_mut(&mut self) -> &mut QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QIODevice* ptr).

impl StaticUpcast<QObject> for QIODevice[src]

unsafe fn static_upcast(ptr: Ptr<QIODevice>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QIODevice* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QIODevice* ptr).

impl StaticUpcast<QIODevice> for QBuffer[src]

unsafe fn static_upcast(ptr: Ptr<QBuffer>) -> Ptr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QBuffer* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QBuffer>) -> MutPtr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QBuffer* ptr).

impl StaticUpcast<QIODevice> for QFileDevice[src]

unsafe fn static_upcast(ptr: Ptr<QFileDevice>) -> Ptr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QFileDevice* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QFileDevice>) -> MutPtr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QFileDevice* ptr).

impl StaticUpcast<QIODevice> for QFile[src]

unsafe fn static_upcast(ptr: Ptr<QFile>) -> Ptr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QFile* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QFile>) -> MutPtr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QFile* ptr).

impl StaticUpcast<QIODevice> for QProcess[src]

unsafe fn static_upcast(ptr: Ptr<QProcess>) -> Ptr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QProcess* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QProcess>) -> MutPtr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QProcess* ptr).

impl StaticUpcast<QIODevice> for QSaveFile[src]

unsafe fn static_upcast(ptr: Ptr<QSaveFile>) -> Ptr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QSaveFile* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QSaveFile>) -> MutPtr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QSaveFile* ptr).

impl StaticUpcast<QIODevice> for QTemporaryFile[src]

unsafe fn static_upcast(ptr: Ptr<QTemporaryFile>) -> Ptr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QTemporaryFile* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QTemporaryFile>) -> MutPtr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QTemporaryFile* ptr).

impl StaticDowncast<QIODevice> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QObject* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QIODevice>[src]

Calls C++ function: QIODevice* static_cast<QIODevice*>(QObject* ptr).

impl StaticDowncast<QBuffer> for QIODevice[src]

unsafe fn static_downcast(ptr: Ptr<QIODevice>) -> Ptr<QBuffer>[src]

Calls C++ function: QBuffer* static_cast<QBuffer*>(QIODevice* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QBuffer>[src]

Calls C++ function: QBuffer* static_cast<QBuffer*>(QIODevice* ptr).

impl StaticDowncast<QFileDevice> for QIODevice[src]

unsafe fn static_downcast(ptr: Ptr<QIODevice>) -> Ptr<QFileDevice>[src]

Calls C++ function: QFileDevice* static_cast<QFileDevice*>(QIODevice* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QFileDevice>[src]

Calls C++ function: QFileDevice* static_cast<QFileDevice*>(QIODevice* ptr).

impl StaticDowncast<QFile> for QIODevice[src]

unsafe fn static_downcast(ptr: Ptr<QIODevice>) -> Ptr<QFile>[src]

Calls C++ function: QFile* static_cast<QFile*>(QIODevice* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QFile>[src]

Calls C++ function: QFile* static_cast<QFile*>(QIODevice* ptr).

impl StaticDowncast<QProcess> for QIODevice[src]

unsafe fn static_downcast(ptr: Ptr<QIODevice>) -> Ptr<QProcess>[src]

Calls C++ function: QProcess* static_cast<QProcess*>(QIODevice* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QProcess>[src]

Calls C++ function: QProcess* static_cast<QProcess*>(QIODevice* ptr).

impl StaticDowncast<QSaveFile> for QIODevice[src]

unsafe fn static_downcast(ptr: Ptr<QIODevice>) -> Ptr<QSaveFile>[src]

Calls C++ function: QSaveFile* static_cast<QSaveFile*>(QIODevice* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QSaveFile>[src]

Calls C++ function: QSaveFile* static_cast<QSaveFile*>(QIODevice* ptr).

impl StaticDowncast<QTemporaryFile> for QIODevice[src]

unsafe fn static_downcast(ptr: Ptr<QIODevice>) -> Ptr<QTemporaryFile>[src]

Calls C++ function: QTemporaryFile* static_cast<QTemporaryFile*>(QIODevice* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QTemporaryFile>[src]

Calls C++ function: QTemporaryFile* static_cast<QTemporaryFile*>(QIODevice* ptr).

impl DynamicCast<QIODevice> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QIODevice>[src]

Calls C++ function: QIODevice* dynamic_cast<QIODevice*>(QObject* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QIODevice>[src]

Calls C++ function: QIODevice* dynamic_cast<QIODevice*>(QObject* ptr).

impl DynamicCast<QBuffer> for QIODevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QIODevice>) -> Ptr<QBuffer>[src]

Calls C++ function: QBuffer* dynamic_cast<QBuffer*>(QIODevice* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QBuffer>[src]

Calls C++ function: QBuffer* dynamic_cast<QBuffer*>(QIODevice* ptr).

impl DynamicCast<QFileDevice> for QIODevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QIODevice>) -> Ptr<QFileDevice>[src]

Calls C++ function: QFileDevice* dynamic_cast<QFileDevice*>(QIODevice* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QFileDevice>[src]

Calls C++ function: QFileDevice* dynamic_cast<QFileDevice*>(QIODevice* ptr).

impl DynamicCast<QFile> for QIODevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QIODevice>) -> Ptr<QFile>[src]

Calls C++ function: QFile* dynamic_cast<QFile*>(QIODevice* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QFile>[src]

Calls C++ function: QFile* dynamic_cast<QFile*>(QIODevice* ptr).

impl DynamicCast<QProcess> for QIODevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QIODevice>) -> Ptr<QProcess>[src]

Calls C++ function: QProcess* dynamic_cast<QProcess*>(QIODevice* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QProcess>[src]

Calls C++ function: QProcess* dynamic_cast<QProcess*>(QIODevice* ptr).

impl DynamicCast<QSaveFile> for QIODevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QIODevice>) -> Ptr<QSaveFile>[src]

Calls C++ function: QSaveFile* dynamic_cast<QSaveFile*>(QIODevice* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QSaveFile>[src]

Calls C++ function: QSaveFile* dynamic_cast<QSaveFile*>(QIODevice* ptr).

impl DynamicCast<QTemporaryFile> for QIODevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QIODevice>) -> Ptr<QTemporaryFile>[src]

Calls C++ function: QTemporaryFile* dynamic_cast<QTemporaryFile*>(QIODevice* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QIODevice>) -> MutPtr<QTemporaryFile>[src]

Calls C++ function: QTemporaryFile* dynamic_cast<QTemporaryFile*>(QIODevice* ptr).

impl CppDeletable for QIODevice[src]

unsafe fn delete(&mut self)[src]

The destructor is virtual, and QIODevice is an abstract base class. This destructor does not call close(), but the subclass destructor might. If you are in doubt, call close() before destroying the QIODevice.

Calls C++ function: virtual [destructor] void QIODevice::~QIODevice().

C++ documentation:

The destructor is virtual, and QIODevice is an abstract base class. This destructor does not call close(), but the subclass destructor might. If you are in doubt, call close() before destroying the QIODevice.

impl Size for QIODevice[src]

unsafe fn size(&self) -> usize[src]

For open random-access devices, this function returns the size of the device. For open sequential devices, bytesAvailable() is returned.

Calls C++ function: virtual qint64 QIODevice::size() const.

C++ documentation:

For open random-access devices, this function returns the size of the device. For open sequential devices, bytesAvailable() is returned.

If the device is closed, the size returned will not reflect the actual size of the device.

See also isSequential() and pos().

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]