Sir,
I have a textedit which is the child widget of another parent. I have implemented the mouseDoubleClickEvent on the text edit and my requirement is that when I doubleclick on a line, I should get that entire line. Here is a part of my code:
if( e
->type
() == QEvent::MouseButtonDblClick ) // Mouse Double clicked {
int *para1,*para2,*index1,*index2;
if( te->hasSelectedText() )
{
system("echo mouse clicked");
te->getSelection(para1,index1,para2,index2,0);
}
// print line in another widget for testing purpose
//call to another function
return true;
}
if( e->type() == QEvent::MouseButtonDblClick ) // Mouse Double clicked
{
int *para1,*para2,*index1,*index2;
if( te->hasSelectedText() )
{
system("echo mouse clicked");
te->getSelection(para1,index1,para2,index2,0);
}
QString line=te->text(*para1);
// print line in another widget for testing purpose
//call to another function
return true;
}
To copy to clipboard, switch view to plain text mode
Now, when I doubleclick the mouse, I could not see the output on console. And when I remove the if -condition inside, I could see the output on console.But the program is exiting itself by reporting "Bus error" on the console. Kindly help me in solving this problem.
Thanks and regards,
Sarma.
Bookmarks