summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-09-07 16:17:29 +0200
committerSergio Ahumada <sergio.ahumada@digia.com>2013-09-07 16:18:32 +0200
commit2346ae167568bb9e5d247da0b946067b7f9aad48 (patch)
treef3a975711bcd223f4d6803caa5b53c080bb68819 /src/widgets
parent5dd2713c8ba98e06ae5c4f3da44b2ed73121d247 (diff)
parent730bc064a070e886e10950ccfd59780e8976f5fd (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp7
-rw-r--r--src/widgets/itemviews/qlistview.cpp8
-rw-r--r--src/widgets/kernel/qshortcut.cpp2
-rw-r--r--src/widgets/widgets/qlineedit.cpp3
-rw-r--r--src/widgets/widgets/qmenu.cpp11
-rw-r--r--src/widgets/widgets/qmenubar.cpp1
6 files changed, 23 insertions, 9 deletions
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 846858ab31..a39c084798 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -3221,6 +3221,13 @@ void QGraphicsView::mouseDoubleClickEvent(QMouseEvent *event)
qt_sendSpontaneousEvent(d->scene, &mouseEvent);
else
QApplication::sendEvent(d->scene, &mouseEvent);
+
+ // Update the original mouse event accepted state.
+ const bool isAccepted = mouseEvent.isAccepted();
+ event->setAccepted(isAccepted);
+
+ // Update the last mouse event accepted state.
+ d->lastMouseEvent.setAccepted(isAccepted);
}
/*!
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 8dbbd16f62..331748eedc 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -1456,7 +1456,7 @@ void QListView::doItemsLayout()
void QListView::updateGeometries()
{
Q_D(QListView);
- if (d->model->rowCount(d->root) <= 0 || d->model->columnCount(d->root) <= 0) {
+ if (geometry().isEmpty() || d->model->rowCount(d->root) <= 0 || d->model->columnCount(d->root) <= 0) {
horizontalScrollBar()->setRange(0, 0);
verticalScrollBar()->setRange(0, 0);
} else {
@@ -1471,15 +1471,15 @@ void QListView::updateGeometries()
// if the scroll bars are turned off, we resize the contents to the viewport
if (d->movement == Static && !d->isWrapping()) {
- const QSize maxSize = maximumViewportSize();
+ d->layoutChildren(); // we need the viewport size to be updated
if (d->flow == TopToBottom) {
if (horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) {
- d->setContentsSize(maxSize.width(), contentsSize().height());
+ d->setContentsSize(viewport()->width(), contentsSize().height());
horizontalScrollBar()->setRange(0, 0); // we see all the contents anyway
}
} else { // LeftToRight
if (verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) {
- d->setContentsSize(contentsSize().width(), maxSize.height());
+ d->setContentsSize(contentsSize().width(), viewport()->height());
verticalScrollBar()->setRange(0, 0); // we see all the contents anyway
}
}
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp
index 471b054a99..678e6f25d1 100644
--- a/src/widgets/kernel/qshortcut.cpp
+++ b/src/widgets/kernel/qshortcut.cpp
@@ -158,7 +158,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
if (context == Qt::WidgetWithChildrenShortcut) {
const QWidget *tw = QApplication::focusWidget();
- while (tw && tw != w && (tw->windowType() == Qt::Widget || tw->windowType() == Qt::Popup))
+ while (tw && tw != w && (tw->windowType() == Qt::Widget || tw->windowType() == Qt::Popup || tw->windowType() == Qt::SubWindow))
tw = tw->parentWidget();
return tw == w;
}
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index a8b6b1a10c..adf70fde66 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -333,8 +333,7 @@ void QLineEdit::setText(const QString& text)
\brief the line edit's placeholder text
Setting this property makes the line edit display a grayed-out
- placeholder text as long as the text() is empty and the widget doesn't
- have focus.
+ placeholder text as long as the text() is empty.
By default, this property contains an empty string.
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 4df89a5ede..c305748c7d 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -2864,8 +2864,15 @@ void QMenu::mouseMoveEvent(QMouseEvent *e)
d->mouseDown = this;
}
if (d->sloppyRegion.contains(e->pos())) {
- d->sloppyAction = action;
- QMenuPrivate::sloppyDelayTimer = startTimer(style()->styleHint(QStyle::SH_Menu_SubMenuPopupDelay, 0, this)*6);
+ // If the timer is already running then don't start a new one unless the action is the same
+ if (d->sloppyAction != action && QMenuPrivate::sloppyDelayTimer != 0) {
+ killTimer(QMenuPrivate::sloppyDelayTimer);
+ QMenuPrivate::sloppyDelayTimer = 0;
+ }
+ if (QMenuPrivate::sloppyDelayTimer == 0) {
+ d->sloppyAction = action;
+ QMenuPrivate::sloppyDelayTimer = startTimer(style()->styleHint(QStyle::SH_Menu_SubMenuPopupDelay, 0, this) * 6);
+ }
} else if (action != d->currentAction) {
d->setCurrentAction(action, style()->styleHint(QStyle::SH_Menu_SubMenuPopupDelay, 0, this));
}
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index f22c48b26f..a7cad28df3 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1054,6 +1054,7 @@ void QMenuBar::mousePressEvent(QMouseEvent *e)
if(QMenu *menu = d->activeMenu) {
d->activeMenu = 0;
menu->hide();
+ d->closePopupMode = 1;
}
} else {
d->setCurrentAction(action, true);