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

📄 qurloperator.3qt

📁 qt-embedded-2.3.8.tar.gz源码
💻 3QT
📖 第 1 页 / 共 2 页
字号:
This signal is emitted when new \fIdata\fR has been received after e.g. calling get() or put(). \fIop\fR holds the name of the file which data is retrieved in the first argument and the data in the second argument (raw). You get them with op->arg( 0 ) and op->rawArg( 1 )..PP\fIop\fR is the pointer to the operation object, which contains all infos of the operation, including the state and so on..PPSee also QNetworkOperation and QNetworkProtocol..SH "void QUrlOperator::dataTransferProgress ( int bytesDone, int bytesTotal, QNetworkOperation * op ) \fC[signal]\fR"When transferring data (using put() or get()) this signal is emitted during the progress. \fIbytesDone\fR tells how many bytes of \fIbytesTotal\fR are transferred. More information about the operation is stored in the \fIop,\fR the pointer to the network operation which is processed. \fIbytesTotal\fR may be -1, which means that the number of total bytes is not known..PPSee also QNetworkOperation and QNetworkProtocol..SH "void QUrlOperator::deleteNetworkProtocol () \fC[protected]\fR"Delete the currently used network protocol..SH "void QUrlOperator::finished ( QNetworkOperation * op ) \fC[signal]\fR"This signal is emitted when an operation of some sort finished. This signal is emitted always, this means on success and on failure. \fIop\fR is the pointer to the operation object, which contains all infos of the operation which has been finished, including the state and so on. To check if the operation was successful or not, check the state and error code of the operation object..PPSee also QNetworkOperation and QNetworkProtocol..SH "const QNetworkOperation * QUrlOperator::get ( const QString & location = QString::null ) \fC[virtual]\fR"Tells the network protocol to get data from \fIlocation\fR or, if this is QString::null, to get data from the location to which this URL points (see QUrl::fileName() and QUrl::encodedPathAndQuery()). What exactly happens then is depending on the network protocol. When data comes in, the data() signal is emitted. As it's unlikely that all the data comes in at once, multiple data() signals will be emitted. During processing the operation the dataTransferProgress() is emitted. Also at the end finished() (on success or failure) is emitted, so check the state of the network operation object to see if the operation was successful or not..PPNow, if \fIlocation\fR is QString::null, the path of this QUrlOperator should point to a file when you use this operation. If \fIlocation\fR is not empty, it can be relative (a child of the path to which the QUrlOperator points) or an absolute URL..PPE.g. for getting a Web page you might do something like.PP.nf.br  QUrlOperator op( "http://www.whatever.org/cgi-bin/search.pl?cmd=Hallo" );.br  op.get();.fi.PPBut as for the most other operations it is required that the path of the QUrlOperator points to a directory, you could do following if you want e.g. download a file.PP.nf.br  QUrlOperator op( "ftp://ftp.whatever.org/pub" );.br  // do some other stuff like op.listChildren() or op.mkdir( "new Dir" ).br  op.get( "a_file.txt" );.fi.PPThis will get the data of ftp://ftp.whatever.org/pub/a_file.txt..PPBut \fBnever\fR do something like.PP.nf.br  QUrlOperator op( "http://www.whatever.org/cgi-bin" );.br  op.get( "search.pl?cmd=Hallo" );.fi.PPThis means if \fIlocation\fR is not empty and relative, it must not contain any queries or references, just the name of a child. So, if you need to specify a query or reference do it like in the first example or specify the full URL (like http://www.whatever.org/cgi-bin/search.pl?cmd=Hallo) as \fIlocation.\fR.PPSee also copy()..SH "void QUrlOperator::getNetworkProtocol () \fC[protected]\fR"Finds a network protocol for the URL and deletes the old network protocol..SH "QUrlInfo QUrlOperator::info ( const QString & entry ) const \fC[virtual]\fR"Returns the URL information for the child \fIentry\fR or en empty QUrlInfo object of there is no information available about \fIentry.\fR.SH "bool QUrlOperator::isDir ( bool * ok = 0 ) \fC[virtual]\fR"Returns TRUE if the url is a directory, else returns FALSE. This may not always work correctly, if the protocol of the URL is something else than file (local filesystem)! If you pass a bool as \fIok\fR argument, this is set to TRUE, if the result of this method is correct for sure, else \fIok\fR is set to FALSE..SH "void QUrlOperator::itemChanged ( QNetworkOperation * op ) \fC[signal]\fR"This signal is emitted whenever a file, which is a child of this URL, has been changed e.g. by successfully calling rename(). \fIop\fR holds the original and the new filenames in the first and second arguments. You get them with op->arg( 0 ) and op->arg( 1 )..PP\fIop\fR is the pointer to the operation object, which contains all infos of the operation, including the state and so on..PPSee also QNetworkOperation and QNetworkProtocol..SH "const QNetworkOperation * QUrlOperator::listChildren () \fC[virtual]\fR"Starts listing the children of this URL (e.g. of a directory). The signal start() is emitted, before the first entry is listed, and after the last one finished() is emitted. For each list of new entries, the newChildren() signals is emitted. If an error occurs, also the signal finished() is emitted, so check the state of the network operation pointer!.PPAs the operation will not be executed immediately, a pointer to the QNetworkOperation object, which is created by this method, is returned. This object contains all data about the operation and is used to refer to this operation later (e.g. in the signals which are emitted by the QUrlOperator). The return value can be also 0 if the operation object couldn't be created..PPThe path of this QUrlOperator has to point to a directory, because the children of this directory will be listed, and not to a file, else this operation might not work!..SH "const QNetworkOperation * QUrlOperator::mkdir ( const QString & dirname ) \fC[virtual]\fR"Tries to create a directory (child) with the name \fIdirname.\fR If it has been successful a newChildren() signal with the new child is emitted, and the createdDirectory() signal with the information about the new child is emitted too. Also finished() (on success or failure) is emitted, after the operation has been processed, so check the state of the network operation object to see if the operation was successful or not..PPAs the operation will not be executed immediately, a pointer to the QNetworkOperation object, which is created by this method, is returned. This object contains all data about the operation and is used to refer to this operation later (e.g. in the signals which are emitted by the QUrlOperator). The return value can be also 0 if the operation object couldn't be created..PPThis path of this QUrlOperator has to point to a directory, as the new directory will be created in this path, and not to a file, else this operation might not work!..SH "QString QUrlOperator::nameFilter () const"Returns the name filter of the URL.PPSee also QUrlOperator::setNameFilter() and QDir::nameFilter()..SH "void QUrlOperator::newChildren ( const QValueList<QUrlInfo> & i, QNetworkOperation * op ) \fC[signal]\fR"This signal is emitted after listChildren() was called and new children (e.g. files) have been read from a list of files. \fIi\fR holds the information about the new children. \fIop\fR is the pointer to the operation object, which contains all infos of the operation, including the state and so on..PPSee also QNetworkOperation and QNetworkProtocol..SH "QUrlOperator& QUrlOperator::operator= ( const QString & url )"Reimplemented for internal reasons; the API is not affected..SH "QUrlOperator& QUrlOperator::operator= ( const QUrlOperator & url )"Reimplemented for internal reasons; the API is not affected..SH "bool QUrlOperator::parse ( const QString & url ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..SH "const QNetworkOperation * QUrlOperator::put ( const QByteArray & data, const QString & location = QString::null ) \fC[virtual]\fR"Tells the network protocol to put \fIdata\fR to \fIlocation,\fR or if this is empty (QString::null) it puts the \fIdata\fR to the location to which the URL points. What exactly happens is depending on the network protocol. Also depending on the network protocol after putting data some data might come back. In this case the data() signal is emitted. During processing the operation the dataTransferProgress() is emitted. Also at the end finished() (on success or failure) is emitted, so check the state of the network operation object to see if the operation was successful or not..PPNow, if \fIlocation\fR is QString::null, the path of this QUrlOperator should point to a file when you use this operation. If \fIlocation\fR is not empty, it can be relative (a child of the path to which the QUrlOperator points) or an absolute URL..PPE.g. for putting some data to a file you can do.PP.nf.br  QUrlOperator op( "ftp://ftp.whatever.com/home/me/filename" );.br  op.put( data );.fi.PPBut as for the most other operations it is required that the path of the QUrlOperator points to a directory, you could do following if you want e.g. upload data to a file.PP.nf.br  QUrlOperator op( "ftp://ftp.whatever.com/home/me" );.br  // do some other stuff like op.listChildren() or op.mkdir( "new Dir" ).br  op.put( data, "filename" );.fi.PPThis will upload the data to ftp://ftp.whatever.com/home/me/filename..PPSee also copy()..SH "const QNetworkOperation * QUrlOperator::remove ( const QString & filename ) \fC[virtual]\fR"Tries to remove the file (child) \fIfilename.\fR If it has been successful the signal removed() is emitted. Also finished() (on success or failure) is emitted after the operation has been processed, so check the state of the network operation object to see if the operation was successful or not..PPAs the operation will not be executed immediately, a pointer to the QNetworkOperation object, which is created by this method, is returned. This object contains all data about the operation and is used to refer to this operation later (e.g. in the signals which are emitted by the QUrlOperator). The return value can be also 0 if the operation object couldn't be created..PPThis path of this QUrlOperator has to point to a directory, because if \fIfilename\fR is relative, it will be tried to remove it in this directory, and not to a file, else this operation might not work!..SH "void QUrlOperator::removed ( QNetworkOperation * op ) \fC[signal]\fR"This signal is emitted when remove() has been succesful and the file has been removed. \fIop\fR holds the filename of the removed file in the first argument, you get it with op->arg( 0 )..PP\fIop\fR is the pointer to the operation object, which contains all infos of the operation, including the state and so on..PPSee also QNetworkOperation and QNetworkProtocol..SH "const QNetworkOperation * QUrlOperator::rename ( const QString & oldname, const QString & newname ) \fC[virtual]\fR"Tries to rename the file (child) \fIoldname\fR by \fInewname.\fR If it has been successful the signal itemChanged() is emitted. Also finished() (on success or failure) is emitted after the operation has been processed, so check the state of the network operation object to see if the operation was successful or not..PPAs the operation will not be executed immediately, a pointer to the QNetworkOperation object, which is created by this method, is returned. This object contains all data about the operation and is used to refer to this operation later (e.g. in the signals which are emitted by the QUrlOperator). The return value can be also 0 if the operation object couldn't be created..PPThis path of this QUrlOperator has to point to a directory, as \fIoldname\fR and \fInewname\fR are handled relatively to this directory, and not to a file, else this operation might not work!..SH "void QUrlOperator::reset () \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..SH "void QUrlOperator::setNameFilter ( const QString & nameFilter ) \fC[virtual]\fR"Sets the name filter of the URL.PPSee also QDir::setNameFilter()..SH "void QUrlOperator::setPath ( const QString & path ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..SH "void QUrlOperator::start ( QNetworkOperation * op ) \fC[signal]\fR"Some operations (like listChildren()) emit this signal when they start processing the operation. \fIop\fR is the pointer to the operation object, which contains all infos of the operation, including the state and so on..PPSee also QNetworkOperation and QNetworkProtocol..SH "void QUrlOperator::startedNextCopy ( const QList<QNetworkOperation> & lst ) \fC[signal]\fR"This signal is emitted if copy() started a new copy operation. \fIlst\fR contains all QNetworkOperations which describe this copy operation..PPSee also copy()..SH "void QUrlOperator::stop () \fC[virtual]\fR"Stops the current network operation which is just processed andremoves all waiting network operations of this QUrlOperator..SH "SEE ALSO".BR http://doc.trolltech.com/qurloperator.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qurloperator.3qt) and the Qtversion (2.3.8).

⌨️ 快捷键说明

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