⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qnetworkprotocol.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QNetworkProtocol 3qt "24 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQNetworkProtocol \- This is the base class for network protocols which provides a common API for network protocols.br.PP\fC#include <qnetworkprotocol.h>\fR.PPInherits QObject..PPInherited by QFtp and QLocalFs..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBState\fR { StWaiting = 0, StInProgress, StDone, StFailed, StStopped }".br.ti -1c.BI "enum \fBOperation\fR { OpListChildren = 1, OpMkDir = 2, OpMkdir = OpMkDir, OpRemove = 4, OpRename = 8, OpGet = 32, OpPut = 64 }".br.ti -1c.BI "enum \fBConnectionState\fR { ConHostFound, ConConnected, ConClosed }".br.ti -1c.BI "enum \fBError\fR { NoError = 0, ErrValid, ErrUnknownProtocol, ErrUnsupported, ErrParse, ErrLoginIncorrect, ErrHostNotFound, ErrListChildren, ErrListChlidren = ErrListChildren, ErrMkDir, ErrMkdir = ErrMkDir, ErrRemove, ErrRename, ErrGet, ErrPut, ErrFileNotExisting, ErrPermissionDenied }".br.ti -1c.BI "\fBQNetworkProtocol\fR () ".br.ti -1c.BI "virtual \fB~QNetworkProtocol\fR () ".br.ti -1c.BI "virtual void \fBsetUrl\fR ( QUrlOperator * u ) ".br.ti -1c.BI "virtual void \fBsetAutoDelete\fR ( bool " "b" ", int " "i" " = 10000 ) ".br.ti -1c.BI "bool \fBautoDelete\fR () const".br.ti -1c.BI "virtual int \fBsupportedOperations\fR () const".br.ti -1c.BI "virtual void \fBaddOperation\fR ( QNetworkOperation * op ) ".br.ti -1c.BI "QUrlOperator* \fBurl\fR () const".br.ti -1c.BI "QNetworkOperation* \fBoperationInProgress\fR () const".br.ti -1c.BI "virtual void \fBclearOperationQueue\fR () ".br.ti -1c.BI "virtual void \fBstop\fR () ".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBdata\fR ( const QByteArray &, QNetworkOperation * res ) ".br.ti -1c.BI "void \fBconnectionStateChanged\fR ( int " "state" ", const QString & data ) ".br.ti -1c.BI "void \fBfinished\fR ( QNetworkOperation * res ) ".br.ti -1c.BI "void \fBstart\fR ( QNetworkOperation * res ) ".br.ti -1c.BI "void \fBnewChildren\fR ( const QValueList<QUrlInfo> &, QNetworkOperation * res ) ".br.ti -1c.BI "void \fBnewChild\fR ( const QUrlInfo &, QNetworkOperation * res ) ".br.ti -1c.BI "void \fBcreatedDirectory\fR ( const QUrlInfo &, QNetworkOperation * res ) ".br.ti -1c.BI "void \fBremoved\fR ( QNetworkOperation * res ) ".br.ti -1c.BI "void \fBitemChanged\fR ( QNetworkOperation * res ) ".br.ti -1c.BI "void \fBdataTransferProgress\fR ( int " "bytesDone" ", int " "bytesTotal" ", QNetworkOperation * res ) ".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "void \fBregisterNetworkProtocol\fR ( const QString & " "protocol" ", QNetworkProtocolFactoryBase * protocolFactory ) ".br.ti -1c.BI "QNetworkProtocol* \fBgetNetworkProtocol\fR ( const QString & protocol ) ".br.ti -1c.BI "bool \fBhasOnlyLocalFileSystem\fR () ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBprocessOperation\fR ( QNetworkOperation * op ) (internal)".br.ti -1c.BI "virtual void \fBoperationListChildren\fR ( QNetworkOperation * op ) ".br.ti -1c.BI "virtual void \fBoperationMkDir\fR ( QNetworkOperation * op ) ".br.ti -1c.BI "virtual void \fBoperationRemove\fR ( QNetworkOperation * op ) ".br.ti -1c.BI "virtual void \fBoperationRename\fR ( QNetworkOperation * op ) ".br.ti -1c.BI "virtual void \fBoperationGet\fR ( QNetworkOperation * op ) ".br.ti -1c.BI "virtual void \fBoperationPut\fR ( QNetworkOperation * op ) ".br.ti -1c.BI "virtual bool \fBcheckConnection\fR ( QNetworkOperation * op ) ".br.in -1c.SH DESCRIPTIONThis is the base class for network protocols which provides a common API for network protocols..PPThis is a baseclass which should be used for implementations of network protocols which can then be used in Qt (e.g. in the filedialog) together with the QUrlOperator..PPThe easiest way to implement a new network protocol is, to reimplement the operation[something]( QNetworkOperation * ) methods. Of course only the ones, which are supported, should be reimplemented. To specify which operations are supported, also reimplement supportedOperations() and return an int there, which is ore'd together using the supported operations from the QNetworkProtocol::Operation enum..PPWhen you implement a network protocol this way, be careful that you always emit the correct signals. Also, always emit the finished() signal when an operation is done (on failure or success!). The Qt Network Architecture relies on correctly emitted finished() signals..PPFor a detailed description about the Qt Network Architecture, and also how to implement and use network protocols in Qt, look at the Qt Network Documentation.SS "Member Type Documentation".SH "QNetworkProtocol::ConnectionState"When the connection state of a network protocol changes, it emits the signal connectionStateChanged(). The first argument is one of following values:.TP\fCConHostFound\fR - Host has been found.TP\fCConConnected\fR - Connection to the host has been established.TP\fCConClosed\fR - connection has been closed.SH "QNetworkProtocol::Error"When an operation failed (finished without success) the QNetworkOperation of the operation returns an error code, which is one of following values:.TP\fCNoError\fR - No error occurred.TP\fCErrValid\fR - The URL you are operating on is not valid.TP\fCErrUnknownProtocol\fR - There is no protocol implementation available for the protocol of the URL you are operating on (e.g. if the protocol is http and no http implementation has been registered).TP\fCErrUnsupported\fR - The operation is not supported by the protocol.TP\fCErrParse\fR - Parse error of the URL.TP\fCErrLoginIncorrect\fR - You needed to login but the username and or password are wrong.TP\fCErrHostNotFound\fR - The specified host (in the URL) couldn磘 be found.TP\fCErrListChlidren\fR - An error occurred while listing the children.TP\fCErrMkdir\fR - An error occurred when creating a directory.TP\fCErrRemove\fR - An error occurred while removing a child.TP\fCErrRename\fR - An error occurred while renaming a child.TP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -