summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp6
-rw-r--r--src/widgets/widgets/qabstractslider.cpp3
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp6
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp4
-rw-r--r--src/widgets/widgets/qcombobox.cpp32
-rw-r--r--src/widgets/widgets/qgroupbox.cpp3
-rw-r--r--src/widgets/widgets/qlabel.cpp6
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp3
-rw-r--r--src/widgets/widgets/qmenu.cpp12
-rw-r--r--src/widgets/widgets/qmenubar.cpp6
-rw-r--r--src/widgets/widgets/qprogressbar.cpp3
-rw-r--r--src/widgets/widgets/qpushbutton.cpp3
-rw-r--r--src/widgets/widgets/qtabbar.cpp10
-rw-r--r--src/widgets/widgets/qtabbar.h3
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp9
15 files changed, 74 insertions, 35 deletions
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index aebef8ddc9..0b24799a56 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -644,7 +644,8 @@ void QAbstractButton::setText(const QString &text)
update();
updateGeometry();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this));
+ QAccessibleEvent event(QAccessible::NameChanged, this);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -769,7 +770,8 @@ void QAbstractButton::setChecked(bool checked)
#ifndef QT_NO_ACCESSIBILITY
QAccessible::State s;
s.checked = true;
- QAccessible::updateAccessibility(QAccessibleStateChangeEvent(s, this));
+ QAccessibleStateChangeEvent event(s, this);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp
index b0216e5277..2d3f79e43d 100644
--- a/src/widgets/widgets/qabstractslider.cpp
+++ b/src/widgets/widgets/qabstractslider.cpp
@@ -538,7 +538,8 @@ void QAbstractSlider::setValue(int value)
emit sliderMoved((d->position = value));
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this));
+ QAccessibleEvent event(QAccessible::ValueChanged, this);
+ QAccessible::updateAccessibility(&event);
#endif
sliderChange(SliderValueChange);
emit valueChanged(value);
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index c083369136..7b55b0fa8c 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -976,7 +976,8 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
}
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this));
+ QAccessibleEvent event(QAccessible::ValueChanged, this);
+ QAccessible::updateAccessibility(&event);
#endif
return;
}
@@ -1595,7 +1596,8 @@ void QAbstractSpinBoxPrivate::updateState(bool up, bool fromKeyboard /* = false
buttonState = (up ? Up : Down) | (fromKeyboard ? Keyboard : Mouse);
q->stepBy(up ? 1 : -1);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, q));
+ QAccessibleEvent event(QAccessible::ValueChanged, q);
+ QAccessible::updateAccessibility(&event);
#endif
}
}
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index 129da9d94d..427af68b64 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -2068,9 +2068,9 @@ QCalendarWidget::QCalendarWidget(QWidget *parent)
d->m_view->setSelectionBehavior(QAbstractItemView::SelectItems);
d->m_view->setSelectionMode(QAbstractItemView::SingleSelection);
d->m_view->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
- d->m_view->horizontalHeader()->setClickable(false);
+ d->m_view->horizontalHeader()->setSectionsClickable(false);
d->m_view->verticalHeader()->setResizeMode(QHeaderView::Stretch);
- d->m_view->verticalHeader()->setClickable(false);
+ d->m_view->verticalHeader()->setSectionsClickable(false);
d->m_selection = d->m_view->selectionModel();
d->createNavigationBar(this);
d->m_view->setFrameStyle(QFrame::NoFrame);
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index c5f5d6e6e1..88c17ca704 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -58,6 +58,7 @@
#include <qtreeview.h>
#include <qheaderview.h>
#include <qmath.h>
+#include <qmetaobject.h>
#include <private/qguiapplication_p.h>
#include <private/qapplication_p.h>
#include <private/qcombobox_p.h>
@@ -982,7 +983,8 @@ void QComboBoxPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIn
q->update();
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, q, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -1238,7 +1240,8 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
emit q->currentIndexChanged(index.row());
emit q->currentIndexChanged(itemText(index));
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, q, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2545,17 +2548,25 @@ void QComboBox::hidePopup()
// Fade out.
bool needFade = style()->styleHint(QStyle::SH_Menu_FadeOutOnHide);
+ bool didFade = false;
if (needFade) {
-#if defined(Q_WS_MAC)
- macWindowFade(qt_mac_window_for(d->container));
-#endif // Q_WS_MAC
+#if defined(Q_OS_MAC)
+ QPlatformNativeInterface *platformNativeInterface = qApp->platformNativeInterface();
+ int at = platformNativeInterface->metaObject()->indexOfMethod("fadeWindow()");
+ if (at != -1) {
+ QMetaMethod windowFade = platformNativeInterface->metaObject()->method(at);
+ windowFade.invoke(platformNativeInterface, Q_ARG(QWindow *, d->container->windowHandle()));
+ didFade = true;
+ }
+
+#endif // Q_OS_MAC
// Other platform implementations welcome :-)
}
d->model->blockSignals(false);
d->container->itemView()->blockSignals(false);
d->container->blockSignals(false);
- if (!needFade)
+ if (!didFade)
#endif // QT_NO_EFFECTS
// Fade should implicitly hide as well ;-)
d->container->hide();
@@ -2578,7 +2589,8 @@ void QComboBox::clear()
Q_D(QComboBox);
d->model->removeRows(0, d->model->rowCount(d->root), d->root);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2597,7 +2609,8 @@ void QComboBox::clearEditText()
if (d->lineEdit)
d->lineEdit->clear();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2610,7 +2623,8 @@ void QComboBox::setEditText(const QString &text)
if (d->lineEdit)
d->lineEdit->setText(text);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index cf3e14871f..7186ddfccc 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -249,7 +249,8 @@ void QGroupBox::setTitle(const QString &title)
update();
updateGeometry();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 82e56f3354..f36dea52dd 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -315,8 +315,10 @@ void QLabel::setText(const QString &text)
d->updateLabel();
#ifndef QT_NO_ACCESSIBILITY
- if (accessibleName().isEmpty())
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ if (accessibleName().isEmpty()) {
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
+ }
#endif
}
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index d06e98e31a..37e956c27f 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -144,7 +144,8 @@ void QLineEditPrivate::_q_selectionChanged()
emit q->selectionChanged();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextSelectionChanged, q));
+ QAccessibleEvent event(QAccessible::TextSelectionChanged, q);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index af4a87e282..7d4f7151a4 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1076,8 +1076,10 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
int actionIndex = indexOf(action);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, q, actionIndex));
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, q, actionIndex));
+ QAccessibleEvent focusEvent(QAccessible::Focus, q, actionIndex);
+ QAccessible::updateAccessibility(&focusEvent);
+ QAccessibleEvent selectionEvent(QAccessible::Selection, q, actionIndex);
+ QAccessible::updateAccessibility(&selectionEvent);
}
#endif
action->showStatusText(topCausedWidget());
@@ -1970,7 +1972,8 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::PopupMenuStart, this ,0));
+ QAccessibleEvent event(QAccessible::PopupMenuStart, this ,0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2091,7 +2094,8 @@ void QMenu::hideEvent(QHideEvent *)
d->eventLoop->exit();
d->setCurrentAction(0);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::PopupMenuEnd, this));
+ QAccessibleEvent event(QAccessible::PopupMenuEnd, this);
+ QAccessible::updateAccessibility(&event);
#endif
#ifndef QT_NO_MENUBAR
if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->causedPopup.widget))
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 0efa6caebc..2712839103 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -531,8 +531,10 @@ void QMenuBarPrivate::_q_actionHovered()
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
int actionIndex = actions.indexOf(action);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, q, actionIndex));
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, q, actionIndex));
+ QAccessibleEvent focusEvent(QAccessible::Focus, q, actionIndex);
+ QAccessible::updateAccessibility(&focusEvent);
+ QAccessibleEvent selectionEvent(QAccessible::Selection, q, actionIndex);
+ QAccessible::updateAccessibility(&selectionEvent);
}
#endif //QT_NO_ACCESSIBILITY
}
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index c1a34bfb7a..0439caeb88 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -314,7 +314,8 @@ void QProgressBar::setValue(int value)
d->value = value;
emit valueChanged(value);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this));
+ QAccessibleEvent event(QAccessible::ValueChanged, this);
+ QAccessible::updateAccessibility(&event);
#endif
if (d->repaintRequired())
repaint();
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index 059b0f801c..5dae4e0b34 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -378,7 +378,8 @@ void QPushButton::setDefault(bool enable)
#ifndef QT_NO_ACCESSIBILITY
QAccessible::State s;
s.defaultButton = true;
- QAccessible::updateAccessibility(QAccessibleStateChangeEvent(s, this));
+ QAccessibleStateChangeEvent event(s, this);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index ecb0ef84e0..2cc573e958 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -359,8 +359,10 @@ void QTabBarPrivate::init()
#endif
q->setFocusPolicy(Qt::TabFocus);
+#ifndef QT_NO_ACCESSIBILITY
leftB->setAccessibleName(QTabBar::tr("Scroll Left"));
rightB->setAccessibleName(QTabBar::tr("Scroll Right"));
+#endif
q->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
elideMode = Qt::TextElideMode(q->style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, q));
useScrollButtons = !q->style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, q);
@@ -1183,8 +1185,10 @@ void QTabBar::setCurrentIndex(int index)
d->layoutTab(index);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, index));
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, this, index));
+ QAccessibleEvent focusEvent(QAccessible::Focus, this, index);
+ QAccessible::updateAccessibility(&focusEvent);
+ QAccessibleEvent selectionEvent(QAccessible::Selection, this, index);
+ QAccessible::updateAccessibility(&selectionEvent);
}
#endif
emit currentChanged(index);
@@ -1739,7 +1743,7 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
if (d->pressedIndex != -1
&& event->buttons() == Qt::NoButton)
d->moveTabFinished(d->pressedIndex);
-
+
// Start drag
if (!d->dragInProgress && d->pressedIndex != -1) {
if ((event->pos() - d->dragStartPosition).manhattanLength() > QApplication::startDragDistance()) {
diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h
index 13ed3bc6d2..2698213d07 100644
--- a/src/widgets/widgets/qtabbar.h
+++ b/src/widgets/widgets/qtabbar.h
@@ -198,8 +198,9 @@ protected:
void changeEvent(QEvent *);
void initStyleOption(QStyleOptionTab *option, int tabIndex) const;
-
+#ifndef QT_NO_ACCESSIBILITY
friend class QAccessibleTabBar;
+#endif
private:
Q_DISABLE_COPY(QTabBar)
Q_DECLARE_PRIVATE(QTabBar)
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index a04339f864..7c659ebb64 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -767,8 +767,10 @@ void QWidgetLineControl::internalSetText(const QString &txt, int pos, bool edite
bool changed = finishChange(-1, true, edited);
#ifndef QT_NO_ACCESSIBILITY
- if (changed)
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextUpdated, parent()));
+ if (changed) {
+ QAccessibleEvent event(QAccessible::TextUpdated, parent());
+ QAccessible::updateAccessibility(&event);
+ }
#endif
}
@@ -1367,7 +1369,8 @@ void QWidgetLineControl::emitCursorPositionChanged()
m_lastCursorPos = m_cursor;
cursorPositionChanged(oldLast, m_cursor);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextCaretMoved, parent()));
+ QAccessibleEvent event(QAccessible::TextCaretMoved, parent());
+ QAccessible::updateAccessibility(&event);
#endif
}
}