summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-18 20:45:53 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-18 20:50:35 +0100
commit4fe2fbcf827ae6bec976b0b8dcaa5d14bd05dc33 (patch)
treed1ba753b45b09b417a9447ebdfe2fa6fc47dba69 /src/widgets
parentc1da6347e8d3ba73de20ab8fb3e50ec3359b75ac (diff)
parent4889269ff0fb37130b332863e82dd7c19564116c (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/itemviews/qlistview.cpp2
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp51
-rw-r--r--src/widgets/kernel/qwidgetbackingstore_p.h2
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp1
-rw-r--r--src/widgets/styles/qstyleoption.cpp2
-rw-r--r--src/widgets/widgets/qcombobox.cpp1
6 files changed, 34 insertions, 25 deletions
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 53a5dcba9c..8e4d94d2f0 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -1440,7 +1440,7 @@ QModelIndexList QListView::selectedIndexes() const
return QModelIndexList();
QModelIndexList viewSelected = d->selectionModel->selectedIndexes();
- for (int i = 0; i < viewSelected.count(); ++i) {
+ for (int i = 0; i < viewSelected.count();) {
const QModelIndex &index = viewSelected.at(i);
if (!isIndexHidden(index) && index.parent() == d->root && index.column() == d->column)
++i;
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index 38b23ec439..03f62582ff 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -1065,6 +1065,31 @@ static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra)
return false;
}
+bool QWidgetBackingStore::syncAllowed()
+{
+#ifndef QT_NO_OPENGL
+ QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
+ if (textureListWatcher && !textureListWatcher->isLocked()) {
+ textureListWatcher->deleteLater();
+ textureListWatcher = 0;
+ } else if (!tlwExtra->widgetTextures.isEmpty()) {
+ bool skipSync = false;
+ foreach (QPlatformTextureList *tl, tlwExtra->widgetTextures) {
+ if (tl->isLocked()) {
+ if (!textureListWatcher)
+ textureListWatcher = new QPlatformTextureListWatcher(this);
+ if (!textureListWatcher->isLocked())
+ textureListWatcher->watch(tl);
+ skipSync = true;
+ }
+ }
+ if (skipSync) // cannot compose due to widget textures being in use
+ return false;
+ }
+#endif
+ return true;
+}
+
/*!
Synchronizes the \a exposedRegion of the \a exposedWidget with the backing store.
@@ -1095,7 +1120,8 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
else
markDirtyOnScreen(exposedRegion, exposedWidget, QPoint());
- doSync();
+ if (syncAllowed())
+ doSync();
}
/*!
@@ -1121,27 +1147,8 @@ void QWidgetBackingStore::sync()
return;
}
-#ifndef QT_NO_OPENGL
- if (textureListWatcher && !textureListWatcher->isLocked()) {
- textureListWatcher->deleteLater();
- textureListWatcher = 0;
- } else if (!tlwExtra->widgetTextures.isEmpty()) {
- bool skipSync = false;
- foreach (QPlatformTextureList *tl, tlwExtra->widgetTextures) {
- if (tl->isLocked()) {
- if (!textureListWatcher)
- textureListWatcher = new QPlatformTextureListWatcher(this);
- if (!textureListWatcher->isLocked())
- textureListWatcher->watch(tl);
- skipSync = true;
- }
- }
- if (skipSync) // cannot compose due to widget textures being in use
- return;
- }
-#endif
-
- doSync();
+ if (syncAllowed())
+ doSync();
}
void QWidgetBackingStore::doSync()
diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h
index d2d4d97841..6e3ba57ced 100644
--- a/src/widgets/kernel/qwidgetbackingstore_p.h
+++ b/src/widgets/kernel/qwidgetbackingstore_p.h
@@ -170,6 +170,8 @@ private:
void updateLists(QWidget *widget);
+ bool syncAllowed();
+
inline void addDirtyWidget(QWidget *widget, const QRegion &rgn)
{
if (widget && !widget->d_func()->inDirtyList && !widget->data->in_destructor) {
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 6b6ca2e9cc..0bc05cc3b5 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -718,7 +718,6 @@ void QWidgetWindow::handleCloseEvent(QCloseEvent *event)
{
bool is_closing = m_widget->d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent);
event->setAccepted(is_closing);
- QWindow::event(event); // Call QWindow QCloseEvent handler.
}
#ifndef QT_NO_WHEELEVENT
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index 73e28e8230..73e6f69041 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -204,7 +204,7 @@ void QStyleOption::init(const QWidget *widget)
if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
state &= ~QStyle::State_Enabled;
#endif
-#if defined(Q_OS_MACX)
+#if defined(Q_OS_OSX) && !defined(QT_NO_STYLE_MAC)
switch (QMacStyle::widgetSizePolicy(widget)) {
case QMacStyle::SizeSmall:
state |= QStyle::State_Small;
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 46507e3e3c..1cf7591302 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -2444,6 +2444,7 @@ struct IndexSetter {
{
cb->setCurrentIndex(index);
emit cb->activated(index);
+ emit cb->activated(cb->itemText(index));
}
};
}