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:

1void mousePressEvent(QMouseEvent*)
2{
3    QDrag *d = new QDrag(this);
4    QMimeData *md = new QMimeData;
5    md->setText("You certainly saw where this was being dragged from");
6    d->setMimeData(md);
7    new QArrowCue(d);
8    d->exec();
9}

6 Comments


Leave a Reply to bRobertD Cancel reply

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