PDA

View Full Version : [QSplitterHandle] Changing Cursor based on coordinate



faizol
20th October 2012, 06:46
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

Ashkan_s
20th October 2012, 09:43
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

faizol
21st October 2012, 17:14
Thanks.

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