summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qtabbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qtabbar.cpp')
-rw-r--r--src/widgets/widgets/qtabbar.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 73d5d73f92..6e34198f67 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -63,7 +63,7 @@
#ifndef QT_NO_TABBAR
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
#include <private/qt_mac_p.h>
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
@@ -1927,7 +1927,7 @@ void QTabBar::mousePressEvent(QMouseEvent *event)
d->moveTabFinished(d->pressedIndex);
d->pressedIndex = d->indexAtPos(event->pos());
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
d->previousPressedIndex = d->pressedIndex;
#endif
if (d->validIndex(d->pressedIndex)) {
@@ -2009,7 +2009,7 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
update();
}
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
} else if (!d->documentMode && event->buttons() == Qt::LeftButton && d->previousPressedIndex != -1) {
int newPressedIndex = d->indexAtPos(event->pos());
if (d->pressedIndex == -1 && d->previousPressedIndex == newPressedIndex) {
@@ -2107,7 +2107,7 @@ void QTabBar::mouseReleaseEvent(QMouseEvent *event)
event->ignore();
return;
}
-#ifdef Q_DEAD_CODE_FROM_QT4_MAC
+#if 0 // Used to be included in Qt4 for Q_WS_MAC
d->previousPressedIndex = -1;
#endif
if (d->movable && d->dragInProgress && d->validIndex(d->pressedIndex)) {
@@ -2552,6 +2552,34 @@ QWidget *QTabBar::tabButton(int index, ButtonPosition position) const
return d->tabList.at(index).rightWidget;
}
+#ifndef QT_NO_ACCESSIBILITY
+/*!
+ Sets the accessibleName of the tab at position \a index to \a name.
+*/
+void QTabBar::setAccessibleTabName(int index, const QString &name)
+{
+ Q_D(QTabBar);
+ if (QTabBarPrivate::Tab *tab = d->at(index)) {
+ tab->accessibleName = name;
+ QAccessibleEvent event(this, QAccessible::NameChanged);
+ event.setChild(index);
+ QAccessible::updateAccessibility(&event);
+ }
+}
+
+/*!
+ Returns the accessibleName of the tab at position \a index, or an empty
+ string if \a index is out of range.
+*/
+QString QTabBar::accessibleTabName(int index) const
+{
+ Q_D(const QTabBar);
+ if (const QTabBarPrivate::Tab *tab = d->at(index))
+ return tab->accessibleName;
+ return QString();
+}
+#endif // QT_NO_ACCESSIBILITY
+
CloseButton::CloseButton(QWidget *parent)
: QAbstractButton(parent)
{