bool MainWindow::eventFilter(QObject *object, QEvent *event){ if(object == ui->graphicsView)checkLoc=1; else checkLoc=0; for(int i=0;i<usersInYourList;i++){ if(active==0) if(object == usersOnForm[i].image) if (event->type() == QEvent::Enter){ active=1; widgetLayout->setVisible(true); usersOnForm[i].image->setVisible(false); usersOnForm[i].image->setBuddy(widgetLayout); usersOnForm[i].gridLayoutOne->addWidget(widgetLayout,3,0); } if(object == widgetLayout) if(event->type() == QEvent::Leave){ usersOnForm[i].image->setVisible(true); widgetLayout->setVisible(false); usersOnForm[i].gridLayoutOne->removeWidget(widgetLayout); active=0; }} return false;}