Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

int QApplication::startDragDistance [read, write]

If you support drag and drop in your application, and want to start a drag and drop operation after the user has moved the cursor a certain distance with a button held down, you should use this property's value as the minimum distance required.

For example, if the mouse position of the click is stored in startPos and the current position (e.g. in the mouse move event) is currentPos, you can find out if a drag should be started with code like this:

        if ((startPos - currentPos).manhattanLength() >=
                QApplication::startDragDistance())
            startTheDrag();

Qt uses this value internally, e.g. in QFileDialog.

The default value is 4 pixels.

See also:
startDragTime() QPoint::manhattanLength() {Drag and Drop}

Definition at line 97 of file qapplication.h.


Generated by  Doxygen 1.6.0   Back to index