drop accessibility support [ci reset]

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-01-26 19:24:38 +02:00
parent 5ca56572ff
commit 23937f9fdc
101 changed files with 155 additions and 15397 deletions

View file

@ -155,9 +155,6 @@ option(WITH_EXECINFO "Build ExecInfo support" OFF)
add_feature_info(execinfo WITH_EXECINFO "build ExecInfo support")
# optional features
option(WITH_ACCESSIBILITY "Build accessibility support" ON)
add_feature_info(accessibility WITH_ACCESSIBILITY "build accessibility support")
option(KATIE_TESTS "Build automatic tests" OFF)
add_feature_info(tests KATIE_TESTS "build automatic tests")
@ -468,10 +465,6 @@ if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
katie_config(QT_NO_DEBUG)
endif()
if(NOT WITH_ACCESSIBILITY)
katie_config(QT_NO_ACCESSIBILITY)
endif()
add_library(pic_test ${KATIE_TYPE} EXCLUDE_FROM_ALL "${CMAKE_SOURCE_DIR}/cmake/pic.cpp")
get_target_property(HAVE_pic pic_test POSITION_INDEPENDENT_CODE)
if(NOT HAVE_pic)
@ -547,25 +540,6 @@ katie_generate_obsolete(QAbstractGraphicsShapeItem QtGui qgraphicsitem.h)
katie_generate_obsolete(QAbstractListModel QtCore qabstractitemmodel.h)
katie_generate_obsolete(QAbstractTableModel QtCore qabstractitemmodel.h)
katie_generate_obsolete(QAbstractUndoItem QtGui qtextdocument.h)
katie_generate_obsolete(QAccessible2Interface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleActionInterface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleApplication QtGui qaccessibleobject.h)
katie_generate_obsolete(QAccessibleBridgeFactoryInterface QtGui qaccessiblebridge.h)
katie_generate_obsolete(QAccessibleBridgePlugin QtGui qaccessiblebridge.h)
katie_generate_obsolete(QAccessibleEditableTextInterface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleEvent QtGui qaccessible.h)
katie_generate_obsolete(QAccessibleFactoryInterface QtGui qaccessibleplugin.h)
katie_generate_obsolete(QAccessibleImageInterface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleInterfaceEx QtGui qaccessible.h)
katie_generate_obsolete(QAccessibleInterface QtGui qaccessible.h)
katie_generate_obsolete(QAccessibleObjectEx QtGui qaccessibleobject.h)
katie_generate_obsolete(QAccessibleSimpleEditableTextInterface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleTable2CellInterface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleTable2Interface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleTableInterface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleTextInterface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleValueInterface QtGui qaccessible2.h)
katie_generate_obsolete(QAccessibleWidgetEx QtGui qaccessiblewidget.h)
katie_generate_obsolete(QActionEvent QtGui qevent.h)
katie_generate_obsolete(QAnimationDriver QtGui qabstractanimation.h)
katie_generate_obsolete(QArgument QtCore qobjectdefs.h)
@ -851,8 +825,6 @@ katie_generate_obsolete(QtConfig QtCore qconfig.h)
katie_generate_obsolete(QtContainerFwd QtCore qcontainerfwd.h)
katie_generate_obsolete(QtDebug QtCore qdebug.h)
katie_generate_obsolete(QtEndian QtCore qendian.h)
katie_generate_obsolete(QTestAccessibilityEvent QtTest qtestaccessible.h)
katie_generate_obsolete(QTestAccessibility QtTest qtestaccessible.h)
katie_generate_obsolete(QTestDelayEvent QtTest qtestevent.h)
katie_generate_obsolete(QTestEventList QtTest qtestevent.h)
katie_generate_obsolete(QTestKeyClicksEvent QtTest qtestevent.h)

1
README
View file

@ -47,6 +47,7 @@ There are several things you should be aware before considering Katie:
- dropped network interfaces management support
- dropped no-op touch devices support
- dropped bitmap fonts support
- dropped accessibility support
- some additions have been made:
- JSON document handler

View file

@ -577,30 +577,6 @@ include/katie/QtGui/QAbstractSlider
include/katie/QtGui/QAbstractSpinBox
include/katie/QtGui/QAbstractTextDocumentLayout
include/katie/QtGui/QAbstractUndoItem
include/katie/QtGui/QAccessible
include/katie/QtGui/QAccessible2Interface
include/katie/QtGui/QAccessibleActionInterface
include/katie/QtGui/QAccessibleApplication
include/katie/QtGui/QAccessibleBridge
include/katie/QtGui/QAccessibleBridgeFactoryInterface
include/katie/QtGui/QAccessibleBridgePlugin
include/katie/QtGui/QAccessibleEditableTextInterface
include/katie/QtGui/QAccessibleEvent
include/katie/QtGui/QAccessibleFactoryInterface
include/katie/QtGui/QAccessibleImageInterface
include/katie/QtGui/QAccessibleInterface
include/katie/QtGui/QAccessibleInterfaceEx
include/katie/QtGui/QAccessibleObject
include/katie/QtGui/QAccessibleObjectEx
include/katie/QtGui/QAccessiblePlugin
include/katie/QtGui/QAccessibleSimpleEditableTextInterface
include/katie/QtGui/QAccessibleTable2CellInterface
include/katie/QtGui/QAccessibleTable2Interface
include/katie/QtGui/QAccessibleTableInterface
include/katie/QtGui/QAccessibleTextInterface
include/katie/QtGui/QAccessibleValueInterface
include/katie/QtGui/QAccessibleWidget
include/katie/QtGui/QAccessibleWidgetEx
include/katie/QtGui/QAction
include/katie/QtGui/QActionEvent
include/katie/QtGui/QActionGroup
@ -965,12 +941,6 @@ include/katie/QtGui/qabstractscrollarea.h
include/katie/QtGui/qabstractslider.h
include/katie/QtGui/qabstractspinbox.h
include/katie/QtGui/qabstracttextdocumentlayout.h
include/katie/QtGui/qaccessible.h
include/katie/QtGui/qaccessible2.h
include/katie/QtGui/qaccessiblebridge.h
include/katie/QtGui/qaccessibleobject.h
include/katie/QtGui/qaccessibleplugin.h
include/katie/QtGui/qaccessiblewidget.h
include/katie/QtGui/qaction.h
include/katie/QtGui/qactiongroup.h
include/katie/QtGui/qanimationgroup.h
@ -1277,8 +1247,6 @@ include/katie/QtTest/QEventSizeOfChecker
include/katie/QtTest/QSignalSpy
include/katie/QtTest/QSpontaneKeyEvent
include/katie/QtTest/QTest
include/katie/QtTest/QTestAccessibility
include/katie/QtTest/QTestAccessibilityEvent
include/katie/QtTest/QTestBasicStreamer
include/katie/QtTest/QTestCoreElement
include/katie/QtTest/QTestCoreList
@ -1304,7 +1272,6 @@ include/katie/QtTest/qsignalspy.h
include/katie/QtTest/qtest.h
include/katie/QtTest/qtest_global.h
include/katie/QtTest/qtest_gui.h
include/katie/QtTest/qtestaccessible.h
include/katie/QtTest/qtestassert.h
include/katie/QtTest/qtestbasicstreamer.h
include/katie/QtTest/qtestcase.h
@ -1384,7 +1351,6 @@ lib/katie/imports/Qt/labs/folderlistmodel/libqmlfolderlistmodelplugin.so
lib/katie/imports/Qt/labs/folderlistmodel/qmldir
lib/katie/imports/Qt/labs/particles/libqmlparticlesplugin.so
lib/katie/imports/Qt/labs/particles/qmldir
lib/katie/plugins/accessible/libqtaccessiblewidgets.so
lib/katie/plugins/designer/libqdeclarativeview.so
lib/katie/plugins/iconengines/libqsvgicon.so
lib/katie/plugins/imageformats/libqsvg.so

View file

@ -580,30 +580,6 @@ include/katie/QtGui/QAbstractSlider
include/katie/QtGui/QAbstractSpinBox
include/katie/QtGui/QAbstractTextDocumentLayout
include/katie/QtGui/QAbstractUndoItem
include/katie/QtGui/QAccessible
include/katie/QtGui/QAccessible2Interface
include/katie/QtGui/QAccessibleActionInterface
include/katie/QtGui/QAccessibleApplication
include/katie/QtGui/QAccessibleBridge
include/katie/QtGui/QAccessibleBridgeFactoryInterface
include/katie/QtGui/QAccessibleBridgePlugin
include/katie/QtGui/QAccessibleEditableTextInterface
include/katie/QtGui/QAccessibleEvent
include/katie/QtGui/QAccessibleFactoryInterface
include/katie/QtGui/QAccessibleImageInterface
include/katie/QtGui/QAccessibleInterface
include/katie/QtGui/QAccessibleInterfaceEx
include/katie/QtGui/QAccessibleObject
include/katie/QtGui/QAccessibleObjectEx
include/katie/QtGui/QAccessiblePlugin
include/katie/QtGui/QAccessibleSimpleEditableTextInterface
include/katie/QtGui/QAccessibleTable2CellInterface
include/katie/QtGui/QAccessibleTable2Interface
include/katie/QtGui/QAccessibleTableInterface
include/katie/QtGui/QAccessibleTextInterface
include/katie/QtGui/QAccessibleValueInterface
include/katie/QtGui/QAccessibleWidget
include/katie/QtGui/QAccessibleWidgetEx
include/katie/QtGui/QAction
include/katie/QtGui/QActionEvent
include/katie/QtGui/QActionGroup
@ -968,12 +944,6 @@ include/katie/QtGui/qabstractscrollarea.h
include/katie/QtGui/qabstractslider.h
include/katie/QtGui/qabstractspinbox.h
include/katie/QtGui/qabstracttextdocumentlayout.h
include/katie/QtGui/qaccessible.h
include/katie/QtGui/qaccessible2.h
include/katie/QtGui/qaccessiblebridge.h
include/katie/QtGui/qaccessibleobject.h
include/katie/QtGui/qaccessibleplugin.h
include/katie/QtGui/qaccessiblewidget.h
include/katie/QtGui/qaction.h
include/katie/QtGui/qactiongroup.h
include/katie/QtGui/qanimationgroup.h
@ -1280,8 +1250,6 @@ include/katie/QtTest/QEventSizeOfChecker
include/katie/QtTest/QSignalSpy
include/katie/QtTest/QSpontaneKeyEvent
include/katie/QtTest/QTest
include/katie/QtTest/QTestAccessibility
include/katie/QtTest/QTestAccessibilityEvent
include/katie/QtTest/QTestBasicStreamer
include/katie/QtTest/QTestCoreElement
include/katie/QtTest/QTestCoreList
@ -1307,7 +1275,6 @@ include/katie/QtTest/qsignalspy.h
include/katie/QtTest/qtest.h
include/katie/QtTest/qtest_global.h
include/katie/QtTest/qtest_gui.h
include/katie/QtTest/qtestaccessible.h
include/katie/QtTest/qtestassert.h
include/katie/QtTest/qtestbasicstreamer.h
include/katie/QtTest/qtestcase.h
@ -1387,7 +1354,6 @@ lib/katie/imports/Qt/labs/folderlistmodel/libqmlfolderlistmodelplugin.so
lib/katie/imports/Qt/labs/folderlistmodel/qmldir
lib/katie/imports/Qt/labs/particles/libqmlparticlesplugin.so
lib/katie/imports/Qt/labs/particles/qmldir
lib/katie/plugins/accessible/libqtaccessiblewidgets.so
lib/katie/plugins/designer/libqdeclarativeview.so
lib/katie/plugins/iconengines/libqsvgicon.so
lib/katie/plugins/imageformats/libqsvg.so

View file

@ -585,30 +585,6 @@ include/katie/QtGui/QAbstractSlider
include/katie/QtGui/QAbstractSpinBox
include/katie/QtGui/QAbstractTextDocumentLayout
include/katie/QtGui/QAbstractUndoItem
include/katie/QtGui/QAccessible
include/katie/QtGui/QAccessible2Interface
include/katie/QtGui/QAccessibleActionInterface
include/katie/QtGui/QAccessibleApplication
include/katie/QtGui/QAccessibleBridge
include/katie/QtGui/QAccessibleBridgeFactoryInterface
include/katie/QtGui/QAccessibleBridgePlugin
include/katie/QtGui/QAccessibleEditableTextInterface
include/katie/QtGui/QAccessibleEvent
include/katie/QtGui/QAccessibleFactoryInterface
include/katie/QtGui/QAccessibleImageInterface
include/katie/QtGui/QAccessibleInterface
include/katie/QtGui/QAccessibleInterfaceEx
include/katie/QtGui/QAccessibleObject
include/katie/QtGui/QAccessibleObjectEx
include/katie/QtGui/QAccessiblePlugin
include/katie/QtGui/QAccessibleSimpleEditableTextInterface
include/katie/QtGui/QAccessibleTable2CellInterface
include/katie/QtGui/QAccessibleTable2Interface
include/katie/QtGui/QAccessibleTableInterface
include/katie/QtGui/QAccessibleTextInterface
include/katie/QtGui/QAccessibleValueInterface
include/katie/QtGui/QAccessibleWidget
include/katie/QtGui/QAccessibleWidgetEx
include/katie/QtGui/QAction
include/katie/QtGui/QActionEvent
include/katie/QtGui/QActionGroup
@ -973,12 +949,6 @@ include/katie/QtGui/qabstractscrollarea.h
include/katie/QtGui/qabstractslider.h
include/katie/QtGui/qabstractspinbox.h
include/katie/QtGui/qabstracttextdocumentlayout.h
include/katie/QtGui/qaccessible.h
include/katie/QtGui/qaccessible2.h
include/katie/QtGui/qaccessiblebridge.h
include/katie/QtGui/qaccessibleobject.h
include/katie/QtGui/qaccessibleplugin.h
include/katie/QtGui/qaccessiblewidget.h
include/katie/QtGui/qaction.h
include/katie/QtGui/qactiongroup.h
include/katie/QtGui/qanimationgroup.h
@ -1290,8 +1260,6 @@ include/katie/QtTest/QEventSizeOfChecker
include/katie/QtTest/QSignalSpy
include/katie/QtTest/QSpontaneKeyEvent
include/katie/QtTest/QTest
include/katie/QtTest/QTestAccessibility
include/katie/QtTest/QTestAccessibilityEvent
include/katie/QtTest/QTestBasicStreamer
include/katie/QtTest/QTestCoreElement
include/katie/QtTest/QTestCoreList
@ -1317,7 +1285,6 @@ include/katie/QtTest/qsignalspy.h
include/katie/QtTest/qtest.h
include/katie/QtTest/qtest_global.h
include/katie/QtTest/qtest_gui.h
include/katie/QtTest/qtestaccessible.h
include/katie/QtTest/qtestassert.h
include/katie/QtTest/qtestbasicstreamer.h
include/katie/QtTest/qtestcase.h
@ -1407,8 +1374,6 @@ lib/katie/imports/Qt/labs/particles/
@so lib/katie/imports/Qt/labs/particles/libqmlparticlesplugin.so
lib/katie/imports/Qt/labs/particles/qmldir
lib/katie/plugins/
lib/katie/plugins/accessible/
@so lib/katie/plugins/accessible/libqtaccessiblewidgets.so
lib/katie/plugins/designer/
@so lib/katie/plugins/designer/libqdeclarativeview.so
lib/katie/plugins/iconengines/

View file

@ -167,25 +167,6 @@ incmap = {
'QtGui': {
'QAbstractGraphicsShapeItem': 'qgraphicsitem.h',
'QAbstractUndoItem': 'qtextdocument.h',
'QAccessible2Interface': 'qaccessible2.h',
'QAccessibleActionInterface': 'qaccessible2.h',
'QAccessibleApplication': 'qaccessibleobject.h',
'QAccessibleBridgeFactoryInterface': 'qaccessiblebridge.h',
'QAccessibleBridgePlugin': 'qaccessiblebridge.h',
'QAccessibleEditableTextInterface': 'qaccessible2.h',
'QAccessibleEvent': 'qaccessible.h',
'QAccessibleFactoryInterface': 'qaccessibleplugin.h',
'QAccessibleImageInterface': 'qaccessible2.h',
'QAccessibleInterface': 'qaccessible.h',
'QAccessibleInterfaceEx': 'qaccessible.h',
'QAccessibleObjectEx': 'qaccessibleobject.h',
'QAccessibleSimpleEditableTextInterface': 'qaccessible2.h',
'QAccessibleTable2CellInterface': 'qaccessible2.h',
'QAccessibleTable2Interface': 'qaccessible2.h',
'QAccessibleTableInterface': 'qaccessible2.h',
'QAccessibleTextInterface': 'qaccessible2.h',
'QAccessibleValueInterface': 'qaccessible2.h',
'QAccessibleWidgetEx': 'qaccessiblewidget.h',
'QActionEvent': 'qevent.h',
'QAnimationDriver': 'qabstractanimation.h',
'QBrushData': 'qbrush.h',
@ -371,8 +352,6 @@ incmap = {
'QtTest': {
'QEventSizeOfChecker': 'qtestspontaneevent.h',
'QSpontaneKeyEvent': 'qtestspontaneevent.h',
'QTestAccessibility': 'qtestaccessible.h',
'QTestAccessibilityEvent': 'qtestaccessible.h',
'QTestDelayEvent': 'qtestevent.h',
'QTestEventList': 'qtestevent.h',
'QTestKeyClicksEvent': 'qtestevent.h',

View file

@ -30,30 +30,6 @@ classlist = [
"QAbstractTableModel",
"QAbstractTextDocumentLayout",
"QAbstractUndoItem",
"QAccessible",
"QAccessible2Interface",
"QAccessibleActionInterface",
"QAccessibleApplication",
"QAccessibleBridge",
"QAccessibleBridgeFactoryInterface",
"QAccessibleBridgePlugin",
"QAccessibleEditableTextInterface",
"QAccessibleEvent",
"QAccessibleFactoryInterface",
"QAccessibleImageInterface",
"QAccessibleInterface",
"QAccessibleInterfaceEx",
"QAccessibleObject",
"QAccessibleObjectEx",
"QAccessiblePlugin",
"QAccessibleSimpleEditableTextInterface",
"QAccessibleTable2CellInterface",
"QAccessibleTable2Interface",
"QAccessibleTableInterface",
"QAccessibleTextInterface",
"QAccessibleValueInterface",
"QAccessibleWidget",
"QAccessibleWidgetEx",
"QAction",
"QActionEvent",
"QActionGroup",
@ -654,8 +630,6 @@ classlist = [
"QTemporaryFile",
"QtEndian",
"QTest",
"QTestAccessibility",
"QTestAccessibilityEvent",
"QTestBasicStreamer",
"QTestCoreElement",
"QTestCoreList",

View file

@ -111,6 +111,7 @@
#define QT_NO_GESTURES
#define QT_NO_STYLE_MOTIF
#define QT_NO_STYLE_PLASTIQUE
#define QT_NO_ACCESSIBILITY
// Not supported, used to bootstrap
#cmakedefine QT_NO_QOBJECT
@ -155,7 +156,6 @@
// Misc
#cmakedefine QT_NO_USING_NAMESPACE
#cmakedefine QT_NO_ACCESSIBILITY
#cmakedefine QT_NO_ACTION
#cmakedefine QT_NO_ANIMATION
#cmakedefine QT_NO_BACKINGSTORE
@ -592,11 +592,6 @@
# define QT_NO_TREEVIEW
#endif
// Accessibility
#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_MENUBAR))
# define QT_NO_ACCESSIBILITY
#endif
// QColumnView
#if !defined(QT_NO_COLUMNVIEW) && defined(QT_NO_LISTVIEW)
# define QT_NO_COLUMNVIEW

View file

@ -1187,18 +1187,15 @@ public:
BackgroundRole = 8,
ForegroundRole = 9,
CheckStateRole = 10,
// Accessibility
AccessibleTextRole = 11,
AccessibleDescriptionRole = 12,
// More general purpose
SizeHintRole = 13,
InitialSortOrderRole = 14,
SizeHintRole = 11,
InitialSortOrderRole = 12,
// Internal UiLib roles
DisplayPropertyRole = 15,
DecorationPropertyRole = 16,
ToolTipPropertyRole = 17,
StatusTipPropertyRole = 18,
WhatsThisPropertyRole = 19,
DisplayPropertyRole = 13,
DecorationPropertyRole = 14,
ToolTipPropertyRole = 15,
StatusTipPropertyRole = 16,
WhatsThisPropertyRole = 17,
// Reserved
UserRole = 32
};

View file

@ -2103,14 +2103,6 @@
of a header view section. (Qt::SortOrder). This
role was introduced in Qt 4.8.
Accessibility roles (with associated types):
\value AccessibleTextRole The text to be used by accessibility
extensions and plugins, such as screen
readers. (QString)
\value AccessibleDescriptionRole A description of the item for accessibility
purposes. (QString)
User roles:
\value UserRole The first role that can be used for application-specific purposes.

View file

@ -73,9 +73,6 @@ QT_BEGIN_NAMESPACE
types and the specialized classes for each type are as follows:
\value None Not an event.
\value AccessibilityDescription Used to query accessibility description texts (QAccessibleEvent).
\value AccessibilityHelp Used to query accessibility help texts (QAccessibleEvent).
\value AccessibilityPrepare Accessibility information is requested.
\value ActionAdded A new action has been added (QActionEvent).
\value ActionChanged An action has been changed (QActionEvent).
\value ActionRemoved An action has been removed (QActionEvent).

View file

@ -96,101 +96,97 @@ public:
UpdateLater = 52, // request update() later
ContextMenu = 53, // context popup menu
AccessibilityPrepare = 54, // accessibility information is requested
LocaleChange = 55, // the system locale changed
LanguageChange = 56, // the application language changed
LayoutDirectionChange = 57, // the layout direction changed
Style = 58, // internal style event
LocaleChange = 54, // the system locale changed
LanguageChange = 55, // the application language changed
LayoutDirectionChange = 56, // the layout direction changed
Style = 57, // internal style event
FontChange = 59, // font has changed
EnabledChange = 60, // enabled state has changed
ActivationChange = 61, // window activation has changed
StyleChange = 62, // style has changed
IconTextChange = 63, // icon text has changed
ModifiedChange = 64, // modified state has changed
MouseTrackingChange = 65, // mouse tracking state has changed
FontChange = 58, // font has changed
EnabledChange = 59, // enabled state has changed
ActivationChange = 60, // window activation has changed
StyleChange = 61, // style has changed
IconTextChange = 62, // icon text has changed
ModifiedChange = 63, // modified state has changed
MouseTrackingChange = 64, // mouse tracking state has changed
WindowBlocked = 66, // window is about to be blocked modally
WindowUnblocked = 67, // windows modal blocking has ended
WindowStateChange = 68,
WindowBlocked = 65, // window is about to be blocked modally
WindowUnblocked = 66, // windows modal blocking has ended
WindowStateChange = 67,
ToolTip = 69,
WhatsThis = 70,
StatusTip = 71,
ToolTip = 68,
WhatsThis = 69,
StatusTip = 70,
ActionChanged = 72,
ActionAdded = 73,
ActionRemoved = 74,
ActionChanged = 71,
ActionAdded = 72,
ActionRemoved = 73,
Shortcut = 75, // shortcut triggered
ShortcutOverride = 76, // shortcut override request
Shortcut = 74, // shortcut triggered
ShortcutOverride = 75, // shortcut override request
WhatsThisClicked = 77,
WhatsThisClicked = 76,
ApplicationActivate = 78, // application has been changed to active
ApplicationDeactivate = 79, // application has been changed to inactive
ApplicationActivate = 77, // application has been changed to active
ApplicationDeactivate = 78, // application has been changed to inactive
QueryWhatsThis = 80, // query what's this widget help
EnterWhatsThisMode = 81,
LeaveWhatsThisMode = 82,
QueryWhatsThis = 79, // query what's this widget help
EnterWhatsThisMode = 80,
LeaveWhatsThisMode = 81,
ZOrderChange = 83, // child widget has had its z-order changed
ZOrderChange = 82, // child widget has had its z-order changed
HoverEnter = 84, // mouse cursor enters a hover widget
HoverLeave = 85, // mouse cursor leaves a hover widget
HoverMove = 86, // mouse cursor move inside a hover widget
HoverEnter = 83, // mouse cursor enters a hover widget
HoverLeave = 84, // mouse cursor leaves a hover widget
HoverMove = 85, // mouse cursor move inside a hover widget
AccessibilityHelp = 87, // accessibility help text request
AccessibilityDescription = 88, // accessibility description text request
AcceptDropsChange = 86,
AcceptDropsChange = 89,
GraphicsSceneMouseMove = 87, // GraphicsView
GraphicsSceneMousePress = 88,
GraphicsSceneMouseRelease = 89,
GraphicsSceneMouseDoubleClick = 90,
GraphicsSceneContextMenu = 91,
GraphicsSceneHoverEnter = 92,
GraphicsSceneHoverMove = 93,
GraphicsSceneHoverLeave = 94,
GraphicsSceneLeave = 95, // internal
GraphicsSceneHelp = 96,
GraphicsSceneDragEnter = 97,
GraphicsSceneDragMove = 98,
GraphicsSceneDragLeave = 99,
GraphicsSceneDrop = 100,
GraphicsSceneWheel = 101,
GraphicsSceneMouseMove = 90, // GraphicsView
GraphicsSceneMousePress = 91,
GraphicsSceneMouseRelease = 92,
GraphicsSceneMouseDoubleClick = 93,
GraphicsSceneContextMenu = 94,
GraphicsSceneHoverEnter = 95,
GraphicsSceneHoverMove = 96,
GraphicsSceneHoverLeave = 97,
GraphicsSceneLeave = 98, // internal
GraphicsSceneHelp = 99,
GraphicsSceneDragEnter = 100,
GraphicsSceneDragMove = 101,
GraphicsSceneDragLeave = 102,
GraphicsSceneDrop = 103,
GraphicsSceneWheel = 104,
KeyboardLayoutChange = 102, // keyboard layout changed
KeyboardLayoutChange = 105, // keyboard layout changed
DynamicPropertyChange = 103, // A dynamic property was changed through setProperty/property
DynamicPropertyChange = 106, // A dynamic property was changed through setProperty/property
NonClientAreaMouseMove = 104,
NonClientAreaMouseButtonPress = 105,
NonClientAreaMouseButtonRelease = 106,
NonClientAreaMouseButtonDblClick = 107,
NonClientAreaMouseMove = 107,
NonClientAreaMouseButtonPress = 108,
NonClientAreaMouseButtonRelease = 109,
NonClientAreaMouseButtonDblClick = 110,
ContentsRectChange = 108, // sent by QWidget::setContentsMargins (internal)
ContentsRectChange = 111, // sent by QWidget::setContentsMargins (internal)
FutureCallOut = 109,
FutureCallOut = 112,
GraphicsSceneResize = 110,
GraphicsSceneMove = 111,
GraphicsSceneResize = 113,
GraphicsSceneMove = 114,
CursorChange = 112,
ToolTipChange = 113,
CursorChange = 115,
ToolTipChange = 116,
NetworkReplyUpdated = 114, // Internal for QNetworkReply
NetworkReplyUpdated = 117, // Internal for QNetworkReply
GrabMouse = 115,
UngrabMouse = 116,
GrabKeyboard = 117,
UngrabKeyboard = 118,
GrabMouse = 118,
UngrabMouse = 119,
GrabKeyboard = 120,
UngrabKeyboard = 121,
RequestSoftwareInputPanel = 119,
CloseSoftwareInputPanel = 120,
RequestSoftwareInputPanel = 122,
CloseSoftwareInputPanel = 123,
WinIdChange = 124,
WinIdChange = 121,
User = 1000, // first user event id
MaxUser = 65535 // last user event id

View file

@ -207,62 +207,6 @@ public:
}
};
// Used by QAccessibleWidget
bool QObjectPrivate::isSender(const QObject *receiver, const char *signal) const
{
Q_Q(const QObject);
int signal_index = signalIndex(signal);
if (signal_index < 0)
return false;
QMutexLocker locker(signalSlotLock(q));
if (connectionLists) {
if (signal_index < connectionLists->count()) {
const QObjectPrivate::Connection *c =
connectionLists->at(signal_index).first;
while (c) {
if (c->receiver == receiver)
return true;
c = c->nextConnectionList;
}
}
}
return false;
}
// Used by QAccessibleWidget
QObjectList QObjectPrivate::receiverList(const char *signal) const
{
Q_Q(const QObject);
QObjectList returnValue;
int signal_index = signalIndex(signal);
if (signal_index < 0)
return returnValue;
QMutexLocker locker(signalSlotLock(q));
if (connectionLists) {
if (signal_index < connectionLists->count()) {
const QObjectPrivate::Connection *c = connectionLists->at(signal_index).first;
while (c) {
if (c->receiver)
returnValue << c->receiver;
c = c->nextConnectionList;
}
}
}
return returnValue;
}
// Used by QAccessibleWidget
QObjectList QObjectPrivate::senderList() const
{
QObjectList returnValue;
QMutexLocker locker(signalSlotLock(q_func()));
for (Connection *c = senders; c; c = c->next)
returnValue << c->sender;
return returnValue;
}
void QObjectPrivate::addConnection(int signal, Connection *c)
{
if (!connectionLists)

View file

@ -120,10 +120,6 @@ public:
void setThreadData_helper(QThreadData *currentData, QThreadData *targetData);
void _q_reregisterTimers(void *pointer);
bool isSender(const QObject *receiver, const char *signal) const;
QObjectList receiverList(const char *signal) const;
QObjectList senderList() const;
void addConnection(int signal, Connection *c);
void cleanConnectionLists();

View file

@ -142,9 +142,6 @@ bool FormWindowManager::eventFilter(QObject *o, QEvent *e)
switch (eventType) { // Uninteresting events
case QEvent::Create:
case QEvent::Destroy:
case QEvent::AccessibilityDescription:
case QEvent::AccessibilityHelp:
case QEvent::AccessibilityPrepare:
case QEvent::ActionAdded:
case QEvent::ActionChanged:
case QEvent::ActionRemoved:

View file

@ -24,11 +24,6 @@ set(GUI_PUBLIC_HEADERS
QAbstractSlider
QAbstractSpinBox
QAbstractTextDocumentLayout
QAccessible
QAccessibleBridge
QAccessibleObject
QAccessiblePlugin
QAccessibleWidget
QAction
QActionGroup
QApplication
@ -923,29 +918,6 @@ if(WITH_FONTCONFIG AND FONTCONFIG_FOUND)
add_definitions(${FONTCONFIG_DEFINITIONS})
endif()
if(WITH_ACCESSIBILITY)
set(GUI_HEADERS
${GUI_HEADERS}
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessible.h
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessible2.h
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessibleobject.h
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessiblewidget.h
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessibleplugin.h
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessiblebridge.h
)
set(GUI_SOURCES
${GUI_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessible.cpp
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessible2.cpp
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessibleobject.cpp
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessiblewidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessibleplugin.cpp
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessible_unix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/accessible/qaccessiblebridge.cpp
)
endif()
# anything that includes qt_x11_p.h is known to break unity build
katie_unity_exclude(
${CMAKE_CURRENT_SOURCE_DIR}/dialogs/qdialog.cpp

File diff suppressed because it is too large Load diff

View file

@ -1,438 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QACCESSIBLE_H
#define QACCESSIBLE_H
#include <QtCore/qobject.h>
#include <QtCore/qrect.h>
#include <QtCore/qset.h>
#include <QtCore/qvector.h>
#include <QtCore/qvariant.h>
#include <QtGui/qcolor.h>
#include <QtGui/qevent.h>
#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
class QAccessibleInterface;
class Q_GUI_EXPORT QAccessible
{
public:
enum Event {
SoundPlayed = 0x0001,
Alert = 0x0002,
ForegroundChanged = 0x0003,
MenuStart = 0x0004,
MenuEnd = 0x0005,
PopupMenuStart = 0x0006,
PopupMenuEnd = 0x0007,
ContextHelpStart = 0x000C,
ContextHelpEnd = 0x000D,
DragDropStart = 0x000E,
DragDropEnd = 0x000F,
DialogStart = 0x0010,
DialogEnd = 0x0011,
ScrollingStart = 0x0012,
ScrollingEnd = 0x0013,
MenuCommand = 0x0018,
// Values from IAccessible2
ActionChanged = 0x0101,
ActiveDescendantChanged = 0x0102,
AttributeChanged = 0x0103,
DocumentContentChanged = 0x0104,
DocumentLoadComplete = 0x0105,
DocumentLoadStopped = 0x0106,
DocumentReload = 0x0107,
HyperlinkEndIndexChanged = 0x0108,
HyperlinkNumberOfAnchorsChanged = 0x0109,
HyperlinkSelectedLinkChanged = 0x010A,
HypertextLinkActivated = 0x010B,
HypertextLinkSelected = 0x010C,
HyperlinkStartIndexChanged = 0x010D,
HypertextChanged = 0x010E,
HypertextNLinksChanged = 0x010F,
ObjectAttributeChanged = 0x0110,
PageChanged = 0x0111,
SectionChanged = 0x0112,
TableCaptionChanged = 0x0113,
TableColumnDescriptionChanged = 0x0114,
TableColumnHeaderChanged = 0x0115,
TableModelChanged = 0x0116,
TableRowDescriptionChanged = 0x0117,
TableRowHeaderChanged = 0x0118,
TableSummaryChanged = 0x0119,
TextAttributeChanged = 0x011A,
TextCaretMoved = 0x011B,
// TextChanged = 0x011C, is deprecated in IA2, use TextUpdated
TextColumnChanged = 0x011D,
TextInserted = 0x011E,
TextRemoved = 0x011F,
TextUpdated = 0x0120,
TextSelectionChanged = 0x0121,
VisibleDataChanged = 0x0122,
ObjectCreated = 0x8000,
ObjectDestroyed = 0x8001,
ObjectShow = 0x8002,
ObjectHide = 0x8003,
ObjectReorder = 0x8004,
Focus = 0x8005,
Selection = 0x8006,
SelectionAdd = 0x8007,
SelectionRemove = 0x8008,
SelectionWithin = 0x8009,
StateChanged = 0x800A,
LocationChanged = 0x800B,
NameChanged = 0x800C,
DescriptionChanged = 0x800D,
ValueChanged = 0x800E,
ParentChanged = 0x800F,
HelpChanged = 0x80A0,
DefaultActionChanged = 0x80B0,
AcceleratorChanged = 0x80C0
};
enum StateFlag {
Normal = 0x00000000,
Unavailable = 0x00000001,
Selected = 0x00000002,
Focused = 0x00000004,
Pressed = 0x00000008,
Checked = 0x00000010,
Mixed = 0x00000020,
ReadOnly = 0x00000040,
HotTracked = 0x00000080,
DefaultButton = 0x00000100,
// #### Qt5 Expandable
Expanded = 0x00000200,
Collapsed = 0x00000400,
Busy = 0x00000800,
// Floating = 0x00001000,
Marqueed = 0x00002000,
Animated = 0x00004000,
Invisible = 0x00008000,
Offscreen = 0x00010000,
Sizeable = 0x00020000,
Movable = 0x00040000,
SelfVoicing = 0x00080000,
Focusable = 0x00100000,
Selectable = 0x00200000,
Linked = 0x00400000,
Traversed = 0x00800000,
MultiSelectable = 0x01000000,
ExtSelectable = 0x02000000,
//AlertLow = 0x04000000,
//AlertMedium = 0x08000000,
//AlertHigh = 0x10000000, /* reused for HasInvokeExtension */
Protected = 0x20000000,
HasPopup = 0x40000000,
Modal = 0x80000000
};
Q_DECLARE_FLAGS(State, StateFlag)
enum Role {
NoRole = 0x00000000,
TitleBar = 0x00000001,
MenuBar = 0x00000002,
ScrollBar = 0x00000003,
Grip = 0x00000004,
Sound = 0x00000005,
Cursor = 0x00000006,
Caret = 0x00000007,
AlertMessage = 0x00000008,
Window = 0x00000009,
Client = 0x0000000A,
PopupMenu = 0x0000000B,
MenuItem = 0x0000000C,
ToolTip = 0x0000000D,
Application = 0x0000000E,
Document = 0x0000000F,
Pane = 0x00000010,
Chart = 0x00000011,
Dialog = 0x00000012,
Border = 0x00000013,
Grouping = 0x00000014,
Separator = 0x00000015,
ToolBar = 0x00000016,
StatusBar = 0x00000017,
Table = 0x00000018,
ColumnHeader = 0x00000019,
RowHeader = 0x0000001A,
Column = 0x0000001B,
Row = 0x0000001C,
Cell = 0x0000001D,
Link = 0x0000001E,
HelpBalloon = 0x0000001F,
Assistant = 0x00000020,
List = 0x00000021,
ListItem = 0x00000022,
Tree = 0x00000023,
TreeItem = 0x00000024,
PageTab = 0x00000025,
PropertyPage = 0x00000026,
Indicator = 0x00000027,
Graphic = 0x00000028,
StaticText = 0x00000029,
EditableText = 0x0000002A, // Editable, selectable, etc.
PushButton = 0x0000002B,
CheckBox = 0x0000002C,
RadioButton = 0x0000002D,
ComboBox = 0x0000002E,
// DropList = 0x0000002F,
ProgressBar = 0x00000030,
Dial = 0x00000031,
HotkeyField = 0x00000032,
Slider = 0x00000033,
SpinBox = 0x00000034,
Canvas = 0x00000035,
Animation = 0x00000036,
Equation = 0x00000037,
ButtonDropDown = 0x00000038,
ButtonMenu = 0x00000039,
ButtonDropGrid = 0x0000003A,
Whitespace = 0x0000003B,
PageTabList = 0x0000003C,
Clock = 0x0000003D,
Splitter = 0x0000003E,
// Additional Qt roles where enum value does not map directly to MSAA:
LayeredPane = 0x0000003F,
Terminal = 0x00000040,
Desktop = 0x00000041,
UserRole = 0x0000ffff
};
enum Text {
Name = 0,
Description,
Value,
Help,
Accelerator,
UserText = 0x0000ffff
};
enum RelationFlag {
Unrelated = 0x00000000,
Self = 0x00000001,
Ancestor = 0x00000002,
Child = 0x00000004,
Descendent = 0x00000008,
Sibling = 0x00000010,
HierarchyMask = 0x000000ff,
Up = 0x00000100,
Down = 0x00000200,
Left = 0x00000400,
Right = 0x00000800,
Covers = 0x00001000,
Covered = 0x00002000,
GeometryMask = 0x0000ff00,
FocusChild = 0x00010000,
Label = 0x00020000,
Labelled = 0x00040000,
Controller = 0x00080000,
Controlled = 0x00100000,
LogicalMask = 0x00ff0000
};
Q_DECLARE_FLAGS(Relation, RelationFlag)
enum Action {
DefaultAction = 0,
Press = -1,
FirstStandardAction = Press,
SetFocus = -2,
Increase = -3,
Decrease = -4,
Accept = -5,
Cancel = -6,
Select = -7,
ClearSelection = -8,
RemoveSelection = -9,
ExtendSelection = -10,
AddToSelection = -11,
LastStandardAction = AddToSelection
};
enum Method {
ListSupportedMethods = 0,
SetCursorPosition = 1,
GetCursorPosition = 2,
ForegroundColor = 3,
BackgroundColor = 4
};
typedef QAccessibleInterface*(*InterfaceFactory)(const QString &key, QObject*);
typedef void(*UpdateHandler)(QObject*, int who, Event reason);
typedef void(*RootObjectHandler)(QObject*);
static void installFactory(InterfaceFactory);
static void removeFactory(InterfaceFactory);
static UpdateHandler installUpdateHandler(UpdateHandler);
static RootObjectHandler installRootObjectHandler(RootObjectHandler);
static QAccessibleInterface *queryAccessibleInterface(QObject *);
static void updateAccessibility(QObject *, int who, Event reason);
static bool isActive();
static void setRootObject(QObject*);
static void initialize();
static void cleanup();
private:
static UpdateHandler updateHandler;
static RootObjectHandler rootObjectHandler;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::State)
Q_DECLARE_OPERATORS_FOR_FLAGS(QAccessible::Relation)
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QSet<QAccessible::Method>)
QT_BEGIN_NAMESPACE
namespace QAccessible2
{
enum InterfaceType
{
TextInterface,
EditableTextInterface,
ValueInterface,
TableInterface,
ActionInterface,
ImageInterface,
Table2Interface
};
}
class QAccessible2Interface;
class QAccessibleTextInterface;
class QAccessibleEditableTextInterface;
class QAccessibleValueInterface;
class QAccessibleTableInterface;
class QAccessibleActionInterface;
class QAccessibleImageInterface;
class QAccessibleTable2Interface;
class Q_GUI_EXPORT QAccessibleInterface : public QAccessible
{
public:
virtual ~QAccessibleInterface() {}
// check for valid pointers
virtual bool isValid() const = 0;
virtual QObject *object() const = 0;
// hierarchy
virtual int childCount() const = 0;
virtual int indexOfChild(const QAccessibleInterface *) const = 0;
// relations
virtual Relation relationTo(int child, const QAccessibleInterface *other,
int otherChild) const = 0;
virtual int childAt(int x, int y) const = 0;
// navigation
virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const = 0;
// properties and state
virtual QString text(Text t, int child) const = 0;
virtual void setText(Text t, int child, const QString &text) = 0;
virtual QRect rect(int child) const = 0;
virtual Role role(int child) const = 0;
virtual State state(int child) const = 0;
// action
virtual int userActionCount(int child) const = 0;
virtual QString actionText(int action, Text t, int child) const = 0;
virtual bool doAction(int action, int child, const QVariantList &params = QVariantList()) = 0;
virtual QVariant invokeMethod(Method method, int child = 0,
const QVariantList &params = QVariantList());
inline QSet<Method> supportedMethods()
{ return qvariant_cast<QSet<Method> >(invokeMethod(ListSupportedMethods)); }
inline QColor foregroundColor()
{ return qvariant_cast<QColor>(invokeMethod(ForegroundColor)); }
inline QColor backgroundColor()
{ return qvariant_cast<QColor>(invokeMethod(BackgroundColor)); }
inline QAccessibleTextInterface *textInterface()
{ return reinterpret_cast<QAccessibleTextInterface *>(cast_helper(QAccessible2::TextInterface)); }
inline QAccessibleEditableTextInterface *editableTextInterface()
{ return reinterpret_cast<QAccessibleEditableTextInterface *>(cast_helper(QAccessible2::EditableTextInterface)); }
inline QAccessibleValueInterface *valueInterface()
{ return reinterpret_cast<QAccessibleValueInterface *>(cast_helper(QAccessible2::ValueInterface)); }
inline QAccessibleTableInterface *tableInterface()
{ return reinterpret_cast<QAccessibleTableInterface *>(cast_helper(QAccessible2::TableInterface)); }
inline QAccessibleActionInterface *actionInterface()
{ return reinterpret_cast<QAccessibleActionInterface *>(cast_helper(QAccessible2::ActionInterface)); }
inline QAccessibleImageInterface *imageInterface()
{ return reinterpret_cast<QAccessibleImageInterface *>(cast_helper(QAccessible2::ImageInterface)); }
inline QAccessibleTable2Interface *table2Interface()
{ return reinterpret_cast<QAccessibleTable2Interface *>(cast_helper(QAccessible2::Table2Interface)); }
// FIXME
virtual QAccessible2Interface *interface_cast(QAccessible2::InterfaceType)
{ return 0; }
private:
QAccessible2Interface *cast_helper(QAccessible2::InterfaceType);
};
typedef QAccessibleInterface QAccessibleInterfaceEx;
class Q_GUI_EXPORT QAccessibleEvent : public QEvent
{
public:
inline QAccessibleEvent(Type type, int child);
inline int child() const { return c; }
inline QString value() const { return val; }
inline void setValue(const QString &aText) { val = aText; }
private:
int c;
QString val;
};
inline QAccessibleEvent::QAccessibleEvent(Type atype, int achild)
: QEvent(atype), c(achild) {}
QT_END_NAMESPACE
#define QAccessibleInterface_iid "Katie.QAccessibleInterface"
Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid)
#endif // QT_NO_ACCESSIBILITY
#endif // QACCESSIBLE_H

View file

@ -1,301 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qaccessible2.h"
#include "qapplication.h"
#include "qclipboard.h"
#include "qtextboundaryfinder.h"
#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
/*!
\namespace QAccessible2
\ingroup accessibility
\internal
\preliminary
\brief The QAccessible2 namespace defines constants relating to
IAccessible2-based interfaces
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
/*!
\class QAccessibleTextInterface
\ingroup accessibility
\internal
\preliminary
\brief The QAccessibleTextInterface class implements support for
the IAccessibleText interface.
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
/*!
\class QAccessibleEditableTextInterface
\ingroup accessibility
\internal
\preliminary
\brief The QAccessibleEditableTextInterface class implements support for
the IAccessibleEditableText interface.
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
/*!
\class QAccessibleSimpleEditableTextInterface
\ingroup accessibility
\internal
\preliminary
\brief The QAccessibleSimpleEditableTextInterface class is a convenience class for
text-based widgets.
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
/*!
\class QAccessibleValueInterface
\ingroup accessibility
\internal
\preliminary
\brief The QAccessibleValueInterface class implements support for
the IAccessibleValue interface.
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
/*!
\class QAccessibleActionInterface
\ingroup accessibility
\internal
\preliminary
\brief The QAccessibleActionInterface class implements support for
the IAccessibleAction interface.
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
/*!
\class QAccessibleImageInterface
\ingroup accessibility
\internal
\preliminary
\brief The QAccessibleImageInterface class implements support for
the IAccessibleImage interface.
\link http://www.linux-foundation.org/en/Accessibility/IAccessible2 IAccessible2 Specification \endlink
*/
/*!
\internal
*/
QString Q_GUI_EXPORT qTextBeforeOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text)
{
QTextBoundaryFinder::BoundaryType type;
switch (boundaryType) {
case QAccessible2::CharBoundary:
type = QTextBoundaryFinder::Grapheme;
break;
case QAccessible2::WordBoundary:
type = QTextBoundaryFinder::Word;
break;
case QAccessible2::SentenceBoundary:
type = QTextBoundaryFinder::Sentence;
break;
default:
// in any other case return the whole line
*startOffset = 0;
*endOffset = text.length();
return text;
}
QTextBoundaryFinder boundary(type, text);
boundary.setPosition(offset);
if (!boundary.isAtBoundary()) {
boundary.toPreviousBoundary();
}
boundary.toPreviousBoundary();
*startOffset = boundary.position();
boundary.toNextBoundary();
*endOffset = boundary.position();
return text.mid(*startOffset, *endOffset - *startOffset);
}
/*!
\internal
*/
QString Q_GUI_EXPORT qTextAfterOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text)
{
QTextBoundaryFinder::BoundaryType type;
switch (boundaryType) {
case QAccessible2::CharBoundary:
type = QTextBoundaryFinder::Grapheme;
break;
case QAccessible2::WordBoundary:
type = QTextBoundaryFinder::Word;
break;
case QAccessible2::SentenceBoundary:
type = QTextBoundaryFinder::Sentence;
break;
default:
// in any other case return the whole line
*startOffset = 0;
*endOffset = text.length();
return text;
}
QTextBoundaryFinder boundary(type, text);
boundary.setPosition(offset);
boundary.toNextBoundary();
*startOffset = boundary.position();
boundary.toNextBoundary();
*endOffset = boundary.position();
return text.mid(*startOffset, *endOffset - *startOffset);
}
/*!
\internal
*/
QString Q_GUI_EXPORT qTextAtOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text)
{
QTextBoundaryFinder::BoundaryType type;
switch (boundaryType) {
case QAccessible2::CharBoundary:
type = QTextBoundaryFinder::Grapheme;
break;
case QAccessible2::WordBoundary:
type = QTextBoundaryFinder::Word;
break;
case QAccessible2::SentenceBoundary:
type = QTextBoundaryFinder::Sentence;
break;
default:
// in any other case return the whole line
*startOffset = 0;
*endOffset = text.length();
return text;
}
QTextBoundaryFinder boundary(type, text);
boundary.setPosition(offset);
if (!boundary.isAtBoundary()) {
boundary.toPreviousBoundary();
}
*startOffset = boundary.position();
boundary.toNextBoundary();
*endOffset = boundary.position();
return text.mid(*startOffset, *endOffset - *startOffset);
}
QAccessibleSimpleEditableTextInterface::QAccessibleSimpleEditableTextInterface(
QAccessibleInterface *accessibleInterface)
: iface(accessibleInterface)
{
Q_ASSERT(iface);
}
#ifndef QT_NO_CLIPBOARD
static QString textForRange(QAccessibleInterface *iface, int startOffset, int endOffset)
{
return iface->text(QAccessible::Value, 0).mid(startOffset, endOffset - startOffset);
}
#endif
void QAccessibleSimpleEditableTextInterface::copyText(int startOffset, int endOffset)
{
#ifdef QT_NO_CLIPBOARD
Q_UNUSED(startOffset);
Q_UNUSED(endOffset);
#else
QApplication::clipboard()->setText(textForRange(iface, startOffset, endOffset));
#endif
}
void QAccessibleSimpleEditableTextInterface::deleteText(int startOffset, int endOffset)
{
QString txt = iface->text(QAccessible::Value, 0);
txt.remove(startOffset, endOffset - startOffset);
iface->setText(QAccessible::Value, 0, txt);
}
void QAccessibleSimpleEditableTextInterface::insertText(int offset, const QString &text)
{
QString txt = iface->text(QAccessible::Value, 0);
txt.insert(offset, text);
iface->setText(QAccessible::Value, 0, txt);
}
void QAccessibleSimpleEditableTextInterface::cutText(int startOffset, int endOffset)
{
#ifdef QT_NO_CLIPBOARD
Q_UNUSED(startOffset);
Q_UNUSED(endOffset);
#else
QString sub = textForRange(iface, startOffset, endOffset);
deleteText(startOffset, endOffset);
QApplication::clipboard()->setText(sub);
#endif
}
void QAccessibleSimpleEditableTextInterface::pasteText(int offset)
{
#ifdef QT_NO_CLIPBOARD
Q_UNUSED(offset);
#else
QString txt = iface->text(QAccessible::Value, 0);
txt.insert(offset, QApplication::clipboard()->text());
iface->setText(QAccessible::Value, 0, txt);
#endif
}
void QAccessibleSimpleEditableTextInterface::replaceText(int startOffset, int endOffset, const QString &text)
{
QString txt = iface->text(QAccessible::Value, 0);
txt.replace(startOffset, endOffset - startOffset, text);
iface->setText(QAccessible::Value, 0, txt);
}
QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY

View file

@ -1,335 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QACCESSIBLE2_H
#define QACCESSIBLE2_H
#include <QtGui/qaccessible.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
class QModelIndex;
namespace QAccessible2
{
enum CoordinateType
{
RelativeToScreen = 0,
RelativeToParent = 1
};
enum BoundaryType {
CharBoundary,
WordBoundary,
SentenceBoundary,
ParagraphBoundary,
LineBoundary,
NoBoundary
};
enum TableModelChangeType {
TableModelChangeInsert,
TableModelChangeDelete,
TableModelChangeUpdate
};
struct TableModelChange {
int firstColumn;
int firstRow;
int lastColumn;
int lastRow;
TableModelChangeType type;
TableModelChange()
: firstColumn(0), firstRow(0), lastColumn(0), lastRow(0), type(TableModelChangeUpdate)
{}
};
}
class Q_GUI_EXPORT QAccessible2Interface
{
public:
virtual ~QAccessible2Interface() {}
};
// catch-all functions. If an accessible class doesn't implement interface T, return 0
inline QAccessible2Interface *qAccessibleValueCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleTextCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleTableCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleActionCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleImageCastHelper() { return 0; }
inline QAccessible2Interface *qAccessibleTable2CastHelper() { return 0; }
#define Q_ACCESSIBLE_OBJECT \
public: \
QAccessible2Interface *interface_cast(QAccessible2::InterfaceType t) \
{ \
switch (t) { \
case QAccessible2::TextInterface: \
return qAccessibleTextCastHelper(); \
case QAccessible2::EditableTextInterface: \
return qAccessibleEditableTextCastHelper(); \
case QAccessible2::ValueInterface: \
return qAccessibleValueCastHelper(); \
case QAccessible2::TableInterface: \
return qAccessibleTableCastHelper(); \
case QAccessible2::ActionInterface: \
return qAccessibleActionCastHelper(); \
case QAccessible2::ImageInterface: \
return qAccessibleImageCastHelper(); \
case QAccessible2::Table2Interface: \
return qAccessibleTable2CastHelper(); \
} \
return 0; \
} \
private:
class Q_GUI_EXPORT QAccessibleTextInterface: public QAccessible2Interface
{
public:
inline QAccessible2Interface *qAccessibleTextCastHelper() { return this; }
virtual ~QAccessibleTextInterface() {}
virtual void addSelection(int startOffset, int endOffset) = 0;
virtual QString attributes(int offset, int *startOffset, int *endOffset) = 0;
virtual int cursorPosition() = 0;
virtual QRect characterRect(int offset, QAccessible2::CoordinateType coordType) = 0;
virtual int selectionCount() = 0;
virtual int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType) = 0;
virtual void selection(int selectionIndex, int *startOffset, int *endOffset) = 0;
virtual QString text(int startOffset, int endOffset) = 0;
virtual QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset) = 0;
virtual QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset) = 0;
virtual QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset) = 0;
virtual void removeSelection(int selectionIndex) = 0;
virtual void setCursorPosition(int position) = 0;
virtual void setSelection(int selectionIndex, int startOffset, int endOffset) = 0;
virtual int characterCount() = 0;
virtual void scrollToSubstring(int startIndex, int endIndex) = 0;
};
class Q_GUI_EXPORT QAccessibleEditableTextInterface: public QAccessible2Interface
{
public:
inline QAccessible2Interface *qAccessibleEditableTextCastHelper() { return this; }
virtual ~QAccessibleEditableTextInterface() {}
virtual void copyText(int startOffset, int endOffset) = 0;
virtual void deleteText(int startOffset, int endOffset) = 0;
virtual void insertText(int offset, const QString &text) = 0;
virtual void cutText(int startOffset, int endOffset) = 0;
virtual void pasteText(int offset) = 0;
virtual void replaceText(int startOffset, int endOffset, const QString &text) = 0;
virtual void setAttributes(int startOffset, int endOffset, const QString &attributes) = 0;
};
class Q_GUI_EXPORT QAccessibleSimpleEditableTextInterface: public QAccessibleEditableTextInterface
{
public:
QAccessibleSimpleEditableTextInterface(QAccessibleInterface *accessibleInterface);
void copyText(int startOffset, int endOffset);
void deleteText(int startOffset, int endOffset);
void insertText(int offset, const QString &text);
void cutText(int startOffset, int endOffset);
void pasteText(int offset);
void replaceText(int startOffset, int endOffset, const QString &text);
inline void setAttributes(int, int, const QString &) {}
private:
QAccessibleInterface *iface;
};
class Q_GUI_EXPORT QAccessibleValueInterface: public QAccessible2Interface
{
public:
inline QAccessible2Interface *qAccessibleValueCastHelper() { return this; }
virtual ~QAccessibleValueInterface() {}
virtual QVariant currentValue() = 0;
virtual void setCurrentValue(const QVariant &value) = 0;
virtual QVariant maximumValue() = 0;
virtual QVariant minimumValue() = 0;
};
class Q_GUI_EXPORT QAccessibleTableInterface: public QAccessible2Interface
{
public:
inline QAccessible2Interface *qAccessibleTableCastHelper() { return this; }
virtual QAccessibleInterface *accessibleAt(int row, int column) = 0;
virtual QAccessibleInterface *caption() = 0;
virtual int childIndex(int rowIndex, int columnIndex) = 0;
virtual QString columnDescription(int column) = 0;
virtual int columnSpan(int row, int column) = 0;
virtual QAccessibleInterface *columnHeader() = 0;
virtual int columnIndex(int childIndex) = 0;
virtual int columnCount() = 0;
virtual int rowCount() = 0;
virtual int selectedColumnCount() = 0;
virtual int selectedRowCount() = 0;
virtual QString rowDescription(int row) = 0;
virtual int rowSpan(int row, int column) = 0;
virtual QAccessibleInterface *rowHeader() = 0;
virtual int rowIndex(int childIndex) = 0;
virtual int selectedRows(int maxRows, QList<int> *rows) = 0;
virtual int selectedColumns(int maxColumns, QList<int> *columns) = 0;
virtual QAccessibleInterface *summary() = 0;
virtual bool isColumnSelected(int column) = 0;
virtual bool isRowSelected(int row) = 0;
virtual bool isSelected(int row, int column) = 0;
virtual void selectRow(int row) = 0;
virtual void selectColumn(int column) = 0;
virtual void unselectRow(int row) = 0;
virtual void unselectColumn(int column) = 0;
virtual void cellAtIndex(int index, int *row, int *column, int *rowSpan,
int *columnSpan, bool *isSelected) = 0;
};
class Q_GUI_EXPORT QAccessibleTable2CellInterface: public QAccessibleInterface
{
public:
// Returns the number of columns occupied by this cell accessible.
virtual int columnExtent() const = 0;
// Returns the column headers as an array of cell accessibles.
virtual QList<QAccessibleInterface*> columnHeaderCells() const = 0;
// Translates this cell accessible into the corresponding column index.
virtual int columnIndex() const = 0;
// Returns the number of rows occupied by this cell accessible.
virtual int rowExtent() const = 0;
// Returns the row headers as an array of cell accessibles.
virtual QList<QAccessibleInterface*> rowHeaderCells() const = 0;
// Translates this cell accessible into the corresponding row index.
virtual int rowIndex() const = 0;
// Returns a boolean value indicating whether this cell is selected.
virtual bool isSelected() const = 0;
// Gets the row and column indexes and extents of this cell accessible and whether or not it is selected.
virtual void rowColumnExtents(int *row, int *column, int *rowExtents, int *columnExtents, bool *selected) const = 0;
// Returns a reference to the accessbile of the containing table.
virtual QAccessibleTable2Interface* table() const = 0;
// #### Qt5 this should not be here but part of the state
virtual bool isExpandable() const = 0;
};
class Q_GUI_EXPORT QAccessibleTable2Interface: public QAccessible2Interface
{
public:
inline QAccessible2Interface *qAccessibleTable2CastHelper() { return this; }
// Returns the cell at the specified row and column in the table.
virtual QAccessibleTable2CellInterface *cellAt (int row, int column) const = 0;
// Returns the caption for the table.
virtual QAccessibleInterface *caption() const = 0;
// Returns the description text of the specified column in the table.
virtual QString columnDescription(int column) const = 0;
// Returns the total number of columns in table.
virtual int columnCount() const = 0;
// Returns the total number of rows in table.
virtual int rowCount() const = 0;
// Returns the total number of selected cells.
virtual int selectedCellCount() const = 0;
// Returns the total number of selected columns.
virtual int selectedColumnCount() const = 0;
// Returns the total number of selected rows.
virtual int selectedRowCount() const = 0;
// Returns the description text of the specified row in the table.
virtual QString rowDescription(int row) const = 0;
// Returns a list of accessibles currently selected.
virtual QList<QAccessibleTable2CellInterface*> selectedCells() const = 0;
// Returns a list of column indexes currently selected (0 based).
virtual QList<int> selectedColumns() const = 0;
// Returns a list of row indexes currently selected (0 based).
virtual QList<int> selectedRows() const = 0;
// Returns the summary description of the table.
virtual QAccessibleInterface *summary() const = 0;
// Returns a boolean value indicating whether the specified column is completely selected.
virtual bool isColumnSelected(int column) const = 0;
// Returns a boolean value indicating whether the specified row is completely selected.
virtual bool isRowSelected(int row) const = 0;
// Selects a row and unselects all previously selected rows.
virtual bool selectRow(int row) = 0;
// Selects a column and unselects all previously selected columns.
virtual bool selectColumn(int column) = 0;
// Unselects one row, leaving other selected rows selected (if any).
virtual bool unselectRow(int row) = 0;
// Unselects one column, leaving other selected columns selected (if any).
virtual bool unselectColumn(int column) = 0;
// Returns the type and extents describing how a table changed.
virtual QAccessible2::TableModelChange modelChange() const = 0;
protected:
// These functions are called when the model changes.
virtual void modelReset() = 0;
virtual void rowsInserted(const QModelIndex &parent, int first, int last) = 0;
virtual void rowsRemoved(const QModelIndex &parent, int first, int last) = 0;
virtual void columnsInserted(const QModelIndex &parent, int first, int last) = 0;
virtual void columnsRemoved(const QModelIndex &parent, int first, int last) = 0;
virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row) = 0;
virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column) = 0;
friend class QAbstractItemView;
friend class QAbstractItemViewPrivate;
};
class Q_GUI_EXPORT QAccessibleActionInterface : public QAccessible2Interface
{
public:
inline QAccessible2Interface *qAccessibleActionCastHelper() { return this; }
virtual int actionCount() = 0;
virtual void doAction(int actionIndex) = 0;
virtual QString description(int actionIndex) = 0;
virtual QString name(int actionIndex) = 0;
virtual QString localizedName(int actionIndex) = 0;
virtual QStringList keyBindings(int actionIndex) = 0;
};
class Q_GUI_EXPORT QAccessibleImageInterface : public QAccessible2Interface
{
public:
inline QAccessible2Interface *qAccessibleImageCastHelper() { return this; }
virtual QString imageDescription() = 0;
virtual QSize imageSize() = 0;
virtual QRect imagePosition(QAccessible2::CoordinateType coordType) = 0;
};
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif

View file

@ -1,118 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qaccessible.h"
#include "qaccessiblebridge.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qcoreapplication.h"
#include "qvector.h"
#include "qfactoryloader_p.h"
QT_BEGIN_NAMESPACE
#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, bridgeloader,
(QAccessibleBridgeFactoryInterface_iid, QLatin1String("/accessiblebridge")))
#endif
Q_GLOBAL_STATIC(QVector<QAccessibleBridge *>, bridges)
void QAccessible::initialize()
{
static const int shouldinit = qgetenv("QT_ACCESSIBILITY").toInt();
if (!shouldinit)
return;
#ifndef QT_NO_LIBRARY
const QStringList l = bridgeloader()->keys();
for (int i = 0; i < l.count(); ++i) {
if (QAccessibleBridgeFactoryInterface *factory =
qobject_cast<QAccessibleBridgeFactoryInterface*>(bridgeloader()->instance(l.at(i)))) {
QAccessibleBridge * bridge = factory->create(l.at(i));
if (bridge)
bridges()->append(bridge);
}
}
#endif
}
void QAccessible::cleanup()
{
qDeleteAll(*bridges());
}
void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
{
Q_ASSERT(o);
if (updateHandler) {
updateHandler(o, who, reason);
return;
}
initialize();
if (!bridges() || bridges()->isEmpty())
return;
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o);
if (!iface)
return;
// updates for List/Table/Tree should send child
if (who) {
QAccessibleInterface *child;
iface->navigate(QAccessible::Child, who, &child);
if (child) {
delete iface;
iface = child;
who = 0;
}
}
for (int i = 0; i < bridges()->count(); ++i)
bridges()->at(i)->notifyAccessibilityUpdate(reason, iface, who);
delete iface;
}
void QAccessible::setRootObject(QObject *o)
{
if (rootObjectHandler) {
rootObjectHandler(o);
return;
}
initialize();
if (bridges()->isEmpty() || !o)
return;
for (int i = 0; i < bridges()->count(); ++i) {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o);
bridges()->at(i)->setRootObject(iface);
}
}
QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY

View file

@ -1,141 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qaccessiblebridge.h"
#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
/*!
\class QAccessibleBridge
\brief The QAccessibleBridge class is the base class for
accessibility back-ends.
\ingroup accessibility
Qt supports Microsoft Active Accessibility (MSAA), Mac OS X
Accessibility, and the Unix/X11 AT-SPI standard. By subclassing
QAccessibleBridge, you can support other backends than the
predefined ones.
Currently, custom bridges are only supported on Unix. We might
add support for them on other platforms as well if there is
enough demand.
\sa QAccessible, QAccessibleBridgePlugin
*/
/*!
\fn QAccessibleBridge::~QAccessibleBridge()
Destroys the accessibility bridge object.
*/
/*!
\fn void QAccessibleBridge::setRootObject(QAccessibleInterface *object)
This function is called by Qt at application startup to set the
root accessible object of the application to \a object. All other
accessible objects in the application can be reached by the
client using object navigation.
*/
/*!
\fn void QAccessibleBridge::notifyAccessibilityUpdate(int reason, QAccessibleInterface *interface, int child)
This function is called by Qt to notify the bridge about a change
in the accessibility information for object wrapped by the given
\a interface.
\a reason specifies the cause of the change. It can take values
of type QAccessible::Event.
\a child is the (1-based) index of the child element that has
changed. When \a child is 0, the object itself has changed.
\sa QAccessible::updateAccessibility()
*/
/*!
\class QAccessibleBridgePlugin
\brief The QAccessibleBridgePlugin class provides an abstract
base for accessibility bridge plugins.
\ingroup plugins
\ingroup accessibility
Writing an accessibility bridge plugin is achieved by subclassing
this base class, reimplementing the pure virtual functions keys()
and create(), and exporting the class with the
Q_EXPORT_PLUGIN2() macro.
\sa QAccessibleBridge, QAccessiblePlugin, {How to Create Qt Plugins}
*/
/*!
Constructs an accessibility bridge plugin with the given \a
parent. This is invoked automatically by the Q_EXPORT_PLUGIN2()
macro.
*/
QAccessibleBridgePlugin::QAccessibleBridgePlugin(QObject *parent)
: QObject(parent)
{
}
/*!
Destroys the accessibility bridge plugin.
You never have to call this explicitly. Qt destroys a plugin
automatically when it is no longer used.
*/
QAccessibleBridgePlugin::~QAccessibleBridgePlugin()
{
}
/*!
\fn QStringList QAccessibleBridgePlugin::keys() const
Returns the list of keys this plugins supports.
These keys must be the names of the bridges that this
plugin provides.
\sa create()
*/
/*!
\fn QAccessibleBridge *QAccessibleBridgePlugin::create(const QString &key)
Creates and returns the QAccessibleBridge object corresponding to
the given \a key. Keys are case sensitive.
\sa keys()
*/
QT_END_NAMESPACE
#include "moc_qaccessiblebridge.h"
#endif // QT_NO_ACCESSIBILITY

View file

@ -1,73 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QACCESSIBLEBRIDGE_H
#define QACCESSIBLEBRIDGE_H
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
class QAccessibleInterface;
class QAccessibleBridge
{
public:
virtual ~QAccessibleBridge() {}
virtual void setRootObject(QAccessibleInterface *) = 0;
virtual void notifyAccessibilityUpdate(int, QAccessibleInterface*, int) = 0;
};
struct Q_GUI_EXPORT QAccessibleBridgeFactoryInterface : public QFactoryInterface
{
virtual QAccessibleBridge *create(const QString& name) = 0;
};
QT_END_NAMESPACE
#define QAccessibleBridgeFactoryInterface_iid "Katie.QAccessibleBridgeFactoryInterface"
Q_DECLARE_INTERFACE(QAccessibleBridgeFactoryInterface, QAccessibleBridgeFactoryInterface_iid)
QT_BEGIN_NAMESPACE
class Q_GUI_EXPORT QAccessibleBridgePlugin : public QObject, public QAccessibleBridgeFactoryInterface
{
Q_OBJECT
Q_INTERFACES(QAccessibleBridgeFactoryInterface:QFactoryInterface)
public:
explicit QAccessibleBridgePlugin(QObject *parent = nullptr);
~QAccessibleBridgePlugin();
virtual QStringList keys() const = 0;
virtual QAccessibleBridge *create(const QString &key) = 0;
};
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // QACCESSIBLEBRIDGE_H

View file

@ -1,337 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qaccessibleobject.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qapplication.h"
#include "qwidget.h"
#include "qpointer.h"
#include "qmetaobject.h"
QT_BEGIN_NAMESPACE
class QAccessibleObjectPrivate
{
public:
QPointer<QObject> object;
};
/*!
\class QAccessibleObject
\brief The QAccessibleObject class implements parts of the
QAccessibleInterface for QObjects.
\ingroup accessibility
This class is mainly provided for convenience. All subclasses of
the QAccessibleInterface that provide implementations of non-widget objects
should use this class as their base class.
\sa QAccessible, QAccessibleWidget
*/
/*!
Creates a QAccessibleObject for \a object.
*/
QAccessibleObject::QAccessibleObject(QObject *object)
{
d = new QAccessibleObjectPrivate;
d->object = object;
}
/*!
Destroys the QAccessibleObject.
This only happens when a call to release() decrements the internal
reference counter to zero.
*/
QAccessibleObject::~QAccessibleObject()
{
delete d;
}
/*!
\reimp
*/
QObject *QAccessibleObject::object() const
{
#ifndef QT_NO_DEBUG
if (!d->object)
qWarning("QAccessibleInterface is invalid. Crash pending...");
#endif
return d->object;
}
/*!
\reimp
*/
bool QAccessibleObject::isValid() const
{
return !d->object.isNull();
}
/*! \reimp */
QRect QAccessibleObject::rect(int) const
{
return QRect();
}
/*! \reimp */
void QAccessibleObject::setText(Text, int, const QString &)
{
}
/*! \reimp */
int QAccessibleObject::userActionCount(int) const
{
return 0;
}
/*! \reimp */
bool QAccessibleObject::doAction(int, int, const QVariantList &)
{
return false;
}
static const char * const action_text[][5] =
{
// Name, Description, Value, Help, Accelerator
{ "Press", "", "", "", "Space" },
{ "SetFocus", "Passes focus to this widget", "", "", "" },
{ "Increase", "", "", "", "" },
{ "Decrease", "", "", "", "" },
{ "Accept", "", "", "", "" },
{ "Cancel", "", "", "", "" },
{ "Select", "", "", "", "" },
{ "ClearSelection", "", "", "", "" },
{ "RemoveSelection", "", "", "", "" },
{ "ExtendSelection", "", "", "", "" },
{ "AddToSelection", "", "", "", "" }
};
/*! \reimp */
QString QAccessibleObject::actionText(int action, Text t, int child) const
{
if (child || action > FirstStandardAction || action < LastStandardAction || t > Accelerator)
return QString();
return QString::fromLatin1(action_text[-(action - FirstStandardAction)][t]);
}
/*!
\class QAccessibleApplication
\brief The QAccessibleApplication class implements the QAccessibleInterface for QApplication.
\internal
\ingroup accessibility
*/
/*!
Creates a QAccessibleApplication for the QApplication object referenced by qApp.
*/
QAccessibleApplication::QAccessibleApplication()
: QAccessibleObject(qApp)
{
}
// all toplevel widgets except popups and the desktop
static QWidgetList topLevelWidgets()
{
QWidgetList list;
const QWidgetList tlw(QApplication::topLevelWidgets());
for (int i = 0; i < tlw.count(); ++i) {
QWidget *w = tlw.at(i);
if (!(w->windowType() == Qt::Popup) && !(w->windowType() == Qt::Desktop))
list.append(w);
}
return list;
}
/*! \reimp */
int QAccessibleApplication::childCount() const
{
return topLevelWidgets().count();
}
/*! \reimp */
int QAccessibleApplication::indexOfChild(const QAccessibleInterface *child) const
{
if (!child->object()->isWidgetType())
return -1;
const QWidgetList tlw(topLevelWidgets());
int index = tlw.indexOf(static_cast<QWidget*>(child->object()));
if (index != -1)
++index;
return index;
}
/*! \reimp */
int QAccessibleApplication::childAt(int x, int y) const
{
const QWidgetList tlw(topLevelWidgets());
for (int i = 0; i < tlw.count(); ++i) {
QWidget *w = tlw.at(i);
if (w->frameGeometry().contains(x,y))
return i+1;
}
return -1;
}
/*! \reimp */
QAccessible::Relation QAccessibleApplication::relationTo(int child, const
QAccessibleInterface *other, int otherChild) const
{
QObject *o = other ? other->object() : 0;
if (!o)
return Unrelated;
if(o == object()) {
if (child && !otherChild)
return Child;
if (!child && otherChild)
return Ancestor;
if (!child && !otherChild)
return Self;
}
QWidgetList tlw(topLevelWidgets());
if (tlw.contains(qobject_cast<QWidget*>(o)))
return Ancestor;
for (int i = 0; i < tlw.count(); ++i) {
QWidget *w = tlw.at(i);
QObjectList cl = w->findChildren<QObject *>(QString());
if (cl.contains(o))
return Ancestor;
}
return Unrelated;
}
/*! \reimp */
int QAccessibleApplication::navigate(RelationFlag relation, int entry,
QAccessibleInterface **target) const
{
if (!target)
return -1;
*target = 0;
QObject *targetObject = 0;
switch (relation) {
case Self:
targetObject = object();
break;
case Child:
if (entry > 0 && entry <= childCount()) {
const QWidgetList tlw(topLevelWidgets());
if (tlw.count() >= entry)
targetObject = tlw.at(entry-1);
} else {
return -1;
}
break;
case FocusChild:
targetObject = QApplication::activeWindow();
break;
default:
break;
}
*target = QAccessible::queryAccessibleInterface(targetObject);
return *target ? 0 : -1;
}
/*! \reimp */
QString QAccessibleApplication::text(Text t, int) const
{
switch (t) {
case Name:
return QApplication::applicationName();
case Description:
return QApplication::applicationFilePath();
default:
break;
}
return QString();
}
/*! \reimp */
QAccessible::Role QAccessibleApplication::role(int) const
{
return Application;
}
/*! \reimp */
QAccessible::State QAccessibleApplication::state(int) const
{
return QApplication::activeWindow() ? Focused : Normal;
}
/*! \reimp */
int QAccessibleApplication::userActionCount(int) const
{
return 1;
}
/*! \reimp */
bool QAccessibleApplication::doAction(int action, int child, const QVariantList &param)
{
if (action == 0 || action == 1) {
QWidget *w = 0;
w = QApplication::activeWindow();
if (!w)
w = topLevelWidgets().at(0);
if (!w)
return false;
w->activateWindow();
return true;
}
return QAccessibleObject::doAction(action, child, param);
}
/*! \reimp */
QString QAccessibleApplication::actionText(int action, Text text, int child) const
{
QString str;
if ((action == 0 || action == 1) && !child) switch (text) {
case Name:
return QApplication::tr("Activate");
case Description:
return QApplication::tr("Activates the program's main window");
default:
break;
}
return QAccessibleObject::actionText(action, text, child);
}
QT_END_NAMESPACE
#endif //QT_NO_ACCESSIBILITY

View file

@ -1,92 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QACCESSIBLEOBJECT_H
#define QACCESSIBLEOBJECT_H
#include <QtGui/qaccessible.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
class QAccessibleObjectPrivate;
class QObject;
class Q_GUI_EXPORT QAccessibleObject : public QAccessibleInterface
{
public:
explicit QAccessibleObject(QObject *object);
bool isValid() const;
QObject *object() const;
// properties
QRect rect(int child) const;
void setText(Text t, int child, const QString &text);
// actions
int userActionCount(int child) const;
bool doAction(int action, int child, const QVariantList &params);
QString actionText(int action, Text t, int child) const;
protected:
virtual ~QAccessibleObject();
private:
QAccessibleObjectPrivate *d;
Q_DISABLE_COPY(QAccessibleObject)
};
typedef QAccessibleObject QAccessibleObjectEx;
class Q_GUI_EXPORT QAccessibleApplication : public QAccessibleObject
{
public:
QAccessibleApplication();
// relations
int childCount() const;
int indexOfChild(const QAccessibleInterface*) const;
Relation relationTo(int, const QAccessibleInterface *, int) const;
// navigation
int childAt(int x, int y) const;
int navigate(RelationFlag, int, QAccessibleInterface **) const;
// properties and state
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
// actions
int userActionCount(int child) const;
bool doAction(int action, int child, const QVariantList &params);
QString actionText(int action, Text t, int child) const;
};
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // QACCESSIBLEOBJECT_H

View file

@ -1,90 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qaccessibleplugin.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
QT_BEGIN_NAMESPACE
/*!
\class QAccessiblePlugin
\brief The QAccessiblePlugin class provides an abstract base for
accessibility plugins.
\ingroup plugins
\ingroup accessibility
Writing an accessibility plugin is achieved by subclassing this
base class, reimplementing the pure virtual functions keys() and
create(), and exporting the class with the Q_EXPORT_PLUGIN2()
macro.
\sa QAccessibleBridgePlugin, {How to Create Qt Plugins}
*/
/*!
Constructs an accessibility plugin with the given \a parent. This
is invoked automatically by the Q_EXPORT_PLUGIN2() macro.
*/
QAccessiblePlugin::QAccessiblePlugin(QObject *parent)
: QObject(parent)
{
}
/*!
Destroys the accessibility plugin.
You never have to call this explicitly. Qt destroys a plugin
automatically when it is no longer used.
*/
QAccessiblePlugin::~QAccessiblePlugin()
{
}
/*!
\fn QStringList QAccessiblePlugin::keys() const
Returns the list of keys this plugin supports.
These keys must be the class names that this plugin provides
an accessibility implementation for.
\sa create()
*/
/*!
\fn QAccessibleInterface *QAccessiblePlugin::create(const QString &key, QObject *object)
Creates and returns a QAccessibleInterface implementation for the
class \a key and the object \a object. Keys are case sensitive.
\sa keys()
*/
QT_END_NAMESPACE
#include "moc_qaccessibleplugin.h"
#endif // QT_NO_ACCESSIBILITY

View file

@ -1,68 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QACCESSIBLEPLUGIN_H
#define QACCESSIBLEPLUGIN_H
#include <QtGui/qaccessible.h>
#include <QtCore/qfactoryinterface.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
class QStringList;
class QAccessibleInterface;
struct Q_GUI_EXPORT QAccessibleFactoryInterface : public QAccessible, public QFactoryInterface
{
virtual QAccessibleInterface* create(const QString &key, QObject *object) = 0;
};
QT_END_NAMESPACE
#define QAccessibleFactoryInterface_iid "Katie.QAccessibleFactoryInterface"
Q_DECLARE_INTERFACE(QAccessibleFactoryInterface, QAccessibleFactoryInterface_iid)
QT_BEGIN_NAMESPACE
class QAccessiblePluginPrivate;
class Q_GUI_EXPORT QAccessiblePlugin : public QObject, public QAccessibleFactoryInterface
{
Q_OBJECT
Q_INTERFACES(QAccessibleFactoryInterface:QFactoryInterface)
public:
explicit QAccessiblePlugin(QObject *parent = nullptr);
~QAccessiblePlugin();
virtual QStringList keys() const = 0;
virtual QAccessibleInterface *create(const QString &key, QObject *object) = 0;
};
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // QACCESSIBLEPLUGIN_H

View file

@ -1,971 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qaccessiblewidget.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaction.h"
#include "qapplication.h"
#include "qgroupbox.h"
#include "qlabel.h"
#include "qtooltip.h"
#include "qwhatsthis.h"
#include "qwidget.h"
#include "qdebug.h"
#include "qmath.h"
#include <QRubberBand>
#include <QtGui/QFocusFrame>
#include <QtGui/QMenu>
#include "qobject_p.h"
QT_BEGIN_NAMESPACE
static QList<QWidget*> childWidgets(const QWidget *widget)
{
QList<QObject*> list = widget->children();
QList<QWidget*> widgets;
for (int i = 0; i < list.size(); ++i) {
QWidget *w = qobject_cast<QWidget *>(list.at(i));
if (w && !w->isWindow()
&& !qobject_cast<QFocusFrame*>(w)
#if !defined(QT_NO_MENU)
&& !qobject_cast<QMenu*>(w)
#endif
&& w->objectName() != QLatin1String("qt_rubberband"))
widgets.append(w);
}
return widgets;
}
static QString buddyString(const QWidget *widget)
{
if (!widget)
return QString();
QWidget *parent = widget->parentWidget();
if (!parent)
return QString();
#ifndef QT_NO_SHORTCUT
QObjectList ol = parent->children();
for (int i = 0; i < ol.size(); ++i) {
QLabel *label = qobject_cast<QLabel*>(ol.at(i));
if (label && label->buddy() == widget)
return label->text();
}
#endif
#ifndef QT_NO_GROUPBOX
QGroupBox *groupbox = qobject_cast<QGroupBox*>(parent);
if (groupbox)
return groupbox->title();
#endif
return QString();
}
/* This function will return the offset of the '&' in the text that would be
preceding the accelerator character.
If this text does not have an accelerator, -1 will be returned. */
static int qt_accAmpIndex(const QString &text)
{
#ifndef QT_NO_SHORTCUT
if (text.isEmpty())
return -1;
int fa = 0;
while ((fa = text.indexOf(QLatin1Char('&'), fa)) != -1) {
++fa;
if (fa < text.length()) {
// ignore "&&"
if (text.at(fa) == QLatin1Char('&')) {
++fa;
continue;
}
return fa - 1;
}
}
return -1;
#else
Q_UNUSED(text);
return -1;
#endif
}
QString Q_GUI_EXPORT qt_accStripAmp(const QString &text)
{
QString newText(text);
int ampIndex = qt_accAmpIndex(newText);
if (ampIndex != -1)
newText.remove(ampIndex, 1);
return newText.replace(QLatin1String("&&"), QLatin1String("&"));
}
QString Q_GUI_EXPORT qt_accHotKey(const QString &text)
{
int ampIndex = qt_accAmpIndex(text);
if (ampIndex != -1)
return QKeySequence(Qt::ALT).toString() + text.at(ampIndex + 1);
return QString();
}
class QAccessibleWidgetPrivate : public QAccessible
{
public:
QAccessibleWidgetPrivate()
:role(Client)
{}
Role role;
QString name;
QString description;
QString value;
QString help;
QString accelerator;
QStringList primarySignals;
const QAccessibleInterface *asking;
};
/*!
\class QAccessibleWidget
\brief The QAccessibleWidget class implements the QAccessibleInterface for QWidgets.
\ingroup accessibility
This class is convenient to use as a base class for custom
implementations of QAccessibleInterfaces that provide information
about widget objects.
The class provides functions to retrieve the parentObject() (the
widget's parent widget), and the associated widget(). Controlling
signals can be added with addControllingSignal(), and setters are
provided for various aspects of the interface implementation, for
example setValue(), setDescription(), setAccelerator(), and
setHelp().
\sa QAccessible, QAccessibleObject
*/
/*!
Creates a QAccessibleWidget object for widget \a w.
\a role and \a name are optional parameters that set the object's
role and name properties.
*/
QAccessibleWidget::QAccessibleWidget(QWidget *w, Role role, const QString &name)
: QAccessibleObject(w)
{
Q_ASSERT(widget());
d = new QAccessibleWidgetPrivate();
d->role = role;
d->name = name;
d->asking = 0;
}
/*!
Destroys this object.
*/
QAccessibleWidget::~QAccessibleWidget()
{
delete d;
}
/*!
Returns the associated widget.
*/
QWidget *QAccessibleWidget::widget() const
{
return qobject_cast<QWidget*>(object());
}
/*!
Returns the associated widget's parent object, which is either the
parent widget, or qApp for top-level widgets.
*/
QObject *QAccessibleWidget::parentObject() const
{
QObject *parent = object()->parent();
if (!parent)
parent = qApp;
return parent;
}
/*! \reimp */
int QAccessibleWidget::childAt(int x, int y) const
{
QWidget *w = widget();
if (!w->isVisible())
return -1;
QPoint gp = w->mapToGlobal(QPoint(0, 0));
if (!QRect(gp.x(), gp.y(), w->width(), w->height()).contains(x, y))
return -1;
QWidgetList list = childWidgets(w);
int ccount = childCount();
// a complex child
if (list.size() < ccount) {
for (int i = 1; i <= ccount; ++i) {
if (rect(i).contains(x, y))
return i;
}
return 0;
}
QPoint rp = w->mapFromGlobal(QPoint(x, y));
for (int i = 0; i<list.size(); ++i) {
QWidget *child = list.at(i);
if (!child->isWindow() && !child->isHidden() && child->geometry().contains(rp)) {
return i + 1;
}
}
return 0;
}
/*! \reimp */
QRect QAccessibleWidget::rect(int child) const
{
if (child) {
qWarning("QAccessibleWidget::rect: This implementation does not support subelements! "
"(ID %d unknown for %s)", child, widget()->metaObject()->className());
}
QWidget *w = widget();
if (!w->isVisible())
return QRect();
QPoint wpos = w->mapToGlobal(QPoint(0, 0));
return QRect(wpos.x(), wpos.y(), w->width(), w->height());
}
class QACConnectionObject : public QObject
{
Q_DECLARE_PRIVATE(QObject)
public:
inline bool isSender(const QObject *receiver, const char *signal) const
{ return d_func()->isSender(receiver, signal); }
inline QObjectList receiverList(const char *signal) const
{ return d_func()->receiverList(signal); }
inline QObjectList senderList() const
{ return d_func()->senderList(); }
};
/*!
Registers \a signal as a controlling signal.
An object is a Controller to any other object connected to a
controlling signal.
*/
void QAccessibleWidget::addControllingSignal(const QString &signal)
{
QByteArray s = QMetaObject::normalizedSignature(signal.toAscii());
if (object()->metaObject()->indexOfSignal(s) < 0)
qWarning("Signal %s unknown in %s", s.constData(), object()->metaObject()->className());
d->primarySignals << QLatin1String(s);
}
/*!
Sets the value of this interface implementation to \a value.
The default implementation of text() returns the set value for
the Value text.
Note that the object wrapped by this interface is not modified.
*/
void QAccessibleWidget::setValue(const QString &value)
{
d->value = value;
}
/*!
Sets the description of this interface implementation to \a desc.
The default implementation of text() returns the set value for
the Description text.
Note that the object wrapped by this interface is not modified.
*/
void QAccessibleWidget::setDescription(const QString &desc)
{
d->description = desc;
}
/*!
Sets the help of this interface implementation to \a help.
The default implementation of text() returns the set value for
the Help text.
Note that the object wrapped by this interface is not modified.
*/
void QAccessibleWidget::setHelp(const QString &help)
{
d->help = help;
}
/*!
Sets the accelerator of this interface implementation to \a accel.
The default implementation of text() returns the set value for
the Accelerator text.
Note that the object wrapped by this interface is not modified.
*/
void QAccessibleWidget::setAccelerator(const QString &accel)
{
d->accelerator = accel;
}
static inline bool isAncestor(const QObject *obj, const QObject *child)
{
while (child) {
if (child == obj)
return true;
child = child->parent();
}
return false;
}
/*! \reimp */
QAccessible::Relation QAccessibleWidget::relationTo(int child,
const QAccessibleInterface *other, int otherChild) const
{
Relation relation = Unrelated;
if (d->asking == this) // recursive call
return relation;
QObject *o = other ? other->object() : 0;
if (!o)
return relation;
QWidget *focus = widget()->focusWidget();
if (object() == focus && isAncestor(o, focus))
relation |= FocusChild;
QACConnectionObject *connectionObject = (QACConnectionObject*)object();
for (int sig = 0; sig < d->primarySignals.count(); ++sig) {
if (connectionObject->isSender(o, d->primarySignals.at(sig).toAscii())) {
relation |= Controller;
break;
}
}
// test for passive relationships.
// d->asking protects from endless recursion.
d->asking = this;
int inverse = other->relationTo(otherChild, this, child);
d->asking = 0;
if (inverse & Controller)
relation |= Controlled;
if (inverse & Label)
relation |= Labelled;
if(o == object()) {
if (child && !otherChild)
return relation | Child;
if (!child && otherChild)
return relation | Ancestor;
if (!child && !otherChild)
return relation | Self;
}
QObject *parent = object()->parent();
if (o == parent)
return relation | Child;
if (o->parent() == parent) {
relation |= Sibling;
QAccessibleInterface *sibIface = QAccessible::queryAccessibleInterface(o);
Q_ASSERT(sibIface);
QRect wg = rect(0);
QRect sg = sibIface->rect(0);
if (wg.intersects(sg)) {
QAccessibleInterface *pIface = 0;
sibIface->navigate(Ancestor, 1, &pIface);
if (pIface && !((sibIface->state(0) | state(0)) & Invisible)) {
int wi = pIface->indexOfChild(this);
int si = pIface->indexOfChild(sibIface);
if (wi > si)
relation |= QAccessible::Covers;
else
relation |= QAccessible::Covered;
}
delete pIface;
} else {
QPoint wc = wg.center();
QPoint sc = sg.center();
if (wc.x() < sc.x())
relation |= QAccessible::Left;
else if(wc.x() > sc.x())
relation |= QAccessible::Right;
if (wc.y() < sc.y())
relation |= QAccessible::Up;
else if (wc.y() > sc.y())
relation |= QAccessible::Down;
}
delete sibIface;
return relation;
}
if (isAncestor(o, object()))
return relation | Descendent;
if (isAncestor(object(), o))
return relation | Ancestor;
return relation;
}
/*! \reimp */
int QAccessibleWidget::navigate(RelationFlag relation, int entry,
QAccessibleInterface **target) const
{
if (!target)
return -1;
*target = 0;
QObject *targetObject = 0;
QWidgetList childList = childWidgets(widget());
bool complexWidget = childList.size() < childCount();
switch (relation) {
// Hierarchical
case Self:
targetObject = object();
break;
case Child:
if (complexWidget) {
if (entry > 0 && entry <= childCount())
return entry;
return -1;
}else {
if (entry > 0 && childList.size() >= entry)
targetObject = childList.at(entry - 1);
}
break;
case Ancestor:
{
if (entry <= 0)
return -1;
targetObject = widget()->parentWidget();
int i;
for (i = entry; i > 1 && targetObject; --i)
targetObject = targetObject->parent();
if (!targetObject && i == 1)
targetObject = qApp;
}
break;
case Sibling:
{
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(parentObject());
if (!iface)
return -1;
iface->navigate(Child, entry, target);
delete iface;
if (*target)
return 0;
}
break;
// Geometrical
case QAccessible::Left:
if (complexWidget && entry) {
if (entry < 2 || widget()->height() > widget()->width() + 20) // looks vertical
return -1;
return entry - 1;
}
// fall through
case QAccessible::Right:
if (complexWidget && entry) {
if (entry >= childCount() || widget()->height() > widget()->width() + 20) // looks vertical
return -1;
return entry + 1;
}
// fall through
case QAccessible::Up:
if (complexWidget && entry) {
if (entry < 2 || widget()->width() > widget()->height() + 20) // looks horizontal
return - 1;
return entry - 1;
}
// fall through
case QAccessible::Down:
if (complexWidget && entry) {
if (entry >= childCount() || widget()->width() > widget()->height() + 20) // looks horizontal
return - 1;
return entry + 1;
} else {
QAccessibleInterface *pIface = QAccessible::queryAccessibleInterface(parentObject());
if (!pIface)
return -1;
QRect startg = rect(0);
QPoint startc = startg.center();
QAccessibleInterface *candidate = 0;
int mindist = 100000;
int sibCount = pIface->childCount();
for (int i = 0; i < sibCount; ++i) {
QAccessibleInterface *sibling = 0;
pIface->navigate(Child, i+1, &sibling);
Q_ASSERT(sibling);
if ((relationTo(0, sibling, 0) & Self) || (sibling->state(0) & QAccessible::Invisible)) {
//ignore ourself and invisible siblings
delete sibling;
continue;
}
QRect sibg = sibling->rect(0);
QPoint sibc = sibg.center();
QPoint sibp;
QPoint startp;
QPoint distp;
switch (relation) {
case QAccessible::Left:
startp = QPoint(startg.left(), startg.top() + startg.height() / 2);
sibp = QPoint(sibg.right(), sibg.top() + sibg.height() / 2);
if (QPoint(sibc - startc).x() >= 0) {
delete sibling;
continue;
}
distp = sibp - startp;
break;
case QAccessible::Right:
startp = QPoint(startg.right(), startg.top() + startg.height() / 2);
sibp = QPoint(sibg.left(), sibg.top() + sibg.height() / 2);
if (QPoint(sibc - startc).x() <= 0) {
delete sibling;
continue;
}
distp = sibp - startp;
break;
case QAccessible::Up:
startp = QPoint(startg.left() + startg.width() / 2, startg.top());
sibp = QPoint(sibg.left() + sibg.width() / 2, sibg.bottom());
if (QPoint(sibc - startc).y() >= 0) {
delete sibling;
continue;
}
distp = sibp - startp;
break;
case QAccessible::Down:
startp = QPoint(startg.left() + startg.width() / 2, startg.bottom());
sibp = QPoint(sibg.left() + sibg.width() / 2, sibg.top());
if (QPoint(sibc - startc).y() <= 0) {
delete sibling;
continue;
}
distp = sibp - startp;
break;
default:
break;
}
int dist = (int)qSqrt((qreal)distp.x() * distp.x() + distp.y() * distp.y());
if (dist < mindist) {
delete candidate;
candidate = sibling;
mindist = dist;
} else {
delete sibling;
}
}
delete pIface;
*target = candidate;
if (*target)
return 0;
}
break;
case Covers:
if (entry > 0) {
QAccessibleInterface *pIface = QAccessible::queryAccessibleInterface(parentObject());
if (!pIface)
return -1;
QRect r = rect(0);
int sibCount = pIface->childCount();
QAccessibleInterface *sibling = 0;
for (int i = pIface->indexOfChild(this) + 1; i <= sibCount && entry; ++i) {
pIface->navigate(Child, i, &sibling);
if (!sibling || (sibling->state(0) & Invisible)) {
delete sibling;
sibling = 0;
continue;
}
if (sibling->rect(0).intersects(r))
--entry;
if (!entry)
break;
delete sibling;
sibling = 0;
}
delete pIface;
*target = sibling;
if (*target)
return 0;
}
break;
case Covered:
if (entry > 0) {
QAccessibleInterface *pIface = QAccessible::queryAccessibleInterface(parentObject());
if (!pIface)
return -1;
QRect r = rect(0);
int index = pIface->indexOfChild(this);
QAccessibleInterface *sibling = 0;
for (int i = 1; i < index && entry; ++i) {
pIface->navigate(Child, i, &sibling);
Q_ASSERT(sibling);
if (!sibling || (sibling->state(0) & Invisible)) {
delete sibling;
sibling = 0;
continue;
}
if (sibling->rect(0).intersects(r))
--entry;
if (!entry)
break;
delete sibling;
sibling = 0;
}
delete pIface;
*target = sibling;
if (*target)
return 0;
}
break;
// Logical
case FocusChild:
{
if (widget()->hasFocus()) {
targetObject = object();
break;
}
QWidget *fw = widget()->focusWidget();
if (!fw)
return -1;
if (isAncestor(widget(), fw) || fw == widget())
targetObject = fw;
/* ###
QWidget *parent = fw;
while (parent && !targetObject) {
parent = parent->parentWidget();
if (parent == widget())
targetObject = fw;
}
*/
}
break;
case Label:
if (entry > 0) {
QAccessibleInterface *pIface = QAccessible::queryAccessibleInterface(parentObject());
if (!pIface)
return -1;
// first check for all siblings that are labels to us
// ideally we would go through all objects and check, but that
// will be too expensive
int sibCount = pIface->childCount();
QAccessibleInterface *candidate = 0;
for (int i = 0; i < sibCount && entry; ++i) {
const int childId = pIface->navigate(Child, i+1, &candidate);
Q_ASSERT(childId >= 0);
if (childId > 0)
candidate = pIface;
if (candidate->relationTo(childId, this, 0) & Label)
--entry;
if (!entry)
break;
if (candidate != pIface)
delete candidate;
candidate = 0;
}
if (!candidate) {
if (pIface->relationTo(0, this, 0) & Label)
--entry;
if (!entry)
candidate = pIface;
}
if (pIface != candidate)
delete pIface;
*target = candidate;
if (*target)
return 0;
}
break;
case Labelled: // only implemented in subclasses
break;
case Controller:
if (entry > 0) {
// check all senders we are connected to,
// and figure out which one are controllers to us
QACConnectionObject *connectionObject = (QACConnectionObject*)object();
QObjectList allSenders = connectionObject->senderList();
QObjectList senders;
for (int s = 0; s < allSenders.size(); ++s) {
QObject *sender = allSenders.at(s);
QAccessibleInterface *candidate = QAccessible::queryAccessibleInterface(sender);
if (!candidate)
continue;
if (candidate->relationTo(0, this, 0)&Controller)
senders << sender;
delete candidate;
}
if (entry <= senders.size())
targetObject = senders.at(entry-1);
}
break;
case Controlled:
if (entry > 0) {
QObjectList allReceivers;
QACConnectionObject *connectionObject = (QACConnectionObject*)object();
for (int sig = 0; sig < d->primarySignals.count(); ++sig) {
QObjectList receivers = connectionObject->receiverList(d->primarySignals.at(sig).toAscii());
allReceivers += receivers;
}
if (entry <= allReceivers.size())
targetObject = allReceivers.at(entry-1);
}
break;
default:
break;
}
*target = QAccessible::queryAccessibleInterface(targetObject);
return *target ? 0 : -1;
}
/*! \reimp */
int QAccessibleWidget::childCount() const
{
QWidgetList cl = childWidgets(widget());
return cl.size();
}
/*! \reimp */
int QAccessibleWidget::indexOfChild(const QAccessibleInterface *child) const
{
QWidgetList cl = childWidgets(widget());
int index = cl.indexOf(qobject_cast<QWidget *>(child->object()));
if (index != -1)
++index;
return index;
}
// from qwidget.cpp
extern QString qt_setWindowTitle_helperHelper(const QString &, const QWidget*);
/*! \reimp */
QString QAccessibleWidget::text(Text t, int child) const
{
QString str;
switch (t) {
case Name:
if (!d->name.isEmpty()) {
str = d->name;
} else if (!widget()->accessibleName().isEmpty()) {
str = widget()->accessibleName();
} else if (!child && widget()->isWindow()) {
if (widget()->isMinimized())
str = qt_setWindowTitle_helperHelper(widget()->windowIconText(), widget());
else
str = qt_setWindowTitle_helperHelper(widget()->windowTitle(), widget());
} else {
str = qt_accStripAmp(buddyString(widget()));
}
break;
case Description:
if (!d->description.isEmpty())
str = d->description;
else if (!widget()->accessibleDescription().isEmpty())
str = widget()->accessibleDescription();
#ifndef QT_NO_TOOLTIP
else
str = widget()->toolTip();
#endif
break;
case Help:
if (!d->help.isEmpty())
str = d->help;
#ifndef QT_NO_WHATSTHIS
else
str = widget()->whatsThis();
#endif
break;
case Accelerator:
if (!d->accelerator.isEmpty())
str = d->accelerator;
else
str = qt_accHotKey(buddyString(widget()));
break;
case Value:
str = d->value;
break;
default:
break;
}
return str;
}
#ifndef QT_NO_ACTION
/*! \reimp */
int QAccessibleWidget::userActionCount(int child) const
{
if (child)
return 0;
return widget()->actions().count();
}
/*! \reimp */
QString QAccessibleWidget::actionText(int action, Text t, int child) const
{
if (action == DefaultAction)
action = SetFocus;
if (action > 0 && !child) {
QAction *act = widget()->actions().value(action - 1);
if (act) {
switch (t) {
case Name:
return act->text();
case Description:
return act->toolTip();
#ifndef QT_NO_SHORTCUT
case Accelerator:
return act->shortcut().toString();
#endif
default:
break;
}
}
}
return QAccessibleObject::actionText(action, t, child);
}
/*! \reimp */
bool QAccessibleWidget::doAction(int action, int child, const QVariantList &params)
{
if (action == SetFocus || action == DefaultAction) {
if (child || !widget()->isEnabled())
return false;
if ((widget()->focusPolicy() == Qt::NoFocus) && (!widget()->isWindow()))
return false;
if (!widget()->isWindow())
widget()->setFocus();
widget()->activateWindow();
return true;
} else if (action > 0) {
if (QAction *act = widget()->actions().value(action - 1)) {
act->trigger();
return true;
}
}
return QAccessibleObject::doAction(action, child, params);
}
#endif // QT_NO_ACTION
/*! \reimp */
QAccessible::Role QAccessibleWidget::role(int child) const
{
if (!child)
return d->role;
QWidgetList childList = childWidgets(widget());
if (childList.count() > 0 && child <= childList.count()) {
QWidget *targetWidget = childList.at(child - 1);
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(targetWidget);
if (iface) {
QAccessible::Role role = iface->role(0);
delete iface;
return role;
}
}
return NoRole;
}
/*! \reimp */
QAccessible::State QAccessibleWidget::state(int child) const
{
if (child)
return Normal;
QAccessible::State state = Normal;
QWidget *w = widget();
if (w->testAttribute(Qt::WA_WState_Visible) == false)
state |= Invisible;
if (w->focusPolicy() != Qt::NoFocus)
state |= Focusable;
if (w->hasFocus())
state |= Focused;
if (!w->isEnabled())
state |= Unavailable;
if (w->isWindow()) {
if (w->windowFlags() & Qt::WindowSystemMenuHint)
state |= Movable;
if (w->minimumSize() != w->maximumSize())
state |= Sizeable;
}
return state;
}
QVariant QAccessibleWidget::invokeMethod(Method method, int child, const QVariantList & /*params*/)
{
if (child)
return QVariant();
switch (method) {
case ListSupportedMethods: {
QSet<QAccessible::Method> set;
set << ListSupportedMethods << ForegroundColor << BackgroundColor;
return QVariant::fromValue(set);
}
case ForegroundColor:
return widget()->palette().color(widget()->foregroundRole());
case BackgroundColor:
return widget()->palette().color(widget()->backgroundRole());
default:
return QVariant();
}
}
QT_END_NAMESPACE
#endif //QT_NO_ACCESSIBILITY

View file

@ -1,82 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtGui module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QACCESSIBLEWIDGET_H
#define QACCESSIBLEWIDGET_H
#include <QtGui/qaccessibleobject.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
class QAccessibleWidgetPrivate;
class Q_GUI_EXPORT QAccessibleWidget : public QAccessibleObject
{
public:
explicit QAccessibleWidget(QWidget *o, Role r = Client, const QString& name = QString());
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
int childAt(int x, int y) const;
QRect rect(int child) const;
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const;
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
#ifndef QT_NO_ACTION
int userActionCount(int child) const;
QString actionText(int action, Text t, int child) const;
bool doAction(int action, int child, const QVariantList &params);
#endif
QVariant invokeMethod(Method method, int child, const QVariantList &params);
protected:
~QAccessibleWidget();
QWidget *widget() const;
QObject *parentObject() const;
void addControllingSignal(const QString &signal);
void setValue(const QString &value);
void setDescription(const QString &desc);
void setHelp(const QString &help);
void setAccelerator(const QString &accel);
private:
QAccessibleWidgetPrivate *d;
Q_DISABLE_COPY(QAccessibleWidget)
};
typedef QAccessibleWidget QAccessibleWidgetEx;
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // QACCESSIBLEWIDGET_H

View file

@ -31,10 +31,6 @@
#include "qcursor.h"
#include "qdialog_p.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#if defined(Q_WS_X11)
# include "qt_x11_p.h"
#endif
@ -608,19 +604,10 @@ void QDialog::setVisible(bool visible)
QApplication::sendEvent(fw, &e);
}
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::DialogStart);
#endif
} else {
if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden))
return;
#ifndef QT_NO_ACCESSIBILITY
if (isVisible())
QAccessible::updateAccessibility(this, 0, QAccessible::DialogEnd);
#endif
// Reimplemented to exit a modal event loop when the dialog is hidden.
QWidget::setVisible(visible);
if (d->eventLoop)

View file

@ -63,12 +63,6 @@
<property name="toolTip" >
<string>Back</string>
</property>
<property name="accessibleName">
<string>Back</string>
</property>
<property name="accessibleDescription">
<string>Go back</string>
</property>
</widget>
</item>
<item>
@ -76,12 +70,6 @@
<property name="toolTip" >
<string>Forward</string>
</property>
<property name="accessibleName">
<string>Forward</string>
</property>
<property name="accessibleDescription">
<string>Go forward</string>
</property>
</widget>
</item>
<item>
@ -89,12 +77,6 @@
<property name="toolTip" >
<string>Parent Directory</string>
</property>
<property name="accessibleName">
<string>Parent Directory</string>
</property>
<property name="accessibleDescription">
<string>Go to the parent directory</string>
</property>
</widget>
</item>
<item>
@ -102,12 +84,6 @@
<property name="toolTip" >
<string>Create New Folder</string>
</property>
<property name="accessibleName">
<string>Create New Folder</string>
</property>
<property name="accessibleDescription">
<string>Create a New Folder</string>
</property>
</widget>
</item>
<item>
@ -115,12 +91,6 @@
<property name="toolTip" >
<string>List View</string>
</property>
<property name="accessibleName">
<string>List View</string>
</property>
<property name="accessibleDescription">
<string>Change to list view mode</string>
</property>
</widget>
</item>
<item>
@ -128,12 +98,6 @@
<property name="toolTip" >
<string>Detail View</string>
</property>
<property name="accessibleName">
<string>Detail View</string>
</property>
<property name="accessibleDescription">
<string>Change to detail view mode</string>
</property>
</widget>
</item>
</layout>

View file

@ -33,9 +33,6 @@
#include <QtGui/qgridlayout.h>
#include <QtGui/qdesktopwidget.h>
#include <QtGui/qpushbutton.h>
#ifndef QT_NO_ACCESSIBILITY
# include <QtGui/qaccessible.h>
#endif
#include <QtGui/qicon.h>
#include <QtGui/qtextdocument.h>
#include <QtGui/qapplication.h>
@ -1238,9 +1235,6 @@ void QMessageBox::showEvent(QShowEvent *e)
d->detectEscapeButton();
d->updateSize();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::Alert);
#endif
QDialog::showEvent(e);
}

View file

@ -191,9 +191,6 @@
<property name="toolTip" >
<string>top margin</string>
</property>
<property name="accessibleName" >
<string>top margin</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignVCenter</set>
</property>
@ -222,9 +219,6 @@
<property name="toolTip" >
<string>left margin</string>
</property>
<property name="accessibleName" >
<string>left margin</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignVCenter</set>
</property>
@ -254,9 +248,6 @@
<property name="toolTip" >
<string>right margin</string>
</property>
<property name="accessibleName" >
<string>right margin</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignVCenter</set>
</property>
@ -285,9 +276,6 @@
<property name="toolTip" >
<string>bottom margin</string>
</property>
<property name="accessibleName" >
<string>bottom margin</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignVCenter</set>
</property>

View file

@ -716,10 +716,6 @@
#include "qwidget_p.h"
#include "qapplication_p.h"
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
#ifdef Q_WS_X11
# include "qt_x11_p.h"
# include "qpixmap_x11_p.h"

View file

@ -223,9 +223,6 @@
#include <QtGui/qtooltip.h>
#include <QtGui/qtransform.h>
#include <QtGui/qgraphicseffect.h>
#ifndef QT_NO_ACCESSIBILITY
# include <QtGui/qaccessible.h>
#endif
#include "qapplication_p.h"
#include "qobject_p.h"
@ -768,13 +765,6 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item,
if (item)
focusItem = item;
#ifndef QT_NO_ACCESSIBILITY
if (focusItem) {
if (QGraphicsObject *focusObj = focusItem->toGraphicsObject()) {
QAccessible::updateAccessibility(focusObj, 0, QAccessible::Focus);
}
}
#endif
if (item) {
QFocusEvent event(QEvent::FocusIn, focusReason);
sendEvent(item, &event);

View file

@ -38,10 +38,6 @@
#include "qstyleditemdelegate.h"
#include "qabstractitemview_p.h"
#include "qabstractitemmodel_p.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#include "qaccessible2.h"
#endif
QT_BEGIN_NAMESPACE
@ -1018,14 +1014,6 @@ void QAbstractItemView::reset()
setRootIndex(QModelIndex());
if (d->selectionModel)
d->selectionModel->reset();
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(this)->table2Interface()->modelReset();
QAccessible::updateAccessibility(this, 0, QAccessible::TableModelChanged);
}
#endif
#endif
}
/*!
@ -3096,14 +3084,6 @@ void QAbstractItemViewPrivate::_q_rowsRemoved(const QModelIndex &index, int star
if (q->isVisible())
q->updateEditorGeometries();
q->setState(QAbstractItemView::NoState);
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsRemoved(index, start, end);
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
#endif
#endif
}
/*!
@ -3176,14 +3156,6 @@ void QAbstractItemViewPrivate::_q_columnsRemoved(const QModelIndex &index, int s
if (q->isVisible())
q->updateEditorGeometries();
q->setState(QAbstractItemView::NoState);
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->columnsRemoved(index, start, end);
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
#endif
#endif
}
@ -3197,16 +3169,6 @@ void QAbstractItemViewPrivate::_q_rowsInserted(const QModelIndex &index, int sta
Q_UNUSED(index)
Q_UNUSED(start)
Q_UNUSED(end)
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
Q_Q(QAbstractItemView);
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsInserted(index, start, end);
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
#endif
#endif
}
/*!
@ -3223,14 +3185,6 @@ void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &index, int
Q_Q(QAbstractItemView);
if (q->isVisible())
q->updateEditorGeometries();
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->columnsInserted(index, start, end);
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
#endif
#endif
}
/*!
@ -3250,15 +3204,6 @@ void QAbstractItemViewPrivate::_q_modelDestroyed()
void QAbstractItemViewPrivate::_q_layoutChanged()
{
doDelayedItemsLayout();
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
Q_Q(QAbstractItemView);
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->modelReset();
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
#endif
#endif
}
/*!

View file

@ -335,7 +335,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_headerDataChanged())
friend class QTreeViewPrivate; // needed to compile with MSVC
friend class QAccessibleItemRow;
friend class QListModeViewBase;
friend class QListViewPrivate;
};

View file

@ -218,10 +218,6 @@ QSizeF QItemDelegatePrivate::doTextLayout(int lineWidth) const
\table
\header \o Role \o Accepted Types
\omit
\row \o \l Qt::AccessibleDescriptionRole \o QString
\row \o \l Qt::AccessibleTextRole \o QString
\endomit
\row \o \l Qt::BackgroundRole \o QBrush
\row \o \l Qt::CheckStateRole \o Qt::CheckState
\row \o \l Qt::DecorationRole \o QIcon, QPixmap and QColor

View file

@ -33,9 +33,6 @@
#include "qrubberband.h"
#include "qlistview_p.h"
#include "qdebug.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
QT_BEGIN_NAMESPACE
@ -3151,58 +3148,6 @@ void QIconModeViewBase::updateContentsSize()
contentsSize = bounding.size();
}
/*!
\reimp
*/
void QListView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
if (current.isValid()) {
int entry = visualIndex(current) + 1;
#ifdef Q_WS_X11
QAccessible::updateAccessibility(this, entry, QAccessible::Focus);
#else
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Focus);
#endif
}
}
#endif
QAbstractItemView::currentChanged(current, previous);
}
/*!
\reimp
*/
void QListView::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
int entry = visualIndex(sel) + 1;
#ifdef Q_WS_X11
QAccessible::updateAccessibility(this, entry, QAccessible::Selection);
#else
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Selection);
#endif
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
int entry = visualIndex(desel) + 1;
#ifdef Q_WS_X11
QAccessible::updateAccessibility(this, entry, QAccessible::SelectionRemove);
#else
QAccessible::updateAccessibility(viewport(), entry, QAccessible::SelectionRemove);
#endif
}
}
#endif
QAbstractItemView::selectionChanged(selected, deselected);
}
int QListView::visualIndex(const QModelIndex &index) const
{
Q_D(const QListView);

View file

@ -159,11 +159,7 @@ protected:
bool isIndexHidden(const QModelIndex &index) const;
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
void currentChanged(const QModelIndex &current, const QModelIndex &previous);
private:
friend class QAccessibleItemView;
int visualIndex(const QModelIndex &index) const;
Q_DECLARE_PRIVATE(QListView)

View file

@ -1058,51 +1058,6 @@ Qt::ItemFlags QStandardItem::flags() const
\sa checkState(), setCheckable()
*/
/*!
\fn QString QStandardItem::accessibleText() const
Returns the item's accessible text.
The accessible text is used by assistive technologies (i.e. for users who
cannot use conventional means of interaction).
\sa setAccessibleText(), accessibleDescription()
*/
/*!
\fn void QStandardItem::setAccessibleText(const QString &accessibleText)
Sets the item's accessible text to the string specified by \a accessibleText.
The accessible text is used by assistive technologies (i.e. for users who
cannot use conventional means of interaction).
\sa accessibleText(), setAccessibleDescription()
*/
/*!
\fn QString QStandardItem::accessibleDescription() const
Returns the item's accessible description.
The accessible description is used by assistive technologies (i.e. for
users who cannot use conventional means of interaction).
\sa setAccessibleDescription(), accessibleText()
*/
/*!
\fn void QStandardItem::setAccessibleDescription(const QString &accessibleDescription)
Sets the item's accessible description to the string specified by \a
accessibleDescription.
The accessible description is used by assistive technologies (i.e. for
users who cannot use conventional means of interaction).
\sa accessibleDescription(), setAccessibleText()
*/
/*!
Sets whether the item is enabled. If \a enabled is true, the item is enabled,
meaning that the user can interact with the item; if \a enabled is false, the

View file

@ -114,16 +114,6 @@ public:
}
inline void setCheckState(Qt::CheckState checkState);
inline QString accessibleText() const {
return qvariant_cast<QString>(data(Qt::AccessibleTextRole));
}
inline void setAccessibleText(const QString &accessibleText);
inline QString accessibleDescription() const {
return qvariant_cast<QString>(data(Qt::AccessibleDescriptionRole));
}
inline void setAccessibleDescription(const QString &accessibleDescription);
Qt::ItemFlags flags() const;
void setFlags(Qt::ItemFlags flags);
@ -267,12 +257,6 @@ inline void QStandardItem::setForeground(const QBrush &abrush)
inline void QStandardItem::setCheckState(Qt::CheckState acheckState)
{ setData(acheckState, Qt::CheckStateRole); }
inline void QStandardItem::setAccessibleText(const QString &aaccessibleText)
{ setData(aaccessibleText, Qt::AccessibleTextRole); }
inline void QStandardItem::setAccessibleDescription(const QString &aaccessibleDescription)
{ setData(aaccessibleDescription, Qt::AccessibleDescriptionRole); }
inline void QStandardItem::setChild(int arow, QStandardItem *aitem)
{ setChild(arow, 0, aitem); }

View file

@ -113,10 +113,6 @@ public:
\table
\header \o Role \o Accepted Types
\omit
\row \o \l Qt::AccessibleDescriptionRole \o QString
\row \o \l Qt::AccessibleTextRole \o QString
\endomit
\row \o \l Qt::BackgroundRole \o QBrush
\row \o \l Qt::CheckStateRole \o Qt::CheckState
\row \o \l Qt::DecorationRole \o QIcon, QPixmap, QImage and QColor

View file

@ -33,9 +33,6 @@
#include "qscrollbar.h"
#include "qabstractbutton.h"
#include "qtableview_p.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
QT_BEGIN_NAMESPACE
@ -3075,70 +3072,6 @@ void QTableViewPrivate::selectColumn(int column, bool anchor)
}
}
/*!
\reimp
*/
void QTableView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
if (current.isValid()) {
#ifdef Q_WS_X11
Q_D(QTableView);
int entry = d->accessibleTable2Index(current);
QAccessible::updateAccessibility(this, entry, QAccessible::Focus);
#else
int entry = visualIndex(current) + 1;
if (horizontalHeader())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Focus);
#endif
}
}
#endif
QAbstractItemView::currentChanged(current, previous);
}
/*!
\reimp
*/
void QTableView::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
#ifndef QT_NO_ACCESSIBILITY
Q_D(QTableView);
Q_UNUSED(d)
if (QAccessible::isActive()) {
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
#ifdef Q_WS_X11
int entry = d->accessibleTable2Index(sel);
QAccessible::updateAccessibility(this, entry, QAccessible::Selection);
#else
int entry = visualIndex(sel);
if (horizontalHeader())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Selection);
#endif
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
#ifdef Q_WS_X11
int entry = d->accessibleTable2Index(desel);
QAccessible::updateAccessibility(this, entry, QAccessible::SelectionRemove);
#else
int entry = visualIndex(sel);
if (horizontalHeader())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::SelectionRemove);
#endif
}
}
#endif
QAbstractItemView::selectionChanged(selected, deselected);
}
int QTableView::visualIndex(const QModelIndex &index) const
{
return index.row();

View file

@ -145,13 +145,7 @@ protected:
bool isIndexHidden(const QModelIndex &index) const;
void selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected);
void currentChanged(const QModelIndex &current,
const QModelIndex &previous);
private:
friend class QAccessibleItemView;
int visualIndex(const QModelIndex &index) const;
Q_DECLARE_PRIVATE(QTableView)

View file

@ -32,11 +32,6 @@
#include "qevent.h"
#include "qpen.h"
#include "qdebug.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#include "qaccessible2.h"
#endif
#include "qtreeview_p.h"
QT_BEGIN_NAMESPACE
@ -2835,14 +2830,6 @@ void QTreeViewPrivate::insertViewItems(int pos, int count, const QTreeViewItem &
for (int i = pos + count; i < viewItems.count(); i++)
if (items[i].parentItem >= pos)
items[i].parentItem += count;
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
Q_Q(QTreeView);
if (QAccessible::isActive()) {
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
#endif
#endif
}
void QTreeViewPrivate::removeViewItems(int pos, int count)
@ -2852,14 +2839,6 @@ void QTreeViewPrivate::removeViewItems(int pos, int count)
for (int i = pos; i < viewItems.count(); i++)
if (items[i].parentItem >= pos)
items[i].parentItem -= count;
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_WS_X11
Q_Q(QTreeView);
if (QAccessible::isActive()) {
QAccessible::updateAccessibility(q, 0, QAccessible::TableModelChanged);
}
#endif
#endif
}
#if 0
@ -3668,59 +3647,6 @@ void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &pr
viewport()->update(currentRect);
}
}
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive() && current.isValid()) {
#ifdef Q_WS_X11
int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column() + 1;
QAccessible::updateAccessibility(this, entry, QAccessible::Focus);
#else
int entry = visualIndex(current) + 1;
if (header())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Focus);
#endif
}
#endif
}
/*!
\reimp
*/
void QTreeView::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
QAbstractItemView::selectionChanged(selected, deselected);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
#ifdef Q_WS_X11
int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column() + 1;
Q_ASSERT(entry > 0);
QAccessible::updateAccessibility(this, entry, QAccessible::Selection);
#else
int entry = visualIndex(sel) + 1;
if (header())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::Selection);
#endif
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
#ifdef Q_WS_X11
int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column() + 1;
Q_ASSERT(entry > 0);
QAccessible::updateAccessibility(this, entry, QAccessible::SelectionRemove);
#else
int entry = visualIndex(desel) + 1;
if (header())
++entry;
QAccessible::updateAccessibility(viewport(), entry, QAccessible::SelectionRemove);
#endif
}
}
#endif
}
int QTreeView::visualIndex(const QModelIndex &index) const

View file

@ -189,15 +189,9 @@ protected:
int rowHeight(const QModelIndex &index) const;
bool isIndexHidden(const QModelIndex &index) const;
void selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected);
void currentChanged(const QModelIndex &current, const QModelIndex &previous);
private:
friend class QAccessibleItemView;
friend class QAccessibleTable2;
friend class QAccessibleTree;
friend class QAccessibleTable2Cell;
int visualIndex(const QModelIndex &index) const;
Q_DECLARE_PRIVATE(QTreeView)

View file

@ -21,7 +21,6 @@
#include "qplatformdefs.h"
#include "qabstracteventdispatcher.h"
#include "qaccessible.h"
#include "qapplication.h"
#include "qclipboard.h"
#include "qcursor.h"
@ -2930,9 +2929,6 @@ void QApplication::changeOverrideCursor(const QCursor &cursor)
*/
int QApplication::exec()
{
#ifndef QT_NO_ACCESSIBILITY
QAccessible::setRootObject(qApp);
#endif
return QCoreApplication::exec();
}

View file

@ -36,9 +36,7 @@
#include "../text/qtextdocumentlayout_p.h"
#include "qtoolbutton.h"
#include "qdebug.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#if defined(Q_WS_X11)
#include "qx11info_x11.h"
#include "qwidget.h"
@ -374,9 +372,6 @@ QWhatsThisPrivate::QWhatsThisPrivate()
QApplication::setOverrideCursor(Qt::WhatsThisCursor);
#endif
}
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::ContextHelpStart);
#endif
}
QWhatsThisPrivate::~QWhatsThisPrivate()
@ -385,9 +380,6 @@ QWhatsThisPrivate::~QWhatsThisPrivate()
action->setChecked(false);
#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
#endif
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::ContextHelpEnd);
#endif
instance = 0;
}

View file

@ -58,10 +58,6 @@
#include "qabstractscrollarea_p.h"
#include "qevent_p.h"
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
#if defined(Q_WS_X11)
# include "qpaintengine_x11_p.h"
# include "qx11info_x11.h"
@ -1165,10 +1161,6 @@ QWidget::~QWidget()
if (!d->children.isEmpty())
d->deleteChildren();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::ObjectDestroyed);
#endif
QApplication::removePostedEvents(this);
destroy(); // platform-dependent cleanup
@ -5359,11 +5351,6 @@ void QWidget::setFocus(Qt::FocusReason reason)
if (f->isActiveWindow()) {
QApplicationPrivate::setFocusWidget(f, reason);
#ifndef QT_NO_ACCESSIBILITY
// menus update the focus manually and this would create bogus events
if (!(f->inherits("QMenuBar") || f->inherits("QMenu")))
QAccessible::updateAccessibility(f, 0, QAccessible::Focus);
#endif
#ifndef QT_NO_GRAPHICSVIEW
if (QWExtra *topData = window()->d_func()->extra) {
if (topData->proxyWidget) {
@ -5429,9 +5416,6 @@ void QWidget::clearFocus()
if (hasFocus()) {
// Update proxy state
QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason);
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::Focus);
#endif
}
}
@ -6367,11 +6351,6 @@ void QWidgetPrivate::show_helper()
if (!isEmbedded && q->windowType() == Qt::Popup)
qApp->d_func()->openPopup(q);
#ifndef QT_NO_ACCESSIBILITY
if (q->windowType() != Qt::ToolTip) // Tooltips are read aloud twice in MS narrator.
QAccessible::updateAccessibility(q, 0, QAccessible::ObjectShow);
#endif
if (QApplicationPrivate::hidden_focus_widget == q) {
QApplicationPrivate::hidden_focus_widget = 0;
q->setFocus(Qt::OtherFocusReason);
@ -6454,11 +6433,6 @@ void QWidgetPrivate::hide_helper()
if (QWidgetBackingStore *bs = maybeBackingStore())
bs->removeDirtyWidget(q);
#ifndef QT_NO_ACCESSIBILITY
if (wasVisible)
QAccessible::updateAccessibility(q, 0, QAccessible::ObjectHide);
#endif
}
/*!
@ -6665,10 +6639,6 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
}
#if defined(Q_WS_X11)
qApp->d_func()->sendSyntheticEnterLeave(widget);
#endif
#ifndef QT_NO_ACCESSIBILITY
if (!spontaneous)
QAccessible::updateAccessibility(widget, 0, QAccessible::ObjectHide);
#endif
}
}
@ -7350,29 +7320,6 @@ bool QWidget::event(QEvent *event)
event->ignore();
break;
#endif
#ifndef QT_NO_ACCESSIBILITY
case QEvent::AccessibilityDescription:
case QEvent::AccessibilityHelp: {
QAccessibleEvent *ev = static_cast<QAccessibleEvent *>(event);
if (ev->child())
return false;
switch (ev->type()) {
#ifndef QT_NO_TOOLTIP
case QEvent::AccessibilityDescription:
ev->setValue(d->toolTip);
break;
#endif
#ifndef QT_NO_WHATSTHIS
case QEvent::AccessibilityHelp:
ev->setValue(d->whatsThis);
break;
#endif
default:
return false;
}
break;
}
#endif
#ifndef QT_NO_ACTION
case QEvent::ActionAdded:
case QEvent::ActionRemoved:
@ -7435,12 +7382,10 @@ bool QWidget::event(QEvent *event)
void QWidget::changeEvent(QEvent * event)
{
switch(event->type()) {
case QEvent::EnabledChange:
case QEvent::EnabledChange: {
update();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::StateChanged);
#endif
break;
}
case QEvent::FontChange:
case QEvent::StyleChange: {
@ -7452,9 +7397,10 @@ void QWidget::changeEvent(QEvent * event)
break;
}
case QEvent::PaletteChange:
case QEvent::PaletteChange: {
update();
break;
}
default:
break;
@ -9228,55 +9174,6 @@ QString QWidget::whatsThis() const
}
#endif // QT_NO_WHATSTHIS
#ifndef QT_NO_ACCESSIBILITY
/*!
\property QWidget::accessibleName
\brief the widget's name as seen by assistive technologies
This property is used by accessible clients to identify, find, or announce
the widget for accessible clients.
By default, this property contains an empty string.
\sa QAccessibleInterface::text()
*/
void QWidget::setAccessibleName(const QString &name)
{
Q_D(QWidget);
d->accessibleName = name;
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
}
QString QWidget::accessibleName() const
{
Q_D(const QWidget);
return d->accessibleName;
}
/*!
\property QWidget::accessibleDescription
\brief the widget's description as seen by assistive technologies
By default, this property contains an empty string.
\sa QAccessibleInterface::text()
*/
void QWidget::setAccessibleDescription(const QString &description)
{
Q_D(QWidget);
d->accessibleDescription = description;
QAccessible::updateAccessibility(this, 0, QAccessible::DescriptionChanged);
}
QString QWidget::accessibleDescription() const
{
Q_D(const QWidget);
return d->accessibleDescription;
}
#endif // QT_NO_ACCESSIBILITY
#ifndef QT_NO_SHORTCUT
/*!
Adds a shortcut to Qt's shortcut system that watches for the given

View file

@ -149,10 +149,6 @@ class Q_GUI_EXPORT QWidget : public QObject, public QPaintDevice
#endif
#ifndef QT_NO_WHATSTHIS
Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis)
#endif
#ifndef QT_NO_ACCESSIBILITY
Q_PROPERTY(QString accessibleName READ accessibleName WRITE setAccessibleName)
Q_PROPERTY(QString accessibleDescription READ accessibleDescription WRITE setAccessibleDescription)
#endif
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection RESET unsetLayoutDirection)
Q_PROPERTY(Qt::WindowFlags windowFlags READ windowFlags WRITE setWindowFlags)
@ -331,12 +327,6 @@ public:
void setWhatsThis(const QString &);
QString whatsThis() const;
#endif
#ifndef QT_NO_ACCESSIBILITY
QString accessibleName() const;
void setAccessibleName(const QString &name);
QString accessibleDescription() const;
void setAccessibleDescription(const QString &description);
#endif
void setLayoutDirection(Qt::LayoutDirection direction);
Qt::LayoutDirection layoutDirection() const;

View file

@ -538,10 +538,6 @@ public:
#ifndef QT_NO_WHATSTHIS
QString whatsThis;
#endif
#ifndef QT_NO_ACCESSIBILITY
QString accessibleName;
QString accessibleDescription;
#endif
// Other variables.
uint inheritedFontResolveMask;

View file

@ -57,7 +57,6 @@
#include "qtooltip.h"
#include "qstyleoption.h"
#include "qlineedit.h"
#include "qaccessible.h"
#ifndef QT_NO_SHORTCUT
#include "qapplication_p.h"
@ -541,10 +540,6 @@ void QTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /*=fal
Q_Q(QTextControl);
if (forceEmitSelectionChanged) {
emit q->selectionChanged();
#ifndef QT_NO_ACCESSIBILITY
if (q->parent())
QAccessible::updateAccessibility(q->parent(), 0, QAccessible::TextSelectionChanged);
#endif
}
bool current = cursor.hasSelection();
@ -555,10 +550,6 @@ void QTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /*=fal
emit q->copyAvailable(current);
if (!forceEmitSelectionChanged) {
emit q->selectionChanged();
#ifndef QT_NO_ACCESSIBILITY
if (q->parent())
QAccessible::updateAccessibility(q->parent(), 0, QAccessible::TextSelectionChanged);
#endif
}
}

View file

@ -28,9 +28,6 @@
#include "qapplication.h"
#include "qstyle.h"
#include "qaction.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
QT_BEGIN_NAMESPACE
@ -470,9 +467,6 @@ void QAbstractButtonPrivate::refresh()
if (blockRefresh)
return;
q->update();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(q, 0, QAccessible::StateChanged);
#endif
}
void QAbstractButtonPrivate::click()
@ -612,9 +606,6 @@ void QAbstractButton::setText(const QString &text)
d->sizeHint = QSize();
update();
updateGeometry();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
#endif
}
QString QAbstractButton::text() const

View file

@ -24,9 +24,7 @@
#include "qevent.h"
#include "qabstractslider_p.h"
#include "qdebug.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include <limits.h>
QT_BEGIN_NAMESPACE
@ -509,9 +507,6 @@ void QAbstractSlider::setValue(int value)
if (d->pressed)
emit sliderMoved((d->position = value));
}
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::ValueChanged);
#endif
sliderChange(SliderValueChange);
emit valueChanged(value);
}

View file

@ -36,13 +36,8 @@
#include "qpalette.h"
#include "qstylepainter.h"
#include "qdebug.h"
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
#if defined(Q_WS_X11)
#include <limits.h>
#endif
//#define QABSTRACTSPINBOX_QSBDEBUG
@ -916,9 +911,6 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
d->updateState(up, true);
}
}
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::ValueChanged);
#endif
return;
}
case Qt::Key_Enter:
@ -1503,9 +1495,6 @@ void QAbstractSpinBoxPrivate::updateState(bool up, bool fromKeyboard /* = false
spinClickThresholdTimerId = q->startTimer(spinClickThresholdTimerInterval);
buttonState = (up ? Up : Down) | (fromKeyboard ? Keyboard : Mouse);
q->stepBy(up ? 1 : -1);
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(q, 0, QAccessible::ValueChanged);
#endif
}
}

View file

@ -47,10 +47,6 @@
# include "qeffects_p.h"
#endif
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
QT_BEGIN_NAMESPACE
QComboBoxPrivate::QComboBoxPrivate()
@ -897,9 +893,6 @@ void QComboBoxPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIn
}
q->update();
}
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(q, 0, QAccessible::NameChanged);
#endif
}
void QComboBoxPrivate::_q_rowsInserted(const QModelIndex &parent, int start, int end)
@ -1151,9 +1144,6 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
Q_Q(QComboBox);
emit q->currentIndexChanged(index.row());
emit q->currentIndexChanged(itemText(index));
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(q, 0, QAccessible::NameChanged);
#endif
}
QString QComboBoxPrivate::itemText(const QModelIndex &index) const
@ -2429,9 +2419,6 @@ void QComboBox::clear()
{
Q_D(QComboBox);
d->model->removeRows(0, d->model->rowCount(d->root), d->root);
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
#endif
}
/*!
@ -2448,9 +2435,6 @@ void QComboBox::clearEditText()
Q_D(QComboBox);
if (d->lineEdit)
d->lineEdit->clear();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
#endif
}
/*!
@ -2461,9 +2445,6 @@ void QComboBox::setEditText(const QString &text)
Q_D(QComboBox);
if (d->lineEdit)
d->lineEdit->setText(text);
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
#endif
}
/*!

View file

@ -221,16 +221,18 @@ private:
QComboBox *mCombo;
};
static const int comboseparatorrole = (Qt::UserRole - 1);
class QComboBoxDelegate : public QStyledItemDelegate
{ Q_OBJECT
public:
QComboBoxDelegate(QObject *parent, QComboBox *cmb) : QStyledItemDelegate(parent), mCombo(cmb) {}
static bool isSeparator(const QModelIndex &index) {
return index.data(Qt::AccessibleDescriptionRole).toString() == QLatin1String("separator");
return index.data(comboseparatorrole).toInt() == 1;
}
static void setSeparator(QAbstractItemModel *model, const QModelIndex &index) {
model->setData(index, QString::fromLatin1("separator"), Qt::AccessibleDescriptionRole);
model->setData(index, 1, comboseparatorrole);
if (QStandardItemModel *m = qobject_cast<QStandardItemModel*>(model))
if (QStandardItem *item = m->itemFromIndex(index))
item->setFlags(item->flags() & ~(Qt::ItemIsSelectable|Qt::ItemIsEnabled));

View file

@ -37,10 +37,6 @@
#include "qabstractslider_p.h"
#include "qmath.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
QT_BEGIN_NAMESPACE
class QDialPrivate : public QAbstractSliderPrivate

View file

@ -29,11 +29,7 @@
#include "qstyle.h"
#include "qstyleoption.h"
#include "qstylepainter.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include "qwidget_p.h"
#include "qdebug.h"
QT_BEGIN_NAMESPACE
@ -226,9 +222,6 @@ void QGroupBox::setTitle(const QString &title)
update();
updateGeometry();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
#endif
}
/*!
@ -613,9 +606,6 @@ void QGroupBox::setChecked(bool b)
update();
d->checked = b;
d->_q_setChildrenEnabled(b);
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::StateChanged);
#endif
emit toggled(b);
}
}

View file

@ -34,11 +34,6 @@
#include "qstylesheetstyle_p.h"
#include "qmath.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
QT_BEGIN_NAMESPACE
/*!
@ -275,11 +270,6 @@ void QLabel::setText(const QString &text)
#endif
d->updateLabel();
#ifndef QT_NO_ACCESSIBILITY
if (accessibleName().isEmpty())
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
#endif
}
QString QLabel::text() const

View file

@ -25,9 +25,6 @@
#include "qabstractitemview.h"
#include "qclipboard.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include "qapplication.h"
#ifndef QT_NO_GRAPHICSVIEW
#include "qgraphicssceneevent.h"
@ -562,14 +559,7 @@ void QLineControl::internalSetText(const QString &txt, int pos, bool edited)
m_modifiedState = m_undoState = 0;
m_cursor = (pos < 0 || pos > m_text.length()) ? m_text.length() : pos;
m_textDirty = (oldText != m_text);
bool changed = finishChange(-1, true, edited);
#ifndef QT_NO_ACCESSIBILITY
if (changed)
QAccessible::updateAccessibility(parent(), 0, QAccessible::TextUpdated);
#else
Q_UNUSED(changed);
#endif
finishChange(-1, true, edited);
}
@ -1173,9 +1163,6 @@ void QLineControl::emitCursorPositionChanged()
const int oldLast = m_lastCursorPos;
m_lastCursorPos = m_cursor;
cursorPositionChanged(oldLast, m_cursor);
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(parent(), 0, QAccessible::TextCaretMoved);
#endif
}
}

View file

@ -44,8 +44,6 @@
#include "QtGui/qclipboard.h"
#include "QtCore/qpoint.h"
#include "QtGui/qcompleter.h"
#include "qaccessible.h"
#include "qplatformdefs.h"

View file

@ -44,9 +44,6 @@
#include "qdebug.h"
#include "qtextedit.h"
#include "qtextedit_p.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include "qabstractitemview.h"
#include "qstylesheetstyle_p.h"

View file

@ -198,7 +198,6 @@ public:
private:
friend class QAbstractSpinBox;
friend class QAccessibleLineEdit;
Q_DISABLE_COPY(QLineEdit)
Q_DECLARE_PRIVATE(QLineEdit)
Q_PRIVATE_SLOT(d_func(), void _q_handleWindowActivate())

View file

@ -26,9 +26,6 @@
#include "qabstractitemview.h"
#include "qclipboard.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
QT_BEGIN_NAMESPACE
@ -108,9 +105,6 @@ void QLineEditPrivate::_q_selectionChanged()
setCursorVisible(showCursor);
emit q->selectionChanged();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(q, 0, QAccessible::TextSelectionChanged);
#endif
}
void QLineEditPrivate::_q_updateNeeded(const QRect &rect)

View file

@ -39,10 +39,6 @@
#include "qpushbutton_p.h"
#include "qaction_p.h"
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
#ifndef QT_NO_EFFECTS
# include "qeffects_p.h"
#endif
@ -1017,13 +1013,6 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
if (action_e == QAction::Hover) {
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
int actionIndex = indexOf(action) + 1;
QAccessible::updateAccessibility(q, actionIndex, QAccessible::Focus);
QAccessible::updateAccessibility(q, actionIndex, QAccessible::Selection);
}
#endif
action->showStatusText(topCausedWidget());
} else {
actionAboutToTrigger = 0;
@ -1886,10 +1875,6 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
{
show();
}
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::PopupMenuStart);
#endif
}
/*!
@ -2008,9 +1993,6 @@ void QMenu::hideEvent(QHideEvent *)
if (d->eventLoop)
d->eventLoop->exit();
d->setCurrentAction(0);
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::PopupMenuEnd);
#endif
#ifndef QT_NO_MENUBAR
if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->causedPopup.widget))
mb->d_func()->setCurrentAction(0);

View file

@ -25,9 +25,6 @@
#include "qlayout.h"
#include "qapplication.h"
#include "qdesktopwidget.h"
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
#include "qpainter.h"
#include "qstylepainter.h"
#include "qevent.h"
@ -495,14 +492,6 @@ void QMenuBarPrivate::_q_actionHovered()
Q_Q(QMenuBar);
if (QAction *action = qobject_cast<QAction *>(q->sender())) {
emit q->hovered(action);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
int actionIndex = actions.indexOf(action);
++actionIndex;
QAccessible::updateAccessibility(q, actionIndex, QAccessible::Focus);
QAccessible::updateAccessibility(q, actionIndex, QAccessible::Selection);
}
#endif //QT_NO_ACCESSIBILITY
}
}

View file

@ -36,7 +36,6 @@
#include "qtextdocument_p.h"
#include "qtextlist.h"
#include "qtextcontrol_p.h"
#include "qaccessible.h"
#include "qtextformat.h"
#include "qdatetime.h"
#include "qapplication.h"
@ -410,10 +409,6 @@ QPlainTextEditControl::QPlainTextEditControl(QPlainTextEdit *parent)
void QPlainTextEditPrivate::_q_cursorPositionChanged()
{
pageUpDownLastCursorYIsValid = false;
#ifndef QT_NO_ACCESSIBILITY
Q_Q(QPlainTextEdit);
QAccessible::updateAccessibility(q, 0, QAccessible::TextCaretMoved);
#endif
}
void QPlainTextEditPrivate::_q_verticalScrollbarActionTriggered(int action) {

View file

@ -26,9 +26,6 @@
#include "qstylepainter.h"
#include "qstyleoption.h"
#include "qwidget_p.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include <limits.h>
@ -291,10 +288,6 @@ void QProgressBar::setValue(int value)
return;
d->value = value;
emit valueChanged(value);
#ifndef QT_NO_ACCESSIBILITY
if (isVisible())
QAccessible::updateAccessibility(this, 0, QAccessible::ValueChanged);
#endif
if (d->repaintRequired())
repaint();
}

View file

@ -37,11 +37,6 @@
#include "qdebug.h"
#include "qlayoutitem.h"
#include "qdialogbuttonbox.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include "qmenu_p.h"
#include "qpushbutton_p.h"
@ -350,9 +345,6 @@ void QPushButton::setDefault(bool enable)
dlg->d_func()->setMainDefault(this);
}
update();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::updateAccessibility(this, 0, QAccessible::StateChanged);
#endif
}
bool QPushButton::isDefault() const

View file

@ -31,12 +31,10 @@
#ifndef QT_NO_SCROLLBAR
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include <limits.h>
#include "qabstractslider_p.h"
#include <limits.h>
QT_BEGIN_NAMESPACE
/*!

View file

@ -21,9 +21,6 @@
#include "qslider.h"
#ifndef QT_NO_SLIDER
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include "qapplication.h"
#include "qevent.h"
#include "qpainter.h"

View file

@ -32,11 +32,6 @@
#include "qstyleoption.h"
#include "qsizegrip.h"
#include "qmainwindow.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#include "qlayoutengine_p.h"
#include "qwidget_p.h"
@ -622,11 +617,6 @@ void QStatusBar::hideOrShow()
emit messageChanged(d->tempItem);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive())
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
#endif
repaint(d->messageRect());
}

View file

@ -36,10 +36,6 @@
#include "qtabbar_p.h"
#include "qguicommon_p.h"
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
#ifndef QT_NO_TABBAR
QT_BEGIN_NAMESPACE
@ -1100,14 +1096,6 @@ void QTabBar::setCurrentIndex(int index)
if (oldIndex >= 0 && oldIndex < count())
d->layoutTab(oldIndex);
d->layoutTab(index);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
QAccessible::updateAccessibility(this, oldIndex + 1, QAccessible::Selection);
QAccessible::updateAccessibility(this, index + 1, QAccessible::Focus);
QAccessible::updateAccessibility(this, index + 1, QAccessible::Selection);
}
#endif
emit currentChanged(index);
}
}

View file

@ -183,8 +183,6 @@ protected:
void changeEvent(QEvent *);
void initStyleOption(QStyleOptionTab *option, int tabIndex) const;
friend class QAccessibleTabBar;
private:
Q_DISABLE_COPY(QTabBar)
Q_DECLARE_PRIVATE(QTabBar)

View file

@ -13,13 +13,6 @@ include_directories(
# place the plugins in a sub-directory the leading of which can be used as plugin path,
# this makes testing without installation possible and is relied upon in the exec script
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/accessible")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/accessible")
if(WITH_ACCESSIBILITY)
add_subdirectory(accessible/widgets)
endif()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/iconengines")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins/iconengines")
add_subdirectory(iconengines/svgiconengine)

View file

@ -1,32 +0,0 @@
set(ACCESSIBLEWIDGETSPLUGIN_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/qaccessiblewidgets.h
${CMAKE_CURRENT_SOURCE_DIR}/simplewidgets.h
${CMAKE_CURRENT_SOURCE_DIR}/rangecontrols.h
${CMAKE_CURRENT_SOURCE_DIR}/complexwidgets.h
${CMAKE_CURRENT_SOURCE_DIR}/qaccessiblemenu.h
${CMAKE_CURRENT_SOURCE_DIR}/itemviews.h
)
set(ACCESSIBLEWIDGETSPLUGIN_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/simplewidgets.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rangecontrols.cpp
${CMAKE_CURRENT_SOURCE_DIR}/complexwidgets.cpp
${CMAKE_CURRENT_SOURCE_DIR}/qaccessiblewidgets.cpp
${CMAKE_CURRENT_SOURCE_DIR}/qaccessiblemenu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/itemviews.cpp
)
katie_setup_target(qtaccessiblewidgetsplugin ${ACCESSIBLEWIDGETSPLUGIN_SOURCES} ${ACCESSIBLEWIDGETSPLUGIN_HEADERS})
add_library(qtaccessiblewidgetsplugin MODULE ${qtaccessiblewidgetsplugin_SOURCES})
target_link_libraries(qtaccessiblewidgetsplugin KtCore KtGui)
set_target_properties(qtaccessiblewidgetsplugin PROPERTIES OUTPUT_NAME qtaccessiblewidgets)
katie_setup_plugin(qtaccessiblewidgetsplugin)
install(
TARGETS qtaccessiblewidgetsplugin
DESTINATION ${KATIE_PLUGINS_PATH}/accessible
COMPONENT Runtime
)

File diff suppressed because it is too large Load diff

View file

@ -1,277 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef COMPLEXWIDGETS_H
#define COMPLEXWIDGETS_H
#include <QtCore/qpointer.h>
#include <QtGui/qaccessiblewidget.h>
#include <QtGui/qabstractitemview.h>
#include <QtGui/qaccessible2.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
class QAbstractButton;
class QHeaderView;
class QTabBar;
class QComboBox;
class QTitleBar;
class QAbstractScrollArea;
class QScrollArea;
#ifndef QT_NO_SCROLLAREA
class QAccessibleAbstractScrollArea : public QAccessibleWidget
{
public:
explicit QAccessibleAbstractScrollArea(QWidget *widget);
enum AbstractScrollAreaElement {
Self = 0,
Viewport,
HorizontalContainer,
VerticalContainer,
CornerWidget,
Undefined
};
QString text(Text textType, int child) const;
void setText(Text textType, int child, const QString &text);
State state(int child) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
bool isValid() const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
QRect rect(int child) const;
int childAt(int x, int y) const;
//protected:
QAbstractScrollArea *abstractScrollArea() const;
private:
QWidgetList accessibleChildren() const;
AbstractScrollAreaElement elementType(QWidget *widget) const;
bool isLeftToRight() const;
};
class QAccessibleScrollArea : public QAccessibleAbstractScrollArea
{
public:
explicit QAccessibleScrollArea(QWidget *widget);
};
#endif // QT_NO_SCROLLAREA
#ifndef QT_NO_ITEMVIEWS
class QAccessibleHeader : public QAccessibleWidget
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleHeader(QWidget *w);
int childCount() const;
QRect rect(int child) const;
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
protected:
QHeaderView *header() const;
};
class QAccessibleItemRow: public QAccessibleInterface
{
friend class QAccessibleItemView;
public:
QAccessibleItemRow(QAbstractItemView *view, const QModelIndex &index = QModelIndex(), bool isHeader = false);
QRect rect(int child) const;
QString text(Text t, int child) const;
void setText(Text t, int child, const QString &text);
bool isValid() const;
QObject *object() const;
Role role(int child) const;
State state(int child) const;
int childCount() const;
int indexOfChild(const QAccessibleInterface *) const;
QList<QModelIndex> children() const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
int childAt(int x, int y) const;
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
int userActionCount(int child) const;
QString actionText(int action, Text t, int child) const;
bool doAction(int action, int child, const QVariantList &params = QVariantList());
QModelIndex childIndex(int child) const;
QHeaderView *horizontalHeader() const; //used by QAccessibleItemView
private:
static QAbstractItemView::CursorAction toCursorAction(Relation rel);
int logicalFromChild(QHeaderView *header, int child) const;
int treeLevel() const;
QHeaderView *verticalHeader() const;
QString text_helper(int child) const;
QPersistentModelIndex row;
QPointer<QAbstractItemView> view;
bool m_header;
};
class QAccessibleItemView: public QAccessibleAbstractScrollArea, public QAccessibleTableInterface
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleItemView(QWidget *w);
QObject *object() const;
Role role(int child) const;
State state(int child) const;
QRect rect(int child) const;
int childAt(int x, int y) const;
int childCount() const;
QString text(Text t, int child) const;
void setText(Text t, int child, const QString &text);
int indexOfChild(const QAccessibleInterface *iface) const;
QModelIndex childIndex(int child) const;
int entryFromIndex(const QModelIndex &index) const;
bool isValid() const;
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
QAccessibleInterface *accessibleAt(int row, int column);
QAccessibleInterface *caption();
int childIndex(int rowIndex, int columnIndex);
QString columnDescription(int column);
int columnSpan(int row, int column);
QAccessibleInterface *columnHeader();
int columnIndex(int childIndex);
int columnCount();
int rowCount();
int selectedColumnCount();
int selectedRowCount();
QString rowDescription(int row);
int rowSpan(int row, int column);
QAccessibleInterface *rowHeader();
int rowIndex(int childIndex);
int selectedRows(int maxRows, QList<int> *rows);
int selectedColumns(int maxColumns, QList<int> *columns);
QAccessibleInterface *summary();
bool isColumnSelected(int column);
bool isRowSelected(int row);
bool isSelected(int row, int column);
void selectRow(int row);
void selectColumn(int column);
void unselectRow(int row);
void unselectColumn(int column);
void cellAtIndex(int index, int *row, int *column, int *rowSpan,
int *columnSpan, bool *isSelected);
QHeaderView *horizontalHeader() const;
QHeaderView *verticalHeader() const;
bool isValidChildRole(QAccessible::Role role) const;
protected:
QAbstractItemView *itemView() const;
QModelIndex index(int row, int column) const;
private:
inline bool atViewport() const {
return atVP;
};
QAccessible::Role expectedRoleOfChildren() const;
bool atVP;
};
#endif
#ifndef QT_NO_TABBAR
class QAccessibleTabBar : public QAccessibleWidget
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleTabBar(QWidget *w);
int childCount() const;
QRect rect(int child) const;
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
int navigate(RelationFlag relation, int entry,
QAccessibleInterface **target) const;
bool doAction(int action, int child, const QVariantList &params);
QString actionText(int action, Text t, int child) const;
int userActionCount(int child) const;
bool setSelected(int child, bool on, bool extend);
QVector<int> selection() const;
protected:
QTabBar *tabBar() const;
private:
QAbstractButton *button(int child) const;
};
#endif // QT_NO_TABBAR
#ifndef QT_NO_COMBOBOX
class QAccessibleComboBox : public QAccessibleWidget
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleComboBox(QWidget *w);
enum ComboBoxElements {
ComboBoxSelf = 0,
CurrentText,
OpenList,
PopupList
};
int childCount() const;
int childAt(int x, int y) const;
int indexOfChild(const QAccessibleInterface *child) const;
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const;
QString text(Text t, int child) const;
QRect rect(int child) const;
Role role(int child) const;
State state(int child) const;
bool doAction(int action, int child, const QVariantList &params);
QString actionText(int action, Text t, int child) const;
protected:
QComboBox *comboBox() const;
};
#endif // QT_NO_COMBOBOX
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // COMPLEXWIDGETS_H

File diff suppressed because it is too large Load diff

View file

@ -1,301 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef ACCESSIBLE_ITEMVIEWS_H
#define ACCESSIBLE_ITEMVIEWS_H
#include "QtCore/qpointer.h"
#include <QtGui/qabstractitemview.h>
#include <QtGui/qheaderview.h>
#include <QtGui/qaccessible.h>
#include <QtGui/qaccessible2.h>
#include <QtGui/qaccessiblewidget.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
#ifndef QT_NO_ITEMVIEWS
class QAccessibleTable2Cell;
class QAccessibleTable2HeaderCell;
class QAccessibleTable2 :public QAccessibleTable2Interface, public QAccessibleObject
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleTable2(QWidget *w);
virtual ~QAccessibleTable2();
Role role(int child) const;
State state(int child) const;
QString text(Text t, int child) const;
QRect rect(int child) const;
int childAt(int x, int y) const;
int childCount() const;
int indexOfChild(const QAccessibleInterface *) const;
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
#ifndef QT_NO_ACTION
int userActionCount(int child) const;
QString actionText(int action, Text t, int child) const;
bool doAction(int action, int child, const QVariantList &params);
#endif
QVariant invokeMethodEx(Method, int, const QVariantList &) { return QVariant(); }
// table2 interface
virtual QAccessibleTable2CellInterface *cellAt(int row, int column) const;
virtual QAccessibleInterface *caption() const;
virtual QAccessibleInterface *summary() const;
virtual QString columnDescription(int column) const;
virtual QString rowDescription(int row) const;
virtual int columnCount() const;
virtual int rowCount() const;
virtual QAccessible2::TableModelChange modelChange() const;
// selection
virtual int selectedCellCount() const;
virtual int selectedColumnCount() const;
virtual int selectedRowCount() const;
virtual QList<QAccessibleTable2CellInterface*> selectedCells() const;
virtual QList<int> selectedColumns() const;
virtual QList<int> selectedRows() const;
virtual bool isColumnSelected(int column) const;
virtual bool isRowSelected(int row) const;
virtual bool selectRow(int row);
virtual bool selectColumn(int column);
virtual bool unselectRow(int row);
virtual bool unselectColumn(int column);
QAbstractItemView *view() const;
protected:
virtual void modelReset();
virtual void rowsInserted(const QModelIndex &parent, int first, int last);
virtual void rowsRemoved(const QModelIndex &parent, int first, int last);
virtual void columnsInserted(const QModelIndex &parent, int first, int last);
virtual void columnsRemoved(const QModelIndex &parent, int first, int last);
virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row);
virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column);
protected:
QAccessible2::TableModelChange lastChange;
inline QAccessibleTable2Cell *cell(const QModelIndex &index) const;
inline QAccessible::Role cellRole() const {
switch (m_role) {
case QAccessible::List:
return QAccessible::ListItem;
case QAccessible::Table:
return QAccessible::Cell;
case QAccessible::Tree:
return QAccessible::TreeItem;
default:
Q_ASSERT(false);
}
return QAccessible::NoRole;
}
QHeaderView *horizontalHeader() const;
QHeaderView *verticalHeader() const;
private:
// the child index for a model index
inline int logicalIndex(const QModelIndex &index) const;
// the model index from the child index
QAccessibleInterface *childFromLogical(int logicalIndex) const;
QAccessible::Role m_role;
};
class QAccessibleTree :public QAccessibleTable2
{
public:
explicit QAccessibleTree(QWidget *w)
: QAccessibleTable2(w)
{}
virtual ~QAccessibleTree() {}
int childAt(int x, int y) const;
int childCount() const;
int indexOfChild(const QAccessibleInterface *) const;
int rowCount() const;
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
// table2 interface
QAccessibleTable2CellInterface *cellAt(int row, int column) const;
QString rowDescription(int row) const;
bool isRowSelected(int row) const;
bool selectRow(int row);
private:
QModelIndex indexFromLogical(int row, int column = 0) const;
};
class QAccessibleTable2Cell: public QAccessibleTable2CellInterface /*), public QAccessibleTextInterface, public QAccessibleSimpleEditableTextInterface*/
{
public:
QAccessibleTable2Cell(QAbstractItemView *view, const QModelIndex &m_index, QAccessible::Role role);
QObject *object() const { return 0; }
Role role(int child) const;
State state(int child) const;
QRect rect(int child) const;
bool isValid() const;
int childAt(int, int) const { return 0; }
int childCount() const { return 0; }
int indexOfChild(const QAccessibleInterface *) const { return -1; }
QString text(Text t, int child) const;
void setText(Text t, int child, const QString &text);
int navigate(RelationFlag relation, int m_index, QAccessibleInterface **iface) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
bool isExpandable() const;
#ifndef QT_NO_ACTION
int userActionCount(int child) const;
QString actionText(int action, Text t, int child) const;
bool doAction(int action, int child, const QVariantList &params);
#endif
// cell interface
virtual int columnExtent() const;
virtual QList<QAccessibleInterface*> columnHeaderCells() const;
virtual int columnIndex() const;
virtual int rowExtent() const;
virtual QList<QAccessibleInterface*> rowHeaderCells() const;
virtual int rowIndex() const;
virtual bool isSelected() const;
virtual void rowColumnExtents(int *row, int *column, int *rowExtents, int *columnExtents, bool *selected) const;
virtual QAccessibleTable2Interface* table() const;
private:
QHeaderView *verticalHeader() const;
QHeaderView *horizontalHeader() const;
QPointer<QAbstractItemView > view;
QModelIndex m_index;
QAccessible::Role m_role;
friend class QAccessibleTable2;
friend class QAccessibleTree;
};
class QAccessibleTable2HeaderCell: public QAccessibleInterface /*), public QAccessibleTextInterface, public QAccessibleSimpleEditableTextInterface*/
{
public:
// For header cells, pass the header view in addition
QAccessibleTable2HeaderCell(QAbstractItemView *view, int index, Qt::Orientation orientation);
QObject *object() const { return 0; }
Role role(int child) const;
State state(int child) const;
QRect rect(int child) const;
bool isValid() const;
int childAt(int, int) const { return 0; }
int childCount() const { return 0; }
int indexOfChild(const QAccessibleInterface *) const { return -1; }
QString text(Text t, int child) const;
void setText(Text t, int child, const QString &text);
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
#ifndef QT_NO_ACTION
int userActionCount(int child) const;
QString actionText(int action, Text t, int child) const;
bool doAction(int action, int child, const QVariantList &params);
#endif
private:
QAbstractItemView *view;
int index;
Qt::Orientation orientation;
friend class QAccessibleTable2;
friend class QAccessibleTree;
};
// This is the corner button on the top left of a table.
// It can be used to select all cells or it is not active at all.
// For now it is ignored.
class QAccessibleTable2CornerButton: public QAccessibleInterface
{
public:
QAccessibleTable2CornerButton(QAbstractItemView *view_)
:view(view_)
{}
QObject *object() const { return 0; }
Role role(int child) const { Q_ASSERT(child == 0); return QAccessible::Pane; }
State state(int child) const { Q_ASSERT(child == 0); return QAccessible::Normal; }
QRect rect(int child) const { Q_ASSERT(child == 0); return QRect(); }
bool isValid() const { return true; }
int childAt(int, int) const { return 0; }
int childCount() const { return 0; }
int indexOfChild(const QAccessibleInterface *) const { return -1; }
QString text(Text, int) const { return QString(); }
void setText(Text, int, const QString &) {}
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
{
if (relation == QAccessible::Ancestor && index == 1) {
*iface = QAccessible::queryAccessibleInterface(view);
return 0;
}
return -1;
}
Relation relationTo(int, const QAccessibleInterface *, int) const
{
return QAccessible::Unrelated;
}
#ifndef QT_NO_ACTION
int userActionCount(int) const { return 0; }
QString actionText(int, Text, int) const { return QString(); }
bool doAction(int, int, const QVariantList &) { return false; }
#endif
private:
QAbstractItemView *view;
};
#endif
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // ACCESSIBLE_ITEMVIEWS_H

View file

@ -1,342 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qaccessiblewidgets.h"
#include "qaccessiblemenu.h"
#include "simplewidgets.h"
#include "rangecontrols.h"
#include "complexwidgets.h"
#include "itemviews.h"
#include "qaccessibleplugin.h"
#include "qplugin.h"
#include "qpushbutton.h"
#include "qtoolbutton.h"
#include "qtreeview.h"
#include "qvariant.h"
#include "qaccessible.h"
#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
class AccessibleFactory : public QAccessiblePlugin
{
public:
AccessibleFactory();
QStringList keys() const;
QAccessibleInterface *create(const QString &classname, QObject *object);
};
AccessibleFactory::AccessibleFactory()
{
}
QStringList AccessibleFactory::keys() const
{
static const QStringList list = QStringList()
#ifndef QT_NO_LINEEDIT
<< QLatin1String("QLineEdit")
#endif
#ifndef QT_NO_COMBOBOX
<< QLatin1String("QComboBox")
#endif
#ifndef QT_NO_SPINBOX
<< QLatin1String("QAbstractSpinBox")
<< QLatin1String("QSpinBox")
<< QLatin1String("QDoubleSpinBox")
#endif
#ifndef QT_NO_SCROLLBAR
<< QLatin1String("QScrollBar")
#endif
#ifndef QT_NO_SLIDER
<< QLatin1String("QSlider")
#endif
<< QLatin1String("QAbstractSlider")
#ifndef QT_NO_TOOLBUTTON
<< QLatin1String("QToolButton")
#endif
#ifndef QT_NO_SPLITTER
<< QLatin1String("QSplitter")
<< QLatin1String("QSplitterHandle")
#endif
#ifndef QT_NO_TEXTEDIT
<< QLatin1String("QTextEdit")
#endif
#ifndef QT_NO_DIAL
<< QLatin1String("QDial")
#endif
#ifndef QT_NO_RUBBERBAND
<< QLatin1String("QRubberBand")
#endif
#ifndef QT_NO_TEXTBROWSER
<< QLatin1String("QTextBrowser")
#endif
#ifndef QT_NO_SCROLLAREA
<< QLatin1String("QAbstractScrollArea")
<< QLatin1String("QScrollArea")
#endif
#ifndef QT_NO_CALENDARWIDGET
<< QLatin1String("QCalendarWidget")
#endif
#ifndef QT_NO_DOCKWIDGET
<< QLatin1String("QDockWidget")
#endif
<< QLatin1String("QPlainTextEdit")
<< QLatin1String("QTipLabel")
<< QLatin1String("QFrame")
<< QLatin1String("QStackedWidget")
<< QLatin1String("QToolBox")
<< QLatin1String("QMdiArea")
<< QLatin1String("QMdiSubWindow")
<< QLatin1String("QWorkspace")
<< QLatin1String("QDialogButtonBox")
<< QLatin1String("QCheckBox")
<< QLatin1String("QRadioButton")
<< QLatin1String("QPushButton")
<< QLatin1String("QAbstractButton")
<< QLatin1String("QDialog")
<< QLatin1String("QMessageBox")
<< QLatin1String("QMainWindow")
<< QLatin1String("QLabel")
<< QLatin1String("QLCDNumber")
<< QLatin1String("QGroupBox")
<< QLatin1String("QStatusBar")
<< QLatin1String("QProgressBar")
<< QLatin1String("QMenuBar")
<< QLatin1String("QMenu")
<< QLatin1String("QHeaderView")
<< QLatin1String("QTabBar")
<< QLatin1String("QToolBar")
<< QLatin1String("QWorkspaceChild")
<< QLatin1String("QSizeGrip")
<< QLatin1String("QAbstractItemView")
<< QLatin1String("QWidget");
return list;
}
QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObject *object)
{
QAccessibleInterface *iface = 0;
if (!object || !object->isWidgetType())
return iface;
QWidget *widget = static_cast<QWidget*>(object);
if (false) {
#ifndef QT_NO_LINEEDIT
} else if (classname == QLatin1String("QLineEdit")) {
iface = new QAccessibleLineEdit(widget);
#endif
#ifndef QT_NO_COMBOBOX
} else if (classname == QLatin1String("QComboBox")) {
iface = new QAccessibleComboBox(widget);
#endif
#ifndef QT_NO_SPINBOX
} else if (classname == QLatin1String("QAbstractSpinBox")) {
iface = new QAccessibleAbstractSpinBox(widget);
} else if (classname == QLatin1String("QSpinBox")) {
iface = new QAccessibleSpinBox(widget);
} else if (classname == QLatin1String("QDoubleSpinBox")) {
iface = new QAccessibleDoubleSpinBox(widget);
#endif
#ifndef QT_NO_SCROLLBAR
} else if (classname == QLatin1String("QScrollBar")) {
iface = new QAccessibleScrollBar(widget);
#endif
} else if (classname == QLatin1String("QAbstractSlider")) {
iface = new QAccessibleAbstractSlider(widget);
#ifndef QT_NO_SLIDER
} else if (classname == QLatin1String("QSlider")) {
iface = new QAccessibleSlider(widget);
#endif
#ifndef QT_NO_TOOLBUTTON
} else if (classname == QLatin1String("QToolButton")) {
Role role = NoRole;
#ifndef QT_NO_MENU
QToolButton *tb = qobject_cast<QToolButton*>(widget);
if (!tb->menu())
role = tb->isCheckable() ? CheckBox : PushButton;
else if (tb->popupMode() != QToolButton::DelayedPopup)
role = ButtonDropDown;
else
#endif
role = ButtonMenu;
iface = new QAccessibleToolButton(widget, role);
#endif // QT_NO_TOOLBUTTON
} else if (classname == QLatin1String("QCheckBox")) {
iface = new QAccessibleButton(widget, CheckBox);
} else if (classname == QLatin1String("QRadioButton")) {
iface = new QAccessibleButton(widget, RadioButton);
} else if (classname == QLatin1String("QPushButton")) {
Role role = NoRole;
QPushButton *pb = qobject_cast<QPushButton*>(widget);
#ifndef QT_NO_MENU
if (pb->menu())
role = ButtonMenu;
else
#endif
if (pb->isCheckable())
role = CheckBox;
else
role = PushButton;
iface = new QAccessibleButton(widget, role);
} else if (classname == QLatin1String("QAbstractButton")) {
iface = new QAccessibleButton(widget, PushButton);
} else if (classname == QLatin1String("QDialog")) {
iface = new QAccessibleWidget(widget, Dialog);
} else if (classname == QLatin1String("QMessageBox")) {
iface = new QAccessibleWidget(widget, AlertMessage);
#ifndef QT_NO_MAINWINDOW
} else if (classname == QLatin1String("QMainWindow")) {
iface = new QAccessibleMainWindow(widget);
#endif
} else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) {
iface = new QAccessibleDisplay(widget);
#ifndef QT_NO_GROUPBOX
} else if (classname == QLatin1String("QGroupBox")) {
iface = new QAccessibleGroupBox(widget);
#endif
} else if (classname == QLatin1String("QStatusBar")) {
iface = new QAccessibleDisplay(widget);
#ifndef QT_NO_PROGRESSBAR
} else if (classname == QLatin1String("QProgressBar")) {
iface = new QAccessibleProgressBar(widget);
#endif
} else if (classname == QLatin1String("QToolBar")) {
iface = new QAccessibleWidget(widget, ToolBar, widget->windowTitle());
#ifndef QT_NO_MENUBAR
} else if (classname == QLatin1String("QMenuBar")) {
iface = new QAccessibleMenuBar(widget);
#endif
#ifndef QT_NO_MENU
} else if (classname == QLatin1String("QMenu")) {
iface = new QAccessibleMenu(widget);
#endif
#ifndef QT_NO_ITEMVIEWS
#ifdef Q_WS_X11
} else if (classname == QLatin1String("QAbstractItemView")) {
if (qobject_cast<const QTreeView*>(widget)) {
iface = new QAccessibleTree(widget);
} else {
iface = new QAccessibleTable2(widget);
}
} else if (classname == QLatin1String("QWidget")
&& widget->objectName() == QLatin1String("qt_scrollarea_viewport")
&& qobject_cast<QAbstractItemView*>(widget->parentWidget())) {
if (qobject_cast<const QTreeView*>(widget->parentWidget())) {
iface = new QAccessibleTree(widget->parentWidget());
} else {
iface = new QAccessibleTable2(widget->parentWidget());
}
#else
} else if (classname == QLatin1String("QHeaderView")) {
iface = new QAccessibleHeader(widget);
} else if (classname == QLatin1String("QAbstractItemView")) {
iface = new QAccessibleItemView(widget);
} else if (classname == QLatin1String("QWidget")
&& widget->objectName() == QLatin1String("qt_scrollarea_viewport")
&& qobject_cast<QAbstractItemView*>(widget->parentWidget())) {
iface = new QAccessibleItemView(widget);
#endif // Q_WS_X11
#endif // QT_NO_ITEMVIEWS
#ifndef QT_NO_TABBAR
} else if (classname == QLatin1String("QTabBar")) {
iface = new QAccessibleTabBar(widget);
#endif
} else if (classname == QLatin1String("QWorkspaceChild")) {
iface = new QAccessibleWidget(widget, Window);
} else if (classname == QLatin1String("QSizeGrip")) {
iface = new QAccessibleWidget(widget, Grip);
#ifndef QT_NO_SPLITTER
} else if (classname == QLatin1String("QSplitter")) {
iface = new QAccessibleWidget(widget, Splitter);
} else if (classname == QLatin1String("QSplitterHandle")) {
iface = new QAccessibleWidget(widget, Grip);
#endif
#ifndef QT_NO_TEXTEDIT
} else if (classname == QLatin1String("QTextEdit")) {
iface = new QAccessibleTextEdit(widget);
#endif
} else if (classname == QLatin1String("QPlainTextEdit")) {
iface = new QAccessiblePlainTextEdit(widget);
} else if (classname == QLatin1String("QTipLabel")) {
iface = new QAccessibleDisplay(widget, ToolTip);
} else if (classname == QLatin1String("QFrame")) {
iface = new QAccessibleWidget(widget, Border);
#ifndef QT_NO_STACKEDWIDGET
} else if (classname == QLatin1String("QStackedWidget")) {
iface = new QAccessibleStackedWidget(widget);
#endif
#ifndef QT_NO_TOOLBOX
} else if (classname == QLatin1String("QToolBox")) {
iface = new QAccessibleToolBox(widget);
#endif
#ifndef QT_NO_MDIAREA
} else if (classname == QLatin1String("QMdiArea")) {
iface = new QAccessibleMdiArea(widget);
} else if (classname == QLatin1String("QMdiSubWindow")) {
iface = new QAccessibleMdiSubWindow(widget);
#endif
#ifndef QT_NO_WORKSPACE
} else if (classname == QLatin1String("QWorkspace")) {
iface = new QAccessibleWorkspace(widget);
#endif
} else if (classname == QLatin1String("QDialogButtonBox")) {
iface = new QAccessibleDialogButtonBox(widget);
#ifndef QT_NO_DIAL
} else if (classname == QLatin1String("QDial")) {
iface = new QAccessibleDial(widget);
#endif
#ifndef QT_NO_RUBBERBAND
} else if (classname == QLatin1String("QRubberBand")) {
iface = new QAccessibleWidget(widget, QAccessible::Border);
#endif
#ifndef QT_NO_TEXTBROWSER
} else if (classname == QLatin1String("QTextBrowser")) {
iface = new QAccessibleTextBrowser(widget);
#endif
#ifndef QT_NO_SCROLLAREA
} else if (classname == QLatin1String("QAbstractScrollArea")) {
iface = new QAccessibleAbstractScrollArea(widget);
} else if (classname == QLatin1String("QScrollArea")) {
iface = new QAccessibleScrollArea(widget);
#endif
#ifndef QT_NO_CALENDARWIDGET
} else if (classname == QLatin1String("QCalendarWidget")) {
iface = new QAccessibleCalendarWidget(widget);
#endif
#ifndef QT_NO_DOCKWIDGET
} else if (classname == QLatin1String("QDockWidget")) {
iface = new QAccessibleDockWidget(widget);
#endif
}
return iface;
}
Q_EXPORT_PLUGIN2(qtaccessiblewidgets, AccessibleFactory)
QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY

View file

@ -1,723 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qaccessiblemenu.h"
#include "qmenu.h"
#include "qmenubar.h"
#include "qaction.h"
#include "qstyle.h"
#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
#ifndef QT_NO_MENU
QString Q_GUI_EXPORT qt_accStripAmp(const QString &text);
QString Q_GUI_EXPORT qt_accHotKey(const QString &text);
QAccessibleMenu::QAccessibleMenu(QWidget *w)
: QAccessibleWidget(w)
{
Q_ASSERT(menu());
}
QMenu *QAccessibleMenu::menu() const
{
return qobject_cast<QMenu*>(object());
}
int QAccessibleMenu::childCount() const
{
return menu()->actions().count();
}
QRect QAccessibleMenu::rect(int child) const
{
if (!child || child > childCount())
return QAccessibleWidget::rect(child);
QRect r = menu()->actionGeometry(menu()->actions()[child - 1]);
QPoint tlp = menu()->mapToGlobal(QPoint(0,0));
return QRect(tlp.x() + r.x(), tlp.y() + r.y(), r.width(), r.height());
}
int QAccessibleMenu::childAt(int x, int y) const
{
QAction *act = menu()->actionAt(menu()->mapFromGlobal(QPoint(x,y)));
if(act && act->isSeparator())
act = 0;
return menu()->actions().indexOf(act) + 1;
}
QString QAccessibleMenu::text(Text t, int child) const
{
QString tx = QAccessibleWidget::text(t, child);
if (!child && tx.size())
return tx;
switch (t) {
case Name:
if (!child)
return menu()->windowTitle();
return qt_accStripAmp(menu()->actions().at(child-1)->text());
case Help:
return child ? menu()->actions().at(child-1)->whatsThis() : tx;
#ifndef QT_NO_SHORTCUT
case Accelerator:
return child ? menu()->actions().at(child-1)->shortcut().toString() : tx;
#endif
default:
break;
}
return tx;
}
QAccessible::Role QAccessibleMenu::role(int child) const
{
if (!child)
return PopupMenu;
QAction *action = menu()->actions()[child-1];
if (action && action->isSeparator())
return Separator;
return MenuItem;
}
QAccessible::State QAccessibleMenu::state(int child) const
{
State s = QAccessibleWidget::state(child);
if (!child)
return s;
QAction *action = menu()->actions()[child-1];
if (!action)
return s;
if (menu()->style()->styleHint(QStyle::SH_Menu_MouseTracking))
s |= HotTracked;
if (action->isSeparator() || !action->isEnabled())
s |= Unavailable;
if (action->isChecked())
s |= Checked;
if (menu()->activeAction() == action)
s |= Focused;
return s;
}
QString QAccessibleMenu::actionText(int action, QAccessible::Text text, int child) const
{
if (action == QAccessible::DefaultAction && child && text == QAccessible::Name) {
QAction *a = menu()->actions().value(child-1, 0);
if (!a || a->isSeparator())
return QString();
if (a->menu()) {
if (a->menu()->isVisible())
return QMenu::tr("Close");
return QMenu::tr("Open");
}
return QMenu::tr("Execute");
}
return QAccessibleWidget::actionText(action, text, child);
}
bool QAccessibleMenu::doAction(int act, int child, const QVariantList &)
{
if (!child || act != QAccessible::DefaultAction)
return false;
QAction *action = menu()->actions().value(child-1, 0);
if (!action || !action->isEnabled())
return false;
if (action->menu() && action->menu()->isVisible())
action->menu()->hide();
else
menu()->setActiveAction(action);
return true;
}
int QAccessibleMenu::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
{
int ret = -1;
if (entry < 0) {
*target = 0;
return ret;
}
if (relation == Self || entry == 0) {
*target = new QAccessibleMenu(menu());
return 0;
}
switch (relation) {
case Child:
if (entry <= childCount()) {
*target = new QAccessibleMenuItem(menu(), menu()->actions().at( entry - 1 ));
ret = 0;
}
break;
case Ancestor: {
QAccessibleInterface *iface;
QWidget *parent = menu()->parentWidget();
if (qobject_cast<QMenu*>(parent) || qobject_cast<QMenuBar*>(parent)) {
iface = new QAccessibleMenuItem(parent, menu()->menuAction());
if (entry == 1) {
*target = iface;
ret = 0;
} else {
ret = iface->navigate(Ancestor, entry - 1, target);
delete iface;
}
} else {
return QAccessibleWidget::navigate(relation, entry, target);
}
break;}
default:
return QAccessibleWidget::navigate(relation, entry, target);
}
if (ret == -1)
*target = 0;
return ret;
}
int QAccessibleMenu::indexOfChild( const QAccessibleInterface *child ) const
{
int index = -1;
Role r = child->role(0);
if ((r == MenuItem || r == Separator) && menu()) {
index = menu()->actions().indexOf(qobject_cast<QAction*>(child->object()));
if (index != -1)
++index;
}
return index;
}
#ifndef QT_NO_MENUBAR
QAccessibleMenuBar::QAccessibleMenuBar(QWidget *w)
: QAccessibleWidget(w)
{
Q_ASSERT(menuBar());
}
QMenuBar *QAccessibleMenuBar::menuBar() const
{
return qobject_cast<QMenuBar*>(object());
}
int QAccessibleMenuBar::childCount() const
{
return menuBar()->actions().count();
}
QRect QAccessibleMenuBar::rect(int child) const
{
if (!child)
return QAccessibleWidget::rect(child);
QRect r = menuBar()->actionGeometry(menuBar()->actions()[child - 1]);
QPoint tlp = menuBar()->mapToGlobal(QPoint(0,0));
return QRect(tlp.x() + r.x(), tlp.y() + r.y(), r.width(), r.height());
}
int QAccessibleMenuBar::childAt(int x, int y) const
{
for (int i = childCount(); i >= 0; --i) {
if (rect(i).contains(x,y))
return i;
}
return -1;
}
int QAccessibleMenuBar::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
{
int ret = -1;
if (entry < 0) {
*target = 0;
return ret;
}
if (relation == Self || entry == 0) {
*target = new QAccessibleMenuBar(menuBar());
return 0;
}
switch (relation) {
case Child:
if (entry <= childCount()) {
*target = new QAccessibleMenuItem(menuBar(), menuBar()->actions().at( entry - 1 ));
ret = 0;
}
break;
default:
return QAccessibleWidget::navigate(relation, entry, target);
}
if (ret == -1)
*target = 0;
return ret;
}
int QAccessibleMenuBar::indexOfChild( const QAccessibleInterface *child ) const
{
int index = -1;
Role r = child->role(0);
if ((r == MenuItem || r == Separator) && menuBar()) {
index = menuBar()->actions().indexOf(qobject_cast<QAction*>(child->object()));
if (index != -1)
++index;
}
return index;
}
QString QAccessibleMenuBar::text(Text t, int child) const
{
QString str;
if (child) {
if (QAction *action = menuBar()->actions().value(child - 1, 0)) {
switch (t) {
case Name:
return qt_accStripAmp(action->text());
case Accelerator:
str = qt_accHotKey(action->text());
break;
default:
break;
}
}
}
if (str.isEmpty())
str = QAccessibleWidget::text(t, child);
return str;
}
QAccessible::Role QAccessibleMenuBar::role(int child) const
{
if (!child)
return MenuBar;
QAction *action = menuBar()->actions()[child-1];
if (action && action->isSeparator())
return Separator;
return MenuItem;
}
QAccessible::State QAccessibleMenuBar::state(int child) const
{
State s = QAccessibleWidget::state(child);
if (!child)
return s;
QAction *action = menuBar()->actions().value(child-1, 0);
if (!action)
return s;
if (menuBar()->style()->styleHint(QStyle::SH_Menu_MouseTracking))
s |= HotTracked;
if (action->isSeparator() || !action->isEnabled())
s |= Unavailable;
if (menuBar()->activeAction() == action)
s |= Focused;
return s;
}
QString QAccessibleMenuBar::actionText(int action, QAccessible::Text text, int child) const
{
if (action == QAccessible::DefaultAction && child && text == QAccessible::Name) {
QAction *a = menuBar()->actions().value(child-1, 0);
if (!a || a->isSeparator())
return QString();
if (a->menu()) {
if (a->menu()->isVisible())
return QMenu::tr("Close");
return QMenu::tr("Open");
}
return QMenu::tr("Execute");
}
return QAccessibleWidget::actionText(action, text, child);
}
bool QAccessibleMenuBar::doAction(int act, int child, const QVariantList &)
{
if (act != !child)
return false;
QAction *action = menuBar()->actions().value(child-1, 0);
if (!action || !action->isEnabled())
return false;
if (action->menu() && action->menu()->isVisible())
action->menu()->hide();
else
menuBar()->setActiveAction(action);
return true;
}
#endif // QT_NO_MENUBAR
QAccessibleMenuItem::QAccessibleMenuItem(QWidget *owner, QAction *action) : m_action(action), m_owner(owner)
{
}
QAccessibleMenuItem::~QAccessibleMenuItem()
{}
int QAccessibleMenuItem::childAt(int x, int y ) const
{
for (int i = childCount(); i >= 0; --i) {
if (rect(i).contains(x,y))
return i;
}
return -1;
}
int QAccessibleMenuItem::childCount() const
{
return m_action->menu() ? 1 : 0;
}
QString QAccessibleMenuItem::actionText(int action, Text text, int child ) const
{
if (text == Name && child == 0) {
switch (action) {
case Press:
case DefaultAction:
if (m_action->menu())
return QMenu::tr("Open");
return QMenu::tr("Execute");
break;
default:
break;
}
}
return QString();
}
bool QAccessibleMenuItem::doAction(int action, int child, const QVariantList & /*params = QVariantList()*/ )
{
if ((child) || ((action != DefaultAction) && (action != Press)))
return false;
// if the action has a menu, expand/hide it
if (m_action->menu()) {
if (m_action->menu()->isVisible()) {
m_action->menu()->hide();
return true;
} else {
if (QMenuBar *bar = qobject_cast<QMenuBar*>(owner())) {
bar->setActiveAction(m_action);
return true;
} else if (QMenu *menu = qobject_cast<QMenu*>(owner())){
menu->setActiveAction(m_action);
return true;
}
}
}
// no menu
m_action->trigger();
return true;
}
// action interface
int QAccessibleMenuItem::actionCount()
{
return 1;
}
void QAccessibleMenuItem::doAction(int actionIndex)
{
if (actionIndex)
return;
doAction(DefaultAction, 0);
}
int QAccessibleMenuItem::indexOfChild( const QAccessibleInterface * child ) const
{
if (child->role(0) == PopupMenu && child->object() == m_action->menu())
return 1;
return -1;
}
bool QAccessibleMenuItem::isValid() const
{
return (m_action != nullptr);
}
int QAccessibleMenuItem::navigate(RelationFlag relation, int entry, QAccessibleInterface ** target ) const
{
int ret = -1;
if (entry < 0) {
*target = 0;
return ret;
}
if (relation == Self || entry == 0) {
*target = new QAccessibleMenuItem(owner(), action());
return 0;
}
switch (relation) {
case Child:
if (entry <= childCount()) {
*target = new QAccessibleMenu(action()->menu());
ret = 0;
}
break;
case Ancestor:{
QWidget *parent = owner();
QAccessibleInterface *ancestor = parent ? QAccessible::queryAccessibleInterface(parent) : 0;
if (ancestor) {
if (entry == 1) {
*target = ancestor;
ret = 0;
} else {
ret = ancestor->navigate(Ancestor, entry - 1, target);
delete ancestor;
}
}
break;}
case Up:
case Down:{
QAccessibleInterface *parent = 0;
int ent = navigate(Ancestor, 1, &parent);
if (ent == 0) {
int index = parent->indexOfChild(this);
if (index != -1) {
index += (relation == Down ? +1 : -1);
ret = parent->navigate(Child, index, target);
}
}
delete parent;
break;}
case Sibling: {
QAccessibleInterface *parent = 0;
int ent = navigate(Ancestor, 1, &parent);
if (ent == 0) {
ret = parent->navigate(Child, entry, target);
}
delete parent;
break;}
default:
break;
}
if (ret == -1)
*target = 0;
return ret;
}
QObject *QAccessibleMenuItem::object() const
{
return m_action;
}
QRect QAccessibleMenuItem::rect (int child ) const
{
QRect rect;
if (child == 0) {
QWidget *own = owner();
#ifndef QT_NO_MENUBAR
if (QMenuBar *menuBar = qobject_cast<QMenuBar*>(own)) {
rect = menuBar->actionGeometry(m_action);
QPoint globalPos = menuBar->mapToGlobal(QPoint(0,0));
rect = rect.translated(globalPos);
} else
#endif // QT_NO_MENUBAR
if (QMenu *menu = qobject_cast<QMenu*>(own)) {
rect = menu->actionGeometry(m_action);
QPoint globalPos = menu->mapToGlobal(QPoint(0,0));
rect = rect.translated(globalPos);
}
} else if (child == 1) {
QMenu *menu = m_action->menu();
if (menu) {
rect = menu->rect();
QPoint globalPos = menu->mapToGlobal(QPoint(0,0));
rect = rect.translated(globalPos);
}
}
return rect;
}
QAccessible::Relation QAccessibleMenuItem::relationTo ( int child, const QAccessibleInterface * other, int otherChild ) const
{
if (other->object() == owner()) {
return Child;
}
Q_UNUSED(child)
Q_UNUSED(other)
Q_UNUSED(otherChild)
// ###
return Unrelated;
}
QAccessible::Role QAccessibleMenuItem::role(int /*child*/ ) const
{
return m_action->isSeparator() ? Separator :MenuItem;
}
void QAccessibleMenuItem::setText ( Text /*t*/, int /*child*/, const QString & /*text */)
{
}
QAccessible::State QAccessibleMenuItem::state(int child ) const
{
QAccessible::State s = Unavailable;
if (child == 0) {
s = Normal;
QWidget *own = owner();
if (own && (own->testAttribute(Qt::WA_WState_Visible) == false || m_action->isVisible() == false)) {
s |= Invisible;
}
if (QMenu *menu = qobject_cast<QMenu*>(own)) {
if (menu->activeAction() == m_action)
s |= Focused;
#ifndef QT_NO_MENUBAR
} else if (QMenuBar *menuBar = qobject_cast<QMenuBar*>(own)) {
if (menuBar->activeAction() == m_action)
s |= Focused;
#endif
}
if (own && own->style()->styleHint(QStyle::SH_Menu_MouseTracking))
s |= HotTracked;
if (m_action->isSeparator() || !m_action->isEnabled())
s |= Unavailable;
if (m_action->isChecked())
s |= Checked;
} else if (child == 1) {
QMenu *menu = m_action->menu();
if (menu) {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(menu);
s = iface->state(0);
delete iface;
}
}
return s;
}
QString QAccessibleMenuItem::text ( Text t, int child ) const
{
QString str;
switch (t) {
case Name:
if (child == 0) {
str = m_action->text();
} else if (child == 1) {
QMenu *m = m_action->menu();
if (m)
str = m->title();
}
str = qt_accStripAmp(str);
break;
case Accelerator:
if (child == 0) {
#ifndef QT_NO_SHORTCUT
QKeySequence key = m_action->shortcut();
if (!key.isEmpty()) {
str = key.toString();
} else
#endif
{
str = qt_accHotKey(m_action->text());
}
}
break;
default:
break;
}
return str;
}
// action interface
int QAccessibleMenuItem::userActionCount ( int /*child*/ ) const
{
return 0;
}
QAction *QAccessibleMenuItem::action() const
{
return m_action;
}
QString QAccessibleMenuItem::description(int)
{
return text(QAccessible::Description, 0);
}
QString QAccessibleMenuItem::name(int)
{
return actionText(DefaultAction, QAccessible::Name, 0);
}
QString QAccessibleMenuItem::localizedName(int)
{
return text(QAccessible::Name, 0);
}
QStringList QAccessibleMenuItem::keyBindings(int)
{
QStringList keys;
#ifndef QT_NO_SHORTCUT
QKeySequence key = m_action->shortcut();
if (!key.isEmpty()) {
keys.append(key.toString());
}
#endif
return keys;
}
QVariant QAccessibleMenuItem::invokeMethodEx(Method, int, const QVariantList &)
{
return QVariant();
}
QWidget *QAccessibleMenuItem::owner() const
{
return m_owner;
}
#endif // QT_NO_MENU
QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY

View file

@ -1,130 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QACCESSIBLEMENU_H
#define QACCESSIBLEMENU_H
#include <QtGui/qaccessiblewidget.h>
#include <QtGui/qaccessible2.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
#ifndef QT_NO_MENU
class QMenu;
class QMenuBar;
class QAction;
class QAccessibleMenu : public QAccessibleWidget
{
public:
explicit QAccessibleMenu(QWidget *w);
int childCount() const;
int childAt(int x, int y) const;
QRect rect(int child) const;
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
int indexOfChild( const QAccessibleInterface *child ) const;
QString actionText(int action, QAccessible::Text text, int child) const;
bool doAction(int action, int child, const QVariantList &params);
protected:
QMenu *menu() const;
};
#ifndef QT_NO_MENUBAR
class QAccessibleMenuBar : public QAccessibleWidget
{
public:
explicit QAccessibleMenuBar(QWidget *w);
int childCount() const;
int childAt(int x, int y) const;
QRect rect(int child) const;
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
int indexOfChild( const QAccessibleInterface *child ) const;
QString actionText(int action, QAccessible::Text text, int child) const;
bool doAction(int action, int child, const QVariantList &params);
protected:
QMenuBar *menuBar() const;
};
#endif // QT_NO_MENUBAR
class QAccessibleMenuItem : public QAccessibleActionInterface, public QAccessibleInterface
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleMenuItem(QWidget *owner, QAction *w);
virtual ~QAccessibleMenuItem();
virtual QString actionText ( int action, Text t, int child ) const;
virtual int childAt ( int x, int y ) const;
virtual int childCount () const;
virtual bool doAction ( int action, int child, const QVariantList & params = QVariantList() );
virtual int indexOfChild ( const QAccessibleInterface * child ) const;
virtual bool isValid () const;
virtual int navigate ( RelationFlag relation, int entry, QAccessibleInterface ** target ) const;
virtual QObject * object () const;
virtual QRect rect ( int child ) const;
virtual Relation relationTo ( int child, const QAccessibleInterface * other, int otherChild ) const;
virtual Role role ( int child ) const;
virtual void setText ( Text t, int child, const QString & text );
virtual State state ( int child ) const;
virtual QString text ( Text t, int child ) const;
virtual int userActionCount ( int child ) const;
// action interface
virtual int actionCount();
virtual void doAction(int actionIndex);
virtual QString description(int);
virtual QString name(int);
virtual QString localizedName(int);
virtual QStringList keyBindings(int);
virtual QVariant invokeMethodEx(Method, int, const QVariantList &);
QWidget *owner() const;
protected:
QAction *action() const;
private:
QAction *m_action;
QWidget *m_owner; // can hold either QMenu or the QMenuBar that contains the action
};
#endif // QT_NO_MENU
QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY
#endif // QACCESSIBLEMENU_H

File diff suppressed because it is too large Load diff

View file

@ -1,355 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QACCESSIBLEWIDGETS_H
#define QACCESSIBLEWIDGETS_H
#include <QtGui/qaccessible2.h>
#include <QtGui/qaccessiblewidget.h>
#ifndef QT_NO_ACCESSIBILITY
#include <QtCore/QPointer>
#include <QtCore/QPair>
QT_BEGIN_NAMESPACE
class QTextEdit;
class QStackedWidget;
class QToolBox;
class QMdiArea;
class QMdiSubWindow;
class QWorkspace;
class QRubberBand;
class QTextBrowser;
class QCalendarWidget;
class QAbstractItemView;
class QDockWidget;
class QDockWidgetLayout;
class QMainWindow;
class QPlainTextEdit;
class QTextCursor;
class QTextDocument;
class QAccessibleTextWidget : public QAccessibleWidget,
public QAccessibleTextInterface,
public QAccessibleEditableTextInterface
{
public:
QAccessibleTextWidget(QWidget *o, Role r = EditableText, const QString& name = QString());
void addSelection(int startOffset, int endOffset);
void setSelection(int selectionIndex, int startOffset, int endOffset);
void removeSelection(int selectionIndex);
void selection(int selectionIndex, int *startOffset, int *endOffset);
int selectionCount();
int characterCount();
void setCursorPosition(int position);
int cursorPosition();
QString text(int startOffset, int endOffset);
QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset);
QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset);
QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset);
QString attributes(int offset, int *startOffset, int *endOffset);
void deleteText(int startOffset, int endOffset);
void insertText(int offset, const QString &text);
void copyText(int startOffset, int endOffset);
void cutText(int startOffset, int endOffset);
void pasteText(int offset);
void setAttributes(int startOffset, int endOffset, const QString &attributes);
void replaceText(int startOffset, int endOffset, const QString &text);
QRect characterRect(int offset, QAccessible2::CoordinateType coordType);
int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType);
protected:
QTextCursor textCursorForRange(int startOffset, int endOffset) const;
QPair<int, int> getBoundaries(int offset, QAccessible2::BoundaryType boundaryType);
virtual QPoint scrollBarPosition() const;
virtual QTextCursor textCursor() const = 0;
virtual void setTextCursor(const QTextCursor &) = 0;
virtual QTextDocument *textDocument() const = 0;
virtual QWidget *viewport() const = 0;
};
class QAccessiblePlainTextEdit : public QAccessibleTextWidget
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessiblePlainTextEdit(QWidget *o);
int childCount() const;
// QAccessibleTextInterface
void scrollToSubstring(int startIndex, int endIndex);
protected:
QPlainTextEdit *plainTextEdit() const;
QPoint scrollBarPosition() const;
QTextCursor textCursor() const;
void setTextCursor(const QTextCursor &textCursor);
QTextDocument *textDocument() const;
QWidget *viewport() const;
};
#ifndef QT_NO_TEXTEDIT
class QAccessibleTextEdit : public QAccessibleTextWidget
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleTextEdit(QWidget *o);
QString text(Text t, int child) const;
void setText(Text t, int control, const QString &text);
Role role(int child) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
QRect rect(int child) const;
int childAt(int x, int y) const;
int childCount() const;
// QAccessibleTextInterface
void scrollToSubstring(int startIndex, int endIndex);
// QAccessibleEditableTextInterface
void copyText(int startOffset, int endOffset);
void cutText(int startOffset, int endOffset);
void pasteText(int offset);
void setAttributes(int startOffset, int endOffset, const QString &attributes);
protected:
QTextEdit *textEdit() const;
QPoint scrollBarPosition() const;
QTextCursor textCursor() const;
void setTextCursor(const QTextCursor &textCursor);
QTextDocument *textDocument() const;
QWidget *viewport() const;
private:
int childOffset;
};
#endif // QT_NO_TEXTEDIT
class QAccessibleStackedWidget : public QAccessibleWidget
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleStackedWidget(QWidget *widget);
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
int childAt(int x, int y) const;
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
protected:
QStackedWidget *stackedWidget() const;
};
class QAccessibleToolBox : public QAccessibleWidget
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleToolBox(QWidget *widget);
QString text(Text textType, int child) const;
void setText(Text textType, int child, const QString &text);
State state(int child) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
protected:
QToolBox *toolBox() const;
};
#ifndef QT_NO_MDIAREA
class QAccessibleMdiArea : public QAccessibleWidget
{
public:
explicit QAccessibleMdiArea(QWidget *widget);
State state(int child) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
protected:
QMdiArea *mdiArea() const;
};
class QAccessibleMdiSubWindow : public QAccessibleWidget
{
public:
explicit QAccessibleMdiSubWindow(QWidget *widget);
QString text(Text textType, int child) const;
void setText(Text textType, int child, const QString &text);
State state(int child) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
QRect rect(int child) const;
int childAt(int x, int y) const;
protected:
QMdiSubWindow *mdiSubWindow() const;
};
#endif // QT_NO_MDIAREA
#ifndef QT_NO_WORKSPACE
class QAccessibleWorkspace : public QAccessibleWidget
{
public:
explicit QAccessibleWorkspace(QWidget *widget);
State state(int child) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
protected:
QWorkspace *workspace() const;
};
#endif
class QAccessibleDialogButtonBox : public QAccessibleWidget
{
public:
explicit QAccessibleDialogButtonBox(QWidget *widget);
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
};
#ifndef QT_NO_TEXTBROWSER
class QAccessibleTextBrowser : public QAccessibleTextEdit
{
public:
explicit QAccessibleTextBrowser(QWidget *widget);
Role role(int child) const;
};
#endif // QT_NO_TEXTBROWSER
#ifndef QT_NO_CALENDARWIDGET
class QAccessibleCalendarWidget : public QAccessibleWidget
{
public:
explicit QAccessibleCalendarWidget(QWidget *widget);
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
int childCount() const;
int indexOfChild(const QAccessibleInterface *child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const;
QRect rect(int child) const;
int childAt(int x, int y) const;
protected:
QCalendarWidget *calendarWidget() const;
private:
QAbstractItemView *calendarView() const;
QWidget *navigationBar() const;
};
#endif // QT_NO_CALENDARWIDGET
#ifndef QT_NO_DOCKWIDGET
class QAccessibleDockWidget: public QAccessibleWidget
{
public:
explicit QAccessibleDockWidget(QWidget *widget);
int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const;
int indexOfChild(const QAccessibleInterface *child) const;
int childCount() const;
QRect rect (int child ) const;
Role role(int child) const;
State state(int child) const;
int childAt(int x, int y) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
QDockWidget *dockWidget() const;
};
class QAccessibleTitleBar : public QAccessibleInterface
{
public:
explicit QAccessibleTitleBar(QDockWidget *widget);
QString actionText(int action, Text t, int child) const;
bool doAction(int action, int child, const QVariantList& params = QVariantList());
int userActionCount ( int child) const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const;
int indexOfChild(const QAccessibleInterface *child) const;
int childCount() const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
void setText(Text t, int child, const QString &text);
QString text(Text t, int child) const;
Role role(int child) const;
QRect rect (int child) const;
State state(int child) const;
int childAt(int x, int y) const;
QObject *object() const;
bool isValid() const;
QPointer<QDockWidget> m_dockWidget;
QDockWidget *dockWidget() const;
QDockWidgetLayout *dockWidgetLayout() const;
};
#endif // QT_NO_DOCKWIDGET
#ifndef QT_NO_MAINWINDOW
class QAccessibleMainWindow : public QAccessibleWidget
{
public:
explicit QAccessibleMainWindow(QWidget *widget);
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
int childCount() const;
int navigate(RelationFlag relation, int entry, QAccessibleInterface **iface) const;
int indexOfChild(const QAccessibleInterface *iface) const;
int childAt(int x, int y) const;
QMainWindow *mainWindow() const;
};
#endif //QT_NO_MAINWINDOW
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // QACESSIBLEWIDGETS_H

View file

@ -1,952 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "rangecontrols.h"
#include "qslider.h"
#include "qdial.h"
#include "qspinbox.h"
#include "qscrollbar.h"
#include "qstyle.h"
#include "qstyleoption.h"
#include "qdebug.h"
#include "qglobal.h"
#include <QDoubleSpinBox>
#include <QDial>
#include "qmath.h"
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
extern QString Q_GUI_EXPORT qt_accStripAmp(const QString &text);
#ifndef QT_NO_SCROLLBAR
extern QStyleOptionSlider Q_GUI_EXPORT qt_qscrollbarStyleOption(QScrollBar *scrollBar);
#endif
#ifndef QT_NO_SLIDER
extern QStyleOptionSlider Q_GUI_EXPORT qt_qsliderStyleOption(QSlider *slider);
#endif
#ifndef QT_NO_SPINBOX
QAccessibleAbstractSpinBox::QAccessibleAbstractSpinBox(QWidget *w)
: QAccessibleWidget(w, SpinBox)
{
Q_ASSERT(abstractSpinBox());
}
/*!
Returns the underlying QAbstractSpinBox.
*/
QAbstractSpinBox *QAccessibleAbstractSpinBox::abstractSpinBox() const
{
return qobject_cast<QAbstractSpinBox*>(object());
}
/*! \reimp */
int QAccessibleAbstractSpinBox::childCount() const
{
return ValueDown;
}
/*! \reimp */
QRect QAccessibleAbstractSpinBox::rect(int child) const
{
QRect rect;
if (!abstractSpinBox()->isVisible())
return rect;
QStyleOptionSpinBox so;
so.rect = widget()->rect();
switch(child) {
case Editor:
rect = widget()->style()->subControlRect(QStyle::CC_SpinBox, &so,
QStyle::SC_SpinBoxEditField, widget());
break;
case ValueUp:
rect = widget()->style()->subControlRect(QStyle::CC_SpinBox, &so,
QStyle::SC_SpinBoxUp, widget());
break;
case ValueDown:
rect = widget()->style()->subControlRect(QStyle::CC_SpinBox, &so,
QStyle::SC_SpinBoxDown, widget());
break;
default:
rect = so.rect;
break;
}
QPoint tl = widget()->mapToGlobal(QPoint(0, 0));
return QRect(tl.x() + rect.x(), tl.y() + rect.y(), rect.width(), rect.height());
}
/*! \reimp */
int QAccessibleAbstractSpinBox::navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
{
*target = 0;
if (entry) switch (rel) {
case Child:
return entry <= childCount() ? entry : -1;
case QAccessible::Left:
return (entry == ValueUp || entry == ValueDown) ? Editor : -1;
case QAccessible::Right:
return entry == Editor ? ValueUp : -1;
case QAccessible::Up:
return entry == ValueDown ? ValueUp : -1;
case QAccessible::Down:
return entry == ValueUp ? ValueDown : -1;
default:
break;
}
return QAccessibleWidget::navigate(rel, entry, target);
}
/*! \reimp */
QString QAccessibleAbstractSpinBox::text(Text t, int child) const
{
if (!abstractSpinBox()->isVisible())
return QString();
switch (t) {
case Name:
switch (child) {
case ValueUp:
return QSpinBox::tr("More");
case ValueDown:
return QSpinBox::tr("Less");
}
break;
case Value:
if (child == Editor || child == SpinBoxSelf)
return abstractSpinBox()->text();
break;
default:
break;
}
return QAccessibleWidget::text(t, 0);
}
/*! \reimp */
QAccessible::Role QAccessibleAbstractSpinBox::role(int child) const
{
switch(child) {
case Editor:
return EditableText;
case ValueUp:
case ValueDown:
return PushButton;
default:
break;
}
return QAccessibleWidget::role(child);
}
/*! \reimp */
bool QAccessibleAbstractSpinBox::doAction(int action, int child, const QVariantList &params)
{
if (!widget()->isEnabled())
return false;
if (action == Press) {
switch(child) {
case ValueUp:
abstractSpinBox()->stepUp();
return true;
case ValueDown:
abstractSpinBox()->stepDown();
return true;
default:
break;
}
}
return QAccessibleWidget::doAction(action, 0, params);
}
QVariant QAccessibleAbstractSpinBox::currentValue()
{
QVariant result = abstractSpinBox()->property("value");
QVariant::Type type = result.type();
// IA2 only allows numeric types
if (type == QVariant::Int || type == QVariant::UInt || type == QVariant::LongLong
|| type == QVariant::ULongLong || type == QVariant::Double)
return result;
return QVariant();
}
void QAccessibleAbstractSpinBox::setCurrentValue(const QVariant &value)
{
abstractSpinBox()->setProperty("value", value);
}
QVariant QAccessibleAbstractSpinBox::maximumValue()
{
return abstractSpinBox()->property("maximum");
}
QVariant QAccessibleAbstractSpinBox::minimumValue()
{
return abstractSpinBox()->property("minimum");
}
QVariant QAccessibleAbstractSpinBox::invokeMethod(Method method, int child, const QVariantList &params)
{
switch (method) {
case ListSupportedMethods: {
QSet<QAccessible::Method> set;
set << ListSupportedMethods;
return QVariant::fromValue(set | qvariant_cast<QSet<QAccessible::Method> >(
QAccessibleWidget::invokeMethod(method, child, params)));
}
default:
return QAccessibleWidget::invokeMethod(method, child, params);
}
}
/*!
\class QAccessibleSpinBox
\brief The QAccessibleSpinBox class implements the QAccessibleInterface for spinbox widgets.
\internal
\ingroup accessibility
*/
/*!
\enum QAccessibleAbstractSpinBox::SpinBoxElements
This enum identifies the components of the spin box.
\value SpinBoxSelf The spin box as a whole
\value Editor The line edit sub-widget.
\value ValueUp The up sub-widget (i.e. the up arrow or + button)
\value ValueDown The down sub-widget (i.e. the down arrow or - button)
*/
/*!
Constructs a QAccessibleSpinWidget object for \a w.
*/
QAccessibleSpinBox::QAccessibleSpinBox(QWidget *w)
: QAccessibleAbstractSpinBox(w)
{
Q_ASSERT(spinBox());
addControllingSignal(QLatin1String("valueChanged(int)"));
addControllingSignal(QLatin1String("valueChanged(QString)"));
}
/*!
Returns the underlying QSpinBox.
*/
QSpinBox *QAccessibleSpinBox::spinBox() const
{
return qobject_cast<QSpinBox*>(object());
}
/*! \reimp */
QAccessible::State QAccessibleSpinBox::state(int child) const
{
State state = QAccessibleAbstractSpinBox::state(child);
switch(child) {
case ValueUp:
if (spinBox()->value() >= spinBox()->maximum())
state |= Unavailable;
return state;
case ValueDown:
if (spinBox()->value() <= spinBox()->minimum())
state |= Unavailable;
return state;
default:
break;
}
return state;
}
/*! \reimp */
bool QAccessibleSpinBox::doAction(int action, int child, const QVariantList &params)
{
if (!widget()->isEnabled())
return false;
if (action == Press) {
switch(child) {
case ValueUp:
if (spinBox()->value() >= spinBox()->maximum())
return false;
spinBox()->stepUp();
return true;
case ValueDown:
if (spinBox()->value() <= spinBox()->minimum())
return false;
spinBox()->stepDown();
return true;
default:
break;
}
}
return QAccessibleAbstractSpinBox::doAction(action, 0, params);
}
// ================================== QAccessibleDoubleSpinBox ==================================
QAccessibleDoubleSpinBox::QAccessibleDoubleSpinBox(QWidget *widget)
: QAccessibleWidget(widget, SpinBox)
{
Q_ASSERT(qobject_cast<QDoubleSpinBox *>(widget));
addControllingSignal(QLatin1String("valueChanged(double)"));
addControllingSignal(QLatin1String("valueChanged(QString)"));
}
/*!
Returns the underlying QDoubleSpinBox.
*/
QDoubleSpinBox *QAccessibleDoubleSpinBox::doubleSpinBox() const
{
return static_cast<QDoubleSpinBox*>(object());
}
/*! \reimp */
int QAccessibleDoubleSpinBox::childCount() const
{
return ValueDown;
}
/*! \reimp */
QRect QAccessibleDoubleSpinBox::rect(int child) const
{
QRect rect;
if (!doubleSpinBox()->isVisible())
return rect;
QStyleOptionSpinBox spinBoxOption;
spinBoxOption.initFrom(doubleSpinBox());
switch (child) {
case Editor:
rect = doubleSpinBox()->style()->subControlRect(QStyle::CC_SpinBox, &spinBoxOption,
QStyle::SC_SpinBoxEditField, doubleSpinBox());
break;
case ValueUp:
rect = doubleSpinBox()->style()->subControlRect(QStyle::CC_SpinBox, &spinBoxOption,
QStyle::SC_SpinBoxUp, doubleSpinBox());
break;
case ValueDown:
rect = doubleSpinBox()->style()->subControlRect(QStyle::CC_SpinBox, &spinBoxOption,
QStyle::SC_SpinBoxDown, doubleSpinBox());
break;
default:
rect = spinBoxOption.rect;
break;
}
const QPoint globalPos = doubleSpinBox()->mapToGlobal(QPoint(0, 0));
return QRect(globalPos.x() + rect.x(), globalPos.y() + rect.y(), rect.width(), rect.height());
}
/*! \reimp */
int QAccessibleDoubleSpinBox::navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
{
if (entry <= 0)
return QAccessibleWidget::navigate(relation, entry, target);
*target = 0;
switch (relation) {
case Child:
return entry <= childCount() ? entry : -1;
case QAccessible::Left:
return (entry == ValueUp || entry == ValueDown) ? Editor : -1;
case QAccessible::Right:
return entry == Editor ? ValueUp : -1;
case QAccessible::Up:
return entry == ValueDown ? ValueUp : -1;
case QAccessible::Down:
return entry == ValueUp ? ValueDown : -1;
default:
break;
}
return QAccessibleWidget::navigate(relation, entry, target);
}
QVariant QAccessibleDoubleSpinBox::invokeMethod(QAccessible::Method, int, const QVariantList &)
{
return QVariant();
}
/*! \reimp */
QString QAccessibleDoubleSpinBox::text(Text textType, int child) const
{
switch (textType) {
case Name:
if (child == ValueUp)
return QDoubleSpinBox::tr("More");
else if (child == ValueDown)
return QDoubleSpinBox::tr("Less");
break;
case Value:
if (child == Editor || child == SpinBoxSelf)
return doubleSpinBox()->textFromValue(doubleSpinBox()->value());
break;
default:
break;
}
return QAccessibleWidget::text(textType, 0);
}
/*! \reimp */
QAccessible::Role QAccessibleDoubleSpinBox::role(int child) const
{
switch (child) {
case Editor:
return EditableText;
case ValueUp:
case ValueDown:
return PushButton;
default:
break;
}
return QAccessibleWidget::role(child);
}
/*! \reimp */
QAccessible::State QAccessibleDoubleSpinBox::state(int child) const
{
State state = QAccessibleWidget::state(child);
switch (child) {
case ValueUp:
if (doubleSpinBox()->value() >= doubleSpinBox()->maximum())
state |= Unavailable;
break;
case ValueDown:
if (doubleSpinBox()->value() <= doubleSpinBox()->minimum())
state |= Unavailable;
break;
default:
break;
}
return state;
}
#endif // QT_NO_SPINBOX
#ifndef QT_NO_SCROLLBAR
/*!
\class QAccessibleScrollBar
\brief The QAccessibleScrollBar class implements the QAccessibleInterface for scroll bars.
\internal
\ingroup accessibility
*/
/*!
\enum QAccessibleScrollBar::ScrollBarElements
This enum identifies the components of the scroll bar.
\value ScrollBarSelf The scroll bar as a whole.
\value LineUp The up arrow button.
\value PageUp The area between the position and the up arrow button.
\value Position The position marking rectangle.
\value PageDown The area between the position and the down arrow button.
\value LineDown The down arrow button.
*/
/*!
Constructs a QAccessibleScrollBar object for \a w.
\a name is propagated to the QAccessibleWidget constructor.
*/
QAccessibleScrollBar::QAccessibleScrollBar(QWidget *w)
: QAccessibleAbstractSlider(w, ScrollBar)
{
Q_ASSERT(scrollBar());
addControllingSignal(QLatin1String("valueChanged(int)"));
}
/*! Returns the scroll bar. */
QScrollBar *QAccessibleScrollBar::scrollBar() const
{
return qobject_cast<QScrollBar*>(object());
}
/*! \reimp */
QRect QAccessibleScrollBar::rect(int child) const
{
if (!scrollBar()->isVisible())
return QRect();
QStyle::SubControl subControl;
switch (child) {
case LineUp:
subControl = QStyle ::SC_ScrollBarSubLine;
break;
case PageUp:
subControl = QStyle::SC_ScrollBarSubPage;
break;
case Position:
subControl = QStyle::SC_ScrollBarSlider;
break;
case PageDown:
subControl = QStyle::SC_ScrollBarAddPage;
break;
case LineDown:
subControl = QStyle::SC_ScrollBarAddLine;
break;
default:
return QAccessibleAbstractSlider::rect(child);
}
const QStyleOptionSlider option = qt_qscrollbarStyleOption(scrollBar());
const QRect rect = scrollBar()->style()->subControlRect(QStyle::CC_ScrollBar, &option,
subControl, scrollBar());
const QPoint tp = scrollBar()->mapToGlobal(QPoint(0,0));
return QRect(tp.x() + rect.x(), tp.y() + rect.y(), rect.width(), rect.height());
}
/*! \reimp */
int QAccessibleScrollBar::childCount() const
{
return LineDown;
}
/*! \reimp */
QString QAccessibleScrollBar::text(Text t, int child) const
{
switch (t) {
case Value:
if (!child || child == Position)
return QString::number(scrollBar()->value());
return QString();
case Name:
switch (child) {
case LineUp:
return QScrollBar::tr("Line up");
case PageUp:
return QScrollBar::tr("Page up");
case Position:
return QScrollBar::tr("Position");
case PageDown:
return QScrollBar::tr("Page down");
case LineDown:
return QScrollBar::tr("Line down");
}
break;
default:
break;
}
return QAccessibleAbstractSlider::text(t, child);
}
/*! \reimp */
QAccessible::Role QAccessibleScrollBar::role(int child) const
{
switch (child) {
case LineUp:
case PageUp:
case PageDown:
case LineDown:
return PushButton;
case Position:
return Indicator;
default:
return ScrollBar;
}
}
/*! \reimp */
QAccessible::State QAccessibleScrollBar::state(int child) const
{
const State parentState = QAccessibleAbstractSlider::state(0);
if (child == 0)
return parentState;
// Inherit the Invisible state from parent.
State state = parentState & QAccessible::Invisible;
// Disable left/right if we are at the minimum/maximum.
const QScrollBar * const scrollBar = QAccessibleScrollBar::scrollBar();
switch (child) {
case LineUp:
case PageUp:
if (scrollBar->value() <= scrollBar->minimum())
state |= Unavailable;
break;
case LineDown:
case PageDown:
if (scrollBar->value() >= scrollBar->maximum())
state |= Unavailable;
break;
case Position:
default:
break;
}
return state;
}
#endif // QT_NO_SCROLLBAR
#ifndef QT_NO_SLIDER
/*!
\class QAccessibleSlider
\brief The QAccessibleSlider class implements the QAccessibleInterface for sliders.
\internal
\ingroup accessibility
*/
/*!
\enum QAccessibleSlider::SliderElements
This enum identifies the components of the slider.
\value SliderSelf The slider as a whole.
\value PageLeft The area to the left of the position.
\value Position The position indicator.
\value PageRight The area to the right of the position.
*/
/*!
Constructs a QAccessibleScrollBar object for \a w.
\a name is propagated to the QAccessibleWidget constructor.
*/
QAccessibleSlider::QAccessibleSlider(QWidget *w)
: QAccessibleAbstractSlider(w)
{
Q_ASSERT(slider());
addControllingSignal(QLatin1String("valueChanged(int)"));
}
/*! Returns the slider. */
QSlider *QAccessibleSlider::slider() const
{
return qobject_cast<QSlider*>(object());
}
/*! \reimp */
QRect QAccessibleSlider::rect(int child) const
{
QRect rect;
if (!slider()->isVisible())
return rect;
const QStyleOptionSlider option = qt_qsliderStyleOption(slider());
QRect srect = slider()->style()->subControlRect(QStyle::CC_Slider, &option,
QStyle::SC_SliderHandle, slider());
switch (child) {
case PageLeft:
if (slider()->orientation() == Qt::Vertical)
rect = QRect(0, 0, slider()->width(), srect.y());
else
rect = QRect(0, 0, srect.x(), slider()->height());
break;
case Position:
rect = srect;
break;
case PageRight:
if (slider()->orientation() == Qt::Vertical)
rect = QRect(0, srect.y() + srect.height(), slider()->width(), slider()->height()- srect.y() - srect.height());
else
rect = QRect(srect.x() + srect.width(), 0, slider()->width() - srect.x() - srect.width(), slider()->height());
break;
default:
return QAccessibleAbstractSlider::rect(child);
}
QPoint tp = slider()->mapToGlobal(QPoint(0,0));
return QRect(tp.x() + rect.x(), tp.y() + rect.y(), rect.width(), rect.height());
}
/*! \reimp */
int QAccessibleSlider::childCount() const
{
return PageRight;
}
/*! \reimp */
QString QAccessibleSlider::text(Text t, int child) const
{
switch (t) {
case Value:
if (!child || child == 2)
return QString::number(slider()->value());
return QString();
case Name:
switch (child) {
case PageLeft:
return slider()->orientation() == Qt::Horizontal ?
QSlider::tr("Page left") : QSlider::tr("Page up");
case Position:
return QSlider::tr("Position");
case PageRight:
return slider()->orientation() == Qt::Horizontal ?
QSlider::tr("Page right") : QSlider::tr("Page down");
}
break;
default:
break;
}
return QAccessibleAbstractSlider::text(t, child);
}
/*! \reimp */
QAccessible::Role QAccessibleSlider::role(int child) const
{
switch (child) {
case PageLeft:
case PageRight:
return PushButton;
case Position:
return Indicator;
default:
return Slider;
}
}
/*! \reimp */
QAccessible::State QAccessibleSlider::state(int child) const
{
const State parentState = QAccessibleAbstractSlider::state(0);
if (child == 0)
return parentState;
// Inherit the Invisible state from parent.
State state = parentState & QAccessible::Invisible;
// Disable left/right if we are at the minimum/maximum.
const QSlider * const slider = QAccessibleSlider::slider();
switch (child) {
case PageLeft:
if (slider->value() <= slider->minimum())
state |= Unavailable;
break;
case PageRight:
if (slider->value() >= slider->maximum())
state |= Unavailable;
break;
case Position:
default:
break;
}
return state;
}
/*!
\fn int QAccessibleSlider::defaultAction(int child) const
Returns the default action for the given \a child. The base class
implementation returns 0.
*/
int QAccessibleSlider::defaultAction(int /*child*/) const
{
/*
switch (child) {
case SliderSelf:
return SetFocus;
case PageLeft:
return Press;
case PageRight:
return Press;
}
*/
return 0;
}
/*! \internal */
QString QAccessibleSlider::actionText(int /*action*/, Text /*t*/, int /*child*/) const
{
return QLatin1String("");
}
QAccessibleAbstractSlider::QAccessibleAbstractSlider(QWidget *w, Role r)
: QAccessibleWidget(w, r)
{
Q_ASSERT(qobject_cast<QAbstractSlider *>(w));
}
QVariant QAccessibleAbstractSlider::invokeMethod(Method method, int child, const QVariantList &params)
{
switch (method) {
case ListSupportedMethods: {
QSet<QAccessible::Method> set;
set << ListSupportedMethods;
return QVariant::fromValue(set | qvariant_cast<QSet<QAccessible::Method> >(
QAccessibleWidget::invokeMethod(method, child, params)));
}
default:
return QAccessibleWidget::invokeMethod(method, child, params);
}
}
QVariant QAccessibleAbstractSlider::currentValue()
{
return abstractSlider()->value();
}
void QAccessibleAbstractSlider::setCurrentValue(const QVariant &value)
{
abstractSlider()->setValue(value.toInt());
}
QVariant QAccessibleAbstractSlider::maximumValue()
{
return abstractSlider()->maximum();
}
QVariant QAccessibleAbstractSlider::minimumValue()
{
return abstractSlider()->minimum();
}
QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const
{
return static_cast<QAbstractSlider *>(object());
}
#endif // QT_NO_SLIDER
#ifndef QT_NO_DIAL
// ======================================= QAccessibleDial ======================================
QAccessibleDial::QAccessibleDial(QWidget *widget)
: QAccessibleWidget(widget, Dial)
{
Q_ASSERT(qobject_cast<QDial *>(widget));
addControllingSignal(QLatin1String("valueChanged(int)"));
}
QRect QAccessibleDial::rect(int child) const
{
QRect rect;
if (!dial()->isVisible())
return rect;
switch (child) {
case Self:
return QAccessibleWidget::rect(child);
case SpeedoMeter: {
// Mixture from qcommonstyle.cpp (focus rect).
int width = dial()->width();
int height = dial()->height();
qreal radius = qMin(width, height) / 2.0;
qreal delta = radius / 6.0;
qreal dx = delta + (width - 2 * radius) / 2.0;
qreal dy = delta + (height - 2 * radius) / 2.0;
rect = QRect(int(dx), int(dy), int(radius * 2 - 2 * delta), int(radius * 2 - 2 * delta));
if (dial()->notchesVisible()) {
rect.translate(int(-radius / 6), int(-radius / 6));
rect.setWidth(rect.width() + int(radius / 3));
rect.setHeight(rect.height() + int(radius / 3));
}
break;
}
case SliderHandle: {
// Mixture from qcommonstyle.cpp and qdial.cpp.
int sliderValue = !dial()->invertedAppearance() ? dial()->value()
: (dial()->maximum() - dial()->value());
qreal angle = 0;
if (dial()->maximum() == dial()->minimum()) {
angle = M_PI_2;
} else if (dial()->wrapping()) {
angle = M_PI * 3 / 2 - (sliderValue - dial()->minimum()) * 2 * M_PI
/ (dial()->maximum() - dial()->minimum());
} else {
angle = (M_PI * 8 - (sliderValue - dial()->minimum()) * 10 * M_PI
/ (dial()->maximum() - dial()->minimum())) / 6;
}
int width = dial()->rect().width();
int height = dial()->rect().height();
int radius = qMin(width, height) / 2;
int xc = width / 2;
int yc = height / 2;
int bigLineSize = radius / 6;
if (bigLineSize < 4)
bigLineSize = 4;
if (bigLineSize > radius / 2)
bigLineSize = radius / 2;
int len = radius - bigLineSize - 5;
if (len < 5)
len = 5;
int back = len / 2;
QPolygonF arrow(3);
arrow[0] = QPointF(0.5 + xc + len * qCos(angle),
0.5 + yc - len * qSin(angle));
arrow[1] = QPointF(0.5 + xc + back * qCos(angle + M_PI * 5 / 6),
0.5 + yc - back * qSin(angle + M_PI * 5 / 6));
arrow[2] = QPointF(0.5 + xc + back * qCos(angle - M_PI * 5 / 6),
0.5 + yc - back * qSin(angle - M_PI * 5 / 6));
rect = arrow.boundingRect().toRect();
break;
}
default:
return QRect();
}
QPoint globalPos = dial()->mapToGlobal(QPoint(0,0));
return QRect(globalPos.x() + rect.x(), globalPos.y() + rect.y(), rect.width(), rect.height());
}
int QAccessibleDial::childCount() const
{
return SliderHandle;
}
QString QAccessibleDial::text(Text textType, int child) const
{
if (textType == Value && child >= Self && child <= SliderHandle)
return QString::number(dial()->value());
if (textType == Name) {
switch (child) {
case Self:
if (!widget()->accessibleName().isEmpty())
return widget()->accessibleName();
return QDial::tr("QDial");
case SpeedoMeter:
return QDial::tr("SpeedoMeter");
case SliderHandle:
return QDial::tr("SliderHandle");
}
}
return QAccessibleWidget::text(textType, child);
}
QAccessible::Role QAccessibleDial::role(int child) const
{
if (child == SpeedoMeter)
return Slider;
else if (child == SliderHandle)
return Indicator;
return QAccessibleWidget::role(child);
}
QAccessible::State QAccessibleDial::state(int child) const
{
const State parentState = QAccessibleWidget::state(0);
if (child == SliderHandle)
return parentState | HotTracked;
return parentState;
}
QVariant QAccessibleDial::invokeMethod(Method, int, const QVariantList &)
{
return QVariant();
}
QDial *QAccessibleDial::dial() const
{
return static_cast<QDial*>(object());
}
#endif // QT_NO_DIAL
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE

View file

@ -1,215 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef RANGECONTROLS_H
#define RANGECONTROLS_H
#include <QtGui/qaccessiblewidget.h>
#include <QtGui/qaccessible2.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
class QAbstractSpinBox;
class QAbstractSlider;
class QScrollBar;
class QSlider;
class QSpinBox;
class QDoubleSpinBox;
class QDial;
#ifndef QT_NO_SPINBOX
class QAccessibleAbstractSpinBox: public QAccessibleWidget, public QAccessibleValueInterface
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleAbstractSpinBox(QWidget *w);
enum SpinBoxElements {
SpinBoxSelf = 0,
Editor,
ValueUp,
ValueDown
};
int childCount() const;
QRect rect(int child) const;
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const;
QString text(Text t, int child) const;
Role role(int child) const;
bool doAction(int action, int child, const QVariantList &params);
QVariant invokeMethod(Method method, int child, const QVariantList &params);
// QAccessibleValueInterface
QVariant currentValue();
void setCurrentValue(const QVariant &value);
QVariant maximumValue();
QVariant minimumValue();
protected:
QAbstractSpinBox *abstractSpinBox() const;
};
class QAccessibleSpinBox : public QAccessibleAbstractSpinBox
{
public:
explicit QAccessibleSpinBox(QWidget *w);
State state(int child) const;
bool doAction(int action, int child, const QVariantList &params);
protected:
QSpinBox *spinBox() const;
};
class QAccessibleDoubleSpinBox : public QAccessibleWidget
{
public:
explicit QAccessibleDoubleSpinBox(QWidget *widget);
enum DoubleSpinBoxElements {
SpinBoxSelf = 0,
Editor,
ValueUp,
ValueDown
};
int childCount() const;
QRect rect(int child) const;
int navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
protected:
QDoubleSpinBox *doubleSpinBox() const;
};
#endif // QT_NO_SPINBOX
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleAbstractSlider(QWidget *w, Role r = Slider);
QVariant invokeMethod(Method method, int child, const QVariantList &params);
// QAccessibleValueInterface
QVariant currentValue();
void setCurrentValue(const QVariant &value);
QVariant maximumValue();
QVariant minimumValue();
protected:
QAbstractSlider *abstractSlider() const;
};
#ifndef QT_NO_SCROLLBAR
class QAccessibleScrollBar : public QAccessibleAbstractSlider
{
public:
explicit QAccessibleScrollBar(QWidget *w);
enum ScrollBarElements {
ScrollBarSelf = 0,
LineUp,
PageUp,
Position,
PageDown,
LineDown
};
int childCount() const;
QRect rect(int child) const;
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
protected:
QScrollBar *scrollBar() const;
};
#endif // QT_NO_SCROLLBAR
#ifndef QT_NO_SLIDER
class QAccessibleSlider : public QAccessibleAbstractSlider
{
public:
explicit QAccessibleSlider(QWidget *w);
enum SliderElements {
SliderSelf = 0,
PageLeft,
Position,
PageRight
};
int childCount() const;
QRect rect(int child) const;
QString text(Text t, int child) const;
Role role(int child) const;
State state(int child) const;
int defaultAction(int child) const;
QString actionText(int action, Text t, int child) const;
protected:
QSlider *slider() const;
};
#endif // QT_NO_SLIDER
#ifndef QT_NO_DIAL
class QAccessibleDial : public QAccessibleWidget
{
public:
explicit QAccessibleDial(QWidget *w);
enum DialElements {
Self = 0,
SpeedoMeter,
SliderHandle
};
int childCount() const;
QRect rect(int child) const;
QString text(Text textType, int child) const;
Role role(int child) const;
State state(int child) const;
QVariant invokeMethod(Method method, int child, const QVariantList &params);
protected:
QDial *dial() const;
};
#endif // QT_NO_DIAL
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // RANGECONTROLS_H

View file

@ -1,994 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "simplewidgets.h"
#include "qabstractbutton.h"
#include "qcheckbox.h"
#include "qpushbutton.h"
#include "qprogressbar.h"
#include "qstatusbar.h"
#include "qradiobutton.h"
#include "qtoolbutton.h"
#include "qlabel.h"
#include "qgroupbox.h"
#include "qlcdnumber.h"
#include "qtextdocument.h"
#include "qlineedit.h"
#include "qlineedit_p.h"
#include "qstyle.h"
#include "qstyleoption.h"
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
using namespace QAccessible2;
extern QList<QWidget*> childWidgets(const QWidget *widget, bool includeTopLevel = false);
QString Q_GUI_EXPORT qt_accStripAmp(const QString &text);
QString Q_GUI_EXPORT qt_accHotKey(const QString &text);
QString Q_GUI_EXPORT qTextBeforeOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text);
QString Q_GUI_EXPORT qTextAtOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text);
QString Q_GUI_EXPORT qTextAfterOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset, const QString& text);
/*!
\class QAccessibleButton
\brief The QAccessibleButton class implements the QAccessibleInterface for button type widgets.
\internal
\ingroup accessibility
*/
/*!
Creates a QAccessibleButton object for \a w.
\a role is propagated to the QAccessibleWidget constructor.
*/
QAccessibleButton::QAccessibleButton(QWidget *w, Role role)
: QAccessibleWidget(w, role)
{
Q_ASSERT(button());
if (button()->isCheckable())
addControllingSignal(QLatin1String("toggled(bool)"));
else
addControllingSignal(QLatin1String("clicked()"));
}
/*! Returns the button. */
QAbstractButton *QAccessibleButton::button() const
{
return qobject_cast<QAbstractButton*>(object());
}
/*! \reimp */
QString QAccessibleButton::actionText(int action, Text text, int child) const
{
if (child)
return QString();
if (text == Name) switch (action) {
case Press:
case DefaultAction: // press, checking or open
switch (role(0)) {
case ButtonMenu:
return QPushButton::tr("Open");
case CheckBox:
{
if (state(child) & Checked)
return QCheckBox::tr("Uncheck");
QCheckBox *cb = qobject_cast<QCheckBox*>(object());
if (!cb || !cb->isTristate() || cb->checkState() == Qt::PartiallyChecked)
return QCheckBox::tr("Check");
return QCheckBox::tr("Toggle");
}
break;
case RadioButton:
return QRadioButton::tr("Check");
default:
break;
}
break;
}
return QAccessibleWidget::actionText(action, text, child);
}
/*! \reimp */
bool QAccessibleButton::doAction(int action, int child, const QVariantList &params)
{
if (child || !widget()->isEnabled())
return false;
switch (action) {
case DefaultAction:
case Press:
{
#ifndef QT_NO_MENU
QPushButton *pb = qobject_cast<QPushButton*>(object());
if (pb && pb->menu())
pb->showMenu();
else
#endif
button()->animateClick();
}
return true;
}
return QAccessibleWidget::doAction(action, child, params);
}
/*! \reimp */
QString QAccessibleButton::text(Text t, int child) const
{
QString str;
switch (t) {
case Accelerator:
{
#ifndef QT_NO_SHORTCUT
QPushButton *pb = qobject_cast<QPushButton*>(object());
if (pb && pb->isDefault())
str = QKeySequence(Qt::Key_Enter).toString();
#endif
if (str.isEmpty())
str = qt_accHotKey(button()->text());
}
break;
case Name:
str = widget()->accessibleName();
if (str.isEmpty())
str = button()->text();
break;
default:
break;
}
if (str.isEmpty())
str = QAccessibleWidget::text(t, child);
return qt_accStripAmp(str);
}
/*! \reimp */
QAccessible::State QAccessibleButton::state(int child) const
{
State state = QAccessibleWidget::state(child);
QAbstractButton *b = button();
QCheckBox *cb = qobject_cast<QCheckBox *>(b);
if (b->isChecked())
state |= Checked;
else if (cb && cb->checkState() == Qt::PartiallyChecked)
state |= Mixed;
if (b->isDown())
state |= Pressed;
QPushButton *pb = qobject_cast<QPushButton*>(b);
if (pb) {
if (pb->isDefault())
state |= DefaultButton;
#ifndef QT_NO_MENU
if (pb->menu())
state |= HasPopup;
#endif
}
return state;
}
int QAccessibleButton::actionCount()
{
return 1;
}
void QAccessibleButton::doAction(int actionIndex)
{
switch (actionIndex) {
case 0:
button()->click();
break;
}
}
QString QAccessibleButton::description(int actionIndex)
{
switch (actionIndex) {
case 0:
if (button()->isCheckable()) {
return QLatin1String("Toggles the button.");
}
return QLatin1String("Clicks the button.");
default:
return QString();
}
}
QString QAccessibleButton::name(int actionIndex)
{
switch (actionIndex) {
case 0:
if (button()->isCheckable()) {
if (button()->isChecked()) {
return QLatin1String("Uncheck");
} else {
return QLatin1String("Check");
}
}
return QLatin1String("Press");
default:
return QString();
}
}
QString QAccessibleButton::localizedName(int actionIndex)
{
switch (actionIndex) {
case 0:
if (button()->isCheckable()) {
if (button()->isChecked()) {
return tr("Uncheck");
} else {
return tr("Check");
}
}
return tr("Press");
default:
return QString();
}
}
QStringList QAccessibleButton::keyBindings(int actionIndex)
{
switch (actionIndex) {
#ifndef QT_NO_SHORTCUT
case 0:
return QStringList() << button()->shortcut().toString();
#endif
default:
return QStringList();
}
}
#ifndef QT_NO_TOOLBUTTON
/*!
\class QAccessibleToolButton
\brief The QAccessibleToolButton class implements the QAccessibleInterface for tool buttons.
\internal
\ingroup accessibility
*/
/*!
\enum QAccessibleToolButton::ToolButtonElements
This enum identifies the components of the tool button.
\value ToolButtonSelf The tool button as a whole.
\value ButtonExecute The button.
\value ButtonDropMenu The drop down menu.
*/
/*!
Creates a QAccessibleToolButton object for \a w.
\a role is propagated to the QAccessibleWidget constructor.
*/
QAccessibleToolButton::QAccessibleToolButton(QWidget *w, Role role)
: QAccessibleButton(w, role)
{
Q_ASSERT(toolButton());
}
/*! Returns the button. */
QToolButton *QAccessibleToolButton::toolButton() const
{
return qobject_cast<QToolButton*>(object());
}
/*!
Returns true if this tool button is a split button.
*/
bool QAccessibleToolButton::isSplitButton() const
{
#ifndef QT_NO_MENU
return toolButton()->menu() && toolButton()->popupMode() == QToolButton::MenuButtonPopup;
#else
return false;
#endif
}
/*! \reimp */
QAccessible::Role QAccessibleToolButton::role(int child) const
{
if (isSplitButton()) switch(child) {
case ButtonExecute:
return PushButton;
case ButtonDropMenu:
return ButtonMenu;
}
return QAccessibleButton::role(child);
}
/*! \reimp */
QAccessible::State QAccessibleToolButton::state(int child) const
{
QAccessible::State st = QAccessibleButton::state(child);
if (toolButton()->autoRaise())
st |= HotTracked;
#ifndef QT_NO_MENU
if (toolButton()->menu() && child != ButtonExecute)
st |= HasPopup;
#endif
return st;
}
/*! \reimp */
int QAccessibleToolButton::childCount() const
{
if (!toolButton()->isVisible())
return 0;
return isSplitButton() ? ButtonDropMenu : 0;
}
/*!
\internal
Returns the rectangle occupied by this button, depending on \a
child.
*/
QRect QAccessibleToolButton::rect(int child) const
{
if (!toolButton()->isVisible())
return QRect();
if (!child)
return QAccessibleButton::rect(child);
QStyleOptionToolButton opt;
opt.init(widget());
QRect subrect = widget()->style()->subControlRect(QStyle::CC_ToolButton, &opt,
QStyle::SC_ToolButtonMenu, toolButton());
if (child == ButtonExecute)
subrect = QRect(0, 0, subrect.x(), widget()->height());
QPoint ntl = widget()->mapToGlobal(subrect.topLeft());
subrect.moveTopLeft(ntl);
return subrect;
}
/*!
\internal
Returns the button's text label, depending on the text \a t, and
the \a child.
*/
QString QAccessibleToolButton::text(Text t, int child) const
{
QString str;
switch (t) {
case Name:
str = toolButton()->accessibleName();
if (str.isEmpty())
str = toolButton()->text();
break;
default:
break;
}
if (str.isEmpty())
str = QAccessibleButton::text(t, child);;
return qt_accStripAmp(str);
}
/*!
\internal
If \a text is \c Name, then depending on the \a child or the \a
action, an action text is returned. This is a translated string
which in English is one of "Press", "Open", or "Set Focus". If \a
text is not \c Name, an empty string is returned.
*/
QString QAccessibleToolButton::actionText(int action, Text text, int child) const
{
if (text == Name) switch(child) {
case ButtonExecute:
return QToolButton::tr("Press");
case ButtonDropMenu:
return QToolButton::tr("Open");
default:
switch(action) {
case 0:
return QToolButton::tr("Press");
case 1:
#ifndef QT_NO_MENU
if (toolButton()->menu())
return QToolButton::tr("Open");
#endif
//fall through
case 2:
return QLatin1String("Set Focus");
}
}
return QString();
}
/*!
\internal
*/
bool QAccessibleToolButton::doAction(int action, int child, const QVariantList &params)
{
if (!widget()->isEnabled())
return false;
if (action == 1 || child == ButtonDropMenu) {
if(!child)
toolButton()->setDown(true);
#ifndef QT_NO_MENU
toolButton()->showMenu();
#endif
return true;
}
return QAccessibleButton::doAction(action, 0, params);
}
#endif // QT_NO_TOOLBUTTON
/*!
\class QAccessibleDisplay
\brief The QAccessibleDisplay class implements the QAccessibleInterface for widgets that display information.
\internal
\ingroup accessibility
*/
/*!
Constructs a QAccessibleDisplay object for \a w.
\a role is propagated to the QAccessibleWidget constructor.
*/
QAccessibleDisplay::QAccessibleDisplay(QWidget *w, Role role)
: QAccessibleWidget(w, role)
{
}
/*! \reimp */
QAccessible::Role QAccessibleDisplay::role(int child) const
{
QLabel *l = qobject_cast<QLabel*>(object());
if (l) {
if (l->pixmap())
return Graphic;
#ifndef QT_NO_MOVIE
if (l->movie())
return Animation;
#endif
#ifndef QT_NO_PROGRESSBAR
} else if (qobject_cast<QProgressBar*>(object())) {
return ProgressBar;
#endif
} else if (qobject_cast<QStatusBar*>(object())) {
return StatusBar;
}
return QAccessibleWidget::role(child);
}
/*! \reimp */
QString QAccessibleDisplay::text(Text t, int child) const
{
QString str;
switch (t) {
case Name:
str = widget()->accessibleName();
if (str.isEmpty()) {
if (qobject_cast<QLabel*>(object())) {
QLabel *label = qobject_cast<QLabel*>(object());
str = label->text();
if (label->textFormat() == Qt::RichText
|| (label->textFormat() == Qt::AutoText && Qt::mightBeRichText(str))) {
QTextDocument doc;
doc.setHtml(str);
str = doc.toPlainText();
}
#ifndef QT_NO_LCDNUMBER
} else if (qobject_cast<QLCDNumber*>(object())) {
QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
if (l->digitCount())
str = QString::number(l->value());
else
str = QString::number(l->intValue());
#endif
} else if (qobject_cast<QStatusBar*>(object())) {
return qobject_cast<QStatusBar*>(object())->currentMessage();
}
}
break;
case Value:
#ifndef QT_NO_PROGRESSBAR
if (qobject_cast<QProgressBar*>(object()))
str = QString::number(qobject_cast<QProgressBar*>(object())->value());
#endif
break;
default:
break;
}
if (str.isEmpty())
str = QAccessibleWidget::text(t, child);;
return qt_accStripAmp(str);
}
/*! \reimp */
QAccessible::Relation QAccessibleDisplay::relationTo(int child, const QAccessibleInterface *other,
int otherChild) const
{
Relation relation = QAccessibleWidget::relationTo(child, other, otherChild);
if (child || otherChild)
return relation;
QObject *o = other->object();
QLabel *label = qobject_cast<QLabel*>(object());
if (label) {
#ifndef QT_NO_SHORTCUT
if (o == label->buddy())
relation |= Label;
#endif
}
return relation;
}
/*! \reimp */
int QAccessibleDisplay::navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
{
*target = 0;
if (rel == Labelled) {
QObject *targetObject = 0;
QLabel *label = qobject_cast<QLabel*>(object());
if (label) {
#ifndef QT_NO_SHORTCUT
if (entry == 1)
targetObject = label->buddy();
#endif
}
*target = QAccessible::queryAccessibleInterface(targetObject);
if (*target)
return 0;
}
return QAccessibleWidget::navigate(rel, entry, target);
}
/*! \internal */
QString QAccessibleDisplay::imageDescription()
{
#ifndef QT_NO_TOOLTIP
return widget()->toolTip();
#else
return QString();
#endif
}
/*! \internal */
QSize QAccessibleDisplay::imageSize()
{
QLabel *label = qobject_cast<QLabel *>(widget());
if (!label)
return QSize();
const QPixmap *pixmap = label->pixmap();
if (!pixmap)
return QSize();
return pixmap->size();
}
/*! \internal */
QRect QAccessibleDisplay::imagePosition(QAccessible2::CoordinateType coordType)
{
QLabel *label = qobject_cast<QLabel *>(widget());
if (!label)
return QRect();
const QPixmap *pixmap = label->pixmap();
if (!pixmap)
return QRect();
switch (coordType) {
case QAccessible2::RelativeToScreen:
return QRect(label->mapToGlobal(label->pos()), label->size());
case QAccessible2::RelativeToParent:
return label->geometry();
}
return QRect();
}
#ifndef QT_NO_GROUPBOX
QAccessibleGroupBox::QAccessibleGroupBox(QWidget *w)
: QAccessibleWidget(w, Grouping)
{
}
QGroupBox* QAccessibleGroupBox::groupBox() const
{
return static_cast<QGroupBox *>(widget());
}
QString QAccessibleGroupBox::text(QAccessible::Text t, int child) const
{
QString txt = QAccessibleWidget::text(t, child);
if (txt.isEmpty()) {
switch (t) {
case Name:
txt = qt_accStripAmp(groupBox()->title());
case Description:
txt = qt_accStripAmp(groupBox()->title());
default:
break;
}
}
return txt;
}
QAccessible::State QAccessibleGroupBox::state(int child) const
{
QAccessible::State st = QAccessibleWidget::state(child);
if (groupBox()->isChecked())
st |= QAccessible::Checked;
return st;
}
QAccessible::Role QAccessibleGroupBox::role(int child) const
{
if (child)
return QAccessibleWidget::role(child);
return groupBox()->isCheckable() ? QAccessible::CheckBox : QAccessible::Grouping;
}
int QAccessibleGroupBox::navigate(RelationFlag rel, int entry, QAccessibleInterface **target) const
{
if ((rel == Labelled) && !groupBox()->title().isEmpty())
rel = Child;
return QAccessibleWidget::navigate(rel, entry, target);
}
QAccessible::Relation QAccessibleGroupBox::relationTo(int child, const QAccessibleInterface* other, int otherChild) const
{
QGroupBox *groupbox = this->groupBox();
QAccessible::Relation relation = QAccessibleWidget::relationTo(child, other, otherChild);
if (!child && !otherChild && !groupbox->title().isEmpty()) {
QObject *o = other->object();
if (groupbox->children().contains(o))
relation |= Label;
}
return relation;
}
int QAccessibleGroupBox::actionCount()
{
return groupBox()->isCheckable() ? 1 : 0;
}
void QAccessibleGroupBox::doAction(int actionIndex)
{
if ((actionIndex == 0) && groupBox()->isCheckable()) {
groupBox()->setChecked(!groupBox()->isChecked());
}
}
QString QAccessibleGroupBox::description(int actionIndex)
{
if ((actionIndex == 0) && (groupBox()->isCheckable())) {
return QLatin1String("Toggles the button.");
}
return QString();
}
QString QAccessibleGroupBox::name(int actionIndex)
{
if (actionIndex || !groupBox()->isCheckable())
return QString();
return QLatin1String("Toggle");
}
QString QAccessibleGroupBox::localizedName(int actionIndex)
{
if (actionIndex || !groupBox()->isCheckable())
return QString();
return QGroupBox::tr("Toggle");
}
QStringList QAccessibleGroupBox::keyBindings(int actionIndex)
{
Q_UNUSED(actionIndex)
return QStringList();
}
#endif
#ifndef QT_NO_LINEEDIT
/*!
\class QAccessibleLineEdit
\brief The QAccessibleLineEdit class implements the QAccessibleInterface for widgets with editable text
\internal
\ingroup accessibility
*/
/*!
Constructs a QAccessibleLineEdit object for \a w.
\a name is propagated to the QAccessibleWidget constructor.
*/
QAccessibleLineEdit::QAccessibleLineEdit(QWidget *w, const QString &name)
: QAccessibleWidget(w, EditableText, name), QAccessibleSimpleEditableTextInterface(this)
{
addControllingSignal(QLatin1String("textChanged(const QString&)"));
addControllingSignal(QLatin1String("returnPressed()"));
}
/*! Returns the line edit. */
QLineEdit *QAccessibleLineEdit::lineEdit() const
{
return qobject_cast<QLineEdit*>(object());
}
/*! \reimp */
QString QAccessibleLineEdit::text(Text t, int child) const
{
QString str;
switch (t) {
case Value:
if (lineEdit()->echoMode() == QLineEdit::Normal)
str = lineEdit()->text();
break;
default:
break;
}
if (str.isEmpty())
str = QAccessibleWidget::text(t, child);;
return qt_accStripAmp(str);
}
/*! \reimp */
void QAccessibleLineEdit::setText(Text t, int control, const QString &text)
{
if (t != Value || control) {
QAccessibleWidget::setText(t, control, text);
return;
}
QString newText = text;
if (lineEdit()->validator()) {
int pos = 0;
if (lineEdit()->validator()->validate(newText, pos) != QValidator::Acceptable)
return;
}
lineEdit()->setText(newText);
}
/*! \reimp */
QAccessible::State QAccessibleLineEdit::state(int child) const
{
State state = QAccessibleWidget::state(child);
QLineEdit *l = lineEdit();
if (l->isReadOnly())
state |= ReadOnly;
if (l->echoMode() != QLineEdit::Normal)
state |= Protected;
state |= Selectable;
if (l->hasSelectedText())
state |= Selected;
if (l->contextMenuPolicy() != Qt::NoContextMenu
&& l->contextMenuPolicy() != Qt::PreventContextMenu)
state |= HasPopup;
return state;
}
QVariant QAccessibleLineEdit::invokeMethod(QAccessible::Method method, int child,
const QVariantList &params)
{
if (child)
return QVariant();
switch (method) {
case ListSupportedMethods: {
QSet<QAccessible::Method> set;
set << ListSupportedMethods << SetCursorPosition << GetCursorPosition;
return QVariant::fromValue(set | qvariant_cast<QSet<QAccessible::Method> >(
QAccessibleWidget::invokeMethod(method, child, params)));
}
case SetCursorPosition:
setCursorPosition(params.value(0).toInt());
return true;
case GetCursorPosition:
return cursorPosition();
default:
return QAccessibleWidget::invokeMethod(method, child, params);
}
}
void QAccessibleLineEdit::addSelection(int startOffset, int endOffset)
{
setSelection(0, startOffset, endOffset);
}
QString QAccessibleLineEdit::attributes(int offset, int *startOffset, int *endOffset)
{
// QLineEdit doesn't have text attributes
*startOffset = *endOffset = offset;
return QString();
}
int QAccessibleLineEdit::cursorPosition()
{
return lineEdit()->cursorPosition();
}
QRect QAccessibleLineEdit::characterRect(int offset, CoordinateType coordType)
{
int left, top, right, bottom;
lineEdit()->getTextMargins(&left, &top, &right, &bottom);
int x = lineEdit()->d_func()->control->cursorToX(offset);
int y = top;
QFontMetrics fm(lineEdit()->font());
const QString ch = text(offset, offset + 1);
int w = fm.width(ch);
int h = fm.height();
QRect r(x, y, w, h);
if (coordType == QAccessible2::RelativeToScreen)
r.moveTo(lineEdit()->mapToGlobal(r.topLeft()));
return r;
}
int QAccessibleLineEdit::selectionCount()
{
return lineEdit()->hasSelectedText() ? 1 : 0;
}
int QAccessibleLineEdit::offsetAtPoint(const QPoint &point, CoordinateType coordType)
{
QPoint p = point;
if (coordType == RelativeToScreen)
p = lineEdit()->mapFromGlobal(p);
return lineEdit()->cursorPositionAt(p);
}
void QAccessibleLineEdit::selection(int selectionIndex, int *startOffset, int *endOffset)
{
*startOffset = *endOffset = 0;
if (selectionIndex != 0)
return;
*startOffset = lineEdit()->selectionStart();
*endOffset = *startOffset + lineEdit()->selectedText().count();
}
QString QAccessibleLineEdit::text(int startOffset, int endOffset)
{
if (startOffset > endOffset)
return QString();
if (lineEdit()->echoMode() != QLineEdit::Normal)
return QString();
return lineEdit()->text().mid(startOffset, endOffset - startOffset);
}
QString QAccessibleLineEdit::textBeforeOffset(int offset, BoundaryType boundaryType,
int *startOffset, int *endOffset)
{
if (lineEdit()->echoMode() != QLineEdit::Normal) {
*startOffset = *endOffset = -1;
return QString();
}
return qTextBeforeOffsetFromString(offset, boundaryType, startOffset, endOffset, lineEdit()->text());
}
QString QAccessibleLineEdit::textAfterOffset(int offset, BoundaryType boundaryType,
int *startOffset, int *endOffset)
{
if (lineEdit()->echoMode() != QLineEdit::Normal) {
*startOffset = *endOffset = -1;
return QString();
}
return qTextAfterOffsetFromString(offset, boundaryType, startOffset, endOffset, lineEdit()->text());
}
QString QAccessibleLineEdit::textAtOffset(int offset, BoundaryType boundaryType,
int *startOffset, int *endOffset)
{
if (lineEdit()->echoMode() != QLineEdit::Normal) {
*startOffset = *endOffset = -1;
return QString();
}
return qTextAtOffsetFromString(offset, boundaryType, startOffset, endOffset, lineEdit()->text());
}
void QAccessibleLineEdit::removeSelection(int selectionIndex)
{
if (selectionIndex != 0)
return;
lineEdit()->deselect();
}
void QAccessibleLineEdit::setCursorPosition(int position)
{
lineEdit()->setCursorPosition(position);
}
void QAccessibleLineEdit::setSelection(int selectionIndex, int startOffset, int endOffset)
{
if (selectionIndex != 0)
return;
lineEdit()->setSelection(startOffset, endOffset - startOffset);
}
int QAccessibleLineEdit::characterCount()
{
return lineEdit()->text().count();
}
void QAccessibleLineEdit::scrollToSubstring(int startIndex, int endIndex)
{
lineEdit()->setCursorPosition(endIndex);
lineEdit()->setCursorPosition(startIndex);
}
#endif // QT_NO_LINEEDIT
#ifndef QT_NO_PROGRESSBAR
QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o)
: QAccessibleDisplay(o)
{
Q_ASSERT(progressBar());
}
QVariant QAccessibleProgressBar::currentValue()
{
return progressBar()->value();
}
QVariant QAccessibleProgressBar::maximumValue()
{
return progressBar()->maximum();
}
QVariant QAccessibleProgressBar::minimumValue()
{
return progressBar()->minimum();
}
QProgressBar *QAccessibleProgressBar::progressBar() const
{
return qobject_cast<QProgressBar *>(object());
}
#endif
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE

View file

@ -1,201 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the plugins of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SIMPLEWIDGETS_H
#define SIMPLEWIDGETS_H
#include <QtCore/qcoreapplication.h>
#include <QtGui/qaccessible2.h>
#include <QtGui/qaccessiblewidget.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
class QAbstractButton;
class QLineEdit;
class QToolButton;
class QGroupBox;
class QProgressBar;
class QAccessibleButton : public QAccessibleWidget, public QAccessibleActionInterface
{
Q_ACCESSIBLE_OBJECT
Q_DECLARE_TR_FUNCTIONS(QAccessibleButton)
public:
QAccessibleButton(QWidget *w, Role r);
QString text(Text t, int child) const;
State state(int child) const;
QString actionText(int action, Text text, int child) const;
bool doAction(int action, int child, const QVariantList &params);
// QAccessibleActionInterface
int actionCount();
void doAction(int actionIndex);
QString description(int actionIndex);
QString name(int actionIndex);
QString localizedName(int actionIndex);
QStringList keyBindings(int actionIndex);
protected:
QAbstractButton *button() const;
};
#ifndef QT_NO_TOOLBUTTON
class QAccessibleToolButton : public QAccessibleButton
{
public:
QAccessibleToolButton(QWidget *w, Role role);
enum ToolButtonElements {
ToolButtonSelf = 0,
ButtonExecute,
ButtonDropMenu
};
Role role(int child) const;
State state(int child) const;
int childCount() const;
QRect rect(int child) const;
QString text(Text t, int child) const;
QString actionText(int action, Text text, int child) const;
bool doAction(int action, int child, const QVariantList &params);
protected:
QToolButton *toolButton() const;
bool isSplitButton() const;
};
#endif // QT_NO_TOOLBUTTON
class QAccessibleDisplay : public QAccessibleWidget, public QAccessibleImageInterface
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleDisplay(QWidget *w, Role role = StaticText);
QString text(Text t, int child) const;
Role role(int child) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
int navigate(RelationFlag, int entry, QAccessibleInterface **target) const;
// QAccessibleImageInterface
QString imageDescription();
QSize imageSize();
QRect imagePosition(QAccessible2::CoordinateType coordType);
};
#ifndef QT_NO_GROUPBOX
class QAccessibleGroupBox : public QAccessibleWidget,
public QAccessibleActionInterface
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleGroupBox(QWidget *w);
State state(int child) const;
Role role(int child) const;
QString text(Text t, int child) const;
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const;
int navigate(RelationFlag rel, int entry, QAccessibleInterface** target) const;
//QAccessibleActionInterface
int actionCount();
QString description(int actionIndex);
void doAction(int actionIndex);
QString name(int actionIndex);
QString localizedName(int actionIndex);
QStringList keyBindings(int actionIndex);
private:
QGroupBox *groupBox() const;
};
#endif
#ifndef QT_NO_LINEEDIT
class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface,
public QAccessibleSimpleEditableTextInterface
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleLineEdit(QWidget *o, const QString &name = QString());
QString text(Text t, int child) const;
void setText(Text t, int control, const QString &text);
State state(int child) const;
QVariant invokeMethod(QAccessible::Method method, int child, const QVariantList &params);
// QAccessibleTextInterface
void addSelection(int startOffset, int endOffset);
QString attributes(int offset, int *startOffset, int *endOffset);
int cursorPosition();
QRect characterRect(int offset, QAccessible2::CoordinateType coordType);
int selectionCount();
int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType);
void selection(int selectionIndex, int *startOffset, int *endOffset);
QString text(int startOffset, int endOffset);
QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset);
QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset);
QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
int *startOffset, int *endOffset);
void removeSelection(int selectionIndex);
void setCursorPosition(int position);
void setSelection(int selectionIndex, int startOffset, int endOffset);
int characterCount();
void scrollToSubstring(int startIndex, int endIndex);
protected:
QLineEdit *lineEdit() const;
};
#endif // QT_NO_LINEEDIT
#ifndef QT_NO_PROGRESSBAR
class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValueInterface
{
Q_ACCESSIBLE_OBJECT
public:
explicit QAccessibleProgressBar(QWidget *o);
// QAccessibleValueInterface
QVariant currentValue();
QVariant maximumValue();
QVariant minimumValue();
inline void setCurrentValue(const QVariant &) {}
protected:
QProgressBar *progressBar() const;
};
#endif
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
#endif // SIMPLEWIDGETS_H

View file

@ -32,7 +32,6 @@ include_directories(
set(TEST_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/qbenchmark.h
${CMAKE_CURRENT_SOURCE_DIR}/qsignalspy.h
${CMAKE_CURRENT_SOURCE_DIR}/qtestaccessible.h
${CMAKE_CURRENT_SOURCE_DIR}/qtestassert.h
${CMAKE_CURRENT_SOURCE_DIR}/qtestbasicstreamer.h
${CMAKE_CURRENT_SOURCE_DIR}/qtestcase.h

View file

@ -1,136 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2016 Ivailo Monev
**
** This file is part of the QtTest module of the Katie Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QTESTACCESSIBLE_H
#define QTESTACCESSIBLE_H
#ifndef QT_NO_ACCESSIBILITY
#define QTEST_ACCESSIBILITY
#define QVERIFY_EVENT(object, child, event) \
QVERIFY(QTestAccessibility::verifyEvent(object, child, (int)event))
#include <QtCore/qlist.h>
#include <QtGui/qaccessible.h>
#include <QtGui/qapplication.h>
QT_BEGIN_NAMESPACE
class QObject;
struct QTestAccessibilityEvent
{
QTestAccessibilityEvent(QObject* o = 0, int c = 0, int e = 0)
: object(o), child(c), event(e) {}
bool operator==(const QTestAccessibilityEvent &o) const
{
return o.object == object && o.child == child && o.event == event;
}
QObject* object;
int child;
int event;
};
typedef QList<QTestAccessibilityEvent> EventList;
class QTestAccessibility
{
public:
static void initialize()
{
if (!instance()) {
instance() = new QTestAccessibility;
qAddPostRoutine(cleanup);
}
}
static void cleanup()
{
delete instance();
instance() = 0;
}
static void clearEvents() { eventList().clear(); }
static EventList events() { return eventList(); }
static bool verifyEvent(const QTestAccessibilityEvent& ev)
{
if (eventList().isEmpty())
return false;
return eventList().takeFirst() == ev;
}
static bool verifyEvent(QObject *o, int c, int e)
{
return verifyEvent(QTestAccessibilityEvent(o, c, e));
}
private:
QTestAccessibility()
{
QAccessible::installUpdateHandler(updateHandler);
QAccessible::installRootObjectHandler(rootObjectHandler);
}
~QTestAccessibility()
{
QAccessible::installUpdateHandler(0);
QAccessible::installRootObjectHandler(0);
}
static void rootObjectHandler(QObject *object)
{
// qDebug("rootObjectHandler called %p", object);
if (object) {
QApplication* app = qobject_cast<QApplication*>(object);
if ( !app )
qWarning("QTEST_ACCESSIBILITY: root Object is not a QApplication!");
} else {
qWarning("QTEST_ACCESSIBILITY: root Object called with 0 pointer");
}
}
static void updateHandler(QObject *o, int c, QAccessible::Event e)
{
// qDebug("updateHandler called: %p %d %d", o, c, (int)e);
eventList().append(QTestAccessibilityEvent(o, c, (int)e));
}
static EventList &eventList()
{
static EventList list;
return list;
}
static QTestAccessibility *&instance()
{
static QTestAccessibility *ta = 0;
return ta;
}
};
#endif
QT_END_NAMESPACE
#endif

View file

@ -82,26 +82,6 @@ static const struct ClassTblData {
{ QLatin1String("QAbstractTableModel"), QLatin1String("QtCore/qabstractitemmodel.h") },
{ QLatin1String("QAbstractTextDocumentLayout"), QLatin1String("QtGui/qabstracttextdocumentlayout.h") },
{ QLatin1String("QAbstractUndoItem"), QLatin1String("QtGui/qtextdocument.h") },
{ QLatin1String("QAccessible"), QLatin1String("QtGui/qaccessible.h") },
{ QLatin1String("QAccessible2Interface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleActionInterface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleApplication"), QLatin1String("QtGui/qaccessibleobject.h") },
{ QLatin1String("QAccessibleBridgeFactoryInterface"), QLatin1String("QtGui/qaccessiblebridge.h") },
{ QLatin1String("QAccessibleBridgePlugin"), QLatin1String("QtGui/qaccessiblebridge.h") },
{ QLatin1String("QAccessibleEditableTextInterface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleEvent"), QLatin1String("QtGui/qaccessible.h") },
{ QLatin1String("QAccessibleFactoryInterface"), QLatin1String("QtGui/qaccessibleplugin.h") },
{ QLatin1String("QAccessibleImageInterface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleInterface"), QLatin1String("QtGui/qaccessible.h") },
{ QLatin1String("QAccessibleObject"), QLatin1String("QtGui/qaccessibleobject.h") },
{ QLatin1String("QAccessiblePlugin"), QLatin1String("QtGui/qaccessibleplugin.h") },
{ QLatin1String("QAccessibleSimpleEditableTextInterface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleTable2CellInterface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleTable2Interface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleTableInterface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleTextInterface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleValueInterface"), QLatin1String("QtGui/qaccessible2.h") },
{ QLatin1String("QAccessibleWidget"), QLatin1String("QtGui/qaccessiblewidget.h") },
{ QLatin1String("QAction"), QLatin1String("QtGui/qaction.h") },
{ QLatin1String("QActionEvent"), QLatin1String("QtGui/qevent.h") },
{ QLatin1String("QActionGroup"), QLatin1String("QtGui/qactiongroup.h") },

View file

@ -162,7 +162,6 @@ namespace {
inline void openIfndef(QTextStream &str, const QString &symbol) { if (!symbol.isEmpty()) str << QLatin1String("#ifndef ") << symbol << endl; }
inline void closeIfndef(QTextStream &str, const QString &symbol) { if (!symbol.isEmpty()) str << QLatin1String("#endif // ") << symbol << endl; }
const char *accessibilityDefineC = "QT_NO_ACCESSIBILITY";
const char *toolTipDefineC = "QT_NO_TOOLTIP";
const char *whatsThisDefineC = "QT_NO_WHATSTHIS";
const char *statusTipDefineC = "QT_NO_STATUSTIP";
@ -1403,8 +1402,6 @@ void WriteInitialization::writeProperties(const QString &varName,
defineC = whatsThisDefineC;
else if (propertyName == QLatin1String("statusTip"))
defineC = statusTipDefineC;
else if (propertyName == QLatin1String("accessibleName") || propertyName == QLatin1String("accessibleDescription"))
defineC = accessibilityDefineC;
QTextStream &o = autoTrOutput(p->elementString());

View file

@ -2976,7 +2976,7 @@ void tst_QObject::deleteQObjectWhenDeletingEvent()
};
QObject o;
QApplication::postEvent(&o, new MyEvent);
QCoreApplication::postEvent(&o, new MyEvent);
QCoreApplication::removePostedEvents(&o); // here you would get a deadlock
}

View file

@ -177,15 +177,7 @@ void tst_QStandardItem::getSetData()
Qt::CheckState checkState((i == 1) ? Qt::PartiallyChecked : Qt::Checked);
item.setCheckState(checkState);
QCOMPARE(item.checkState(), checkState);
QString accessibleText = QString("accessibleText %0").arg(i);
item.setAccessibleText(accessibleText);
QCOMPARE(item.accessibleText(), accessibleText);
QString accessibleDescription = QString("accessibleDescription %0").arg(i);
item.setAccessibleDescription(accessibleDescription);
QCOMPARE(item.accessibleDescription(), accessibleDescription);
QCOMPARE(item.text(), text);
QCOMPARE(item.icon(), icon);
QCOMPARE(item.toolTip(), toolTip);
@ -197,8 +189,6 @@ void tst_QStandardItem::getSetData()
QCOMPARE(item.background().color(), backgroundColor);
QCOMPARE(item.foreground().color(), textColor);
QCOMPARE(item.checkState(), checkState);
QCOMPARE(item.accessibleText(), accessibleText);
QCOMPARE(item.accessibleDescription(), accessibleDescription);
QCOMPARE(qvariant_cast<QString>(item.data(Qt::DisplayRole)), text);
QCOMPARE(qvariant_cast<QIcon>(item.data(Qt::DecorationRole)), icon);
@ -211,8 +201,6 @@ void tst_QStandardItem::getSetData()
QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::BackgroundRole)), QBrush(backgroundColor));
QCOMPARE(qvariant_cast<QBrush>(item.data(Qt::ForegroundRole)), QBrush(textColor));
QCOMPARE(qvariant_cast<int>(item.data(Qt::CheckStateRole)), int(checkState));
QCOMPARE(qvariant_cast<QString>(item.data(Qt::AccessibleTextRole)), accessibleText);
QCOMPARE(qvariant_cast<QString>(item.data(Qt::AccessibleDescriptionRole)), accessibleDescription);
item.setBackground(pixmap);
QCOMPARE(item.background().texture(), pixmap);
@ -229,8 +217,6 @@ void tst_QStandardItem::getSetData()
item.setData(QVariant(), Qt::BackgroundRole);
item.setData(QVariant(), Qt::ForegroundRole);
item.setData(QVariant(), Qt::CheckStateRole);
item.setData(QVariant(), Qt::AccessibleTextRole);
item.setData(QVariant(), Qt::AccessibleDescriptionRole);
QCOMPARE(item.data(Qt::DisplayRole), QVariant());
QCOMPARE(item.data(Qt::DecorationRole), QVariant());
@ -243,8 +229,6 @@ void tst_QStandardItem::getSetData()
QCOMPARE(item.data(Qt::BackgroundRole), QVariant());
QCOMPARE(item.data(Qt::ForegroundRole), QVariant());
QCOMPARE(item.data(Qt::CheckStateRole), QVariant());
QCOMPARE(item.data(Qt::AccessibleTextRole), QVariant());
QCOMPARE(item.data(Qt::AccessibleDescriptionRole), QVariant());
}
}
@ -887,8 +871,6 @@ void tst_QStandardItem::streamItem()
item.setBackground(QColor(Qt::blue));
item.setForeground(QColor(Qt::green));
item.setCheckState(Qt::PartiallyChecked);
item.setAccessibleText(QLatin1String("accessibleText"));
item.setAccessibleDescription(QLatin1String("accessibleDescription"));
QByteArray ba;
{
@ -909,8 +891,6 @@ void tst_QStandardItem::streamItem()
QCOMPARE(streamedItem.background(), item.background());
QCOMPARE(streamedItem.foreground(), item.foreground());
QCOMPARE(streamedItem.checkState(), item.checkState());
QCOMPARE(streamedItem.accessibleText(), item.accessibleText());
QCOMPARE(streamedItem.accessibleDescription(), item.accessibleDescription());
QCOMPARE(streamedItem.flags(), item.flags());
}
}
@ -948,8 +928,6 @@ void tst_QStandardItem::clone()
item.setBackground(QColor(Qt::blue));
item.setForeground(QColor(Qt::green));
item.setCheckState(Qt::PartiallyChecked);
item.setAccessibleText(QLatin1String("accessibleText"));
item.setAccessibleDescription(QLatin1String("accessibleDescription"));
item.setFlags(Qt::ItemIsEnabled | Qt::ItemIsDropEnabled);
QStandardItem *clone = item.clone();
@ -963,8 +941,6 @@ void tst_QStandardItem::clone()
QCOMPARE(clone->background(), item.background());
QCOMPARE(clone->foreground(), item.foreground());
QCOMPARE(clone->checkState(), item.checkState());
QCOMPARE(clone->accessibleText(), item.accessibleText());
QCOMPARE(clone->accessibleDescription(), item.accessibleDescription());
QCOMPARE(clone->flags(), item.flags());
QVERIFY(!(*clone < item));
delete clone;

View file

@ -1103,10 +1103,6 @@ void tst_QStandardItemModel::getSetItemData()
roles.insert(Qt::ForegroundRole, textColor);
Qt::CheckState checkState(Qt::PartiallyChecked);
roles.insert(Qt::CheckStateRole, int(checkState));
QLatin1String accessibleText("accessibleText");
roles.insert(Qt::AccessibleTextRole, accessibleText);
QLatin1String accessibleDescription("accessibleDescription");
roles.insert(Qt::AccessibleDescriptionRole, accessibleDescription);
QStandardItemModel model;
model.insertRows(0, 1);

View file

@ -27,6 +27,7 @@
#include <qthread.h>
#include <qprocess.h>
#include <qdir.h>
#include <qvector.h>
//TESTED_CLASS=
//TESTED_FILES=

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-10 12:09+0200\n"
"POT-Creation-Date: 2022-01-26 19:24+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -422,12 +422,12 @@ msgstr ""
msgid "Cannot anchor a vertical edge to a horizontal edge."
msgstr ""
#: src/declarative/graphicsitems/qdeclarativetextinput.cpp:872
#: src/declarative/graphicsitems/qdeclarativetextinput.cpp:880
#: src/declarative/graphicsitems/qdeclarativetextinput.cpp:870
#: src/declarative/graphicsitems/qdeclarativetextinput.cpp:878
msgid "Could not load cursor delegate"
msgstr ""
#: src/declarative/graphicsitems/qdeclarativetextinput.cpp:891
#: src/declarative/graphicsitems/qdeclarativetextinput.cpp:889
msgid "Could not instantiate cursor delegate"
msgstr ""
@ -1181,15 +1181,6 @@ msgstr ""
msgid "Animation is an abstract class"
msgstr ""
#: src/gui/accessible/qaccessibleobject.cpp:322
#: src/plugins/accessible/widgets/complexwidgets.cpp:1597
msgid "Activate"
msgstr ""
#: src/gui/accessible/qaccessibleobject.cpp:324
msgid "Activates the program's main window"
msgstr ""
#: src/gui/dialogs/qwizard.cpp:578
msgid "Go Back"
msgstr ""
@ -1323,19 +1314,19 @@ msgstr ""
msgid "Computer"
msgstr ""
#: src/gui/dialogs/qmessagebox.cpp:105
#: src/gui/dialogs/qmessagebox.cpp:102
msgid "Show Details..."
msgstr ""
#: src/gui/dialogs/qmessagebox.cpp:105
#: src/gui/dialogs/qmessagebox.cpp:102
msgid "Hide Details..."
msgstr ""
#: src/gui/dialogs/qmessagebox.cpp:1454
#: src/gui/dialogs/qmessagebox.cpp:1448
msgid "<h3>About Katie</h3><p>This program uses Katie version %1.</p>"
msgstr ""
#: src/gui/dialogs/qmessagebox.cpp:1458
#: src/gui/dialogs/qmessagebox.cpp:1452
msgid ""
"<p>Katie is a C++ toolkit derived from the Qt 4.8 framework.</p><p>Katie is "
"licensed under the GNU LGPL version 2.1</p><p>Copyright (C) 2015 The Qt "
@ -1344,7 +1335,7 @@ msgid ""
"katie</a> for more information.</p>"
msgstr ""
#: src/gui/dialogs/qmessagebox.cpp:1466
#: src/gui/dialogs/qmessagebox.cpp:1460
msgid "About Katie"
msgstr ""
@ -1358,7 +1349,7 @@ msgctxt "QPrintPreviewDialog"
msgid "Page Setup"
msgstr ""
#: src/gui/dialogs/qdialog.cpp:491 src/gui/kernel/qwhatsthis.cpp:469
#: src/gui/dialogs/qdialog.cpp:487 src/gui/kernel/qwhatsthis.cpp:461
msgid "What's This?"
msgstr ""
@ -1659,14 +1650,6 @@ msgid "Find Directory"
msgstr ""
#: src/gui/dialogs/qfiledialog.cpp:495
#: src/plugins/accessible/widgets/simplewidgets.cpp:96
#: src/plugins/accessible/widgets/simplewidgets.cpp:411
#: src/plugins/accessible/widgets/simplewidgets.cpp:419
#: src/plugins/accessible/widgets/qaccessiblemenu.cpp:138
#: src/plugins/accessible/widgets/qaccessiblemenu.cpp:363
#: src/plugins/accessible/widgets/qaccessiblemenu.cpp:417
#: src/plugins/accessible/widgets/complexwidgets.cpp:1829
#: src/plugins/accessible/widgets/complexwidgets.cpp:1895
msgid "Open"
msgstr ""
@ -1860,94 +1843,88 @@ msgctxt "QImageReader"
msgid "Unknown error"
msgstr ""
#: src/gui/widgets/qtabbar.cpp:2175
#: src/gui/widgets/qtabbar.cpp:2163
msgid "Close Tab"
msgstr ""
#: src/gui/widgets/qlineedit.cpp:1755 src/gui/text/qtextcontrol.cpp:1858
#: src/gui/widgets/qlineedit.cpp:1710 src/gui/text/qtextcontrol.cpp:1849
msgid "&Undo"
msgstr ""
#: src/gui/widgets/qlineedit.cpp:1759 src/gui/text/qtextcontrol.cpp:1860
#: src/gui/widgets/qlineedit.cpp:1714 src/gui/text/qtextcontrol.cpp:1851
msgid "&Redo"
msgstr ""
#: src/gui/widgets/qlineedit.cpp:1768 src/gui/text/qtextcontrol.cpp:1864
#: src/gui/widgets/qlineedit.cpp:1723 src/gui/text/qtextcontrol.cpp:1855
msgid "Cu&t"
msgstr ""
#: src/gui/widgets/qlineedit.cpp:1774 src/gui/text/qtextcontrol.cpp:1869
#: src/gui/widgets/qlineedit.cpp:1729 src/gui/text/qtextcontrol.cpp:1860
msgid "&Copy"
msgstr ""
#: src/gui/widgets/qlineedit.cpp:1780 src/gui/text/qtextcontrol.cpp:1882
#: src/gui/widgets/qlineedit.cpp:1735 src/gui/text/qtextcontrol.cpp:1873
msgid "&Paste"
msgstr ""
#: src/gui/widgets/qlineedit.cpp:1787 src/gui/text/qtextcontrol.cpp:1885
#: src/gui/widgets/qlineedit.cpp:1742 src/gui/text/qtextcontrol.cpp:1876
#: src/scripttools/debugging/qscriptbreakpointswidget.cpp:279
msgid "Delete"
msgstr ""
#: src/gui/widgets/qlineedit.cpp:1795 src/gui/text/qtextcontrol.cpp:1892
#: src/gui/widgets/qlineedit.cpp:1750 src/gui/text/qtextcontrol.cpp:1883
msgid "Select All"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:382
#: src/gui/widgets/qscrollbar.cpp:380
msgid "Scroll here"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:384
#: src/gui/widgets/qscrollbar.cpp:382
msgid "Left edge"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:384
#: src/gui/widgets/qscrollbar.cpp:382
msgid "Top"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:385
#: src/gui/widgets/qscrollbar.cpp:383
msgid "Right edge"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:385
#: src/gui/widgets/qscrollbar.cpp:383
msgid "Bottom"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:387
#: src/plugins/accessible/widgets/rangecontrols.cpp:685
#: src/gui/widgets/qscrollbar.cpp:385
msgid "Page left"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:387
#: src/plugins/accessible/widgets/rangecontrols.cpp:532
#: src/plugins/accessible/widgets/rangecontrols.cpp:685
#: src/gui/widgets/qscrollbar.cpp:385
msgid "Page up"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:388
#: src/plugins/accessible/widgets/rangecontrols.cpp:690
#: src/gui/widgets/qscrollbar.cpp:386
msgid "Page right"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:388
#: src/plugins/accessible/widgets/rangecontrols.cpp:536
#: src/plugins/accessible/widgets/rangecontrols.cpp:690
#: src/gui/widgets/qscrollbar.cpp:386
msgid "Page down"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:390
#: src/gui/widgets/qscrollbar.cpp:388
msgid "Scroll left"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:390
#: src/gui/widgets/qscrollbar.cpp:388
msgid "Scroll up"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:391
#: src/gui/widgets/qscrollbar.cpp:389
msgid "Scroll right"
msgstr ""
#: src/gui/widgets/qscrollbar.cpp:391
#: src/gui/widgets/qscrollbar.cpp:389
msgid "Scroll down"
msgstr ""
@ -2091,11 +2068,6 @@ msgid "Restore"
msgstr ""
#: src/gui/widgets/qmdisubwindow.cpp:309 src/gui/widgets/qworkspace.cpp:93
#: src/plugins/accessible/widgets/qaccessiblemenu.cpp:137
#: src/plugins/accessible/widgets/qaccessiblemenu.cpp:362
#: src/plugins/accessible/widgets/qaccessiblewidgets.cpp:1309
#: src/plugins/accessible/widgets/complexwidgets.cpp:1594
#: src/plugins/accessible/widgets/complexwidgets.cpp:1895
#: src/scripttools/debugging/qscriptbreakpointswidget.cpp:56
#: src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp:116
msgid "Close"
@ -2141,28 +2113,28 @@ msgstr ""
msgid "&Unshade"
msgstr ""
#: src/gui/widgets/qmenubar.cpp:1599
#: src/gui/widgets/qmenubar.cpp:1500
msgctxt "QMenuBar"
msgid "Corner Toolbar"
msgstr ""
#: src/gui/widgets/qabstractspinbox.cpp:1152
#: src/gui/widgets/qabstractspinbox.cpp:1144
msgid "&Select All"
msgstr ""
#: src/gui/widgets/qabstractspinbox.cpp:1158
#: src/gui/widgets/qabstractspinbox.cpp:1150
msgid "&Step up"
msgstr ""
#: src/gui/widgets/qabstractspinbox.cpp:1160
#: src/gui/widgets/qabstractspinbox.cpp:1152
msgid "Step &down"
msgstr ""
#: src/gui/kernel/qwidget.cpp:5039
#: src/gui/kernel/qwidget.cpp:5031
msgid "*"
msgstr ""
#: src/gui/kernel/qapplication.cpp:1647
#: src/gui/kernel/qapplication.cpp:1646
msgid "QT_LAYOUT_DIRECTION"
msgstr ""
@ -4514,96 +4486,91 @@ msgstr ""
msgid "<empty>"
msgstr ""
#: src/gui/text/qfontdatabase.cpp:185
#: src/gui/text/qfontdatabase.cpp:683
msgctxt "QFontDatabase"
msgid "Black"
msgstr ""
#: src/gui/text/qfontdatabase.cpp:187
#: src/gui/text/qfontdatabase.cpp:685
msgctxt "QFontDatabase"
msgid "Bold"
msgstr ""
#: src/gui/text/qfontdatabase.cpp:189
#: src/gui/text/qfontdatabase.cpp:687
msgctxt "QFontDatabase"
msgid "Demi Bold"
msgstr ""
#: src/gui/text/qfontdatabase.cpp:191
#: src/gui/text/qfontdatabase.cpp:689
msgctxt "QFontDatabase"
msgid "Light"
msgstr ""
#: src/gui/text/qfontdatabase.cpp:194
#: src/gui/text/qfontdatabase.cpp:693
msgctxt "QFontDatabase"
msgid "Italic"
msgstr ""
#: src/gui/text/qfontdatabase.cpp:196
#: src/gui/text/qfontdatabase.cpp:695
msgctxt "QFontDatabase"
msgid "Oblique"
msgstr ""
#: src/gui/text/qfontdatabase.cpp:199
msgctxt "QFontDatabase"
msgid "Normal"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:1876
#: src/gui/text/qtextcontrol.cpp:1867
msgid "Copy &Link Location"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2790
#: src/gui/text/qtextcontrol.cpp:2781
msgctxt "QUnicodeControlCharacterMenu"
msgid "LRM Left-to-right mark"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2791
#: src/gui/text/qtextcontrol.cpp:2782
msgctxt "QUnicodeControlCharacterMenu"
msgid "RLM Right-to-left mark"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2792
#: src/gui/text/qtextcontrol.cpp:2783
msgctxt "QUnicodeControlCharacterMenu"
msgid "ZWJ Zero width joiner"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2793
#: src/gui/text/qtextcontrol.cpp:2784
msgctxt "QUnicodeControlCharacterMenu"
msgid "ZWNJ Zero width non-joiner"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2794
#: src/gui/text/qtextcontrol.cpp:2785
msgctxt "QUnicodeControlCharacterMenu"
msgid "ZWSP Zero width space"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2795
#: src/gui/text/qtextcontrol.cpp:2786
msgctxt "QUnicodeControlCharacterMenu"
msgid "LRE Start of left-to-right embedding"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2796
#: src/gui/text/qtextcontrol.cpp:2787
msgctxt "QUnicodeControlCharacterMenu"
msgid "RLE Start of right-to-left embedding"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2797
#: src/gui/text/qtextcontrol.cpp:2788
msgctxt "QUnicodeControlCharacterMenu"
msgid "LRO Start of left-to-right override"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2798
#: src/gui/text/qtextcontrol.cpp:2789
msgctxt "QUnicodeControlCharacterMenu"
msgid "RLO Start of right-to-left override"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2799
#: src/gui/text/qtextcontrol.cpp:2790
msgctxt "QUnicodeControlCharacterMenu"
msgid "PDF Pop directional formatting"
msgstr ""
#: src/gui/text/qtextcontrol.cpp:2805
#: src/gui/text/qtextcontrol.cpp:2796
msgid "Insert Unicode control character"
msgstr ""
@ -5356,94 +5323,6 @@ msgctxt "QNetworkAccessFileBackend"
msgid "Read error reading from %1: %2"
msgstr ""
#: src/plugins/accessible/widgets/simplewidgets.cpp:100
#: src/plugins/accessible/widgets/simplewidgets.cpp:245
msgid "Uncheck"
msgstr ""
#: src/plugins/accessible/widgets/simplewidgets.cpp:103
#: src/plugins/accessible/widgets/simplewidgets.cpp:108
#: src/plugins/accessible/widgets/simplewidgets.cpp:247
msgid "Check"
msgstr ""
#: src/plugins/accessible/widgets/simplewidgets.cpp:104
#: src/plugins/accessible/widgets/simplewidgets.cpp:714
msgid "Toggle"
msgstr ""
#: src/plugins/accessible/widgets/simplewidgets.cpp:250
#: src/plugins/accessible/widgets/simplewidgets.cpp:409
#: src/plugins/accessible/widgets/simplewidgets.cpp:415
#: src/plugins/accessible/widgets/complexwidgets.cpp:1599
msgid "Press"
msgstr ""
#: src/plugins/accessible/widgets/qaccessiblemenu.cpp:140
#: src/plugins/accessible/widgets/qaccessiblemenu.cpp:365
#: src/plugins/accessible/widgets/qaccessiblemenu.cpp:418
msgid "Execute"
msgstr ""
#: src/plugins/accessible/widgets/rangecontrols.cpp:128
#: src/plugins/accessible/widgets/rangecontrols.cpp:391
msgid "More"
msgstr ""
#: src/plugins/accessible/widgets/rangecontrols.cpp:130
#: src/plugins/accessible/widgets/rangecontrols.cpp:393
msgid "Less"
msgstr ""
#: src/plugins/accessible/widgets/rangecontrols.cpp:530
msgid "Line up"
msgstr ""
#: src/plugins/accessible/widgets/rangecontrols.cpp:534
#: src/plugins/accessible/widgets/rangecontrols.cpp:687
msgid "Position"
msgstr ""
#: src/plugins/accessible/widgets/rangecontrols.cpp:538
msgid "Line down"
msgstr ""
#: src/plugins/accessible/widgets/rangecontrols.cpp:912
msgid "QDial"
msgstr ""
#: src/plugins/accessible/widgets/rangecontrols.cpp:914
msgid "SpeedoMeter"
msgstr ""
#: src/plugins/accessible/widgets/rangecontrols.cpp:916
msgid "SliderHandle"
msgstr ""
#: src/plugins/accessible/widgets/qaccessiblewidgets.cpp:1311
msgid "Dock"
msgstr ""
#: src/plugins/accessible/widgets/qaccessiblewidgets.cpp:1312
msgid "Float"
msgstr ""
#: src/plugins/accessible/widgets/complexwidgets.cpp:1495
msgid "Scroll Left"
msgstr ""
#: src/plugins/accessible/widgets/complexwidgets.cpp:1495
msgid "Scroll Right"
msgstr ""
#: src/plugins/accessible/widgets/complexwidgets.cpp:1604
msgid "Close the tab"
msgstr ""
#: src/plugins/accessible/widgets/complexwidgets.cpp:1607
msgid "Activate the tab"
msgstr ""
#: src/scripttools/debugging/qscriptedit.cpp:391
#: src/scripttools/debugging/qscriptdebugger.cpp:1767
msgid "Toggle Breakpoint"
@ -5706,12 +5585,12 @@ msgctxt "QFormBuilder"
msgid "The enumeration-type property %1 could not be read."
msgstr ""
#: src/uitools/properties.cpp:292
#: src/uitools/properties.cpp:289
msgctxt "QFormBuilder"
msgid "Reading properties of the type %1 is not supported yet."
msgstr ""
#: src/uitools/properties.cpp:565
#: src/uitools/properties.cpp:558
msgctxt "QFormBuilder"
msgid "The property %1 could not be written. The type %2 is not supported yet."
msgstr ""
@ -5807,14 +5686,14 @@ msgctxt "QAbstractFormBuilder"
msgid "This version of the uitools library is linked without script support."
msgstr ""
#: src/uitools/properties_p.h:109
#: src/uitools/properties_p.h:107
msgctxt "QFormBuilder"
msgid ""
"The enumeration-value '%1' is invalid. The default value '%2' will be used "
"instead."
msgstr ""
#: src/uitools/properties_p.h:123
#: src/uitools/properties_p.h:121
msgctxt "QFormBuilder"
msgid "The flag-value '%1' is invalid. Zero will be used instead."
msgstr ""

Some files were not shown because too many files have changed in this diff Show more