QNetworkOperation(3qt)
β¨ QNetworkOperation β the manual page, but make it cute β¨
okay bestie, welcome to QNetworkOperation(3qt), the Qt 3 manual page that's literally about the common operations for network protocols π grab a boba, we're doing networking lore.
π NAME π
QNetworkOperation β common operations for network protocols. that's it, that's the whole vibe check.
πΈ SYNOPSIS πΈ
#include <qnetworkprotocol.h>
Inherits QObject. so yes, it's a proper Qt citizen, it has the whole QObject family tree going on π
π Public Members π
QNetworkOperation ( QNetworkProtocol::Operation operation, const QString & arg0, const QString & arg1, const QString & arg2 )QNetworkOperation ( QNetworkProtocol::Operation operation, const QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2 )~QNetworkOperation ()void setState ( QNetworkProtocol::State state )void setProtocolDetail ( const QString & detail )void setErrorCode ( int ec )void setArg ( int num, const QString & arg )void setRawArg ( int num, const QByteArray & arg )QNetworkProtocol::Operation operation () constQNetworkProtocol::State state () constQString arg ( int num ) constQByteArray rawArg ( int num ) constQString protocolDetail () constint errorCode () constvoid free ()
π¦ DESCRIPTION π¦
The QNetworkOperation class provides common operations for network protocols. no cap.
So like, an object gets created to describe the operation and the current state for each and every operation that a network protocol should process. it's giving "little note that travels around telling everyone what's happening" energy π
If you want the detailed description of the Qt Network Architecture, and how to actually implement and use network protocols in Qt, go read the Qt Network Documentation. it's the main character of this story fr fr.
See also QNetworkProtocol and Input/Output and Networking.
π MEMBER FUNCTION DOCUMENTATION π
π QNetworkOperation::QNetworkOperation ( QNetworkProtocol::Operation operation, const QString & arg0, const QString & arg1, const QString & arg2 )
Constructs a network operation object π«Ά operation is the type of the operation, and arg0, arg1 and arg2 are the first three arguments of the operation. The state is initialized to QNetworkProtocol::StWaiting.
See also QNetworkProtocol::Operation and QNetworkProtocol::State.
π QNetworkOperation::QNetworkOperation ( QNetworkProtocol::Operation operation, const QByteArray & arg0, const QByteArray & arg1, const QByteArray & arg2 )
Constructs a network operation object π«Ά operation is the type of the operation, and arg0, arg1 and arg2 are the first three raw data arguments of the operation (yes, raw, it's the bytearray twin of the constructor above, iconic duo π). The state is initialized to QNetworkProtocol::StWaiting.
See also QNetworkProtocol::Operation and QNetworkProtocol::State.
π QNetworkOperation::~QNetworkOperation ()
Destructor. it's done, it's logging off, say bye π
π QString QNetworkOperation::arg ( int num ) const
Returns the operation's num-th argument. If this argument was not already set, an empty string is returned. so like, no argument? you get "". humble. respectful. β¨
Example: network/networkprotocol/nntp.cpp.
π int QNetworkOperation::errorCode () const
Returns the error code for the last error that occurred π the receipts of what went wrong.
π void QNetworkOperation::free ()
Sets this object to delete itself when it hasn't been used for one second. lowkey dramatic of it but okay β³
Here's why: because QNetworkOperation pointers are passed around a lot, QNetworkProtocol generally does not have enough knowledge to delete these at the correct time. So if a QNetworkProtocol doesn't need an operation any more, it will call this function instead.
Note: you should never need to call the method yourself. like, never ever. hands off bestie π
π QNetworkProtocol::Operation QNetworkOperation::operation () const
Returns the type of the operation. the "what am i" of it all.
π QString QNetworkOperation::protocolDetail () const
Returns a detailed error message for the last error. This must have been set using setProtocolDetail(). if nobody set it, don't come for this function, it can't invent lore π
π QByteArray QNetworkOperation::rawArg ( int num ) const
Returns the operation's num-th raw data argument. If this argument was not already set, an empty bytearray is returned. same energy as arg(), but raw π
π void QNetworkOperation::setArg ( int num, const QString & arg )
Sets the network operation's num-th argument to arg. boom. done. set. β¨
π void QNetworkOperation::setErrorCode ( int ec )
Sets the error code to ec.
If the operation failed, the protocol should set an error code to describe the error in more detail. And if possible, one of the error codes defined in QNetworkProtocol should be used β like, please use the ones we already have, they're right there π₯Ί
See also setProtocolDetail() and QNetworkProtocol::Error.
π void QNetworkOperation::setProtocolDetail ( const QString & detail )
If the operation failed, the error message can be specified as detail. the β¨narrativeβ¨ of the failure.
π void QNetworkOperation::setRawArg ( int num, const QByteArray & arg )
Sets the network operation's num-th raw data argument to arg. raw version, obviously π¦
π void QNetworkOperation::setState ( QNetworkProtocol::State state )
Sets the state of the operation object. This should be done by the network protocol during processing; at the end it should be set to QNetworkProtocol::StDone or QNetworkProtocol::StFailed, depending on success or failure. so like, you HAVE to close the loop, either it ate or it flopped, no in-between π«Ά
See also QNetworkProtocol::State.
π QNetworkProtocol::State QNetworkOperation::state () const
Returns the state of the operation. You can determine whether an operation is still waiting to be processed, is being processed, has been processed successfully, or failed. it's the vibe check for your operation: waiting, doing, slayed, or flopped π₯
π SEE ALSO π
β COPYRIGHT β
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. read the license bestie, it's giving legally binding π
π§ AUTHOR π§
Generated automatically from the source code. so no human author to thank, the machine did it π
π BUGS π
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. (genuinely, good bug reports are the love language of maintainers π«Ά)
The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. so like, the man page is the vibe version, the HTML is the canon β¨
If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qnetworkoperation.3qt) and the Qt version (3.3.8). don't forget the version number, they will literally need it π
and that's the whole page, bestie!! this lil man page is brought to you by Trolltech AS, dated 2 February 2007, and it's from the Qt 3.3.8 era β so old it's vintage, so iconic it's still slaying ππ periodt.
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms