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  ·  Fonctions  · 

QUriDrag Class Reference

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

#include <qdragobject.h>

Inherits QStoredDrag.

List of all member functions.

Public Members

  • QUriDrag ( QStrList uris, QWidget * dragSource = 0, const char * name = 0 )
  • QUriDrag ( QWidget * dragSource = 0, const char * name = 0 )
  • ~QUriDrag ()
  • void setFilenames ( const QStringList & fnames )  (obsolete)
  • void setFileNames ( const QStringList & fnames )
  • void setUnicodeUris ( const QStringList & uuris )
  • virtual void setUris ( QStrList uris )

Static Public Members


Detailed Description

The QUriDrag 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-readble form with setUnicodeUris().

Static functions are provided to convert between filenames and URIs, e.g. uriToLocalFile() and localFileToUri(), and to and from human-readable form, e.g. uriToUnicodeUri(), unicodeUriToUri(). You can also decode URIs from a mimesource into a list with decodeLocalFiles() and decodeToUnicodeUris().

See also Drag And Drop Classes.


Member Function Documentation

QUriDrag::QUriDrag ( QStrList uris, QWidget * dragSource = 0, const char * name = 0 )

Constructs an object to drag the list of URIs in uris. The dragSource and name arguments are passed on to QStoredDrag. Note that URIs are always in escaped UTF8 encoding.

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

Constructs an object to drag. You must call setUris() before you start the drag(). Passes dragSource and name to the QStoredDrag constructor.

QUriDrag::~QUriDrag ()

Destroys the object.

bool QUriDrag::canDecode ( const QMimeSource * e ) [static]

Returns TRUE if decode() would be able to decode e; otherwise returns FALSE.

bool QUriDrag::decode ( const QMimeSource * e, QStrList & l ) [static]

Decodes URIs from e, placing the result in l (which is first cleared).

Returns TRUE if e contained a valid list of URIs; otherwise returns FALSE.

Example: dirview/dirview.cpp.

bool QUriDrag::decodeLocalFiles ( const QMimeSource * e, QStringList & l ) [static]

Decodes URIs from the mime source event e, converts them to local files if they refer to local files, and places them in l (which is first cleared).

Returns TRUE if contained a valid list of URIs; otherwise returns FALSE. The list will be empty if no URIs were local files.

Example: fileiconview/qfileiconview.cpp.

bool QUriDrag::decodeToUnicodeUris ( const QMimeSource * e, QStringList & l ) [static]

Decodes URIs from the mime source event e, converts them to Unicode URIs (only useful for displaying to humans), placing them in l (which is first cleared).

Returns TRUE if contained a valid list of URIs; otherwise returns FALSE.

QCString QUriDrag::localFileToUri ( const QString & filename ) [static]

Returns the URI equivalent to the absolute local file filename.

See also uriToLocalFile().

void QUriDrag::setFileNames ( const QStringList & fnames )

Sets the URIs to be the local-file URIs equivalent to fnames.

See also localFileToUri() and setUris().

Example: dirview/dirview.cpp.

void QUriDrag::setFilenames ( const QStringList & fnames )

This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.

Use setFileNames() instead (notice the N).

void QUriDrag::setUnicodeUris ( const QStringList & uuris )

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

See also localFileToUri() and setUris().

void QUriDrag::setUris ( QStrList uris ) [virtual]

Changes the list of uris to be dragged.

Note that URIs are always in escaped UTF8 encoding.

QCString QUriDrag::unicodeUriToUri ( const QString & uuri ) [static]

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

See also uriToLocalFile().

QString QUriDrag::uriToLocalFile ( const char * uri ) [static]

Returns the name of a local file equivalent to uri or a null string if uri is not a local file.

Note that URIs are always in escaped UTF8 encoding.

See also localFileToUri().

Example: dirview/dirview.cpp.

QString QUriDrag::uriToUnicodeUri ( const char * uri ) [static]

Returns the Unicode URI (only useful for displaying to humans) equivalent of uri.

Note that URIs are always in escaped UTF8 encoding.

See also localFileToUri().


This file is part of the Qt toolkit. Copyright © 1995-2005 Trolltech. All Rights Reserved.

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 82
  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. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 6
Page suivante

Le Qt Quarterly au hasard

Logo

Les formes du pluriel dans les traductions

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. 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 3.3
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