Source Code (Use browser search to find items of interest.)

Class Index

qt'QStoredDrag (./qt-2.1.0/src/kernel/qdragobject.h:68)

class Q_EXPORT QStoredDrag: public QDragObject {
    Q_OBJECT
    QStoredDragData * d;

public:
    QStoredDrag( const char * mimeType,
		 QWidget * dragSource = 0, const char * name = 0 );
    ~QStoredDrag();

    virtual void setEncodedData( const QByteArray & );

    const char * format(int i) const;
    virtual QByteArray encodedData(const char*) const;
};


qt'QStoredDrag::QStoredDrag() (./qt-2.1.0/src/kernel/qdragobject.cpp:922)

QStoredDrag::QStoredDrag( const char* mimeType, QWidget * dragSource, const char * name ) :
    QDragObject(dragSource,name)
{
    d = new QStoredDragData();
    d->fmt = qstrdup(mimeType);
}

/*!
  Destroys the drag object and frees all allocated resources.
*/

qt'QStoredDrag::~QStoredDrag() (./qt-2.1.0/src/kernel/qdragobject.cpp:932)

QStoredDrag::~QStoredDrag()
{
    delete d->fmt;
    delete d;
}

/*!
  \reimp
*/

qt'QStoredDrag::format() (./qt-2.1.0/src/kernel/qdragobject.cpp:941)

const char * QStoredDrag::format(int i) const
{
    if ( i==0 )
	return d->fmt;
    else
	return 0;
}


/*!
  Sets the encoded data of this drag object to \a encodedData.  The
  encoded data is what's delivered to the drop sites, and must be in a
  strictly defined and portable format.

  The drag object can't be dropped (by the user) until this function
  has been called.
*/


qt'QStoredDrag::setEncodedData() (./qt-2.1.0/src/kernel/qdragobject.cpp:959)

void QStoredDrag::setEncodedData( const QByteArray & encodedData )
{
    d->enc = encodedData.copy();
}

/*!
  Returns the stored data.

  \sa setEncodedData()
*/

qt'QStoredDrag::encodedData() (./qt-2.1.0/src/kernel/qdragobject.cpp:969)

QByteArray QStoredDrag::encodedData(const char* m) const
{
    if ( !qstricmp(m,d->fmt) )
	return d->enc;
    else
	return QByteArray();
}


/*!
  \class QUriDrag qdragobject.h
  \brief Provides for drag-and-drop of a list of URI references.

  URIs are a useful way to refer to files that may be distributed
  across multiple machines.  Much of the time a URI will refer to
  a file on a machine local to both the drag source and the
  drop target, and so the URI will be equivalent to passing a
  filename, but more extensible.

  While presenting URIs to the user, use them in Unicode form so
  that the user can confortably edit and view them.
  For use in HTTP or other protocols, use the correctly escaped
  ASCII form (see
*/

/*!
  Constructs an object to drag the list of URIs in \a uris.
  The \a dragSource and \a name arguments are passed on to
  QStoredDrag.  Note that URIs are always in escaped UTF8
  encoding, as defined by the W3C.
*/