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  · 

Q3IconDrag Class Reference
[Qt3Support module]

The Q3IconDrag class supports drag and drop operations within a Q3IconView. More...

 #include <Q3IconDrag>

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 Q3DragObject.

Public Functions

  • Q3IconDrag ( QWidget * dragSource, const char * name = 0 )
  • virtual ~Q3IconDrag ()
  • void append ( const Q3IconDragItem & i, const QRect & pr, const QRect & tr )
  • virtual QByteArray encodedData ( const char * mime ) const

Static Public Members

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

Additional Inherited Members


Detailed Description

The Q3IconDrag class supports drag and drop operations within a Q3IconView.

A Q3IconDrag object is used to maintain information about the positions of dragged items and the data associated with them. Q3IconViews are able to use this information to paint the dragged items in the correct positions. Internally, Q3IconDrag stores the data associated with drag items in Q3IconDragItem objects.

If you want to use the extended drag and drop functionality of Q3IconView, create a Q3IconDrag object in a reimplementation of Q3IconView::dragObject(). Then create a Q3IconDragItem for each item which should be dragged, set the data it represents with Q3IconDragItem::setData(), and add each Q3IconDragItem to the drag object using append().

The data in Q3IconDragItems is stored in a QByteArray and is mime-typed (see QMimeSource and the Drag and Drop overview). If you want to use your own mime-types derive a class from Q3IconDrag and reimplement format(), encodedData() and canDecode().

The fileiconview example program demonstrates the use of the Q3IconDrag class including subclassing and reimplementing dragObject(), format(), encodedData() and canDecode().

See also QMimeSource::format().


Member Function Documentation

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

Constructs a drag object called name, which is a child of dragSource.

Note that the drag object will be deleted when dragSource is deleted.

Q3IconDrag::~Q3IconDrag ()   [virtual]

Destructor.

void Q3IconDrag::append ( const Q3IconDragItem & i, const QRect & pr, const QRect & tr )

Append the Q3IconDragItem, i, to the Q3IconDrag object's list of items. You must also supply the geometry of the pixmap, pr, and the textual caption, tr.

See also Q3IconDragItem.

bool Q3IconDrag::canDecode ( QMimeSource * e )   [static]

Returns true if e can be decoded by the Q3IconDrag, otherwise return false.

QByteArray Q3IconDrag::encodedData ( const char * mime ) const   [virtual]

Returns the encoded data of the drag object if mime is application/x-qiconlist.

Reimplemented from QMimeSource.

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