summaryrefslogtreecommitdiffstats
path: root/src
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
parent5dd2713c8ba98e06ae5c4f3da44b2ed73121d247 (diff)
parent730bc064a070e886e10950ccfd59780e8976f5fd (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp6
-rw-r--r--src/corelib/kernel/qmetaobject.cpp9
-rw-r--r--src/corelib/tools/qbytearray.cpp2
-rw-r--r--src/corelib/tools/qvector.h2
-rw-r--r--src/gui/image/qpnghandler.cpp16
-rw-r--r--src/platformsupport/glxconvenience/glxconvenience.pri5
-rw-r--r--src/plugins/platforms/android/src/androidjnimain.cpp40
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp21
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h2
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.cpp1
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm6
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm10
-rw-r--r--src/plugins/platforms/offscreen/offscreen.pro2
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp6
-rw-r--r--src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc11
-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
23 files changed, 117 insertions, 60 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index e8904b0ab7..57231b57a9 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -573,9 +573,12 @@ typedef enum { Q_FileIdInfo = 18 } Q_FILE_INFO_BY_HANDLE_CLASS;
# if defined(Q_CC_MINGW) || (defined(Q_CC_MSVC) && _MSC_VER < 1700)
+// MinGW-64 defines FILE_ID_128 as of gcc-4.8.1 along with FILE_SUPPORTS_INTEGRITY_STREAMS
+# if !(defined(Q_CC_MINGW) && defined(FILE_SUPPORTS_INTEGRITY_STREAMS))
typedef struct _FILE_ID_128 {
BYTE Identifier[16];
} FILE_ID_128, *PFILE_ID_128;
+# endif // !(Q_CC_MINGW && FILE_SUPPORTS_INTEGRITY_STREAMS)
typedef struct _FILE_ID_INFO {
ULONGLONG VolumeSerialNumber;
@@ -614,7 +617,8 @@ QByteArray fileIdWin8(HANDLE handle)
&infoEx, sizeof(FILE_ID_INFO))) {
result = QByteArray::number(infoEx.VolumeSerialNumber, 16);
result += ':';
- result += QByteArray((char *)infoEx.FileId.Identifier, sizeof(infoEx.FileId.Identifier)).toHex();
+ // Note: MinGW-64's definition of FILE_ID_128 differs from the MSVC one.
+ result += QByteArray((char *)&infoEx.FileId, sizeof(infoEx.FileId)).toHex();
}
}
return result;
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 4dc766ecc5..8d6cf5beb5 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -42,6 +42,7 @@
#include "qmetaobject.h"
#include "qmetatype.h"
#include "qobject.h"
+#include "qmetaobject_p.h"
#include <qcoreapplication.h>
#include <qcoreevent.h>
@@ -2098,8 +2099,12 @@ bool QMetaMethod::invoke(QObject *object,
if (qstrcmp(returnValue.name(), retType) != 0) {
// normalize the return value as well
QByteArray normalized = QMetaObject::normalizedType(returnValue.name());
- if (qstrcmp(normalized.constData(), retType) != 0)
- return false;
+ if (qstrcmp(normalized.constData(), retType) != 0) {
+ // String comparison failed, try compare the metatype.
+ int t = returnType();
+ if (t == QMetaType::UnknownType || t != QMetaType::type(normalized))
+ return false;
+ }
}
}
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 20d4339a19..a2d3891f00 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -646,8 +646,6 @@ static inline char qToLower(char c)
store raw binary data, and when memory conservation is critical
(e.g., with Qt for Embedded Linux).
- The maximum array size of a QByteArray is under 2^30.
-
One way to initialize a QByteArray is simply to pass a \c{const
char *} to its constructor. For example, the following code
creates a byte array of size 5 containing the data "Hello":
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 288404f3c2..0f2acd6986 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -642,7 +642,7 @@ typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
iterator moveEnd = d->end();
while (moveBegin != moveEnd) {
if (QTypeInfo<T>::isComplex)
- abegin->~T();
+ static_cast<T *>(abegin)->~T();
new (abegin++) T(*moveBegin++);
}
if (abegin < d->end()) {
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index e43ac666c7..7838b7df8e 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -591,14 +591,14 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage)
if (doScaledRead) {
read_image_scaled(outImage, png_ptr, info_ptr, amp, scaledSize);
} else {
- png_uint_32 width;
- png_uint_32 height;
- png_int_32 offset_x;
- png_int_32 offset_y;
-
- int bit_depth;
- int color_type;
- int unit_type;
+ png_uint_32 width = 0;
+ png_uint_32 height = 0;
+ png_int_32 offset_x = 0;
+ png_int_32 offset_y = 0;
+
+ int bit_depth = 0;
+ int color_type = 0;
+ int unit_type = PNG_OFFSET_PIXEL;
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, &unit_type);
uchar *data = outImage->bits();
diff --git a/src/platformsupport/glxconvenience/glxconvenience.pri b/src/platformsupport/glxconvenience/glxconvenience.pri
index d325f5adf9..cc5b198f6c 100644
--- a/src/platformsupport/glxconvenience/glxconvenience.pri
+++ b/src/platformsupport/glxconvenience/glxconvenience.pri
@@ -1,6 +1,7 @@
-contains(QT_CONFIG,xlib):contains(QT_CONFIG,xrender) {
+contains(QT_CONFIG, xlib) {
contains(QT_CONFIG,opengl):!contains(QT_CONFIG,opengles2) {
- LIBS_PRIVATE += $$QMAKE_LIBS_X11 -lXrender
+ contains(QT_CONFIG, xrender): LIBS_PRIVATE += -lXrender
+ LIBS_PRIVATE += $$QMAKE_LIBS_X11
HEADERS += $$PWD/qglxconvenience_p.h
SOURCES += $$PWD/qglxconvenience.cpp
}
diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp
index 023cce30ec..b426839f3d 100644
--- a/src/plugins/platforms/android/src/androidjnimain.cpp
+++ b/src/plugins/platforms/android/src/androidjnimain.cpp
@@ -565,33 +565,37 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
m_nativeWindow = nativeWindow;
if (m_waitForWindow)
m_waitForWindowSemaphore.release();
- if (m_androidPlatformIntegration && !sameNativeWindow) {
- m_surfaceMutex.unlock();
- m_androidPlatformIntegration->surfaceChanged();
- } else if (m_androidPlatformIntegration && sameNativeWindow) {
- QPlatformScreen *screen = m_androidPlatformIntegration->screen();
+
+ if (m_androidPlatformIntegration) {
QSize size = QtAndroid::nativeWindowSize();
+ QPlatformScreen *screen = m_androidPlatformIntegration->screen();
QRect geometry(QPoint(0, 0), size);
QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry);
QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry);
- // Resize all top level windows, since they share the same surface
- foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
- QAndroidOpenGLPlatformWindow *window =
- static_cast<QAndroidOpenGLPlatformWindow *>(w->handle());
-
- if (window != 0) {
- window->lock();
- window->scheduleResize(size);
-
- QWindowSystemInterface::handleExposeEvent(window->window(),
- QRegion(window->window()->geometry()));
- window->unlock();
+ if (!sameNativeWindow) {
+ m_surfaceMutex.unlock();
+ m_androidPlatformIntegration->surfaceChanged();
+ } else {
+ // Resize all top level windows, since they share the same surface
+ foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
+ QAndroidOpenGLPlatformWindow *window =
+ static_cast<QAndroidOpenGLPlatformWindow *>(w->handle());
+
+ if (window != 0) {
+ window->lock();
+ window->scheduleResize(size);
+
+ QWindowSystemInterface::handleExposeEvent(window->window(),
+ QRegion(window->window()->geometry()));
+ window->unlock();
+ }
}
+
+ m_surfaceMutex.unlock();
}
- m_surfaceMutex.unlock();
} else {
m_surfaceMutex.unlock();
}
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
index f9262c69f6..4934047af9 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
@@ -84,9 +84,19 @@ void QAndroidOpenGLPlatformWindow::invalidateSurface()
}
}
+void QAndroidOpenGLPlatformWindow::updateStaticNativeWindow()
+{
+ QWriteLocker locker(&m_staticSurfaceLock);
+ m_staticNativeWindow = QtAndroid::nativeWindow(false);
+}
+
void QAndroidOpenGLPlatformWindow::resetSurface()
{
- m_referenceCount.ref();
+ // Only add a reference if we're not already holding one, otherwise we're just updating
+ // the native window pointer
+ if (m_window == 0)
+ m_referenceCount.ref();
+
if (m_staticSurface == 0) {
QWriteLocker locker(&m_staticSurfaceLock);
QEglFSWindow::resetSurface();
@@ -94,12 +104,17 @@ void QAndroidOpenGLPlatformWindow::resetSurface()
m_staticNativeWindow = m_window;
} else {
QReadLocker locker(&m_staticSurfaceLock);
- Q_ASSERT(m_staticSurface != m_surface);
m_window = m_staticNativeWindow;
m_surface = m_staticSurface;
}
- QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event
+ {
+ lock();
+ scheduleResize(QtAndroid::nativeWindowSize());
+ QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event
+ unlock();
+ }
+
QWindowSystemInterface::flushWindowSystemEvents();
}
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h
index 36a110e1a8..9a25957ccd 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h
@@ -71,6 +71,8 @@ public:
void destroy();
+ static void updateStaticNativeWindow();
+
private:
QSize m_scheduledResize;
QMutex m_lock;
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
index 045eb57148..286d4cc7f2 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
@@ -171,6 +171,7 @@ void QAndroidPlatformIntegration::invalidateNativeSurface()
void QAndroidPlatformIntegration::surfaceChanged()
{
+ QAndroidOpenGLPlatformWindow::updateStaticNativeWindow();
foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
QAndroidOpenGLPlatformWindow *window =
static_cast<QAndroidOpenGLPlatformWindow *>(w->handle());
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 3ac48df09e..14b8dee101 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -457,7 +457,9 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatf
// Else, we need to transform 'pos' to window or screen coordinates.
NSPoint nsPos = NSMakePoint(pos.x() - 1, pos.y());
if (view) {
+ // Flip y-coordinate first, the convert to content view space.
nsPos.y = view.frame.size.height - nsPos.y;
+ nsPos = [view convertPoint:nsPos toView:view.window.contentView];
} else if (!QGuiApplication::screens().isEmpty()) {
QScreen *screen = QGuiApplication::screens().at(0);
nsPos.y = screen->availableVirtualSize().height() - nsPos.y;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 46d3b7329e..5fc2975a9d 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -795,6 +795,7 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
QRect rect = window()->geometry();
NSRect frame = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height());
[m_contentView setFrame:frame];
+ [m_contentView setHidden: YES];
}
const qreal opacity = qt_window_private(window())->opacity;
@@ -913,7 +914,8 @@ void QCocoaWindow::clearNSWindow(NSWindow *window)
[window setContentView:nil];
[window setDelegate:nil];
[window clearPlatformWindow];
- [[NSNotificationCenter defaultCenter] removeObserver:m_contentView];
+ [[NSNotificationCenter defaultCenter] removeObserver:m_contentView
+ name:nil object:window];
}
// Returns the current global screen geometry for the nswindow associated with this window.
@@ -1025,7 +1027,7 @@ qreal QCocoaWindow::devicePixelRatio() const
void QCocoaWindow::exposeWindow()
{
- if (!m_isExposed) {
+ if (!m_isExposed && ![[m_contentView superview] isHidden]) {
m_isExposed = true;
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
}
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 51c3953af1..b8a31329fe 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -107,12 +107,9 @@ static QTouchDevice *touchDevice = 0;
m_maskImage = 0;
m_maskData = 0;
m_window = 0;
- if (m_subscribesForGlobalFrameNotifications) {
- m_subscribesForGlobalFrameNotifications = false;
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:NSViewGlobalFrameDidChangeNotification
- object:self];
-}
+ m_subscribesForGlobalFrameNotifications = false;
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
delete currentCustomDragTypes;
[super dealloc];
@@ -603,6 +600,7 @@ static QTouchDevice *touchDevice = 0;
QWindowSystemInterface::handleCloseEvent(m_platformWindow->m_activePopupWindow);
QWindowSystemInterface::flushWindowSystemEvents();
m_platformWindow->m_activePopupWindow = 0;
+ return;
}
if ([self hasMarkedText]) {
NSInputManager* inputManager = [NSInputManager currentInputManager];
diff --git a/src/plugins/platforms/offscreen/offscreen.pro b/src/plugins/platforms/offscreen/offscreen.pro
index f9c5bd2165..5db5e32e65 100644
--- a/src/plugins/platforms/offscreen/offscreen.pro
+++ b/src/plugins/platforms/offscreen/offscreen.pro
@@ -17,7 +17,7 @@ HEADERS = qoffscreenintegration.h \
OTHER_FILES += offscreen.json
-contains(QT_CONFIG, xcb):contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles2) {
+contains(QT_CONFIG, xlib):contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles2) {
SOURCES += qoffscreenintegration_x11.cpp
HEADERS += qoffscreenintegration_x11.h
system(echo "Using X11 offscreen integration with GLX")
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 745f6548b5..0e6c49aedb 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -1801,8 +1801,8 @@ void QWindowsXpNativeFileDialog::populateOpenFileName(OPENFILENAME *ofn, HWND ow
QString defaultSuffix = m_options->defaultSuffix();
if (defaultSuffix.startsWith(QLatin1Char('.')))
defaultSuffix.remove(0, 1);
- if (!defaultSuffix.isEmpty())
- ofn->lpstrDefExt = qStringToWCharArray(defaultSuffix);
+ // QTBUG-33156, also create empty strings to trigger the appending mechanism.
+ ofn->lpstrDefExt = qStringToWCharArray(defaultSuffix);
}
// Flags.
ofn->Flags = (OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_EXPLORER | OFN_PATHMUSTEXIST);
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 498bd509fa..49fdfc15b8 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -39,6 +39,12 @@
**
****************************************************************************/
+// SHSTOCKICONINFO is only available since Vista
+#if _WIN32_WINNT < 0x0600
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x0600
+#endif
+
#include "qwindowstheme.h"
#include "qwindowsdialoghelpers.h"
#include "qwindowscontext.h"
diff --git a/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc b/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc
index 4289f357e9..20e0b86b6c 100644
--- a/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc
+++ b/src/tools/qdoc/doc/qdoc-minimum-qdocconf.qdoc
@@ -26,12 +26,15 @@
****************************************************************************/
/*!
\page qdoc-minimum-qdocconf.html
-\title A minimal qdocconf file with comments
+\title A minimal qdocconf file with Comments
\brief Describes a minimal .qdocconf file
-Below you will find the full contents of qtgui.qdocconf. The subsequent section will discuss
-every statement in the qdocconf file.
+Below you will find the full contents of qtgui.qdocconf. The subsequent section
+will discuss every statement in the qdocconf file.
+
+Each line from the qdocconf file is first quoted. Below each statement you will
+find the meaning.
\code
#include(compat.qdocconf)
@@ -83,4 +86,6 @@ The source code of the example files can be found in the current directory.
The image files can be found in the underlying directory "images".
+\note Please take care with this minimal qdocconf file. Using it in the wrong directory
+could cause qdoc to include a large number of files.
*/
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);