本文整理汇总了C++中QUrl::setUserInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ QUrl::setUserInfo方法的具体用法?C++ QUrl::setUserInfo怎么用?C++ QUrl::setUserInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QUrl
的用法示例。
在下文中一共展示了QUrl::setUserInfo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFullOutputMappingURL
QUrl ModelBaker::getFullOutputMappingURL() const {
QUrl appendedURL = _outputMappingURL;
appendedURL.setFragment(_outputURLSuffix.fragment());
appendedURL.setQuery(_outputURLSuffix.query());
appendedURL.setUserInfo(_outputURLSuffix.userInfo());
return appendedURL;
}
示例2: setUserInfo
int Url::setUserInfo ( lua_State * L )// ( const QString & userInfo )
{
QUrl* lhs = ValueInstaller2<QUrl>::check( L, 1 );
//QString* userInfo = ValueInstaller2<QString>::check( L, 2 );
lhs->setUserInfo( Util::toString( L, 2 ) );
return 0;
}
示例3: sessionUrl
QUrl Client::sessionUrl(bool includeUser) const
{
if(!isConnected())
return QUrl();
QUrl url = static_cast<const TcpServer*>(_server)->url();
url.setScheme("drawpile");
if(!includeUser)
url.setUserInfo(QString());
url.setPath("/" + sessionId());
return url;
}
示例4: load
void HttpOptsWidget::load()
{
lineFileName->setText(m_download->m_strFile);
m_urls = m_download->m_urls;
foreach(UrlClient::UrlObject obj,m_urls)
{
QUrl copy = obj.url;
copy.setUserInfo(QString());
listUrls->addItem(copy.toString());
}
示例5: createUrl
QUrl createUrl(const char *urlData, const http_parser_url &urlInfo)
{
QUrl url;
url.setScheme(CHECK_AND_GET_FIELD(urlData, urlInfo, UF_SCHEMA));
url.setHost(CHECK_AND_GET_FIELD(urlData, urlInfo, UF_HOST));
// Port is dealt with separately since it is available as an integer.
url.setPath(CHECK_AND_GET_FIELD(urlData, urlInfo, UF_PATH));
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
url.setQuery(CHECK_AND_GET_FIELD(urlData, urlInfo, UF_QUERY));
#else
if (HAS_URL_FIELD(urlInfo, UF_QUERY)) {
url.setEncodedQuery(QByteArray(urlData + urlInfo.field_data[UF_QUERY].off,
urlInfo.field_data[UF_QUERY].len));
}
#endif
url.setFragment(CHECK_AND_GET_FIELD(urlData, urlInfo, UF_FRAGMENT));
url.setUserInfo(CHECK_AND_GET_FIELD(urlData, urlInfo, UF_USERINFO));
if (HAS_URL_FIELD(urlInfo, UF_PORT))
url.setPort(urlInfo.port);
return url;
}
示例6: sendRequest
bool QHttpNetworkConnectionChannel::sendRequest()
{
if (!reply) {
// heh, how should that happen!
qWarning() << "QHttpNetworkConnectionChannel::sendRequest() called without QHttpNetworkReply";
state = QHttpNetworkConnectionChannel::IdleState;
return false;
}
switch (state) {
case QHttpNetworkConnectionChannel::IdleState: { // write the header
if (!ensureConnection()) {
// wait for the connection (and encryption) to be done
// sendRequest will be called again from either
// _q_connected or _q_encrypted
return false;
}
written = 0; // excluding the header
bytesTotal = 0;
QHttpNetworkReplyPrivate *replyPrivate = reply->d_func();
replyPrivate->clear();
replyPrivate->connection = connection;
replyPrivate->connectionChannel = this;
replyPrivate->autoDecompress = request.d->autoDecompress;
replyPrivate->pipeliningUsed = false;
// if the url contains authentication parameters, use the new ones
// both channels will use the new authentication parameters
if (!request.url().userInfo().isEmpty() && request.withCredentials()) {
QUrl url = request.url();
QAuthenticator &auth = authenticator;
if (url.userName() != auth.user()
|| (!url.password().isEmpty() && url.password() != auth.password())) {
auth.setUser(url.userName());
auth.setPassword(url.password());
connection->d_func()->copyCredentials(connection->d_func()->indexOf(socket), &auth, false);
}
// clear the userinfo, since we use the same request for resending
// userinfo in url can conflict with the one in the authenticator
url.setUserInfo(QString());
request.setUrl(url);
}
// Will only be false if QtWebKit is performing a cross-origin XMLHttpRequest
// and withCredentials has not been set to true.
if (request.withCredentials())
connection->d_func()->createAuthorization(socket, request);
#ifndef QT_NO_NETWORKPROXY
QByteArray header = QHttpNetworkRequestPrivate::header(request,
(connection->d_func()->networkProxy.type() != QNetworkProxy::NoProxy));
#else
QByteArray header = QHttpNetworkRequestPrivate::header(request, false);
#endif
socket->write(header);
// flushing is dangerous (QSslSocket calls transmit which might read or error)
// socket->flush();
QNonContiguousByteDevice* uploadByteDevice = request.uploadByteDevice();
if (uploadByteDevice) {
// connect the signals so this function gets called again
QObject::connect(uploadByteDevice, SIGNAL(readyRead()),this, SLOT(_q_uploadDataReadyRead()));
bytesTotal = request.contentLength();
state = QHttpNetworkConnectionChannel::WritingState; // start writing data
sendRequest(); //recurse
} else {
state = QHttpNetworkConnectionChannel::WaitingState; // now wait for response
sendRequest(); //recurse
}
break;
}
case QHttpNetworkConnectionChannel::WritingState:
{
// write the data
QNonContiguousByteDevice* uploadByteDevice = request.uploadByteDevice();
if (!uploadByteDevice || bytesTotal == written) {
if (uploadByteDevice)
emit reply->dataSendProgress(written, bytesTotal);
state = QHttpNetworkConnectionChannel::WaitingState; // now wait for response
sendRequest(); // recurse
break;
}
// only feed the QTcpSocket buffer when there is less than 32 kB in it
const qint64 socketBufferFill = 32*1024;
const qint64 socketWriteMaxSize = 16*1024;
#ifndef QT_NO_OPENSSL
QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket);
// if it is really an ssl socket, check more than just bytesToWrite()
while ((socket->bytesToWrite() + (sslSocket ? sslSocket->encryptedBytesToWrite() : 0))
<= socketBufferFill && bytesTotal != written)
#else
while (socket->bytesToWrite() <= socketBufferFill
&& bytesTotal != written)
#endif
{
// get pointer to upload data
//.........这里部分代码省略.........
示例7: setUserInfo
void QUrlProto::setUserInfo(const QString &userInfo)
{
QUrl *item = qscriptvalue_cast<QUrl*>(thisObject());
if (item)
item->setUserInfo(userInfo);
}