Long-lost Qt Goodies – QArrowCue

Have you ever wanted to indicate (in a more pronounced way than usual mouse cursor change) that a drag action is taking place? Now is your chance to do just that 🙂 Thanks to QArrowCue you can display a neat arrow for any QDrag object you have out there. I’ll give your more details on it (and the usual BSD-licensed source code 😉 ) soon. As promised, the source code and demo (BSD licensed) is here:

QArrowCue source code and demo

Usage is as simple as the few lines below, nothing to be discussed really:

void mousePressEvent(QMouseEvent*)
{
	QDrag *d = new QDrag(this);
	QMimeData *md = new QMimeData;
	md->setText("You certainly saw where this was being dragged from");
	d->setMimeData(md);
	new QArrowCue(d);
	d->exec();
}

6 Comments


Leave a Reply

Your email address will not be published. Required fields are marked *