diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt
index 8594017d30..d57bcea0a8 100644
--- a/examples/widgets/painting/affine/CMakeLists.txt
+++ b/examples/widgets/painting/affine/CMakeLists.txt
@@ -30,7 +30,6 @@ qt_add_executable(affine
     xform.cpp xform.h
 )
 set_target_properties(affine PROPERTIES
-    WIN32_EXECUTABLE TRUE
     MACOSX_BUNDLE TRUE
 )
 target_include_directories(affine PUBLIC
diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp
index d7ed2125d2..63e738b710 100644
--- a/examples/widgets/painting/affine/xform.cpp
+++ b/examples/widgets/painting/affine/xform.cpp
@@ -60,6 +60,7 @@ const int alpha = 155;
 XFormView::XFormView(QWidget *parent)
     : ArthurFrame(parent)
 {
+    setObjectName("XFormView");
     setAttribute(Qt::WA_MouseTracking);
     m_type = VectorType;
     m_rotation = 0.0;
@@ -782,6 +783,7 @@ void XFormView::drawVectorType(QPainter *painter)
 XFormWidget::XFormWidget(QWidget *parent)
     : QWidget(parent), textEditor(new QLineEdit)
 {
+    setObjectName("XFormWidget");
     setWindowTitle(tr("Affine Transformations"));
 
     view = new XFormView(this);
@@ -820,6 +822,7 @@ XFormWidget::XFormWidget(QWidget *parent)
 
     QPushButton *resetButton = new QPushButton(mainGroup);
     resetButton->setText(tr("Reset Transform"));
+    resetButton ->setObjectName("Reset Transform");
 
     QPushButton *animateButton = new QPushButton(mainGroup);
     animateButton->setText(tr("Animate"));
diff --git a/examples/widgets/painting/shared/arthurwidgets.cpp b/examples/widgets/painting/shared/arthurwidgets.cpp
index 667246b79a..4b79a385c4 100644
--- a/examples/widgets/painting/shared/arthurwidgets.cpp
+++ b/examples/widgets/painting/shared/arthurwidgets.cpp
@@ -101,6 +101,8 @@ void ArthurFrame::enableOpenGL(bool use_opengl)
     if (m_use_opengl == use_opengl)
         return;
 
+    qDebug() << __FUNCTION__ << use_opengl;
+
     m_use_opengl = use_opengl;
 
     if (!m_glWindow && use_opengl) {
@@ -123,6 +125,7 @@ void ArthurFrame::createGlWindow()
     Q_ASSERT(m_use_opengl);
 
     m_glWindow = new QOpenGLWindow();
+     m_glWindow->setObjectName("OpenGLWindow");
     QSurfaceFormat f = QSurfaceFormat::defaultFormat();
     f.setSamples(4);
     f.setAlphaBufferSize(8);
@@ -131,6 +134,7 @@ void ArthurFrame::createGlWindow()
     m_glWindow->setFlags(Qt::WindowTransparentForInput);
     m_glWindow->resize(width(), height());
     m_glWidget = QWidget::createWindowContainer(m_glWindow, this);
+     m_glWidget->setObjectName("GLContainer");
     // create() must be called after createWindowContainer() otherwise
     // an incorrect offsetting of the position will occur.
     m_glWindow->create();
diff --git a/examples/widgets/painting/shared/hoverpoints.cpp b/examples/widgets/painting/shared/hoverpoints.cpp
index 417d593d04..cdd6ca98c6 100644
--- a/examples/widgets/painting/shared/hoverpoints.cpp
+++ b/examples/widgets/painting/shared/hoverpoints.cpp
@@ -63,7 +63,7 @@ HoverPoints::HoverPoints(QWidget *widget, PointShape shape)
     : QObject(widget)
 {
     m_widget = widget;
-    widget->installEventFilter(this);
+    qApp->installEventFilter(this);
     widget->setAttribute(Qt::WA_AcceptTouchEvents);
 
     m_connectionType = CurveConnection;
@@ -90,9 +90,51 @@ void HoverPoints::setEnabled(bool enabled)
     }
 }
 
+struct formatQPoint
+{
+    formatQPoint(const QPoint &p) : m_p(p) {}
+
+    const QPoint &m_p;
+};
+
+QDebug operator<<(QDebug d, const formatQPoint &p)
+{
+    QDebugStateSaver s(d);
+    d.nospace();
+    d << Qt::forcesign << p.m_p.x() << p.m_p.y() << Qt::noforcesign;
+    return d;
+}
+
+struct formatQRect
+{
+    formatQRect(const QRect &r) : m_r(r) {}
+
+    const QRect &m_r;
+};
+
+QDebug operator<<(QDebug d, const formatQRect &r)
+{
+    QDebugStateSaver s(d);
+    d.nospace();
+    d << r.m_r.width() << 'x' << r.m_r.height() << formatQPoint(r.m_r.topLeft());
+    return d;
+}
 
 bool HoverPoints::eventFilter(QObject *object, QEvent *event)
 {
+    if (event->type() ==  QEvent::MouseButtonPress) {
+        QMouseEvent *me = (QMouseEvent *) event;
+        QRect r = object->isWidgetType()
+                ? static_cast<QWidget *>(object)->geometry()
+                : static_cast<QWindow *>(object)->geometry();
+
+        qDebug().nospace() << __FUNCTION__ << " Press=" << formatQPoint(me->position().toPoint())
+                 << " glob=" << formatQPoint(me->globalPosition().toPoint())
+                 << " g=" << formatQRect(r) << ' '
+                 << object->metaObject()->className()
+                 << '/' << object->objectName();
+   }
+
     if (object == m_widget && m_enabled) {
         switch (event->type()) {
 
@@ -106,12 +148,16 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event)
             int index = -1;
             for (int i=0; i<m_points.size(); ++i) {
                 QPainterPath path;
+                auto r = pointBoundingRect(i);
                 if (m_shape == CircleShape)
-                    path.addEllipse(pointBoundingRect(i));
+                    path.addEllipse(r);
                 else
-                    path.addRect(pointBoundingRect(i));
+                    path.addRect(r);
 
-                if (path.contains(clickPos)) {
+                auto d= r.center() -clickPos;
+                bool match = path.contains(clickPos);
+                qDebug() << __FUNCTION__ << match << "dist=" << d << clickPos;
+                if (match) {
                     index = i;
                     break;
                 }
