mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-07 08:24:43 -04:00
Fix resize cursor not being cleared when mouse moves over child widgets
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QLayout>
|
||||
#include <QTableWidget>
|
||||
|
||||
#include "framelesswindowresizer.h"
|
||||
|
||||
@@ -40,6 +41,14 @@ void FramelessWindowResizer::enableChildMouseTracking()
|
||||
for (auto widget : widgets) {
|
||||
widget->setMouseTracking(true);
|
||||
}
|
||||
// QTableWidgets don't send us mouseMoveEvents for some unknown reason
|
||||
// so install an event filter on their viewport
|
||||
QList<QTableWidget *> tables = m_widget->findChildren<QTableWidget *>();
|
||||
for (auto table : tables)
|
||||
{
|
||||
table->viewport()->setMouseTracking(true);
|
||||
table->viewport()->installEventFilter(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool FramelessWindowResizer::mouseOnTopBorder(QPoint pos) const
|
||||
@@ -141,6 +150,16 @@ void FramelessWindowResizer::leaveEvent(QEvent*)
|
||||
clearCursor();
|
||||
}
|
||||
|
||||
bool FramelessWindowResizer::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::MouseMove)
|
||||
{
|
||||
// Mouse moving over child table widget
|
||||
clearCursor();
|
||||
}
|
||||
return QObject::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
void FramelessWindowResizer::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
if (m_vResizing || m_hResizing)
|
||||
|
||||
Reference in New Issue
Block a user