summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-08-29 12:11:53 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-08-29 12:11:53 +0200
commitd0c48efbae386dc88ea2313264e739715d9154b4 (patch)
tree97a30a0c58c8ecb8a9a58ae892f53c6e9efe03d7 /src/widgets
parente35a83b293e6b38f6060895262b5494d36515e6e (diff)
parentd7305c10948f501450b6b3358d261217d13c6d6e (diff)
Merge remote branch 'gerrit/master' into refactor
Conflicts: src/gui/accessible/qaccessible.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.h src/gui/kernel/qapplication_mac.mm src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qapplication_s60.cpp src/gui/kernel/qapplication_win.cpp src/gui/kernel/qapplication_x11.cpp src/gui/kernel/qdnd_x11.cpp src/gui/kernel/qwidget.cpp src/gui/widgets/qlabel.cpp Change-Id: Ief9c75724d2cff89ed45f009bdee2ffc5e4395ba
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/accessible/qaccessible.h71
-rw-r--r--src/widgets/accessible/qaccessible_unix.cpp2
-rw-r--r--src/widgets/kernel/qapplication.cpp27
-rw-r--r--src/widgets/kernel/qapplication.h1
-rw-r--r--src/widgets/widgets/qlabel.cpp9
5 files changed, 74 insertions, 36 deletions
diff --git a/src/widgets/accessible/qaccessible.h b/src/widgets/accessible/qaccessible.h
index 312e2a3088..3a59810866 100644
--- a/src/widgets/accessible/qaccessible.h
+++ b/src/widgets/accessible/qaccessible.h
@@ -84,40 +84,40 @@ public:
MenuCommand = 0x0018,
// Values from IAccessible2
- ActionChanged = 0x0101,
- ActiveDescendantChanged,
- AttributeChanged,
- DocumentContentChanged,
- DocumentLoadComplete,
- DocumentLoadStopped,
- DocumentReload,
- HyperlinkEndIndexChanged,
- HyperlinkNumberOfAnchorsChanged,
- HyperlinkSelectedLinkChanged,
- HypertextLinkActivated,
- HypertextLinkSelected,
- HyperlinkStartIndexChanged,
- HypertextChanged,
- HypertextNLinksChanged,
- ObjectAttributeChanged,
- PageChanged,
- SectionChanged,
- TableCaptionChanged,
- TableColumnDescriptionChanged,
- TableColumnHeaderChanged,
- TableModelChanged,
- TableRowDescriptionChanged,
- TableRowHeaderChanged,
- TableSummaryChanged,
- TextAttributeChanged,
- TextCaretMoved,
- // TextChanged, deprecated, use TextUpdated
- TextColumnChanged = TextCaretMoved + 2,
- TextInserted,
- TextRemoved,
- TextUpdated,
- TextSelectionChanged,
- VisibleDataChanged,
+ 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,
@@ -162,6 +162,9 @@ public:
Offscreen = 0x00010000,
Sizeable = 0x00020000,
Movable = 0x00040000,
+#ifdef QT3_SUPPORT
+ Moveable = Movable,
+#endif
SelfVoicing = 0x00080000,
Focusable = 0x00100000,
Selectable = 0x00200000,
diff --git a/src/widgets/accessible/qaccessible_unix.cpp b/src/widgets/accessible/qaccessible_unix.cpp
index 19fbe78301..1c1eb2ad05 100644
--- a/src/widgets/accessible/qaccessible_unix.cpp
+++ b/src/widgets/accessible/qaccessible_unix.cpp
@@ -96,7 +96,7 @@ void QAccessible::updateAccessibility(QObject *o, int who, Event reason)
}
initialize();
- if (bridges()->isEmpty())
+ if (!bridges() || bridges()->isEmpty())
return;
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(o);
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index a8ac1a1bc0..e597760a61 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3172,7 +3172,7 @@ bool QApplication::desktopSettingsAware()
one of the above events. If no keys are being held Qt::NoModifier is
returned.
- \sa mouseButtons()
+ \sa mouseButtons(), queryKeyboardModifiers()
*/
Qt::KeyboardModifiers QApplication::keyboardModifiers()
@@ -3181,6 +3181,31 @@ Qt::KeyboardModifiers QApplication::keyboardModifiers()
}
/*!
+ \fn Qt::KeyboardModifiers QApplication::queryKeyboardModifiers()
+
+ Queries and returns the state of the modifier keys on the keyboard.
+ Unlike keyboardModifiers, this method returns the actual keys held
+ on the input device at the time of calling the method.
+
+ It does not rely on the keypress events having been received by this
+ process, which makes it possible to check the modifiers while moving
+ a window, for instance. Note that in most cases, you should use
+ keyboardModifiers(), which is faster and more accurate since it contains
+ the state of the modifiers as they were when the currently processed
+ event was received.
+
+ \sa keyboardModifiers()
+
+ \since 4.8
+*/
+
+Qt::KeyboardModifiers QApplication::queryKeyboardModifiers()
+{
+ qWarning("queryKeyboardModifiers() doesn't have a QPA implementation");
+ return QApplicationPrivate::modifier_buttons;
+}
+
+/*!
Returns the current state of the buttons on the mouse. The current state is
updated syncronously as the event queue is emptied of events that will
spontaneously change the mouse state (QEvent::MouseButtonPress and
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index c7ec35c83d..aec2c07763 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -200,6 +200,7 @@ public:
static void alert(QWidget *widget, int duration = 0);
static Qt::KeyboardModifiers keyboardModifiers();
+ static Qt::KeyboardModifiers queryKeyboardModifiers();
static Qt::MouseButtons mouseButtons();
static void setDesktopSettingsAware(bool);
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index fa75aeaebc..b122632e44 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -55,6 +55,10 @@
#include "private/qstylesheetstyle_p.h"
#include <qmath.h>
+#ifndef QT_NO_ACCESSIBILITY
+#include <qaccessible.h>
+#endif
+
QT_BEGIN_NAMESPACE
/*!
@@ -377,6 +381,11 @@ 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