Qt Toolkit - QUrlDrag Class

# QUrlDrag Class Reference

Provides for drag-and-drop of a list of file references. More...

`#include <qdragobject.h>`

Inherits QStoredDrag.

List of all member functions.

## Public Members

- QUrlDrag ( QStrList urls, QWidget * dragSource = 0, const char * name = 0 )
- QUrlDrag ( QWidget * dragSource = 0, const char * name = 0 )
- ~QUrlDrag ()
- void setUrls ( QStrList urls )

## Static Public Members

- QString urlToLocalFile ( const char * )
- bool canDecode ( QDragMoveEvent * e )
- bool decode ( QDropEvent * e, QStrList & i )
- bool decodeLocalFiles ( QDropEvent * e, QStrList & i )

## Detailed Description

Provides for drag-and-drop of a list of file references.

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

## Member Function Documentation

### QUrlDrag::QUrlDrag ( QStrList urls, QWidget * dragSource = 0, const char * name = 0 )

Creates an object to drag the list of urls in urls. The dragSource and name arguments are passed on to QStoredDrag.

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

Creates a object to drag. You will need to call setUrls() before you start the drag().

### QUrlDrag::~QUrlDrag ()

Destroys the object.

### bool QUrlDrag::canDecode ( QDragMoveEvent * e ) `[static]`

Returns TRUE if decode() would be able to decode e.

### bool QUrlDrag::decode ( QDropEvent * e, QStrList & l ) `[static]`

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

Returns TRUE if the event contained a valid list of URLs.

### bool QUrlDrag::decodeLocalFiles ( QDropEvent * e, QStrList & l ) `[static]`

Decodes URLs from e, converts them to local files if they refer to local files, and places them in l (which is first cleared).

Returns TRUE if the event contained a valid list of URLs. The list will be empty if no URLs were local files.

### void QUrlDrag::setUrls ( QStrList urls )

Changes the list of urls to be dragged.

### QString QUrlDrag::urlToLocalFile ( const char * url ) `[static]`

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

Search the documentation, FAQ, qt-interest archive and more (uses www.troll.no):

This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.

It was generated from the following files:

- qdragobject.h: 1998/08/19
- qdragobject.cpp: 1998/12/07