summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qabstractitemmodel.cpp37
-rw-r--r--src/corelib/kernel/qabstractitemmodel.h3
-rw-r--r--src/gui/accessible/qaccessible_mac.mm2
-rw-r--r--src/gui/kernel/qwidget_mac.mm5
-rw-r--r--src/gui/painting/qgraphicssystemfactory.cpp2
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.cpp19
6 files changed, 51 insertions, 17 deletions
diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp
index b7ac6aa..ddf1fbb 100644
--- a/src/corelib/kernel/qabstractitemmodel.cpp
+++ b/src/corelib/kernel/qabstractitemmodel.cpp
@@ -1348,6 +1348,26 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
*/
/*!
+ \since 4.8
+
+ This slot is called just after the internal data of a model is cleared
+ while it is being reset.
+
+ This slot is provided the convenience of subclasses of concrete proxy
+ models, such as subclasses of QSortFilterProxyModel which maintain extra
+ data.
+
+ \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 10
+
+ \sa modelAboutToBeReset(), modelReset()
+*/
+void QAbstractItemModel::resetInternalData()
+{
+
+}
+
+
+/*!
Constructs an abstract item model with the given \a parent.
*/
QAbstractItemModel::QAbstractItemModel(QObject *parent)
@@ -1747,18 +1767,19 @@ QMimeData *QAbstractItemModel::mimeData(const QModelIndexList &indexes) const
Returns true if the data and action can be handled by the model; otherwise
returns false.
- Although the specified \a row, \a column and \a parent indicate the
- location of an item in the model where the operation ended, it is the
- responsibility of the view to provide a suitable location for where the
- data should be inserted.
+ The specified \a row, \a column and \a parent indicate the location of an
+ item in the model where the operation ended. It is the responsibility of
+ the model to complete the action at the correct location.
For instance, a drop action on an item in a QTreeView can result in new
items either being inserted as children of the item specified by \a row,
\a column, and \a parent, or as siblings of the item.
- When row and column are -1 it means that it is up to the model to decide
- where to place the data. This can occur in a tree when data is dropped on
- a parent. Models will usually append the data to the parent in this case.
+ When \a row and \a column are -1 it means that the dropped data should be
+ considered as dropped directly on \a parent. Usually this will mean
+ appending the data as child items of \a parent. If \a row and column are
+ greater than or equal zero, it means that the drop occurred just before the
+ specified \a row and \a column in the specified \a parent.
\sa supportedDropActions(), {Using drag and drop with item views}
*/
@@ -2888,6 +2909,7 @@ void QAbstractItemModel::reset()
Q_D(QAbstractItemModel);
emit modelAboutToBeReset();
d->invalidatePersistentIndexes();
+ QMetaObject::invokeMethod(this, "resetInternalData");
emit modelReset();
}
@@ -2930,6 +2952,7 @@ void QAbstractItemModel::endResetModel()
{
Q_D(QAbstractItemModel);
d->invalidatePersistentIndexes();
+ QMetaObject::invokeMethod(this, "resetInternalData");
emit modelReset();
}
diff --git a/src/corelib/kernel/qabstractitemmodel.h b/src/corelib/kernel/qabstractitemmodel.h
index c7af7a2..eab1475 100644
--- a/src/corelib/kernel/qabstractitemmodel.h
+++ b/src/corelib/kernel/qabstractitemmodel.h
@@ -303,6 +303,9 @@ protected:
void setRoleNames(const QHash<int,QByteArray> &roleNames);
+protected Q_SLOTS:
+ void resetInternalData();
+
private:
Q_DECLARE_PRIVATE(QAbstractItemModel)
Q_DISABLE_COPY(QAbstractItemModel)
diff --git a/src/gui/accessible/qaccessible_mac.mm b/src/gui/accessible/qaccessible_mac.mm
index 432b536..a250730 100644
--- a/src/gui/accessible/qaccessible_mac.mm
+++ b/src/gui/accessible/qaccessible_mac.mm
@@ -2427,7 +2427,7 @@ void QAccessible::updateAccessibility(QObject *object, int child, Event reason)
}
// There is no equivalent Mac notification for ObjectShow/Hide, so we call HIObjectSetAccessibilityIgnored
- // and isItIntersting which will mark the HIObject accociated with the element as ignored if the
+ // and isItInteresting which will mark the HIObject accociated with the element as ignored if the
// QAccessible::Invisible state bit is set.
QAInterface interface = accessibleHierarchyManager()->lookup(element);
if (interface.isValid()) {
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index b3bf365..a51e295 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3490,7 +3490,10 @@ void QWidgetPrivate::show_sys()
QWidget *top = 0;
if (QApplicationPrivate::tryModalHelper(q, &top)) {
- [window makeKeyAndOrderFront:window];
+ if (q->testAttribute(Qt::WA_ShowWithoutActivating))
+ [window orderFront:window];
+ else
+ [window makeKeyAndOrderFront:window];
// If this window is app modal, we need to start spinning
// a modal session for it. Interrupting
// the event dispatcher will make this happend:
diff --git a/src/gui/painting/qgraphicssystemfactory.cpp b/src/gui/painting/qgraphicssystemfactory.cpp
index 4309140..01ece09 100644
--- a/src/gui/painting/qgraphicssystemfactory.cpp
+++ b/src/gui/painting/qgraphicssystemfactory.cpp
@@ -74,7 +74,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key)
if (system.isEmpty()) {
system = QLatin1String("runtime");
}
-#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) || defined(Q_WS_X11) || (defined (Q_WS_MAC) && defined(QT_MAC_USE_COCOA))
+#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) || defined(Q_WS_X11)
if (system.isEmpty()) {
system = QLatin1String("raster");
}
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
index c62624b..a0dde37 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
@@ -73,6 +73,9 @@ QT_BEGIN_NAMESPACE
using namespace QAccessible2;
+QString Q_GUI_EXPORT qt_accStripAmp(const QString &text);
+QString Q_GUI_EXPORT qt_accHotKey(const QString &text);
+
QList<QWidget*> childWidgets(const QWidget *widget, bool includeTopLevel)
{
if (widget == 0)
@@ -1139,8 +1142,8 @@ int QAccessibleTitleBar::childCount() const
QString QAccessibleTitleBar::text(Text t, int child) const
{
if (!child) {
- if (t == Value) {
- return dockWidget()->windowTitle();
+ if (t == Name || t == Value) {
+ return qt_accStripAmp(dockWidget()->windowTitle());
}
}
return QString();
@@ -1171,17 +1174,19 @@ QAccessible::State QAccessibleTitleBar::state(int child) const
return state;
}
-QRect QAccessibleTitleBar::rect (int child ) const
+QRect QAccessibleTitleBar::rect(int child) const
{
bool mapToGlobal = true;
QRect rect;
if (child == 0) {
if (dockWidget()->isFloating()) {
rect = dockWidget()->frameGeometry();
- QPoint globalPos = dockWidget()->mapToGlobal( dockWidget()->widget()->rect().topLeft() );
- globalPos.ry()--;
- rect.setBottom(globalPos.y());
- mapToGlobal = false;
+ if (dockWidget()->widget()) {
+ QPoint globalPos = dockWidget()->mapToGlobal(dockWidget()->widget()->rect().topLeft());
+ globalPos.ry()--;
+ rect.setBottom(globalPos.y());
+ mapToGlobal = false;
+ }
} else {
QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(dockWidget()->layout());
rect = layout->titleArea();