summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp65
-rw-r--r--src/widgets/kernel/qapplication.h4
-rw-r--r--src/widgets/kernel/qapplication_p.h3
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp4
-rw-r--r--src/widgets/kernel/qwidget.cpp28
5 files changed, 14 insertions, 90 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 90b64db579..348eb2f343 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -371,9 +371,6 @@ void qt_init(QApplicationPrivate *priv, int type
);
void qt_cleanup();
-Qt::MouseButtons QApplicationPrivate::mouse_buttons = Qt::NoButton;
-Qt::KeyboardModifiers QApplicationPrivate::modifier_buttons = Qt::NoModifier;
-
QStyle *QApplicationPrivate::app_style = 0; // default application style
QString QApplicationPrivate::styleOverride; // style override
@@ -2665,68 +2662,6 @@ QDesktopWidget *QApplication::desktop()
return qt_desktopWidget;
}
-/*!
- Returns the current state of the modifier keys on the keyboard. The current
- state is updated sychronously as the event queue is emptied of events that
- will spontaneously change the keyboard state (QEvent::KeyPress and
- QEvent::KeyRelease events).
-
- It should be noted this may not reflect the actual keys held on the input
- device at the time of calling but rather the modifiers as last reported in
- one of the above events. If no keys are being held Qt::NoModifier is
- returned.
-
- \sa mouseButtons(), queryKeyboardModifiers()
-*/
-
-Qt::KeyboardModifiers QApplication::keyboardModifiers()
-{
- return QApplicationPrivate::modifier_buttons;
-}
-
-/*!
- \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
- QEvent::MouseButtonRelease events).
-
- It should be noted this may not reflect the actual buttons held on the
- input device at the time of calling but rather the mouse buttons as last
- reported in one of the above events. If no mouse buttons are being held
- Qt::NoButton is returned.
-
- \sa keyboardModifiers()
-*/
-
-Qt::MouseButtons QApplication::mouseButtons()
-{
- return QApplicationPrivate::mouse_buttons;
-}
/*!
\fn bool QApplication::isSessionRestored() const
diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h
index 060765969f..55ed6998fa 100644
--- a/src/widgets/kernel/qapplication.h
+++ b/src/widgets/kernel/qapplication.h
@@ -150,10 +150,6 @@ public:
static void beep();
static void alert(QWidget *widget, int duration = 0);
- static Qt::KeyboardModifiers keyboardModifiers();
- static Qt::KeyboardModifiers queryKeyboardModifiers();
- static Qt::MouseButtons mouseButtons();
-
static void setCursorFlashTime(int);
static int cursorFlashTime();
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 2d639172e2..74af3bca6d 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -247,9 +247,6 @@ public:
QPoint toolTipPos, toolTipGlobalPos, hoverGlobalPos;
QPointer<QWidget> toolTipWidget;
- static Qt::MouseButtons mouse_buttons;
- static Qt::KeyboardModifiers modifier_buttons;
-
static QSize app_strut;
static QWidgetList *popupWidgets;
static QStyle *app_style;
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 4a6f3518d0..1c20b98139 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -412,7 +412,7 @@ QWhatsThisPrivate::QWhatsThisPrivate()
#endif
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpStart, this, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpStart, this));
#endif
}
@@ -424,7 +424,7 @@ QWhatsThisPrivate::~QWhatsThisPrivate()
QApplication::restoreOverrideCursor();
#endif
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpEnd, this, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpEnd, this));
#endif
instance = 0;
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index bf864503a4..1493f61972 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5965,7 +5965,7 @@ void QWidget::setFocus(Qt::FocusReason reason)
// menus update the focus manually and this would create bogus events
if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem")))
# endif
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, f, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, f));
#endif
#ifndef QT_NO_GRAPHICSVIEW
if (QWExtra *topData = window()->d_func()->extra) {
@@ -6045,7 +6045,7 @@ void QWidget::clearFocus()
#endif
{
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this));
#endif
}
}
@@ -7052,7 +7052,7 @@ void QWidgetPrivate::show_helper()
#ifndef QT_NO_ACCESSIBILITY
if (q->windowType() != Qt::ToolTip) // Tooltips are read aloud twice in MS narrator.
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectShow, q, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectShow, q));
#endif
if (QApplicationPrivate::hidden_focus_widget == q) {
@@ -7143,7 +7143,7 @@ void QWidgetPrivate::hide_helper()
#ifndef QT_NO_ACCESSIBILITY
if (wasVisible)
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, q, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, q));
#endif
}
@@ -7375,7 +7375,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
qApp->d_func()->sendSyntheticEnterLeave(widget);
#ifndef QT_NO_ACCESSIBILITY
if (!spontaneous)
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, widget, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, widget));
#endif
}
}
@@ -8245,12 +8245,15 @@ 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(QAccessibleEvent(QAccessible::StateChanged, this, 0));
+ QAccessible::State s;
+ s.disabled = true;
+ QAccessible::updateAccessibility(QAccessibleStateChangeEvent(s, this));
#endif
break;
+ }
case QEvent::FontChange:
case QEvent::StyleChange: {
@@ -10386,7 +10389,7 @@ void QWidget::setAccessibleName(const QString &name)
{
Q_D(QWidget);
d->accessibleName = name;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this));
}
QString QWidget::accessibleName() const
@@ -10408,7 +10411,7 @@ void QWidget::setAccessibleDescription(const QString &description)
{
Q_D(QWidget);
d->accessibleDescription = description;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, this, 0));
+ QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, this));
}
QString QWidget::accessibleDescription() const
@@ -10515,13 +10518,6 @@ void QWidget::updateMicroFocus()
{
// updating everything since this is currently called for any kind of state change
qApp->inputMethod()->update(Qt::ImQueryAll);
-
-#ifndef QT_NO_ACCESSIBILITY
- if (isVisible()) {
- // ##### is this correct
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::StateChanged, this, 0));
- }
-#endif
}
/*!