PDA

View Full Version : QTextEdit and URL clicked signal



Pablik
24th June 2012, 16:20
Hi
I need make signal in QTextEdit when URL will by clicked and this sgnal mass have URL as parameter ( for example SIGNAL(urlClick(QString f_URL)))
Can do that ??

wysota
24th June 2012, 16:59
Combine mouse events with QTextEdit::anchorAt() or use QTextBrowser which has a QTextBrowser::anchorClicked() signal.

Pablik
24th June 2012, 18:09
It mass be on QTextEdit.
With mouse event and QTextEdit::anchorAt() will be very difficul because in my aplication will be can add and remove URL ;(
There is no other way ?

wysota
24th June 2012, 18:23
I don't know what other way than handling mouse events you would like to have.

Pablik
24th June 2012, 19:01
Maybey other way.
My app is a notepad, the URL will by path to file and i want do somthing like that, if URL will bee clicked then app open this file in window.

wysota
24th June 2012, 19:40
I still don't understand what does it have to do with my solution.

Pablik
24th June 2012, 20:06
Srry, Its work ;) Thx for help