i did that but now i can't even get to start the form... the eventFilter is run endlessly and sends the event directly to the parent:
{
//printf("got in\n");
if ( obj == textScreen->viewport() )
{
printf("its the textEdit\n");
if ( e
->type
() == QEvent::MouseButtonRelease ) {
printf("ad %d,%d\n",e->x(),e->y());
return TRUE;
}
else
{
return FALSE;
}
}
else
if ( obj == this )
{
if ( e
->type
() == QEvent::MouseButtonRelease ) {
printf("af %d,%d\n",e->x(),e->y());
return TRUE;
}
else
{
return FALSE;
}
}
else
{
printf("sending event to parent");
return alarmScreen::eventFilter( obj, ev );
}
}
bool alarmScreen::eventFilter( QObject *obj, QEvent *ev )
{
//printf("got in\n");
QMouseEvent *e=(QMouseEvent *)ev;
if ( obj == textScreen->viewport() )
{
printf("its the textEdit\n");
if ( e->type() == QEvent::MouseButtonRelease )
{
printf("ad %d,%d\n",e->x(),e->y());
return TRUE;
}
else
{
return FALSE;
}
}
else
if ( obj == this )
{
if ( e->type() == QEvent::MouseButtonRelease )
{
printf("af %d,%d\n",e->x(),e->y());
return TRUE;
}
else
{
return FALSE;
}
}
else
{
printf("sending event to parent");
return alarmScreen::eventFilter( obj, ev );
}
}
To copy to clipboard, switch view to plain text mode
it's very weird behaviour.. because when the mouse pointer flies over QTextEdits's frame border the eventFilter procedure is called and even when i click on the QTextEdits's frame border the right branch is called.. also when i click on the frame that lies (and covers) all of QWidget (alarmScreen) works properly..
but, IN the white space of the QTextEdit (the writing space) it seems it is dead.. or that something else interecepts the mouse events before alarmScreen::eventFilter() can do so...
thank you for your attempts to help
nass
Bookmarks