diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qabstractscrollarea.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/qcalendarwidget.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/qcocoamenu_mac.mm | 3 | ||||
-rw-r--r-- | src/gui/widgets/qdockarealayout.cpp | 8 | ||||
-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/qplaintextedit.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/qplaintextedit_p.h | 1 | ||||
-rw-r--r-- | src/gui/widgets/qtabbar.cpp | 27 | ||||
-rw-r--r-- | src/gui/widgets/qtabbar_p.h | 1 | ||||
-rw-r--r-- | src/gui/widgets/qtextedit.cpp | 2 |
12 files changed, 30 insertions, 40 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 770e769..6de7c10 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -54,6 +54,7 @@ #ifdef Q_WS_WIN #include "qstandardgestures.h" +#include <private/qstandardgestures_p.h> #endif #include "qabstractscrollarea_p.h" @@ -299,8 +300,11 @@ void QAbstractScrollAreaPrivate::init() layoutChildren(); #ifdef Q_WS_WIN - panGesture = new QPanGesture(viewport); + panGesture = new QPanGesture(viewport, q); + panGesture->d_func()->implicitGesture = true; + QObject::connect(panGesture, SIGNAL(started()), q, SLOT(_q_gestureTriggered())); QObject::connect(panGesture, SIGNAL(triggered()), q, SLOT(_q_gestureTriggered())); + QObject::connect(panGesture, SIGNAL(finished()), q, SLOT(_q_gestureTriggered())); #endif // Q_WS_WIN } diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp index dfd8639..8ed57cd 100644 --- a/src/gui/widgets/qcalendarwidget.cpp +++ b/src/gui/widgets/qcalendarwidget.cpp @@ -1967,9 +1967,7 @@ void QCalendarWidgetPrivate::_q_editingFinished() The widget is initialized with the current month and year, but QCalendarWidget provides several public slots to change the year - and month that is shown. The currently displayed month and year - can be retrieved using the currentPageMonth() and currentPageYear() - functions, respectively. + and month that is shown. By default, today's date is selected, and the user can select a date using both mouse and keyboard. The currently selected date @@ -1982,6 +1980,9 @@ void QCalendarWidgetPrivate::_q_editingFinished() all. Note that a date also can be selected programmatically using the setSelectedDate() slot. + The currently displayed month and year can be retrieved using the + monthShown() and yearShown() functions, respectively. + A newly created calendar widget uses abbreviated day names, and both Saturdays and Sundays are marked in red. The calendar grid is not visible. The week numbers are displayed, and the first column @@ -2287,7 +2288,7 @@ int QCalendarWidget::monthShown() const selected date. The currently displayed month and year can be retrieved using the - currentPageMonth() and currentPageYear() functions respectively. + monthShown() and yearShown() functions respectively. \sa yearShown(), monthShown(), showPreviousMonth(), showNextMonth(), showPreviousYear(), showNextYear() 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/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp index 3d1d3b1..3920ae9 100644 --- a/src/gui/widgets/qdockarealayout.cpp +++ b/src/gui/widgets/qdockarealayout.cpp @@ -2601,28 +2601,28 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list, center_rect.setBottom(rect.bottom() - docks[QInternal::BottomDock].rect.height() - sep); QSize left_hint = docks[QInternal::LeftDock].size(); - if (!left_hint.isValid()) + if (left_hint.isNull()) left_hint = docks[QInternal::LeftDock].sizeHint(); QSize left_min = docks[QInternal::LeftDock].minimumSize(); QSize left_max = docks[QInternal::LeftDock].maximumSize(); left_hint = left_hint.boundedTo(left_max).expandedTo(left_min); QSize right_hint = docks[QInternal::RightDock].size(); - if (!right_hint.isValid()) + if (right_hint.isNull()) right_hint = docks[QInternal::RightDock].sizeHint(); QSize right_min = docks[QInternal::RightDock].minimumSize(); QSize right_max = docks[QInternal::RightDock].maximumSize(); right_hint = right_hint.boundedTo(right_max).expandedTo(right_min); QSize top_hint = docks[QInternal::TopDock].size(); - if (!top_hint.isValid()) + if (top_hint.isNull()) top_hint = docks[QInternal::TopDock].sizeHint(); QSize top_min = docks[QInternal::TopDock].minimumSize(); QSize top_max = docks[QInternal::TopDock].maximumSize(); top_hint = top_hint.boundedTo(top_max).expandedTo(top_min); QSize bottom_hint = docks[QInternal::BottomDock].size(); - if (!bottom_hint.isValid()) + if (bottom_hint.isNull()) bottom_hint = docks[QInternal::BottomDock].sizeHint(); QSize bottom_min = docks[QInternal::BottomDock].minimumSize(); QSize bottom_max = docks[QInternal::BottomDock].maximumSize(); 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/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index c79e482..085341c 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -794,10 +794,6 @@ void QPlainTextEditPrivate::init(const QString &txt) viewport->setCursor(Qt::IBeamCursor); #endif originalOffsetY = 0; -#ifdef Q_WS_WIN - panGesture = new QPanGesture(q); - QObject::connect(panGesture, SIGNAL(triggered()), q, SLOT(_q_gestureTriggered())); -#endif } void QPlainTextEditPrivate::_q_repaintContents(const QRectF &contentsRect) diff --git a/src/gui/widgets/qplaintextedit_p.h b/src/gui/widgets/qplaintextedit_p.h index 7ff0c03..cda1d92 100644 --- a/src/gui/widgets/qplaintextedit_p.h +++ b/src/gui/widgets/qplaintextedit_p.h @@ -182,7 +182,6 @@ public: #ifdef Q_WS_WIN void _q_gestureTriggered(); - QPanGesture *panGesture; #endif }; 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); diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp index 547a4fb..cc79464 100644 --- a/src/gui/widgets/qtextedit.cpp +++ b/src/gui/widgets/qtextedit.cpp @@ -67,8 +67,6 @@ #include <qtexttable.h> #include <qvariant.h> -#include <qstandardgestures.h> - #include <qinputcontext.h> #endif |