From 8ba412e584254dc0dd9f188bc83c7ddd5b911480 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 27 Jan 2017 16:51:14 +0100 Subject: [PATCH] ComboTabBar: Add setFocusPolicy TabBar is setting Qt::NoFocus policy which was ignored --- src/lib/tabwidget/combotabbar.cpp | 7 +++++++ src/lib/tabwidget/combotabbar.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/lib/tabwidget/combotabbar.cpp b/src/lib/tabwidget/combotabbar.cpp index 2386bd341..0caa64ee1 100644 --- a/src/lib/tabwidget/combotabbar.cpp +++ b/src/lib/tabwidget/combotabbar.cpp @@ -498,6 +498,13 @@ bool ComboTabBar::isPinned(int index) const return index >= 0 && index < pinnedTabsCount(); } +void ComboTabBar::setFocusPolicy(Qt::FocusPolicy policy) +{ + QWidget::setFocusPolicy(policy); + m_mainTabBar->setFocusPolicy(policy); + m_pinnedTabBar->setFocusPolicy(policy); +} + void ComboTabBar::setObjectName(const QString &name) { m_mainTabBar->setObjectName(name); diff --git a/src/lib/tabwidget/combotabbar.h b/src/lib/tabwidget/combotabbar.h index 91e161bd9..902c2bf4c 100644 --- a/src/lib/tabwidget/combotabbar.h +++ b/src/lib/tabwidget/combotabbar.h @@ -117,6 +117,7 @@ public: bool isPinned(int index) const; void setMaxVisiblePinnedTab(int max); + void setFocusPolicy(Qt::FocusPolicy policy); void setObjectName(const QString &name); void setMouseTracking(bool enable);