Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

  • Qt 4.8
  • Qt3SupportLight
  • Q3UriDrag

Q3UriDrag Class

TheQ3UriDrag class provides a drag object for a list of URI references.More...

Header:#include <Q3UriDrag>
Inherits:Q3StoredDrag

Public Functions

Q3UriDrag(const Q3StrList & uris, QWidget * dragSource = 0, const char * name = 0)
Q3UriDrag(QWidget * dragSource = 0, const char * name = 0)
~Q3UriDrag()
voidsetFileNames(const QStringList & filenames)
voidsetFileNames(const QString & name)
voidsetFilenames(const QString & name)
voidsetUnicodeUris(const QStringList & list)
virtual voidsetUris(const QList<QByteArray> & list)

Static Public Members

boolcanDecode(const QMimeSource * source)
booldecode(const QMimeSource * source, Q3StrList & list)
booldecodeLocalFiles(const QMimeSource * source, QStringList & list)
booldecodeToUnicodeUris(const QMimeSource * source, QStringList & list)
QByteArraylocalFileToUri(const QString & filename)
QByteArrayunicodeUriToUri(const QString & string)
QStringuriToLocalFile(const char * string)
QStringuriToUnicodeUri(const char * string)

Additional Inherited Members

Detailed Description

TheQ3UriDrag 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 usingsetFileNames(), or into human-readable form withsetUnicodeUris().

Static functions are provided to convert between filenames and URIs; e.g.uriToLocalFile() andlocalFileToUri(). Static functions are also provided to convert URIs to and from human-readable form; e.g.uriToUnicodeUri() andunicodeUriToUri(). You can also decode URIs from a MIME source into a list withdecodeLocalFiles() anddecodeToUnicodeUris().

Member Function Documentation

Q3UriDrag::Q3UriDrag(constQ3StrList & uris,QWidget * dragSource = 0, constchar * name = 0)

Constructs an object to drag the list ofuris. ThedragSource andname are passed to theQ3StoredDrag constructor.

Note that URIs are always in escaped UTF8 encoding.

Q3UriDrag::Q3UriDrag(QWidget * dragSource = 0, constchar * name = 0)

Constructs an object to drag with the givenname. You must callsetUris() before you start thedrag(). Both thedragSource and thename are passed to theQ3StoredDrag constructor.

Q3UriDrag::~Q3UriDrag()

Destroys the URI drag object.

[static]bool Q3UriDrag::canDecode(constQMimeSource * source)

Returns true ifdecode() can decode the MIMEsource; otherwise returns false.

[static]bool Q3UriDrag::decode(constQMimeSource * source,Q3StrList & list)

Decodes URIs from the MIMEsource, placing the result in thelist. The list is cleared before any items are inserted.

Returns true if the MIMEsource contained a valid list of URIs; otherwise returns false.

[static]bool Q3UriDrag::decodeLocalFiles(constQMimeSource * source,QStringList & list)

Decodes URIs from the MIMEsource, converting them to local filenames where possible, and places them in thelist (which is first cleared).

Returns true if the MIMEsource 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(constQMimeSource * source,QStringList & list)

Decodes URIs from the MIMEsource, converting them to Unicode URIs (only useful for displaying to humans), and places them in thelist (which is first cleared).

Returns true if the MIMEsource contained a valid list of URIs; otherwise returns false.

[static]QByteArray Q3UriDrag::localFileToUri(constQString & filename)

Returns the URI equivalent to the absolute localfilename.

See alsouriToLocalFile().

void Q3UriDrag::setFileNames(constQStringList & filenames)

Sets the URIs to be local file URIs equivalent to thefilenames.

See alsolocalFileToUri() andsetUris().

void Q3UriDrag::setFileNames(constQString & name)

Same assetFileNames(QStringList(name)).

void Q3UriDrag::setFilenames(constQString & name)

Same assetFileNames(QStringList(name)).

void Q3UriDrag::setUnicodeUris(constQStringList & list)

Sets the URIs in thelist to be Unicode URIs (only useful for displaying to humans).

See alsolocalFileToUri() andsetUris().

[virtual]void Q3UriDrag::setUris(constQList<QByteArray> & list)

Changes thelist of URIs to be dragged.

Note that URIs are always in escaped UTF8 encoding.

[static]QByteArray Q3UriDrag::unicodeUriToUri(constQString & string)

Returns the URI equivalent of the Unicode URI given in thestring (only useful for displaying to humans).

See alsouriToLocalFile().

[static]QString Q3UriDrag::uriToLocalFile(constchar * string)

Returns the name of a local file equivalent to the URI given in thestring, or an empty string if it does not refer to a local file.

Note that URIs are always in escaped UTF8 encoding.

See alsolocalFileToUri().

[static]QString Q3UriDrag::uriToUnicodeUri(constchar * string)

Returns the Unicode URI (only useful for displaying to humans) equivalent of the URI given in thestring.

Note that URIs are always in escaped UTF8 encoding.

See alsolocalFileToUri().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp