diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qcocoamenu_mac.mm | 3 | ||||
-rw-r--r-- | src/gui/widgets/qmaccocoaviewcontainer_mac.mm | 3 | ||||
-rw-r--r-- | src/gui/widgets/qmacnativewidget_mac.mm | 3 | ||||
-rw-r--r-- | src/gui/widgets/qmainwindowlayout_mac.mm | 3 | ||||
-rw-r--r-- | src/gui/widgets/qtabbar.cpp | 27 | ||||
-rw-r--r-- | src/gui/widgets/qtabbar_p.h | 1 |
6 files changed, 16 insertions, 24 deletions
diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm index bda9352..5f95b70 100644 --- a/src/gui/widgets/qcocoamenu_mac.mm +++ b/src/gui/widgets/qcocoamenu_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #include "qmacdefines_mac.h" diff --git a/src/gui/widgets/qmaccocoaviewcontainer_mac.mm b/src/gui/widgets/qmaccocoaviewcontainer_mac.mm index 2ed2e5f..a45d992 100644 --- a/src/gui/widgets/qmaccocoaviewcontainer_mac.mm +++ b/src/gui/widgets/qmaccocoaviewcontainer_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #import <Cocoa/Cocoa.h> diff --git a/src/gui/widgets/qmacnativewidget_mac.mm b/src/gui/widgets/qmacnativewidget_mac.mm index 28fa1ec..224a51f 100644 --- a/src/gui/widgets/qmacnativewidget_mac.mm +++ b/src/gui/widgets/qmacnativewidget_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #import <Cocoa/Cocoa.h> diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index 2ccd3e7..797c7c5 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -37,9 +37,6 @@ ** ** $QT_END_LICENSE$ ** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** ****************************************************************************/ #include <private/qmainwindowlayout_p.h> diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index 64e383f..560b76c 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1897,13 +1897,8 @@ void QTabBar::keyPressEvent(QKeyEvent *event) event->ignore(); return; } - int dx = event->key() == (isRightToLeft() ? Qt::Key_Right : Qt::Key_Left) ? -1 : 1; - for (int index = d->currentIndex + dx; d->validIndex(index); index += dx) { - if (d->tabList.at(index).enabled) { - setCurrentIndex(index); - break; - } - } + int offset = event->key() == (isRightToLeft() ? Qt::Key_Right : Qt::Key_Left) ? -1 : 1; + d->setCurrentNextEnabledIndex(offset); } /*!\reimp @@ -1912,15 +1907,23 @@ void QTabBar::keyPressEvent(QKeyEvent *event) void QTabBar::wheelEvent(QWheelEvent *event) { Q_D(QTabBar); - int overIndex = d->indexAtPos(event->pos()); - if (overIndex != -1) { - int offset = event->delta() > 0 ? -1 : 1; - setCurrentIndex(currentIndex() + offset); - } + int offset = event->delta() > 0 ? -1 : 1; + d->setCurrentNextEnabledIndex(offset); QWidget::wheelEvent(event); } #endif //QT_NO_WHEELEVENT +void QTabBarPrivate::setCurrentNextEnabledIndex(int offset) +{ + Q_Q(QTabBar); + for (int index = currentIndex + offset; validIndex(index); index += offset) { + if (tabList.at(index).enabled) { + q->setCurrentIndex(index); + break; + } + } +} + /*!\reimp */ void QTabBar::changeEvent(QEvent *event) diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h index 150909e..2ddd8bb 100644 --- a/src/gui/widgets/qtabbar_p.h +++ b/src/gui/widgets/qtabbar_p.h @@ -159,6 +159,7 @@ public: int indexAtPos(const QPoint &p) const; inline bool validIndex(int index) const { return index >= 0 && index < tabList.count(); } + void setCurrentNextEnabledIndex(int offset); QSize minimumTabSizeHint(int index); |