PDA

View Full Version : setCursor



mickey
23rd April 2006, 16:20
Hi, i'd like change cursor; this below work; the problem is that the "eye" appear a little distorted; it's a 16x16 pic; Is it possible that qt change automatically dimension to 32x32?
How to see it fine? Thanks


setCursor(QCursor(QPixmap::fromMimeSource("eye.png")));

Chaid
23rd April 2006, 17:50
Try to use picture with greater size for example 24x24. I think that qt will resize it to normal dimensions...

jpn
23rd April 2006, 18:06
From QCursor docs (http://doc.trolltech.com/3.3/qcursor.html#QCursor-4):


Valid cursor sizes depend on the display hardware (or the underlying window system). We recommend using 32x32 cursors, because this size is supported on all platforms. Some platforms also support 16x16, 48x48 and 64x64 cursors.

mickey
23rd April 2006, 20:37
I use other 16x16 icons in my app (They are inserted in the toolbar); but they don't appear distorted! Only if I use in cursor: I don't find other eye icon (and if I resize from some programs it, it reult distorted much more!).

Chicken Blood Machine
23rd April 2006, 20:39
I use other 16x16 icons in my app (They are inserted in the toolbar); but they don't appear distorted! Only if I use in cursor: I don't find other eye icon (and if I resize from some programs it, it reult distorted much more!).

Cursors are different to toolbars. The icon size used for cursors is very important on some platforms (particularly Windows). Take the advice given.