Compatibility Members for QUrl

以下成員源於類 QUrl are part of the Qt compatibility layer. We advise against using them in new code.

公共函數

void addPath (const QString & p )
bool cdUp ()
QString dirPath () const
QString fileName () const
bool hasHost () const
bool hasPassword () const
bool hasPath () const
bool hasPort () const
bool hasRef () const
bool hasUser () const
QString protocol () const
QString query () const
QString ref () const
void setFileName (const QString & txt )
void setProtocol (const QString & s )
void setQuery (const QString & txt )
void setRef (const QString & txt )
void setUser (const QString & s )
QString user () const
operator QString () const

靜態公共成員

void decode (QString & url )
void encode (QString & url )
bool isRelativeUrl (const QString & url )

保護函數

void reset ()

成員函數文檔編製

void QUrl:: addPath (const QString & p )

使用 setPath () 代替。

bool QUrl:: cdUp ()

Use resolved("..") instead.

例如,若有代碼像

QUrl url("http://example.com/Developer/");
url.cdUp();
					

可以把它重寫成

QUrl url("http://example.com/Developer/");
url = url.resolved("..");
					

[static] void QUrl:: decode ( QString & url )

使用 fromPercentEncoding () 代替。

QString QUrl:: dirPath () const

使用 QFileInfo ( path ()).absolutePath() or QFileInfo ( path ()) instead.

[static] void QUrl:: encode ( QString & url )

使用 toPercentEncoding () 代替。

QString QUrl:: fileName () const

使用 QFileInfo ( path ()).fileName() instead.

另請參閱 setFileName ().

bool QUrl:: hasHost () const

Use ! host (). isEmpty () 代替。

bool QUrl:: hasPassword () const

Use ! password (). isEmpty () 代替。

bool QUrl:: hasPath () const

Use ! path (). isEmpty () 代替。

bool QUrl:: hasPort () const

使用 port () != -1 instead.

bool QUrl:: hasRef () const

Use ! fragment (). isEmpty () 代替。

bool QUrl:: hasUser () const

Use ! userName (). isEmpty () 代替。

[static] bool QUrl:: isRelativeUrl (const QString & url )

使用 isRelative () 代替。

QString QUrl:: protocol () const

使用 scheme () 代替。

另請參閱 setProtocol ().

QString QUrl:: query () const

使用 encodedQuery () 代替。

另請參閱 setQuery ().

QString QUrl:: ref () const

使用 fragment () 代替。

另請參閱 setRef ().

[protected] void QUrl:: reset ()

使用 clear () 代替。

void QUrl:: setFileName (const QString & txt )

使用 setPath () 代替。

另請參閱 fileName ().

void QUrl:: setProtocol (const QString & s )

使用 setScheme () 代替。

另請參閱 protocol ().

void QUrl:: setQuery (const QString & txt )

使用 setEncodedQuery () 代替。

另請參閱 query ().

void QUrl:: setRef (const QString & txt )

使用 setFragment () 代替。

另請參閱 ref ().

void QUrl:: setUser (const QString & s )

使用 setUserName () 代替。

另請參閱 user ().

QString QUrl:: user () const

使用 userName () 代替。

另請參閱 setUser ().

QUrl:: operator QString () const

使用 toString () 代替。