[Qt-interest] setDragCursor() in Snow Leopard not having any effect

Hostile Fork hostilefork at gmail.com
Fri Nov 27 05:53:24 CET 2009


Hostile Fork wrote:

> setDragCursor() seems to ignore the pixmap I supply.  I tried both Cocoa and Carbon libraries, in 4.5 and 4.6 RC1 variants.  None worked for me.

"Tony Rietwyk" wrote

> Have you looked at the documentation for QCursor?  A cursor pixmap can only
> be certain sizes.  It also suggests that only on WinCE is the pixmap scaled
> to fit.  Not sure why it works on Kubuntu.  

Hi Tony...

The Drag and Drop API doesn't take a QCursor, it takes a QPixmap.  But yes, it says "We recommend using 32 x 32 cursors," which is why in the example I gave I did:

	drag->setDragCursor(pixmap.scaled(QSize(32, 32)), Qt::MoveAction);


> Note that during the drag, the cursor pixmap can change depending on the
> current proposed drop action and whether it is allowed at the current
> location.  The drag pixmap represents what is being dragged and just follows
> the cursor, and it cannot be changed during the drag.

Yup, I know.  But the repro case I gave was pretty cut and dry... it was just using the puzzle example and then suggesting a one line change:

	http://lists.trolltech.com/pipermail/qt-interest/2009-November/015573.html

So my question remains.  Has *anyone* seen setDragCursor work on the Mac in 4.5 or 4.6... ever?  Is anyone using this function successfully?

Thanks,
   Brian

P.S. In another platform difference, I can't seem to get the status bar to pay attention to the frame settings on widgets embedded in status bars, e.g.:

        statusBarMessage = new QLabel(this);
        statusBarMessage->setFrameShape(QFrame::NoFrame);
        statusBarMessage->setFrameShadow(QFrame::Plain);
        statusBar()->addWidget(statusBarMessage);

Regardless of the NoFrame and Plain, I get a frame on the message inside the status bar on the mac.





More information about the Qt-interest-old mailing list