You'll get editor events which you can handle in the editorEvent of the item delegate. You can open the link from there.
You'll get editor events which you can handle in the editorEvent of the item delegate. You can open the link from there.
vfernandez (28th March 2007)
Thanks. After enabling mouse tracking in the view I receive the events in editorEvent().
Dear all,
I am having the same requirement as in this thread.
In my application, Cancel link alone enough, which cancels the current process.
please anyone help me how to find whether this link is clicked (or) the mouse cursor is hover the link?
How the editorEvent() helps to achieve this.
I have drawn the 'Cancel' text using drawText method.
is any other way to implement this?
I am using Qt4.3.3
Thanks in advance.
Handle the mouse release event through the delegate or use the view's clicked() signal.
Thank you for your reply.
I am using clicked signal and the mouse pointer position for finding the link is clicked or not.
is there is a way to find whether the mouser is hover the link or not.
Thank you.
You mean whether the cursor is over an item or whether it is over an area covered by the pixels of the link? If the former, then QStyleOptionViewItem object passed in the editor event of the delegate carries such information.
once again thanks for your reply.
I mean the cursor is on the area which is covered by the link.
Thank you.
You have to calculate that yourself. QFontMetrics::boundingRect() might be helpful.
jay (19th March 2008)
Bookmarks