Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QSocketDescriptor Class Reference

\inmodule QtCore More...

#include <qsocketnotifier.h>

Collaboration diagram for QSocketDescriptor:

Public Types

using DescriptorType = int

Public Member Functions

Q_DECL_CONSTEXPR_NOT_WIN Q_IMPLICIT QSocketDescriptor (DescriptorType descriptor=DescriptorType(-1)) noexcept
Q_DECL_CONSTEXPR operator DescriptorType () const noexcept
Q_DECL_CONSTEXPR_NOT_WIN bool isValid () const noexcept

Friends

Q_DECL_CONSTEXPR_NOT_WIN bool comparesEqual (const QSocketDescriptor &lhs, const QSocketDescriptor &rhs) noexcept

Detailed Description

\inmodule QtCore

A class which holds a native socket descriptor.

Since
5.15

QSocketDescriptor makes it easier to handle native socket descriptors in cross-platform code.

On Windows it holds a {Qt::HANDLE} and on Unix it holds an int. The class will implicitly convert between the class and the native descriptor type.

Definition at line 61 of file qsocketnotifier.h.

Member Typedef Documentation

◆ DescriptorType

Definition at line 68 of file qsocketnotifier.h.

Constructor & Destructor Documentation

◆ QSocketDescriptor()

Q_DECL_CONSTEXPR_NOT_WIN Q_IMPLICIT QSocketDescriptor::QSocketDescriptor ( DescriptorType descriptor = DescriptorType(-1))
inlinenoexcept

Construct a QSocketDescriptor from a native socket descriptor.

Construct a QSocketDescriptor from a native socket descriptor.

Note
This constructor is only available on Windows.

Definition at line 73 of file qsocketnotifier.h.

Member Function Documentation

◆ isValid()

Q_DECL_CONSTEXPR_NOT_WIN bool QSocketDescriptor::isValid ( ) const
inlinenoexcept

Definition at line 84 of file qsocketnotifier.h.

◆ operator DescriptorType()

Q_DECL_CONSTEXPR QSocketDescriptor::operator DescriptorType ( ) const
inlinenoexcept

Definition at line 82 of file qsocketnotifier.h.

◆ comparesEqual

Q_DECL_CONSTEXPR_NOT_WIN bool comparesEqual ( const QSocketDescriptor & lhs,
const QSocketDescriptor & rhs )
friend

Definition at line 87 of file qsocketnotifier.h.


The documentation for this class was generated from the following files: