Q3TextDrag Class Reference |
Q3TextDrag ( const QString & text, QWidget * dragSource = 0, const char * name = 0 ) | |
Q3TextDrag ( QWidget * dragSource = 0, const char * name = 0 ) | |
~Q3TextDrag () | |
virtual void | setSubtype ( const QString & subtype ) |
virtual void | setText ( const QString & text ) |
virtual QByteArray | encodedData ( const char * mime ) const |
virtual const char * | format ( int i ) const |
bool | canDecode ( const QMimeSource * source ) |
bool | decode ( const QMimeSource * source, QString & string ) |
bool | decode ( const QMimeSource * source, QString & string, QString & subtype ) |
The Q3TextDrag class is a drag and drop object for transferring plain and Unicode text.
Plain text is passed in a QString which may contain multiple lines (i.e. may contain newline characters). The drag target will receive the newlines according to the runtime environment, e.g. LF on Unix, and CRLF on Windows.
Qt provides no built-in mechanism for delivering only a single-line.
For more information about drag and drop, see the Q3DragObject class and the drag and drop documentation.
Constructs a text drag object with the given name, and sets its data to text. The dragSource is the widget that the drag operation started from.
Constructs a default text drag object with the given name. The dragSource is the widget that the drag operation started from.
Destroys the text drag object.
Returns true if the information in the MIME source can be decoded into a QString; otherwise returns false.
See also decode().
Attempts to decode the dropped information in the MIME source into the string given. Returns true if successful; otherwise returns false.
See also canDecode().
This is an overloaded function.
Attempts to decode the dropped information in the MIME source into the string given. Returns true if successful; otherwise returns false. If subtype is null, any text subtype is accepted; otherwise only the specified subtype is accepted.
See also canDecode().
Reimplemented from QMimeSource::encodedData().
Reimplemented from QMimeSource::format().
Sets the MIME subtype of the text being dragged. The default subtype is "plain", so the default MIME type of the text is "text/plain". You might use this to declare that the text is "text/html" by calling setSubtype("html").
Sets the text to be dragged. You will need to call this if you did not pass the text during construction.
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.6-snapshot | |
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 ! |
Copyright © 2000-2012 - www.developpez.com