From f0bf2b514911d24d8c3452d9146378c7ca509744 Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Tue, 20 Dec 2011 13:20:13 +0100 Subject: [PATCH] Fix up the accessibility inspector. After accessibility API changes. Also make the windows a bit smaller since the primary user is on a laptop now. Change-Id: I53a86cbe85adbbb27401dbf6c3c389629e295b4d Reviewed-by: Frederik Gladhorn --- .../accessibilityinspector.cpp | 4 ++-- util/accessibilityinspector/screenreader.cpp | 24 ++++--------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/util/accessibilityinspector/accessibilityinspector.cpp b/util/accessibilityinspector/accessibilityinspector.cpp index af7fd521e8..88008cd35b 100644 --- a/util/accessibilityinspector/accessibilityinspector.cpp +++ b/util/accessibilityinspector/accessibilityinspector.cpp @@ -106,14 +106,14 @@ void AccessibilityInspector::inspectWindow(QWindow *window) accessibilityView = new QGraphicsView(); accessibilityView->setScene(accessibilityScene); - accessibilityView->resize(1024, 768); + accessibilityView->resize(640, 480); accessibilityView->scale(1.3, 1.3); accessibilityTreeScene = new QGraphicsScene(); accessibilityTreeView = new QGraphicsView(); accessibilityTreeView->setScene(accessibilityTreeScene); - accessibilityTreeView->resize(1024, 768); + accessibilityTreeView->resize(640, 480); sceneManager = new AccessibilitySceneManager(); QObject::connect(optionsWidget, SIGNAL(optionsChanged()), sceneManager, SLOT(updateAccessibilitySceneItemFlags())); diff --git a/util/accessibilityinspector/screenreader.cpp b/util/accessibilityinspector/screenreader.cpp index aa17bfb6ee..5560743bc6 100644 --- a/util/accessibilityinspector/screenreader.cpp +++ b/util/accessibilityinspector/screenreader.cpp @@ -97,31 +97,17 @@ void ScreenReader::processTouchPoint() int hit = -2; int guardCounter = 0; const int guardMax = 40; - while (hit != 0) { + while (currentInterface != 0) { ++guardCounter; if (guardCounter > guardMax) { qDebug() << "touchPoint exit recursion overflow"; return; // outside } -/* - hit = currentInterface->childAt(m_currentTouchPoint.x(), m_currentTouchPoint.y()); - //qDebug() << "hit" << hit; - if (hit == -1) { - return; // outside - } else if (hit == 0) { - break; // found it. - } else { - QAccessibleInterface *childInterface = 0; - int child = currentInterface->navigate(QAccessible::Child, hit, &childInterface); - if (childInterface == 0) { - return; // navigation error - } - if (currentInterface != m_rootInterface) - delete currentInterface; - currentInterface = childInterface; - } -*/ + QAccessibleInterface * hit = currentInterface->childAt(m_currentTouchPoint.x(), m_currentTouchPoint.y()); + if (!hit) + break; + currentInterface = hit; } m_selectedInterface = currentInterface;