diff options
| author | Amandeep Singh <[email protected]> | 2012-08-06 17:40:30 +0530 |
|---|---|---|
| committer | Amandeep Singh <[email protected]> | 2012-08-14 20:27:55 +0530 |
| commit | cd1d45c831458f96904c12b2803c3b8fc29f17f2 (patch) | |
| tree | 4ee39ff1b15cccf5fea3a142bf9b569808f8017f /src/kitemviews/kitemlistcontainer.cpp | |
| parent | 220d0d522dd3aca740c4c2d0c1f91f277f2405fd (diff) | |
Adding the Accessibility classes
Diffstat (limited to 'src/kitemviews/kitemlistcontainer.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistcontainer.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp index 5500851c8..6e2540260 100644 --- a/src/kitemviews/kitemlistcontainer.cpp +++ b/src/kitemviews/kitemlistcontainer.cpp @@ -38,6 +38,8 @@ #include <KDebug> +#include "kitemlistviewaccessible.h" + /** * Replaces the default viewport of KItemListContainer by a * non-scrollable viewport. The scrolling is done in an optimized @@ -67,6 +69,14 @@ void KItemListContainerViewport::wheelEvent(QWheelEvent* event) event->ignore(); } +QAccessibleInterface* accessibleContainerFactory(const QString &key, QObject *object) +{ + Q_UNUSED(key) + if (KItemListView *view = qobject_cast<KItemListView*>(object)) + return new KItemListViewAccessible(view); + return 0; +} + KItemListContainer::KItemListContainer(KItemListController* controller, QWidget* parent) : QAbstractScrollArea(parent), m_controller(controller), @@ -93,6 +103,8 @@ KItemListContainer::KItemListContainer(KItemListController* controller, QWidget* this, SLOT(slotModelChanged(KItemModelBase*,KItemModelBase*))); connect(controller, SIGNAL(viewChanged(KItemListView*,KItemListView*)), this, SLOT(slotViewChanged(KItemListView*,KItemListView*))); + + QAccessible::installFactory(accessibleContainerFactory); } KItemListContainer::~KItemListContainer() @@ -101,6 +113,8 @@ KItemListContainer::~KItemListContainer() // the QGraphicsScene might get deleted before the view. delete m_controller; m_controller = 0; + + QAccessible::removeFactory(accessibleContainerFactory); } KItemListController* KItemListContainer::controller() const |
