summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/animation/animation.pri3
-rw-r--r--src/widgets/animation/qguivariantanimation.cpp95
-rw-r--r--src/widgets/dialogs/qdialog.cpp9
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp3
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp3
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp2
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp18
-rw-r--r--src/widgets/itemviews/qheaderview.cpp130
-rw-r--r--src/widgets/itemviews/qheaderview.h27
-rw-r--r--src/widgets/itemviews/qlistview.cpp9
-rw-r--r--src/widgets/itemviews/qtableview.cpp50
-rw-r--r--src/widgets/itemviews/qtreeview.cpp19
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp2
-rw-r--r--src/widgets/kernel/qiconloader.cpp4
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp6
-rw-r--r--src/widgets/kernel/qwidget.cpp37
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa.cpp4
-rw-r--r--src/widgets/kernel/qwidgetwindow_qpa_p.h2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm1
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp60
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp6
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp6
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp1
-rw-r--r--src/widgets/widgets.pro1
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp6
-rw-r--r--src/widgets/widgets/qabstractslider.cpp3
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp6
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp4
-rw-r--r--src/widgets/widgets/qcombobox.cpp32
-rw-r--r--src/widgets/widgets/qgroupbox.cpp3
-rw-r--r--src/widgets/widgets/qlabel.cpp6
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp3
-rw-r--r--src/widgets/widgets/qmenu.cpp12
-rw-r--r--src/widgets/widgets/qmenubar.cpp6
-rw-r--r--src/widgets/widgets/qprogressbar.cpp3
-rw-r--r--src/widgets/widgets/qpushbutton.cpp3
-rw-r--r--src/widgets/widgets/qtabbar.cpp10
-rw-r--r--src/widgets/widgets/qtabbar.h3
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp9
39 files changed, 330 insertions, 277 deletions
diff --git a/src/widgets/animation/animation.pri b/src/widgets/animation/animation.pri
deleted file mode 100644
index 27763ca003..0000000000
--- a/src/widgets/animation/animation.pri
+++ /dev/null
@@ -1,3 +0,0 @@
-# Qt gui animation module
-
-SOURCES += animation/qguivariantanimation.cpp
diff --git a/src/widgets/animation/qguivariantanimation.cpp b/src/widgets/animation/qguivariantanimation.cpp
deleted file mode 100644
index c344a18b8a..0000000000
--- a/src/widgets/animation/qguivariantanimation.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <QtCore/qvariantanimation.h>
-#include <private/qvariantanimation_p.h>
-
-#ifndef QT_NO_ANIMATION
-
-#include <QtGui/qcolor.h>
-#include <QtGui/qvector2d.h>
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector4d.h>
-#include <QtGui/qquaternion.h>
-
-QT_BEGIN_NAMESPACE
-
-template<> Q_INLINE_TEMPLATE QColor _q_interpolate(const QColor &f,const QColor &t, qreal progress)
-{
- return QColor(qBound(0,_q_interpolate(f.red(), t.red(), progress),255),
- qBound(0,_q_interpolate(f.green(), t.green(), progress),255),
- qBound(0,_q_interpolate(f.blue(), t.blue(), progress),255),
- qBound(0,_q_interpolate(f.alpha(), t.alpha(), progress),255));
-}
-
-template<> Q_INLINE_TEMPLATE QQuaternion _q_interpolate(const QQuaternion &f,const QQuaternion &t, qreal progress)
-{
- return QQuaternion::slerp(f, t, progress);
-}
-
-static void qRegisterGuiGetInterpolator()
-{
- qRegisterAnimationInterpolator<QColor>(_q_interpolateVariant<QColor>);
- qRegisterAnimationInterpolator<QVector2D>(_q_interpolateVariant<QVector2D>);
- qRegisterAnimationInterpolator<QVector3D>(_q_interpolateVariant<QVector3D>);
- qRegisterAnimationInterpolator<QVector4D>(_q_interpolateVariant<QVector4D>);
- qRegisterAnimationInterpolator<QQuaternion>(_q_interpolateVariant<QQuaternion>);
-}
-Q_CONSTRUCTOR_FUNCTION(qRegisterGuiGetInterpolator)
-
-static void qUnregisterGuiGetInterpolator()
-{
- // casts required by Sun CC 5.5
- qRegisterAnimationInterpolator<QColor>(
- (QVariant (*)(const QColor &, const QColor &, qreal))0);
- qRegisterAnimationInterpolator<QVector2D>(
- (QVariant (*)(const QVector2D &, const QVector2D &, qreal))0);
- qRegisterAnimationInterpolator<QVector3D>(
- (QVariant (*)(const QVector3D &, const QVector3D &, qreal))0);
- qRegisterAnimationInterpolator<QVector4D>(
- (QVariant (*)(const QVector4D &, const QVector4D &, qreal))0);
- qRegisterAnimationInterpolator<QQuaternion>(
- (QVariant (*)(const QQuaternion &, const QQuaternion &, qreal))0);
-}
-Q_DESTRUCTOR_FUNCTION(qUnregisterGuiGetInterpolator)
-
-QT_END_NAMESPACE
-
-#endif //QT_NO_ANIMATION
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index f1a6a294d2..5d36bc07e8 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -754,7 +754,8 @@ void QDialog::setVisible(bool visible)
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DialogStart, this));
+ QAccessibleEvent event(QAccessible::DialogStart, this);
+ QAccessible::updateAccessibility(&event);
#endif
} else {
@@ -762,8 +763,10 @@ void QDialog::setVisible(bool visible)
return;
#ifndef QT_NO_ACCESSIBILITY
- if (isVisible())
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DialogEnd, this));
+ if (isVisible()) {
+ QAccessibleEvent event(QAccessible::DialogEnd, this);
+ QAccessible::updateAccessibility(&event);
+ }
#endif
// Reimplemented to exit a modal event loop when the dialog is hidden.
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index e1b134ee48..040f61dfc5 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1463,7 +1463,8 @@ void QMessageBox::showEvent(QShowEvent *e)
d->updateSize();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Alert, this));
+ QAccessibleEvent event(QAccessible::Alert, this);
+ QAccessible::updateAccessibility(&event);
#endif
#ifdef Q_OS_WIN
if (const HMENU systemMenu = qt_getWindowsSystemMenu(this)) {
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index 830853094a..752542c1ee 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -843,7 +843,8 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item,
#ifndef QT_NO_ACCESSIBILITY
if (focusItem) {
if (QGraphicsObject *focusObj = focusItem->toGraphicsObject()) {
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, focusObj));
+ QAccessibleEvent event(QAccessible::Focus, focusObj);
+ QAccessible::updateAccessibility(&event);
}
}
#endif
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp
index 6184a5845a..ecba3e238f 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.cpp
+++ b/src/widgets/itemviews/qabstractitemdelegate.cpp
@@ -243,6 +243,8 @@ QWidget *QAbstractItemDelegate::createEditor(QWidget *,
/*!
+ \since 5.0
+
A function called when the editor is no longer needed and should be
destroyed. The default behavior is a call to deleteLater on the editor.
It possible e.g. to avoid this delete by reimplementing this function.
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 8530e2c23e..8992a3bdfe 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -1112,7 +1112,8 @@ void QAbstractItemView::reset()
#ifdef Q_WS_X11
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(this)->table2Interface()->modelReset();
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TableModelChanged, this, 0));
+ QAccessibleEvent event(QAccessible::TableModelChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
}
#endif
#endif
@@ -3342,7 +3343,8 @@ void QAbstractItemViewPrivate::_q_rowsRemoved(const QModelIndex &index, int star
#ifdef Q_WS_X11
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsRemoved(index, start, end);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TableModelChanged, q, 0));
+ QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
}
#endif
#endif
@@ -3422,7 +3424,8 @@ void QAbstractItemViewPrivate::_q_columnsRemoved(const QModelIndex &index, int s
#ifdef Q_WS_X11
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->columnsRemoved(index, start, end);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TableModelChanged, q, 0));
+ QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
}
#endif
#endif
@@ -3445,7 +3448,8 @@ void QAbstractItemViewPrivate::_q_rowsInserted(const QModelIndex &index, int sta
Q_Q(QAbstractItemView);
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->rowsInserted(index, start, end);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TableModelChanged, q, 0));
+ QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
}
#endif
#endif
@@ -3469,7 +3473,8 @@ void QAbstractItemViewPrivate::_q_columnsInserted(const QModelIndex &index, int
#ifdef Q_WS_X11
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->columnsInserted(index, start, end);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TableModelChanged, q, 0));
+ QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
}
#endif
#endif
@@ -3497,7 +3502,8 @@ void QAbstractItemViewPrivate::_q_layoutChanged()
Q_Q(QAbstractItemView);
if (QAccessible::isActive()) {
QAccessible::queryAccessibleInterface(q)->table2Interface()->modelReset();
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TableModelChanged, q, 0));
+ QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
}
#endif
#endif
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index eac543d37d..425eb4cd95 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -120,9 +120,9 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span)
\section1 Moving Header Sections
- A header can be fixed in place, or made movable with setMovable(). It can
- be made clickable with setClickable(), and has resizing behavior in
- accordance with setResizeMode().
+ A header can be fixed in place, or made movable with setSectionsMovable(). It can
+ be made clickable with setSectionsClickable(), and has resizing behavior in
+ accordance with setResizeMode() and setSectionResizeMode()
\note Double-clicking on a header to resize a section only applies for
visible rows.
@@ -185,7 +185,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span)
The following values are obsolete:
\value Custom Use Fixed instead.
- \sa setResizeMode() stretchLastSection minimumSectionSize
+ \sa setResizeMode() setSectionResizeMode() stretchLastSection minimumSectionSize
*/
/*!
@@ -216,7 +216,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span)
This signal is emitted when a section is pressed. The section's logical
index is specified by \a logicalIndex.
- \sa setClickable()
+ \sa setSectionsClickable()
*/
/*!
@@ -227,7 +227,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span)
Note that the sectionPressed signal will also be emitted.
- \sa setClickable(), sectionPressed()
+ \sa setSectionsClickable(), sectionPressed()
*/
/*!
@@ -238,7 +238,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span)
mouse button is pressed. The section's logical index is specified by
\a logicalIndex.
- \sa setClickable(), sectionPressed()
+ \sa setSectionsClickable(), sectionPressed()
*/
/*!
@@ -247,7 +247,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span)
This signal is emitted when a section is double-clicked. The section's
logical index is specified by \a logicalIndex.
- \sa setClickable()
+ \sa setSectionsClickable()
*/
/*!
@@ -266,7 +266,7 @@ QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span)
This signal is emitted when a section is double-clicked. The section's
logical index is specified by \a logicalIndex.
- \sa setClickable()
+ \sa setSectionsClickable()
*/
/*!
@@ -866,9 +866,11 @@ void QHeaderView::swapSections(int first, int second)
\fn void QHeaderView::resizeSection(int logicalIndex, int size)
Resizes the section specified by \a logicalIndex to \a size measured in
- pixels.
+ pixels. The size parameter must be a value larger or equal to zero. A
+ size equal to zero is however not recommended. In that situation hideSection
+ should be used instead.
- \sa sectionResized(), resizeMode(), sectionSize()
+ \sa sectionResized(), resizeMode(), sectionSize(), hideSection()
*/
void QHeaderView::resizeSection(int logical, int size)
@@ -1085,62 +1087,98 @@ int QHeaderView::logicalIndex(int visualIndex) const
}
/*!
- If \a movable is true, the header may be moved by the user; otherwise it
+ If \a sectionsMovable is true, the header may be moved by the user; otherwise it
is fixed in place.
- \sa isMovable(), sectionMoved()
+ \sa sectionsMovable(), sectionMoved()
*/
-// ### Qt 5: change to setSectionsMovable()
-void QHeaderView::setMovable(bool movable)
+void QHeaderView::setSectionsMovable(bool movable)
{
Q_D(QHeaderView);
d->movableSections = movable;
}
+// ### Qt 6 - remove this obsolete function
+/*!
+ \obsolete
+ \fn void QHeaderView::setMovable(bool movable)
+
+ Use setSectionsMovable instead.
+
+ \sa setSectionsMovable()
+*/
+
/*!
Returns true if the header can be moved by the user; otherwise returns
false.
- \sa setMovable()
+ \sa setSectionsMovable()
*/
-// ### Qt 5: change to sectionsMovable()
-bool QHeaderView::isMovable() const
+bool QHeaderView::sectionsMovable() const
{
Q_D(const QHeaderView);
return d->movableSections;
}
+// ### Qt 6 - remove this obsolete function
+/*!
+ \obsolete
+ \fn bool QHeaderView::isMovable(bool movable)
+
+ Use sectionsMovable instead.
+
+ \sa sectionsMovable()
+*/
+
/*!
If \a clickable is true, the header will respond to single clicks.
- \sa isClickable(), sectionClicked(), sectionPressed(),
+ \sa sectionsClickable(), sectionClicked(), sectionPressed(),
setSortIndicatorShown()
*/
-// ### Qt 5: change to setSectionsClickable()
-void QHeaderView::setClickable(bool clickable)
+void QHeaderView::setSectionsClickable(bool clickable)
{
Q_D(QHeaderView);
d->clickableSections = clickable;
}
+// ### Qt 6 - remove this obsolete function
+/*!
+ \obsolete
+ \fn void QHeaderView::setClickable(bool clickable)
+
+ Use setSectionsClickable instead.
+
+ \sa setSectionsClickable()
+*/
+
/*!
Returns true if the header is clickable; otherwise returns false. A
clickable header could be set up to allow the user to change the
representation of the data in the view related to the header.
- \sa setClickable()
+ \sa setSectionsClickable()
*/
-// ### Qt 5: change to sectionsClickable()
-bool QHeaderView::isClickable() const
+bool QHeaderView::sectionsClickable() const
{
Q_D(const QHeaderView);
return d->clickableSections;
}
+// ### Qt 6 - remove this obsolete function
+/*!
+ \obsolete
+ \fn bool QHeaderView::isClickable() const
+
+ Use sectionsClickable instead.
+
+ \sa sectionsClickable()
+*/
+
void QHeaderView::setHighlightSections(bool highlight)
{
Q_D(QHeaderView);
@@ -1172,8 +1210,6 @@ void QHeaderView::setResizeMode(ResizeMode mode)
}
/*!
- \overload
-
Sets the constraints on how the section specified by \a logicalIndex in
the header can be resized to those described by the given \a mode. The logical
index should exist at the time this function is called.
@@ -1185,8 +1221,7 @@ void QHeaderView::setResizeMode(ResizeMode mode)
\sa setStretchLastSection()
*/
-// ### Qt 5: change to setSectionResizeMode()
-void QHeaderView::setResizeMode(int logicalIndex, ResizeMode mode)
+void QHeaderView::setSectionResizeMode(int logicalIndex, ResizeMode mode)
{
Q_D(QHeaderView);
int visual = visualIndex(logicalIndex);
@@ -1208,6 +1243,17 @@ void QHeaderView::setResizeMode(int logicalIndex, ResizeMode mode)
d->doDelayedResizeSections(); // section sizes may change as a result of the new mode
}
+// ### Qt 6 - remove this obsolete function
+/*!
+ \overload
+ \obsolete
+ \fn void QHeaderView::setResizeMode(int logicalIndex, ResizeMode mode)
+
+ Use setSectionResizeMode instead.
+
+ \sa setSectionResizeMode()
+*/
+
/*!
Returns the resize mode that applies to the section specified by the given
\a logicalIndex.
@@ -1215,7 +1261,7 @@ void QHeaderView::setResizeMode(int logicalIndex, ResizeMode mode)
\sa setResizeMode()
*/
-QHeaderView::ResizeMode QHeaderView::resizeMode(int logicalIndex) const
+QHeaderView::ResizeMode QHeaderView::sectionResizeMode(int logicalIndex) const
{
Q_D(const QHeaderView);
int visual = visualIndex(logicalIndex);
@@ -1224,6 +1270,16 @@ QHeaderView::ResizeMode QHeaderView::resizeMode(int logicalIndex) const
return d->headerSectionResizeMode(visual);
}
+// ### Qt 6 - remove this obsolete function
+/*!
+ \obsolete
+ \fn QHeaderView::ResizeMode QHeaderView::resizeMode(int logicalIndex) const
+
+ Use sectionResizeMode instead.
+
+ \sa sectionResizeMode()
+*/
+
/*!
\since 4.1
@@ -1246,7 +1302,7 @@ int QHeaderView::stretchSectionCount() const
By default, this property is false.
- \sa setClickable()
+ \sa setSectionsClickable()
*/
void QHeaderView::setSortIndicatorShown(bool show)
@@ -1299,8 +1355,8 @@ void QHeaderView::setSortIndicator(int logicalIndex, Qt::SortOrder order)
}
if (old != logicalIndex
- && ((logicalIndex >= 0 && resizeMode(logicalIndex) == ResizeToContents)
- || old >= d->sectionCount() || (old >= 0 && resizeMode(old) == ResizeToContents))) {
+ && ((logicalIndex >= 0 && sectionResizeMode(logicalIndex) == ResizeToContents)
+ || old >= d->sectionCount() || (old >= 0 && sectionResizeMode(old) == ResizeToContents))) {
resizeSections();
d->viewport->update();
} else {
@@ -2207,7 +2263,7 @@ void QHeaderView::mousePressEvent(QMouseEvent *e)
updateSection(d->pressed);
d->state = QHeaderViewPrivate::SelectSections;
}
- } else if (resizeMode(handle) == Interactive) {
+ } else if (sectionResizeMode(handle) == Interactive) {
d->originalSize = sectionSize(handle);
d->state = QHeaderViewPrivate::ResizeSection;
d->section = handle;
@@ -2289,7 +2345,7 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
#ifndef QT_NO_CURSOR
int handle = d->sectionHandleAt(pos);
bool hasCursor = testAttribute(Qt::WA_SetCursor);
- if (handle != -1 && (resizeMode(handle) == Interactive)) {
+ if (handle != -1 && (sectionResizeMode(handle) == Interactive)) {
if (!hasCursor)
setCursor(d->orientation == Qt::Horizontal ? Qt::SplitHCursor : Qt::SplitVCursor);
} else if (hasCursor) {
@@ -2360,7 +2416,7 @@ void QHeaderView::mouseDoubleClickEvent(QMouseEvent *e)
Q_D(QHeaderView);
int pos = d->orientation == Qt::Horizontal ? e->x() : e->y();
int handle = d->sectionHandleAt(pos);
- if (handle > -1 && resizeMode(handle) == Interactive) {
+ if (handle > -1 && sectionResizeMode(handle) == Interactive) {
emit sectionHandleDoubleClicked(handle);
#ifndef QT_NO_CURSOR
Qt::CursorShape splitCursor = (d->orientation == Qt::Horizontal)
@@ -2368,7 +2424,7 @@ void QHeaderView::mouseDoubleClickEvent(QMouseEvent *e)
if (cursor().shape() == splitCursor) {
// signal handlers may have changed the section size
handle = d->sectionHandleAt(pos);
- if (!(handle > -1 && resizeMode(handle) == Interactive))
+ if (!(handle > -1 && sectionResizeMode(handle) == Interactive))
setCursor(Qt::ArrowCursor);
}
#endif
@@ -2673,7 +2729,7 @@ void QHeaderView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bot
int first = orientation() == Qt::Horizontal ? topLeft.column() : topLeft.row();
int last = orientation() == Qt::Horizontal ? bottomRight.column() : bottomRight.row();
for (int i = first; i <= last && !resizeRequired; ++i)
- resizeRequired = (resizeMode(i) == ResizeToContents);
+ resizeRequired = (sectionResizeMode(i) == ResizeToContents);
if (resizeRequired)
d->doDelayedResizeSections();
}
diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h
index d72b8cd735..bf686e2925 100644
--- a/src/widgets/itemviews/qheaderview.h
+++ b/src/widgets/itemviews/qheaderview.h
@@ -114,18 +114,33 @@ public:
int visualIndex(int logicalIndex) const;
int logicalIndex(int visualIndex) const;
- void setMovable(bool movable);
- bool isMovable() const;
+ void setSectionsMovable(bool movable);
+ bool sectionsMovable() const;
+#if QT_DEPRECATED_SINCE(5, 0)
+ inline QT_DEPRECATED void setMovable(bool movable) { setSectionsMovable(movable); }
+ inline QT_DEPRECATED bool isMovable() const { return sectionsMovable(); }
+#endif
- void setClickable(bool clickable);
- bool isClickable() const;
+ void setSectionsClickable(bool clickable);
+ bool sectionsClickable() const;
+#if QT_DEPRECATED_SINCE(5, 0)
+ inline QT_DEPRECATED void setClickable(bool clickable) { setSectionsClickable(clickable); }
+ inline QT_DEPRECATED bool isClickable() const { return sectionsClickable(); }
+#endif
void setHighlightSections(bool highlight);
bool highlightSections() const;
void setResizeMode(ResizeMode mode);
- void setResizeMode(int logicalIndex, ResizeMode mode);
- ResizeMode resizeMode(int logicalIndex) const;
+ ResizeMode sectionResizeMode(int logicalIndex) const;
+ void setSectionResizeMode(int logicalIndex, ResizeMode mode);
+#if QT_DEPRECATED_SINCE(5, 0)
+ inline QT_DEPRECATED void setResizeMode(int logicalindex, ResizeMode mode)
+ { setSectionResizeMode(logicalindex, mode); }
+ inline QT_DEPRECATED ResizeMode resizeMode(int logicalindex) const
+ { return sectionResizeMode(logicalindex); }
+#endif
+
int stretchSectionCount() const;
void setSortIndicatorShown(bool show);
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index b00b1073a3..872798a8e9 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -3169,7 +3169,8 @@ void QListView::currentChanged(const QModelIndex &current, const QModelIndex &pr
if (QAccessible::isActive()) {
if (current.isValid()) {
int entry = visualIndex(current) + 1;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, entry));
+ QAccessibleEvent event(QAccessible::Focus, this, entry);
+ QAccessible::updateAccessibility(&event);
}
}
#endif
@@ -3188,12 +3189,14 @@ void QListView::selectionChanged(const QItemSelection &selected,
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
int entry = visualIndex(sel) + 1;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, this, entry));
+ QAccessibleEvent event(QAccessible::Selection, this, entry);
+ QAccessible::updateAccessibility(&event);
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
int entry = visualIndex(desel) + 1;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::SelectionRemove, this, entry));
+ QAccessibleEvent event(QAccessible::SelectionRemove, this, entry);
+ QAccessible::updateAccessibility(&event);
}
}
#endif
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index d3bc826750..55cf18d78c 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -616,12 +616,12 @@ void QTableViewPrivate::init()
q->setEditTriggers(editTriggers|QAbstractItemView::AnyKeyPressed);
QHeaderView *vertical = new QHeaderView(Qt::Vertical, q);
- vertical->setClickable(true);
+ vertical->setSectionsClickable(true);
vertical->setHighlightSections(true);
q->setVerticalHeader(vertical);
QHeaderView *horizontal = new QHeaderView(Qt::Horizontal, q);
- horizontal->setClickable(true);
+ horizontal->setSectionsClickable(true);
horizontal->setHighlightSections(true);
q->setHorizontalHeader(horizontal);
@@ -1071,6 +1071,10 @@ void QTableView::setModel(QAbstractItemModel *model)
disconnect(d->model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
this, SLOT(_q_updateSpanRemovedColumns(QModelIndex,int,int)));
}
+ if (d->selectionModel) { // support row editing
+ disconnect(d->selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
+ d->model, SLOT(submit()));
+ }
if (model) { //and connect to the new one
connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(_q_updateSpanInsertedRows(QModelIndex,int,int)));
@@ -1123,9 +1127,21 @@ void QTableView::setSelectionModel(QItemSelectionModel *selectionModel)
{
Q_D(QTableView);
Q_ASSERT(selectionModel);
+ if (d->selectionModel) {
+ // support row editing
+ disconnect(d->selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
+ d->model, SLOT(submit()));
+ }
+
d->verticalHeader->setSelectionModel(selectionModel);
d->horizontalHeader->setSelectionModel(selectionModel);
QAbstractItemView::setSelectionModel(selectionModel);
+
+ if (d->selectionModel) {
+ // support row editing
+ connect(d->selectionModel, SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
+ d->model, SLOT(submit()));
+ }
}
/*!
@@ -3164,16 +3180,10 @@ void QTableView::currentChanged(const QModelIndex &current, const QModelIndex &p
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
if (current.isValid()) {
-#ifdef Q_OS_UNIX
Q_D(QTableView);
int entry = d->accessibleTable2Index(current);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, entry));
-#else
- int entry = visualIndex(current) + 1;
- if (horizontalHeader())
- ++entry;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, viewport(), entry));
-#endif
+ QAccessibleEvent event(QAccessible::Focus, this, entry);
+ QAccessible::updateAccessibility(&event);
}
}
#endif
@@ -3193,27 +3203,15 @@ void QTableView::selectionChanged(const QItemSelection &selected,
// ### does not work properly for selection ranges.
QModelIndex sel = selected.indexes().value(0);
if (sel.isValid()) {
-#ifdef Q_OS_UNIX
int entry = d->accessibleTable2Index(sel);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, this, entry));
-#else
- int entry = visualIndex(sel);
- if (horizontalHeader())
- ++entry;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, viewport(), entry));
-#endif
+ QAccessibleEvent event(QAccessible::Selection, this, entry);
+ QAccessible::updateAccessibility(&event);
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
-#ifdef Q_OS_UNIX
int entry = d->accessibleTable2Index(desel);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::SelectionRemove, this, entry));
-#else
- int entry = visualIndex(sel);
- if (horizontalHeader())
- ++entry;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::SelectionRemove, viewport(), entry));
-#endif
+ QAccessibleEvent event(QAccessible::SelectionRemove, this, entry);
+ QAccessible::updateAccessibility(&event);
}
}
#endif
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index c54c11d0f5..6166823754 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -848,7 +848,7 @@ void QTreeView::setSortingEnabled(bool enable)
{
Q_D(QTreeView);
header()->setSortIndicatorShown(enable);
- header()->setClickable(enable);
+ header()->setSectionsClickable(enable);
if (enable) {
//sortByColumn has to be called before we connect or set the sortingEnabled flag
// because otherwise it will not call sort on the model.
@@ -2886,7 +2886,7 @@ void QTreeViewPrivate::initialize()
q->setAttribute(Qt::WA_MacShowFocusRect);
QHeaderView *header = new QHeaderView(Qt::Horizontal, q);
- header->setMovable(true);
+ header->setSectionsMovable(true);
header->setStretchLastSection(true);
header->setDefaultAlignment(Qt::AlignLeft|Qt::AlignVCenter);
q->setHeader(header);
@@ -2937,7 +2937,8 @@ void QTreeViewPrivate::insertViewItems(int pos, int count, const QTreeViewItem &
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_OS_UNIX
if (QAccessible::isActive()) {
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TableModelChanged, q, 0));
+ QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
}
#endif
#endif
@@ -2955,7 +2956,8 @@ void QTreeViewPrivate::removeViewItems(int pos, int count)
#ifndef QT_NO_ACCESSIBILITY
#ifdef Q_OS_UNIX
if (QAccessible::isActive()) {
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TableModelChanged, q, 0));
+ QAccessibleEvent event(QAccessible::TableModelChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
}
#endif
#endif
@@ -3769,7 +3771,8 @@ void QTreeView::currentChanged(const QModelIndex &current, const QModelIndex &pr
if (QAccessible::isActive() && current.isValid()) {
#ifdef Q_OS_UNIX
int entry = (visualIndex(current) + (header()?1:0))*current.model()->columnCount()+current.column() + 1;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, entry));
+ QAccessibleEvent event(QAccessible::Focus, this, entry);
+ QAccessible::updateAccessibility(&event);
#else
int entry = visualIndex(current) + 1;
if (header())
@@ -3794,13 +3797,15 @@ void QTreeView::selectionChanged(const QItemSelection &selected,
if (sel.isValid()) {
int entry = (visualIndex(sel) + (header()?1:0))*sel.model()->columnCount()+sel.column() + 1;
Q_ASSERT(entry > 0);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, this, entry));
+ QAccessibleEvent event(QAccessible::Selection, this, entry);
+ QAccessible::updateAccessibility(&event);
}
QModelIndex desel = deselected.indexes().value(0);
if (desel.isValid()) {
int entry = (visualIndex(desel) + (header()?1:0))*desel.model()->columnCount()+desel.column() + 1;
Q_ASSERT(entry > 0);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::SelectionRemove, this, entry));
+ QAccessibleEvent event(QAccessible::SelectionRemove, this, entry);
+ QAccessible::updateAccessibility(&event);
}
}
#endif
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 156121a533..f8e3a375a4 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -2535,7 +2535,7 @@ QTreeWidget::QTreeWidget(QWidget *parent)
this, SLOT(_q_sort()));
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(_q_selectionChanged(QItemSelection,QItemSelection)));
- header()->setClickable(false);
+ header()->setSectionsClickable(false);
}
/*!
diff --git a/src/widgets/kernel/qiconloader.cpp b/src/widgets/kernel/qiconloader.cpp
index 2f9576f864..a0ee95c80c 100644
--- a/src/widgets/kernel/qiconloader.cpp
+++ b/src/widgets/kernel/qiconloader.cpp
@@ -61,10 +61,6 @@
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
-#ifdef Q_WS_X11
-#include <private/qt_x11_p.h>
-#endif
-
#include <private/qhexstring_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 1c20b98139..114cde59e9 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -412,7 +412,8 @@ QWhatsThisPrivate::QWhatsThisPrivate()
#endif
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpStart, this));
+ QAccessibleEvent event(QAccessible::ContextHelpStart, this);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -424,7 +425,8 @@ QWhatsThisPrivate::~QWhatsThisPrivate()
QApplication::restoreOverrideCursor();
#endif
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpEnd, this));
+ QAccessibleEvent event(QAccessible::ContextHelpEnd, this);
+ QAccessible::updateAccessibility(&event);
#endif
instance = 0;
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 084d609730..ffb4b1fef5 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5965,7 +5965,10 @@ void QWidget::setFocus(Qt::FocusReason reason)
// menus update the focus manually and this would create bogus events
if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem")))
# endif
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, f));
+ {
+ QAccessibleEvent event(QAccessible::Focus, f);
+ QAccessible::updateAccessibility(&event);
+ }
#endif
#ifndef QT_NO_GRAPHICSVIEW
if (QWExtra *topData = window()->d_func()->extra) {
@@ -6045,7 +6048,8 @@ void QWidget::clearFocus()
#endif
{
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this));
+ QAccessibleEvent event(QAccessible::Focus, this);
+ QAccessible::updateAccessibility(&event);
#endif
}
}
@@ -7051,8 +7055,10 @@ void QWidgetPrivate::show_helper()
qApp->d_func()->openPopup(q);
#ifndef QT_NO_ACCESSIBILITY
- if (q->windowType() != Qt::ToolTip) // Tooltips are read aloud twice in MS narrator.
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectShow, q));
+ if (q->windowType() != Qt::ToolTip) { // Tooltips are read aloud twice in MS narrator.
+ QAccessibleEvent event(QAccessible::ObjectShow, q);
+ QAccessible::updateAccessibility(&event);
+ }
#endif
if (QApplicationPrivate::hidden_focus_widget == q) {
@@ -7142,8 +7148,10 @@ void QWidgetPrivate::hide_helper()
bs->removeDirtyWidget(q);
#ifndef QT_NO_ACCESSIBILITY
- if (wasVisible)
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, q));
+ if (wasVisible) {
+ QAccessibleEvent event(QAccessible::ObjectHide, q);
+ QAccessible::updateAccessibility(&event);
+ }
#endif
}
@@ -7374,8 +7382,10 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
}
qApp->d_func()->sendSyntheticEnterLeave(widget);
#ifndef QT_NO_ACCESSIBILITY
- if (!spontaneous)
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, widget));
+ if (!spontaneous) {
+ QAccessibleEvent event(QAccessible::ObjectHide, widget);
+ QAccessible::updateAccessibility(&event);
+ }
#endif
}
}
@@ -8250,7 +8260,8 @@ void QWidget::changeEvent(QEvent * event)
#ifndef QT_NO_ACCESSIBILITY
QAccessible::State s;
s.disabled = true;
- QAccessible::updateAccessibility(QAccessibleStateChangeEvent(s, this));
+ QAccessibleStateChangeEvent event(s, this);
+ QAccessible::updateAccessibility(&event);
#endif
break;
}
@@ -9229,6 +9240,8 @@ int QWidget::heightForWidth(int w) const
/*!
+ \Since 5.0
+
Returns true if the widget's preferred height depends on its width; otherwise returns false.
*/
bool QWidget::hasHeightForWidth() const
@@ -10390,7 +10403,8 @@ void QWidget::setAccessibleName(const QString &name)
{
Q_D(QWidget);
d->accessibleName = name;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this));
+ QAccessibleEvent event(QAccessible::NameChanged, this);
+ QAccessible::updateAccessibility(&event);
}
QString QWidget::accessibleName() const
@@ -10412,7 +10426,8 @@ void QWidget::setAccessibleDescription(const QString &description)
{
Q_D(QWidget);
d->accessibleDescription = description;
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, this));
+ QAccessibleEvent event(QAccessible::DescriptionChanged, this);
+ QAccessible::updateAccessibility(&event);
}
QString QWidget::accessibleDescription() const
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp
index 4d5e9d5774..f58dddb70f 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa.cpp
+++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp
@@ -43,7 +43,9 @@
#include "private/qwidget_p.h"
#include "private/qapplication_p.h"
+#ifndef QT_NO_ACCESSIBILITY
#include <QtGui/qaccessible.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -60,12 +62,14 @@ QWidgetWindow::QWidgetWindow(QWidget *widget)
{
}
+#ifndef QT_NO_ACCESSIBILITY
QAccessibleInterface *QWidgetWindow::accessibleRoot() const
{
if (m_widget)
return QAccessible::queryAccessibleInterface(m_widget);
return 0;
}
+#endif
QObject *QWidgetWindow::focusObject() const
{
diff --git a/src/widgets/kernel/qwidgetwindow_qpa_p.h b/src/widgets/kernel/qwidgetwindow_qpa_p.h
index 1e8813fddc..e5c07a2d3a 100644
--- a/src/widgets/kernel/qwidgetwindow_qpa_p.h
+++ b/src/widgets/kernel/qwidgetwindow_qpa_p.h
@@ -62,7 +62,9 @@ public:
QWidgetWindow(QWidget *widget);
QWidget *widget() const { return m_widget; }
+#ifndef QT_NO_ACCESSIBILITY
QAccessibleInterface *accessibleRoot() const;
+#endif
QObject *focusObject() const;
protected:
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 1f91fa4d00..7e07cc1532 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -6390,6 +6390,7 @@ CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice)
CGContextRelease the context when finished using it.
\warning This function is only available on Mac OS X.
+ \warning This function is duplicated in the Cocoa platform plugin.
*/
CGContextRef qt_mac_cg_context(const QPaintDevice *pdev)
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 7a0cc09452..0e928b13c2 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -2498,38 +2498,48 @@ void QStyleSheetStyle::setGeometry(QWidget *w)
void QStyleSheetStyle::setProperties(QWidget *w)
{
- // we have two data structures here: a hash of property -> value for lookup,
- // and a vector giving properties in the order they are specified.
- //
- // this means we only set a property once (thanks to the hash) but we set
- // properties in the order they are specified.
- QHash<QString, QVariant> propertyHash;
- QVector<QString> properties;
- QVector<Declaration> decls = declarations(styleRules(w), QString());
-
- // run through the declarations in order
- for (int i = 0; i < decls.count(); i++) {
- const Declaration &decl = decls.at(i);
+ // The final occurrence of each property is authoritative.
+ // Set value for each property in the order of property final occurrence
+ // since properties interact.
+
+ const QVector<Declaration> decls = declarations(styleRules(w), QString());
+ QVector<int> finals; // indices in reverse order of each property's final occurrence
+
+ {
+ // scan decls for final occurence of each "qproperty"
+ QSet<const QString> propertySet;
+ for (int i = decls.count() - 1; i >= 0; --i) {
+ const QString property = decls.at(i).d->property;
+ if (!property.startsWith(QStringLiteral("qproperty-"), Qt::CaseInsensitive))
+ continue;
+ if (!propertySet.contains(property)) {
+ propertySet.insert(property);
+ finals.append(i);
+ }
+ }
+ }
+
+ for (int i = finals.count() - 1; i >= 0; --i) {
+ const Declaration &decl = decls.at(finals[i]);
QString property = decl.d->property;
- if (!property.startsWith(QLatin1String("qproperty-"), Qt::CaseInsensitive))
- continue;
property.remove(0, 10); // strip "qproperty-"
- const QVariant value = w->property(property.toLatin1());
+
const QMetaObject *metaObject = w->metaObject();
int index = metaObject->indexOfProperty(property.toLatin1());
if (index == -1) {
qWarning() << w << " does not have a property named " << property;
continue;
}
- QMetaProperty metaProperty = metaObject->property(index);
+ const QMetaProperty metaProperty = metaObject->property(index);
if (!metaProperty.isWritable() || !metaProperty.isDesignable()) {
qWarning() << w << " cannot design property named " << property;
continue;
}
+
QVariant v;
+ const QVariant value = w->property(property.toLatin1());
switch (value.type()) {
- // ### Qt 5
-// case QVariant::Icon: v = decl.iconValue(); break;
+ case QVariant::Icon: v = cssIconValueToIcon(decl.iconValue()); break;
case QVariant::Image: v = QImage(decl.uriValue()); break;
case QVariant::Pixmap: v = QPixmap(decl.uriValue()); break;
case QVariant::Rect: v = decl.rectValue(); break;
@@ -2542,19 +2552,7 @@ void QStyleSheetStyle::setProperties(QWidget *w)
default: v = decl.d->values.at(0).variant; break;
}
- if (propertyHash.contains(property)) {
- // we're ignoring the original appearance of this property
- properties.remove(properties.indexOf(property));
- }
-
- propertyHash[property] = v;
- properties.append(property);
- }
-
- // apply the values from left to right order
- for (int i = 0; i < properties.count(); i++) {
- const QString &property = properties.at(i);
- w->setProperty(property.toLatin1(), propertyHash[property]);
+ w->setProperty(property.toLatin1(), v);
}
}
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index 1aecb64acf..c18b2266b8 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -586,10 +586,12 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
bool isEnabled = option->state & State_Enabled;
uint resolve_mask = panel->palette.resolve();
if (widget) {
- //Since spin box and combo box includes a line edit we need to resolve the palette on the parent instead
+ // Since spin box includes a line edit we need to resolve the palette mask also from
+ // the parent, as while the color is always correct on the palette supplied by panel,
+ // the mask can still be empty. If either mask specifies custom base color, use that.
#ifndef QT_NO_SPINBOX
if (QAbstractSpinBox *spinbox = qobject_cast<QAbstractSpinBox*>(widget->parentWidget()))
- resolve_mask = spinbox->palette().resolve();
+ resolve_mask |= spinbox->palette().resolve();
#endif // QT_NO_SPINBOX
}
if (resolve_mask & (1 << QPalette::Base)) {
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 5aab69983c..8b745ba114 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -1583,10 +1583,12 @@ case PE_Frame:
uint resolve_mask = panel->palette.resolve();
#ifndef QT_NO_SPINBOX
- //Since spin box includes a line edit we need to resolve the palette on the spin box instead
+ // Since spin box includes a line edit we need to resolve the palette mask also from
+ // the parent, as while the color is always correct on the palette supplied by panel,
+ // the mask can still be empty. If either mask specifies custom base color, use that.
if (widget) {
if (QAbstractSpinBox *spinbox = qobject_cast<QAbstractSpinBox*>(widget->parentWidget()))
- resolve_mask = spinbox->palette().resolve();
+ resolve_mask |= spinbox->palette().resolve();
}
#endif // QT_NO_SPINBOX
if (resolve_mask & (1 << QPalette::Base)) {
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
index f3d4347986..fa72e791ba 100644
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ b/src/widgets/util/qsystemtrayicon_win.cpp
@@ -81,6 +81,7 @@ struct Q_NOTIFYICONIDENTIFIER {
# define NIN_BALLOONTIMEOUT (WM_USER + 4)
# define NIN_BALLOONUSERCLICK (WM_USER + 5)
# define NIF_SHOWTIP 0x00000080
+# define NOTIFYICON_VERSION_4 4
#endif
#define Q_MSGFLT_ALLOW 1
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index 8f6a9713f6..596e8a994a 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -25,7 +25,6 @@ mac:include(kernel/mac.pri)
win32:include(kernel/win.pri)
#modules
-include(animation/animation.pri)
include(kernel/kernel.pri)
include(styles/styles.pri)
include(widgets/widgets.pri)
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index aebef8ddc9..0b24799a56 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -644,7 +644,8 @@ void QAbstractButton::setText(const QString &text)
update();
updateGeometry();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this));
+ QAccessibleEvent event(QAccessible::NameChanged, this);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -769,7 +770,8 @@ void QAbstractButton::setChecked(bool checked)
#ifndef QT_NO_ACCESSIBILITY
QAccessible::State s;
s.checked = true;
- QAccessible::updateAccessibility(QAccessibleStateChangeEvent(s, this));
+ QAccessibleStateChangeEvent event(s, this);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp
index b0216e5277..2d3f79e43d 100644
--- a/src/widgets/widgets/qabstractslider.cpp
+++ b/src/widgets/widgets/qabstractslider.cpp
@@ -538,7 +538,8 @@ void QAbstractSlider::setValue(int value)
emit sliderMoved((d->position = value));
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this));
+ QAccessibleEvent event(QAccessible::ValueChanged, this);
+ QAccessible::updateAccessibility(&event);
#endif
sliderChange(SliderValueChange);
emit valueChanged(value);
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index c083369136..7b55b0fa8c 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -976,7 +976,8 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
}
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this));
+ QAccessibleEvent event(QAccessible::ValueChanged, this);
+ QAccessible::updateAccessibility(&event);
#endif
return;
}
@@ -1595,7 +1596,8 @@ void QAbstractSpinBoxPrivate::updateState(bool up, bool fromKeyboard /* = false
buttonState = (up ? Up : Down) | (fromKeyboard ? Keyboard : Mouse);
q->stepBy(up ? 1 : -1);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, q));
+ QAccessibleEvent event(QAccessible::ValueChanged, q);
+ QAccessible::updateAccessibility(&event);
#endif
}
}
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index 129da9d94d..427af68b64 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -2068,9 +2068,9 @@ QCalendarWidget::QCalendarWidget(QWidget *parent)
d->m_view->setSelectionBehavior(QAbstractItemView::SelectItems);
d->m_view->setSelectionMode(QAbstractItemView::SingleSelection);
d->m_view->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
- d->m_view->horizontalHeader()->setClickable(false);
+ d->m_view->horizontalHeader()->setSectionsClickable(false);
d->m_view->verticalHeader()->setResizeMode(QHeaderView::Stretch);
- d->m_view->verticalHeader()->setClickable(false);
+ d->m_view->verticalHeader()->setSectionsClickable(false);
d->m_selection = d->m_view->selectionModel();
d->createNavigationBar(this);
d->m_view->setFrameStyle(QFrame::NoFrame);
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index c5f5d6e6e1..88c17ca704 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -58,6 +58,7 @@
#include <qtreeview.h>
#include <qheaderview.h>
#include <qmath.h>
+#include <qmetaobject.h>
#include <private/qguiapplication_p.h>
#include <private/qapplication_p.h>
#include <private/qcombobox_p.h>
@@ -982,7 +983,8 @@ void QComboBoxPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIn
q->update();
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, q, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -1238,7 +1240,8 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
emit q->currentIndexChanged(index.row());
emit q->currentIndexChanged(itemText(index));
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, q, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, q, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2545,17 +2548,25 @@ void QComboBox::hidePopup()
// Fade out.
bool needFade = style()->styleHint(QStyle::SH_Menu_FadeOutOnHide);
+ bool didFade = false;
if (needFade) {
-#if defined(Q_WS_MAC)
- macWindowFade(qt_mac_window_for(d->container));
-#endif // Q_WS_MAC
+#if defined(Q_OS_MAC)
+ QPlatformNativeInterface *platformNativeInterface = qApp->platformNativeInterface();
+ int at = platformNativeInterface->metaObject()->indexOfMethod("fadeWindow()");
+ if (at != -1) {
+ QMetaMethod windowFade = platformNativeInterface->metaObject()->method(at);
+ windowFade.invoke(platformNativeInterface, Q_ARG(QWindow *, d->container->windowHandle()));
+ didFade = true;
+ }
+
+#endif // Q_OS_MAC
// Other platform implementations welcome :-)
}
d->model->blockSignals(false);
d->container->itemView()->blockSignals(false);
d->container->blockSignals(false);
- if (!needFade)
+ if (!didFade)
#endif // QT_NO_EFFECTS
// Fade should implicitly hide as well ;-)
d->container->hide();
@@ -2578,7 +2589,8 @@ void QComboBox::clear()
Q_D(QComboBox);
d->model->removeRows(0, d->model->rowCount(d->root), d->root);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2597,7 +2609,8 @@ void QComboBox::clearEditText()
if (d->lineEdit)
d->lineEdit->clear();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2610,7 +2623,8 @@ void QComboBox::setEditText(const QString &text)
if (d->lineEdit)
d->lineEdit->setText(text);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index cf3e14871f..7186ddfccc 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -249,7 +249,8 @@ void QGroupBox::setTitle(const QString &title)
update();
updateGeometry();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 82e56f3354..f36dea52dd 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -315,8 +315,10 @@ void QLabel::setText(const QString &text)
d->updateLabel();
#ifndef QT_NO_ACCESSIBILITY
- if (accessibleName().isEmpty())
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0));
+ if (accessibleName().isEmpty()) {
+ QAccessibleEvent event(QAccessible::NameChanged, this, 0);
+ QAccessible::updateAccessibility(&event);
+ }
#endif
}
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index d06e98e31a..37e956c27f 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -144,7 +144,8 @@ void QLineEditPrivate::_q_selectionChanged()
emit q->selectionChanged();
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextSelectionChanged, q));
+ QAccessibleEvent event(QAccessible::TextSelectionChanged, q);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index af4a87e282..7d4f7151a4 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1076,8 +1076,10 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
int actionIndex = indexOf(action);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, q, actionIndex));
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, q, actionIndex));
+ QAccessibleEvent focusEvent(QAccessible::Focus, q, actionIndex);
+ QAccessible::updateAccessibility(&focusEvent);
+ QAccessibleEvent selectionEvent(QAccessible::Selection, q, actionIndex);
+ QAccessible::updateAccessibility(&selectionEvent);
}
#endif
action->showStatusText(topCausedWidget());
@@ -1970,7 +1972,8 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::PopupMenuStart, this ,0));
+ QAccessibleEvent event(QAccessible::PopupMenuStart, this ,0);
+ QAccessible::updateAccessibility(&event);
#endif
}
@@ -2091,7 +2094,8 @@ void QMenu::hideEvent(QHideEvent *)
d->eventLoop->exit();
d->setCurrentAction(0);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::PopupMenuEnd, this));
+ QAccessibleEvent event(QAccessible::PopupMenuEnd, this);
+ QAccessible::updateAccessibility(&event);
#endif
#ifndef QT_NO_MENUBAR
if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->causedPopup.widget))
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 0efa6caebc..2712839103 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -531,8 +531,10 @@ void QMenuBarPrivate::_q_actionHovered()
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
int actionIndex = actions.indexOf(action);
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, q, actionIndex));
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, q, actionIndex));
+ QAccessibleEvent focusEvent(QAccessible::Focus, q, actionIndex);
+ QAccessible::updateAccessibility(&focusEvent);
+ QAccessibleEvent selectionEvent(QAccessible::Selection, q, actionIndex);
+ QAccessible::updateAccessibility(&selectionEvent);
}
#endif //QT_NO_ACCESSIBILITY
}
diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp
index c1a34bfb7a..0439caeb88 100644
--- a/src/widgets/widgets/qprogressbar.cpp
+++ b/src/widgets/widgets/qprogressbar.cpp
@@ -314,7 +314,8 @@ void QProgressBar::setValue(int value)
d->value = value;
emit valueChanged(value);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this));
+ QAccessibleEvent event(QAccessible::ValueChanged, this);
+ QAccessible::updateAccessibility(&event);
#endif
if (d->repaintRequired())
repaint();
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index 059b0f801c..5dae4e0b34 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -378,7 +378,8 @@ void QPushButton::setDefault(bool enable)
#ifndef QT_NO_ACCESSIBILITY
QAccessible::State s;
s.defaultButton = true;
- QAccessible::updateAccessibility(QAccessibleStateChangeEvent(s, this));
+ QAccessibleStateChangeEvent event(s, this);
+ QAccessible::updateAccessibility(&event);
#endif
}
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index ecb0ef84e0..2cc573e958 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -359,8 +359,10 @@ void QTabBarPrivate::init()
#endif
q->setFocusPolicy(Qt::TabFocus);
+#ifndef QT_NO_ACCESSIBILITY
leftB->setAccessibleName(QTabBar::tr("Scroll Left"));
rightB->setAccessibleName(QTabBar::tr("Scroll Right"));
+#endif
q->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
elideMode = Qt::TextElideMode(q->style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, q));
useScrollButtons = !q->style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, q);
@@ -1183,8 +1185,10 @@ void QTabBar::setCurrentIndex(int index)
d->layoutTab(index);
#ifndef QT_NO_ACCESSIBILITY
if (QAccessible::isActive()) {
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, index));
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, this, index));
+ QAccessibleEvent focusEvent(QAccessible::Focus, this, index);
+ QAccessible::updateAccessibility(&focusEvent);
+ QAccessibleEvent selectionEvent(QAccessible::Selection, this, index);
+ QAccessible::updateAccessibility(&selectionEvent);
}
#endif
emit currentChanged(index);
@@ -1739,7 +1743,7 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
if (d->pressedIndex != -1
&& event->buttons() == Qt::NoButton)
d->moveTabFinished(d->pressedIndex);
-
+
// Start drag
if (!d->dragInProgress && d->pressedIndex != -1) {
if ((event->pos() - d->dragStartPosition).manhattanLength() > QApplication::startDragDistance()) {
diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h
index 13ed3bc6d2..2698213d07 100644
--- a/src/widgets/widgets/qtabbar.h
+++ b/src/widgets/widgets/qtabbar.h
@@ -198,8 +198,9 @@ protected:
void changeEvent(QEvent *);
void initStyleOption(QStyleOptionTab *option, int tabIndex) const;
-
+#ifndef QT_NO_ACCESSIBILITY
friend class QAccessibleTabBar;
+#endif
private:
Q_DISABLE_COPY(QTabBar)
Q_DECLARE_PRIVATE(QTabBar)
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index a04339f864..7c659ebb64 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -767,8 +767,10 @@ void QWidgetLineControl::internalSetText(const QString &txt, int pos, bool edite
bool changed = finishChange(-1, true, edited);
#ifndef QT_NO_ACCESSIBILITY
- if (changed)
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextUpdated, parent()));
+ if (changed) {
+ QAccessibleEvent event(QAccessible::TextUpdated, parent());
+ QAccessible::updateAccessibility(&event);
+ }
#endif
}
@@ -1367,7 +1369,8 @@ void QWidgetLineControl::emitCursorPositionChanged()
m_lastCursorPos = m_cursor;
cursorPositionChanged(oldLast, m_cursor);
#ifndef QT_NO_ACCESSIBILITY
- QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextCaretMoved, parent()));
+ QAccessibleEvent event(QAccessible::TextCaretMoved, parent());
+ QAccessible::updateAccessibility(&event);
#endif
}
}