Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Event filter

$
0
0
Hello, I removed native Menu with (Minimize, Exit) and created my own frame… I have a piece of code which handles mouse moving of my app… It reacts on whole app… I would like it to react only on menu frame… How can I handle moving only with top frame??? I tried to set event filters but without success… void MainWindow::mousePressEvent(QMouseEvent *event)  {        if (event->button() == Qt::LeftButton) {          dragPosition = event->globalPos() - frameGeometry().topLeft();          event->accept();        }  }    void MainWindow::mouseMoveEvent(QMouseEvent *event)  {        if (event->buttons() & Qt::LeftButton) {          move(event->globalPos() - dragPosition);          event->accept();        }  } P.S: I know I posted this once already, but was not a standalone topic…

Viewing all articles
Browse latest Browse all 13965