Add some function to reimplement method
-
Hi
I want add:
[code]
if( !anchorAt( e->pos() ).isEmpty() )
QMessageBox::information(0,"",anchorAt( e->pos() ));
[/code]
to orginal(default, not edited) method "mouseDoubleClickEvent" in qtextedit.If i make my own method
[code]
void MyTextEdit::mouseDoubleClickEvent(QMouseEvent *e)
{
if( !anchorAt( e->pos() ).isEmpty() )
QMessageBox::information(0,"",anchorAt( e->pos() ));
}
[/code]
then default(if you double click on char then selected all word) will be not workSo if i want add(not edit) then i will be have to make somting like this
[code]
void MyTextEdit::mouseDoubleClickEvent(QMouseEvent *e)
{
//i have to finde default code mouseDoubleClickEventand and past hereif( !anchorAt( e->pos() ).isEmpty() ) QMessageBox::information(0,"",anchorAt( e->pos() ));
}
[/code]Somebody know faster way to do this , without copy code from default method ??
-
ok i hav solution
[code]
void MyTextEdit::mouseDoubleClickEvent(QMouseEvent *e)
{
QTextEdit::mouseDoubleClickEvent(e);
if( !anchorAt( e->pos() ).isEmpty() )
QMessageBox::information(0,"",anchorAt( e->pos() ));
}
[/code]