Results 1 to 5 of 5

Thread: setCursor

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default setCursor

    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
    Qt Code:
    1. setCursor(QCursor(QPixmap::fromMimeSource("eye.png")));
    To copy to clipboard, switch view to plain text mode 
    Regards

  2. #2
    Join Date
    Mar 2006
    Posts
    10
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setCursor

    Try to use picture with greater size for example 24x24. I think that qt will resize it to normal dimensions...

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: setCursor

    From QCursor docs:
    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.
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    mickey (23rd April 2006)

  5. #4
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: setCursor

    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!).
    Regards

  6. #5
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setCursor

    Quote Originally Posted by mickey
    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.
    Save yourself some pain. Learn C++ before learning Qt.

  7. The following user says thank you to Chicken Blood Machine for this useful post:

    mickey (23rd April 2006)

Similar Threads

  1. setCursor & a disabled Widget
    By FoX_*D i E* in forum Qt Programming
    Replies: 3
    Last Post: 16th September 2008, 10:27
  2. setcursor problem
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 17th May 2008, 16:58
  3. setCursor
    By ^NyAw^ in forum Qt Programming
    Replies: 9
    Last Post: 16th May 2008, 12:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.