Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Q3UriDrag Class Reference
[Qt3Support module]

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

 #include <Q3UriDrag>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Inherits Q3StoredDrag.

Public Functions

Static Public Members

  • 1 static public member inherited from Q3DragObject
  • 5 static public members inherited from QObject

Additional Inherited Members


Detailed Description

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() and localFileToUri(). Static functions are also provided to convert URIs to and from human-readable form; e.g. uriToUnicodeUri() and unicodeUriToUri(). You can also decode URIs from a MIME source into a list with decodeLocalFiles() and decodeToUnicodeUris().


Member Function Documentation

Q3UriDrag::Q3UriDrag ( const Q3StrList & uris, QWidget * dragSource = 0, const char * name = 0 )

Constructs an object to drag the list of uris. The dragSource and name are passed to the Q3StoredDrag constructor.

Note that URIs are always in escaped UTF8 encoding.

Q3UriDrag::Q3UriDrag ( QWidget * dragSource = 0, const char * name = 0 )

Constructs an object to drag with the given name. You must call setUris() before you start the drag(). Both the dragSource and the name are passed to the Q3StoredDrag constructor.

Q3UriDrag::~Q3UriDrag ()

Destroys the URI drag object.

bool Q3UriDrag::canDecode ( const QMimeSource * source )   [static]

Returns true if decode() can decode the MIME source; otherwise returns false.

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

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.

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

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.

bool Q3UriDrag::decodeToUnicodeUris ( const QMimeSource * source, QStringList & list )   [static]

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.

QByteArray Q3UriDrag::localFileToUri ( const QString & filename )   [static]

Returns the URI equivalent to the absolute local filename.

See also uriToLocalFile().

void Q3UriDrag::setFileNames ( const QStringList & filenames )

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

See also localFileToUri() and setUris().

void Q3UriDrag::setFileNames ( const QString & name )

This is an overloaded member function, provided for convenience.

Same as setFileNames(QStringList(name)).

void Q3UriDrag::setFilenames ( const QString & name )

Same as setFileNames(QStringList(name)).

void Q3UriDrag::setUnicodeUris ( const QStringList & list )

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

See also localFileToUri() and setUris().

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

Changes the list of URIs to be dragged.

Note that URIs are always in escaped UTF8 encoding.

QByteArray Q3UriDrag::unicodeUriToUri ( const QString & string )   [static]

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

See also uriToLocalFile().

QString Q3UriDrag::uriToLocalFile ( const char * string )   [static]

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.

See also localFileToUri().

QString Q3UriDrag::uriToUnicodeUri ( const char * string )   [static]

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.

See also localFileToUri().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Comment fermer une application

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.2
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web