The Q3UriDrag class provides a drag object for a list of URI references. 更多...
| 头: | #include <Q3UriDrag> |
| 继承: | Q3StoredDrag |
| Q3UriDrag (const Q3StrList & uris , QWidget * dragSource = 0, const char * name = 0) | |
| Q3UriDrag (QWidget * dragSource = 0, const char * name = 0) | |
| ~Q3UriDrag () | |
| void | setFileNames (const QStringList & filenames ) |
| void | setFileNames (const QString & name ) |
| void | setFilenames (const QString & name ) |
| void | setUnicodeUris (const QStringList & list ) |
| virtual void | setUris (const QList<QByteArray> & list ) |
| bool | canDecode (const QMimeSource * source ) |
| bool | decode (const QMimeSource * source , Q3StrList & list ) |
| bool | decodeLocalFiles (const QMimeSource * source , QStringList & list ) |
| bool | decodeToUnicodeUris (const QMimeSource * source , QStringList & list ) |
| QByteArray | localFileToUri (const QString & filename ) |
| QByteArray | unicodeUriToUri (const QString & string ) |
| QString | uriToLocalFile (const char * string ) |
| QString | uriToUnicodeUri (const char * string ) |
The Q3UriDrag class provides a drag object for a list of URI references.
URIs are a useful way to refer to files that may be distributed across multiple machines. A URI will often refer to a file on a machine local to both the drag source and the drop target, so the URI can be equivalent to passing a file name but is more extensible.
Use URIs in Unicode form so that the user can comfortably edit and view them. For use in HTTP or other protocols, use the correctly escaped ASCII form.
You can convert a list of file names to file URIs using setFileNames (), or into human-readable form with setUnicodeUris ().
Static functions are provided to convert between filenames and URIs; e.g. uriToLocalFile () 和 localFileToUri (). Static functions are also provided to convert URIs to and from human-readable form; e.g. uriToUnicodeUri () 和 unicodeUriToUri (). You can also decode URIs from a MIME source into a list with decodeLocalFiles () 和 decodeToUnicodeUris ().
Constructs an object to drag the list of uris 。 dragSource and name 被传递给 Q3StoredDrag 构造函数。
Note that URIs are always in escaped UTF8 encoding.
Constructs an object to drag with the given name . You must call setUris () before you start the drag (). Both the dragSource 和 name 被传递给 Q3StoredDrag 构造函数。
Destroys the URI drag object.
[static]
bool
Q3UriDrag::
canDecode
(const
QMimeSource
*
source
)
返回 true 若 decode () can decode the MIME source ;否则返回 false。
[static]
bool
Q3UriDrag::
decode
(const
QMimeSource
*
source
,
Q3StrList
&
list
)
Decodes URIs from the MIME source , placing the result in the list . The list is cleared before any items are inserted.
Returns true if the MIME source contained a valid list of URIs; otherwise returns false.
[static]
bool
Q3UriDrag::
decodeLocalFiles
(const
QMimeSource
*
source
,
QStringList
&
list
)
Decodes URIs from the MIME source , converting them to local filenames where possible, and places them in the list (which is first cleared).
Returns true if the MIME source contained a valid list of URIs; otherwise returns false. The list will be empty if no URIs referred to local files.
[static]
bool
Q3UriDrag::
decodeToUnicodeUris
(const
QMimeSource
*
source
,
QStringList
&
list
)
Decodes URIs from the MIME source , converting them to Unicode URIs (only useful for displaying to humans), and places them in the list (which is first cleared).
Returns true if the MIME source contained a valid list of URIs; otherwise returns false.
[static]
QByteArray
Q3UriDrag::
localFileToUri
(const
QString
&
filename
)
Returns the URI equivalent to the absolute local filename .
另请参阅 uriToLocalFile ().
Sets the URIs to be local file URIs equivalent to the filenames .
另请参阅 localFileToUri () 和 setUris ().
如同 setFileNames ( QStringList ( name )).
如同 setFileNames ( QStringList ( name )).
Sets the URIs in the list to be Unicode URIs (only useful for displaying to humans).
另请参阅 localFileToUri () 和 setUris ().
[虚拟]
void
Q3UriDrag::
setUris
(const
QList
<
QByteArray
> &
list
)
改变 list of URIs to be dragged.
Note that URIs are always in escaped UTF8 encoding.
[static]
QByteArray
Q3UriDrag::
unicodeUriToUri
(const
QString
&
string
)
Returns the URI equivalent of the Unicode URI given in the string (only useful for displaying to humans).
另请参阅 uriToLocalFile ().
[static]
QString
Q3UriDrag::
uriToLocalFile
(const
char
*
string
)
Returns the name of a local file equivalent to the URI given in the string , or an empty string if it does not refer to a local file.
Note that URIs are always in escaped UTF8 encoding.
另请参阅 localFileToUri ().
[static]
QString
Q3UriDrag::
uriToUnicodeUri
(const
char
*
string
)
Returns the Unicode URI (only useful for displaying to humans) equivalent of the URI given in the string .
Note that URIs are always in escaped UTF8 encoding.
另请参阅 localFileToUri ().