void alarmScreen::init()
{
textScreen->installEventFilter( this );
}
void alarmScreen::closeButton_clicked()
{
//delete the alarm codes
accept();
}
void alarmScreen::upButton_clicked()
{
textScreen->scrollBy(0,-60);
}
void alarmScreen::downButton_clicked()
{
textScreen->scrollBy(0,60);
}
{
printf("%d,%d\n",e->x(),e->y());
}
{
//printf("got in\n");
if ( obj == textScreen )
{
printf("its the textEdit\n");
if ( e
->type
() == QEvent::MouseButtonPress ) {
printf("ad%d,%d\n",e->x(),e->y());
return TRUE;
}
}
else
{
printf("af: %d,%d\n",e->x(),e->y());
// pass the event on to the parent class
//return QMainWindow::eventFilter( obj, ev );
}
}
void alarmScreen::init()
{
textScreen->installEventFilter( this );
}
void alarmScreen::closeButton_clicked()
{
//delete the alarm codes
accept();
}
void alarmScreen::upButton_clicked()
{
textScreen->scrollBy(0,-60);
}
void alarmScreen::downButton_clicked()
{
textScreen->scrollBy(0,60);
}
void alarmScreen::mousePressEvent( QMouseEvent *e )
{
printf("%d,%d\n",e->x(),e->y());
}
bool alarmScreen::eventFilter( QObject *obj, QEvent *ev )
{
//printf("got in\n");
QMouseEvent *e=(QMouseEvent *)ev;
if ( obj == textScreen )
{
printf("its the textEdit\n");
if ( e->type() == QEvent::MouseButtonPress )
{
printf("ad%d,%d\n",e->x(),e->y());
return TRUE;
}
}
else
{
printf("af: %d,%d\n",e->x(),e->y());
// pass the event on to the parent class
//return QMainWindow::eventFilter( obj, ev );
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks