Results 1 to 3 of 3

Thread: [QSplitterHandle] Changing Cursor based on coordinate

  1. #1
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [QSplitterHandle] Changing Cursor based on coordinate

    Hi all,

    what's the best way to change a cursor based on location on a splitterhandle? I have a vertical splitter that I want to have a cursor to change when it hovers around 10% of the lower area of the handle.

    Also, is there a method to explicitly move a qsplitterhandle object? I did try qsplitter resize() method and I can get the the splitterhandle to move, but is it possible to get/set explicit coordinate of a splitterhandle object?

    TIA.

    Best Regards,
    Faizol
    Last edited by faizol; 20th October 2012 at 06:51.

  2. #2
    Join Date
    Sep 2012
    Location
    Iran, Tehran
    Posts
    76
    Thanks
    17
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Post Re: [QSplitterHandle] Changing Cursor based on coordinate

    To move the handle you can create a subclass of QSplitter and implement a function which calls QSplitter::moveSplitter, i.e. create a public version of the QSplitter::moveSplitter.


    Added after 11 minutes:


    what's the best way to change a cursor based on location on a splitterhandle?
    Don't know if it is the best way, but you can try re-implementing mouseMoveEvent method of QSplitter. QWidget::mouseMoveEvent
    Last edited by Ashkan_s; 20th October 2012 at 09:49. Reason: updated contents

  3. The following user says thank you to Ashkan_s for this useful post:

    faizol (21st October 2012)

  4. #3
    Join Date
    Dec 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [QSplitterHandle] Changing Cursor based on coordinate

    Thanks.

    I ended up re-implementing paintevent method on QSplitter and didn't touch QSplitterHandle at all.

Similar Threads

  1. Changing cursor shape
    By Odyseusz in forum Qt Programming
    Replies: 7
    Last Post: 22nd November 2011, 16:39
  2. Update of lable / changing the cursor
    By mw0001 in forum Newbie
    Replies: 3
    Last Post: 24th February 2010, 08:15
  3. unified the cursor and item coordinate
    By ensky_cy in forum Qt Programming
    Replies: 4
    Last Post: 7th December 2009, 08:41
  4. Cursor not changing
    By bpetty in forum Newbie
    Replies: 4
    Last Post: 17th July 2007, 15:13
  5. ummm...cursor not changing...
    By nupul in forum Qt Programming
    Replies: 7
    Last Post: 4th May 2006, 16:57

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.