From b8ccacbb03cb8d265209970c4443218dac33fc81 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 2 Dec 2013 16:48:18 +0200 Subject: Default to 5.2 source repository for Qt 5.2.x We can't use latest anymore because the qreal change is not back compatible and all the apps that used latest will stop to run when Ministro will upgrade the libs. Change-Id: I5286e72eccf86b4dead773a637aa28e29d120605 Reviewed-by: Paul Olav Tvete --- src/android/java/res/values/libs.xml | 2 +- src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/java/res/values/libs.xml b/src/android/java/res/values/libs.xml index 231406d224..797e6bb8c4 100644 --- a/src/android/java/res/values/libs.xml +++ b/src/android/java/res/values/libs.xml @@ -1,7 +1,7 @@ - https://download.qt-project.org/ministro/android/qt5/latest + https://download.qt-project.org/ministro/android/qt5/qt-5.2 index mapping Entries m_entries; int m_index; + QByteArray m_className; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::AddMembers) diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp index 51c0b27668..13c538bb59 100644 --- a/src/dbus/qdbusmetaobject.cpp +++ b/src/dbus/qdbusmetaobject.cpp @@ -445,8 +445,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj) data_size += 2 + mm.inputTypes.count() + mm.outputTypes.count(); idata.resize(data_size + 1); - QMetaStringTable strings; - strings.enter(className.toLatin1()); + QMetaStringTable strings(className.toLatin1()); int offset = header->methodData; int parametersOffset = offset + header->methodCount * 5; diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp index 8f6bd50cca..5cf3e6d97c 100644 --- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp +++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp @@ -75,6 +75,8 @@ private slots: void usage_connect(); void usage_templateConnect(); + void classNameFirstInStringData(); + private: static bool checkForSideEffects (const QMetaObjectBuilder& builder, @@ -1694,6 +1696,20 @@ void tst_QMetaObjectBuilder::usage_templateConnect() QVERIFY(!con); } +void tst_QMetaObjectBuilder::classNameFirstInStringData() +{ + QMetaObjectBuilder builder; + builder.addMetaObject(&SomethingOfEverything::staticMetaObject); + builder.setClassName(QByteArrayLiteral("TestClass")); + QMetaObject *mo = builder.toMetaObject(); + + QByteArrayDataPtr header; + header.ptr = const_cast(mo->d.stringdata); + QCOMPARE(QByteArray(header), QByteArrayLiteral("TestClass")); + + free(mo); +} + QTEST_MAIN(tst_QMetaObjectBuilder) #include "tst_qmetaobjectbuilder.moc" -- cgit v1.2.3 From 8be546d107ac69bc48ec278396e9c3f63470fd0d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 7 Dec 2013 08:49:34 +0100 Subject: Revert "Move the glxfbconfig configtest to qpa and rename it to glx" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a2d3b7c99165cb5c4be6f0dd83a967e1119cf732. That commit broke -opengl es2 builds on Linux desktops (when GLX is available). /usr/include/GL/gl.h:162:17: error: conflicting declaration ‘typedef double GLdouble’ qopengl.h:97:17: error: ‘GLdouble’ has a previous declaration as ‘typedef GLfloat GLdouble’ Change-Id: Id5f48c05803be1a8c03eeffca139b80e9a85a0eb Reviewed-by: Thiago Macieira --- config.tests/qpa/glx/glx.cpp | 52 ------------------------ config.tests/qpa/glx/glx.pro | 10 ----- config.tests/x11/glxfbconfig/glxfbconfig.cpp | 51 ++++++++++++++++++++++++ config.tests/x11/glxfbconfig/glxfbconfig.pro | 10 +++++ configure | 59 +++++++++++----------------- src/plugins/platforms/xcb/xcb-plugin.pro | 2 +- 6 files changed, 86 insertions(+), 98 deletions(-) delete mode 100644 config.tests/qpa/glx/glx.cpp delete mode 100644 config.tests/qpa/glx/glx.pro create mode 100644 config.tests/x11/glxfbconfig/glxfbconfig.cpp create mode 100644 config.tests/x11/glxfbconfig/glxfbconfig.pro diff --git a/config.tests/qpa/glx/glx.cpp b/config.tests/qpa/glx/glx.cpp deleted file mode 100644 index 03af3f6131..0000000000 --- a/config.tests/qpa/glx/glx.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, 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, Digia gives you certain additional -** rights. These rights are described in the Digia 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. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -int main(int, char **) -{ - //We require glxfbconfig, ie. glx 1.3 - GLXFBConfig config; - config = 0; - - return 0; -} diff --git a/config.tests/qpa/glx/glx.pro b/config.tests/qpa/glx/glx.pro deleted file mode 100644 index da51a6d231..0000000000 --- a/config.tests/qpa/glx/glx.pro +++ /dev/null @@ -1,10 +0,0 @@ -SOURCES = glx.cpp -CONFIG += x11 -INCLUDEPATH += $$QMAKE_INCDIR_OPENGL - -for(p, QMAKE_LIBDIR_OPENGL) { - exists($$p):LIBS += -L$$p -} - -CONFIG -= qt -LIBS += -lGL diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.cpp b/config.tests/x11/glxfbconfig/glxfbconfig.cpp new file mode 100644 index 0000000000..77bedb41c8 --- /dev/null +++ b/config.tests/x11/glxfbconfig/glxfbconfig.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +int main(int, char **) +{ + GLXFBConfig config; + config = 0; + + return 0; +} diff --git a/config.tests/x11/glxfbconfig/glxfbconfig.pro b/config.tests/x11/glxfbconfig/glxfbconfig.pro new file mode 100644 index 0000000000..65f855a5f2 --- /dev/null +++ b/config.tests/x11/glxfbconfig/glxfbconfig.pro @@ -0,0 +1,10 @@ +SOURCES = glxfbconfig.cpp +CONFIG += x11 +INCLUDEPATH += $$QMAKE_INCDIR_OPENGL + +for(p, QMAKE_LIBDIR_OPENGL) { + exists($$p):LIBS += -L$$p +} + +CONFIG -= qt +LIBS += -lGL diff --git a/configure b/configure index ab1f81c2cf..99023dc8b5 100755 --- a/configure +++ b/configure @@ -611,7 +611,6 @@ CFG_OPENVG_LC_INCLUDES=no CFG_OPENVG_SHIVA=auto CFG_OPENVG_ON_OPENGL=auto CFG_EGL=auto -CFG_GLX=auto CFG_SSE=auto CFG_FONTCONFIG=auto CFG_FREETYPE=auto @@ -1482,13 +1481,6 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; - glx) - if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then - CFG_GLX="$VAL" - else - UNKNOWN_OPT=yes - fi - ;; pch) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_PRECOMPILE="$VAL" @@ -4911,6 +4903,19 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then fi CFG_OPENGL=no fi + case "$PLATFORM" in + hpux*) + # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct. + if [ "$CFG_OPENGL" = "desktop" ]; then + compileTest x11/glxfbconfig "OpenGL" + if [ $? != "0" ]; then + QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT + fi + fi + ;; + *) + ;; + esac elif [ "$CFG_OPENGL" = "es2" ]; then #OpenGL ES 2.x compileTest unix/opengles2 "OpenGL ES 2.x" @@ -4931,6 +4936,17 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then echo " ${XQMAKESPEC}." exit 1 fi + case "$PLATFORM" in + hpux*) + # HP-UX have buggy glx headers; check if we really need to define the GLXFBConfig struct. + compileTest x11/glxfbconfig "OpenGL" + if [ $? != "0" ]; then + QMakeVar add DEFINES QT_DEFINE_GLXFBCONFIG_STRUCT + fi + ;; + *) + ;; + esac fi fi # X11/MINGW OpenGL @@ -5289,24 +5305,6 @@ if [ "$CFG_EGL" != "no" ]; then fi fi -# GLX Support -if [ "$CFG_GLX" != "no" ]; then - if [ "$CFG_GLX" = "yes" ] && [ "$CFG_OPENGL" = "no" ]; then - echo "GLX support was requested but OpenGL support is disabled." - echo "Either disable GLX support or enable OpenGL support." - exit 101 - fi - if compileTest qpa/glx "GLX"; then - CFG_GLX=yes - elif [ "$CFG_GLX" = "yes" ]; then - echo " The GLX functionality test failed; GLX is required by the xcb plugin to manage contexts & surfaces." - exit 1 - else - CFG_GLX=no - fi -fi - - if [ "$CFG_EGLFS" != "no" ]; then if [ "$XPLATFORM_QNX" = "no" ]; then CFG_EGLFS="$CFG_EGL" @@ -5677,13 +5675,6 @@ else QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EGL" fi -# enable glx -if [ "$CFG_GLX" = "yes" ]; then - QT_CONFIG="$QT_CONFIG glx" -else - QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLX" -fi - # enable eglfs if [ "$CFG_EGLFS" = "yes" ]; then QT_CONFIG="$QT_CONFIG eglfs" @@ -6719,8 +6710,6 @@ else report_support " pkg-config ............. no" fi report_support " PulseAudio ............." "$CFG_PULSEAUDIO" -report_support " EGL ...................." "$CFG_EGL" -report_support " GLX ...................." "$CFG_GLX" report_support " QPA backends:" report_support " DirectFB ............." "$CFG_DIRECTFB" report_support " EGLFS ................" "$CFG_EGLFS" diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index 49a1c1b320..8968d020c4 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -81,7 +81,7 @@ contains(QT_CONFIG, xcb-sm) { } contains(QT_CONFIG, opengl) { - contains(QT_CONFIG, xcb-xlib):contains(QT_CONFIG, glx) { + contains(QT_CONFIG, xcb-xlib):!contains(QT_CONFIG, opengles2) { DEFINES += XCB_USE_GLX HEADERS += qglxintegration.h SOURCES += qglxintegration.cpp -- cgit v1.2.3 From 5bf67f5f41ab110eb41ab74f2a87e649735af435 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 3 Dec 2013 23:25:27 -0800 Subject: Don't check the Qt version across modules in -developer-build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of enforcing the check, we'll simply trust developers to do the right thing. For one, it's useful to mix libraries during testing (regression testing, git bisects, etc.). For another, Qt developers are faced day-to-day with binary incompatibility issues anyway, so this check is mostly superfluous. If there's one commit we could be sure that isn't breaking binary compatibility, that's the "Bump Qt version" commit. And yet that's the one that would cause the fatal to trip... Change-Id: I8965f764a6ca1b2d125b42bce7ac6b27e3afc8ac Reviewed-by: Olivier Goffart Reviewed-by: Friedemann Kleint Reviewed-by: Jędrzej Nowacki Reviewed-by: Stephen Kelly Reviewed-by: Marc Mutz --- src/corelib/kernel/qobject.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a65cf517ce..50fb1e5970 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -194,9 +194,15 @@ QMetaObject *QObjectData::dynamicMetaObject() const QObjectPrivate::QObjectPrivate(int version) : threadData(0), connectionLists(0), senders(0), currentSender(0), currentChildBeingDeleted(0) { +#ifdef QT_BUILD_INTERNAL + // Don't check the version parameter in internal builds. + // This allows incompatible versions to be loaded, possibly for testing. + Q_UNUSED(version); +#else if (version != QObjectPrivateVersion) qFatal("Cannot mix incompatible Qt library (version 0x%x) with this library (version 0x%x)", version, QObjectPrivateVersion); +#endif // QObjectData initialization q_ptr = 0; -- cgit v1.2.3 From 77cd033e44f9b899749994b17fc0bbfa7a164a3b Mon Sep 17 00:00:00 2001 From: John Layt Date: Sun, 8 Dec 2013 00:16:45 +0100 Subject: QPrintDialog - Fix setting of PageOrder The print dialog was setting the PageOrder on the QPrinter as soon as the check box was toggled and not when the Print button was pressed, meaning the change is not forgotten when Cancel is pressed. Change-Id: I19637b7efacfb5388c70d2e7d9d05a05ecc5b2ea Reviewed-by: Andy Shaw --- src/printsupport/dialogs/qprintdialog.h | 1 - src/printsupport/dialogs/qprintdialog_unix.cpp | 14 +------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h index c822aa0533..886cd1e08d 100644 --- a/src/printsupport/dialogs/qprintdialog.h +++ b/src/printsupport/dialogs/qprintdialog.h @@ -106,7 +106,6 @@ Q_SIGNALS: private: #if defined (Q_OS_UNIX) && !defined(Q_OS_MAC) - Q_PRIVATE_SLOT(d_func(), void _q_chbPrintLastFirstToggled(bool)) Q_PRIVATE_SLOT(d_func(), void _q_togglePageSetCombo(bool)) Q_PRIVATE_SLOT(d_func(), void _q_collapseOrExpandDialog()) # if !defined(QT_NO_MESSAGEBOX) diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index fe7e43814c..41a01abf3b 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -203,7 +203,6 @@ public: void selectPrinter(const QPrinter::OutputFormat outputFormat); - void _q_chbPrintLastFirstToggled(bool); void _q_togglePageSetCombo(bool); #ifndef QT_NO_MESSAGEBOX void _q_checkFields(); @@ -363,9 +362,6 @@ void QPrintDialogPrivate::init() #endif QObject::connect(buttons, SIGNAL(rejected()), q, SLOT(reject())); - QObject::connect(options.reverse, SIGNAL(toggled(bool)), - q, SLOT(_q_chbPrintLastFirstToggled(bool))); - QObject::connect(options.printSelection, SIGNAL(toggled(bool)), q, SLOT(_q_togglePageSetCombo(bool))); @@ -429,6 +425,7 @@ void QPrintDialogPrivate::setupPrinter() } p->setColorMode(options.color->isChecked() ? QPrinter::Color : QPrinter::GrayScale); + p->setPageOrder(options.reverse->isChecked() ? QPrinter::LastPageFirst : QPrinter::FirstPageFirst); // print range if (options.printAll->isChecked()) { @@ -486,15 +483,6 @@ void QPrintDialogPrivate::setupPrinter() top->d->setupPrinter(); } -void QPrintDialogPrivate::_q_chbPrintLastFirstToggled(bool checked) -{ - Q_Q(QPrintDialog); - if (checked) - q->printer()->setPageOrder(QPrinter::LastPageFirst); - else - q->printer()->setPageOrder(QPrinter::FirstPageFirst); -} - void QPrintDialogPrivate::_q_togglePageSetCombo(bool checked) { if (printerOutputFormat == QPrinter::PdfFormat) -- cgit v1.2.3 From 1698369924e5f14769fc4b107697626660d9ddf4 Mon Sep 17 00:00:00 2001 From: John Layt Date: Sun, 8 Dec 2013 11:13:01 +0100 Subject: QPageSetupWidget - Fix copying of printer settings Don't copy the dialog settings to the QPrinter before the Print button is pressed, in case the Cancel button is pressed instead. The settings already get copied in the right place. Change-Id: I84d0053b450cf5839bf1a879af013f305a8fd377 Reviewed-by: Andy Shaw --- src/printsupport/dialogs/qpagesetupdialog_unix.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp index 8809b52751..c1b9828a23 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp +++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp @@ -457,9 +457,6 @@ void QPageSetupWidget::selectPrinter() unitChanged(widget.unit->currentIndex()); m_pagePreview->setMargins(m_leftMargin, m_topMargin, m_rightMargin, m_bottomMargin); - - // setup printer here the first time - setupPrinter(); } void QPageSetupWidget::selectPdfPsPrinter(const QPrinter *p) -- cgit v1.2.3 From d9fd2085f9c2105187732a2c14fa78c414678d8b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Sun, 8 Dec 2013 13:19:46 +0100 Subject: Reinitialize the printer after changing the custom paper size Task-number: QTBUG-34276 Change-Id: Ie382c39cb7b7b8307fcd1130702ca97e80e4a4f5 Reviewed-by: John Layt --- src/printsupport/kernel/qprintengine_win.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index e2446c19b1..67e7c34fca 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -1453,6 +1453,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant & d->devMode->dmPaperLength = qRound(sizeMM.height() * 10.0); d->devMode->dmPaperWidth = qRound(sizeMM.width() * 10.0); } + d->doReinit(); break; } -- cgit v1.2.3 From 29b0a565e9e420a6dc34aaaf3b66976bb75edcb0 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 9 Dec 2013 11:24:56 +0100 Subject: fix Windows CE comments Change-Id: Ib42c456c236f59727dddd6a111dfe0946fff1aef Reviewed-by: Friedemann Kleint --- tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index d248f022ed..d141c11a90 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -538,7 +538,6 @@ void tst_QProcess::echoTest2() #endif #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) -//Batch files are not supported on Winfows CE // Reading and writing to a process is not supported on Qt/CE //----------------------------------------------------------------------------- void tst_QProcess::echoTestGui() @@ -560,7 +559,7 @@ void tst_QProcess::echoTestGui() //----------------------------------------------------------------------------- #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) -//Batch files are not supported on Winfows CE +// Batch files are not supported on Windows CE void tst_QProcess::batFiles_data() { QTest::addColumn("batFile"); -- cgit v1.2.3 From fbc6240cc6f4846fbde1ee8dff6cda28863ed55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Fri, 6 Dec 2013 15:12:50 +0000 Subject: Windows: Fix corner case where frameless windows would cover the taskbar. In commit 0c936ca83c40b73f30195a619900f2be98b9e968 we fixed the case where the window was maximized programmatically, but if the window gets restored by clicking on the taskbar we don't get to set WithinMaximize flag, since we immediately get the WM_GETMINMAXINFO request from Windows. To reproduce the problem, run tests/manual/windowflags, remove frames, maximize, minimize, and restore by clicking on the taskbar. Task-number: QTBUG-8361 Change-Id: I8a7cf4fccbb2c3dac5f570848501ac1e8d2c2307 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 89b5bdbf0e..51902385e1 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1912,7 +1912,8 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const const QWindowsGeometryHint hint(window(), m_data.customMargins); hint.applyToMinMaxInfo(m_data.hwnd, mmi); - if (testFlag(WithinMaximize) && (m_data.flags & Qt::FramelessWindowHint)) { + if ((testFlag(WithinMaximize) || (window()->windowState() == Qt::WindowMinimized)) + && (m_data.flags & Qt::FramelessWindowHint)) { // This block fixes QTBUG-8361: Frameless windows shouldn't cover the // taskbar when maximized if (const QScreen *screen = effectiveScreen(window())) { -- cgit v1.2.3 From b0f83f2284af777f17e06e084a2399f9ad2a87f8 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 3 Dec 2013 15:38:50 +0100 Subject: Simplify linking to different jpeg libs. This makes it slightly more obvious which compiler should be used with which. Task-number: QTBUG-23119 Change-Id: Ie3e5cf995d686bfa846902a040668716c8b5f526 Reviewed-by: Andy Shaw --- src/gui/image/qjpeghandler.pri | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qjpeghandler.pri b/src/gui/image/qjpeghandler.pri index 3cb35c95ed..c8de33d8b4 100644 --- a/src/gui/image/qjpeghandler.pri +++ b/src/gui/image/qjpeghandler.pri @@ -3,8 +3,10 @@ INCLUDEPATH *= $$PWD HEADERS += $$PWD/qjpeghandler_p.h SOURCES += $$PWD/qjpeghandler.cpp contains(QT_CONFIG, system-jpeg) { - if(unix|win32-g++*): LIBS += -ljpeg - else:win32: LIBS += libjpeg.lib + msvc: \ + LIBS += libjpeg.lib + else: \ + LIBS += -ljpeg } else { include($$PWD/../../3rdparty/libjpeg.pri) } -- cgit v1.2.3 From bd1a609aef4b2e2e36c0fe43c18b175a951b2e55 Mon Sep 17 00:00:00 2001 From: John Layt Date: Sat, 7 Dec 2013 20:17:52 +0100 Subject: QPrintDialog - Fix Cups printer setup sequence First set up the selected output format, printer and page size, and then setup the selected job options. This ensures all values are correctly setup for the requested format and printer as not all settings may be able to persist across the change in output format or printer. Change-Id: I67f261f4e3be479a9018139633886ee8e570f42a Reviewed-by: Andy Shaw --- src/printsupport/dialogs/qprintdialog_unix.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp index 41a01abf3b..a903d170f2 100644 --- a/src/printsupport/dialogs/qprintdialog_unix.cpp +++ b/src/printsupport/dialogs/qprintdialog_unix.cpp @@ -412,6 +412,10 @@ void QPrintDialogPrivate::applyPrinterProperties() void QPrintDialogPrivate::setupPrinter() { + // First setup the requested OutputFormat, Printer and Page Size first + top->d->setupPrinter(); + + // Then setup Print Job options Q_Q(QPrintDialog); QPrinter* p = q->printer(); @@ -479,8 +483,6 @@ void QPrintDialogPrivate::setupPrinter() // copies p->setCopyCount(options.copies->value()); p->setCollateCopies(options.collate->isChecked()); - - top->d->setupPrinter(); } void QPrintDialogPrivate::_q_togglePageSetCombo(bool checked) -- cgit v1.2.3 From 3c7231a9800e4e2de3f90b175f9bb39a9f046b18 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 6 Dec 2013 20:25:12 +0100 Subject: QMetaStringTable: make ctor explicit Recent commit 105d10de introduced the QMetaStringTable(QByteArray) constructor, but failed to mark it as explicit. The argument, the class' name, is not an equivalent representation of a string table, so mark the constructor explicit. Change-Id: I2f141969400b98d3253283bd6fb0b9d18f2d53b3 Reviewed-by: Simon Hausmann Reviewed-by: Olivier Goffart --- src/corelib/kernel/qmetaobjectbuilder_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qmetaobjectbuilder_p.h b/src/corelib/kernel/qmetaobjectbuilder_p.h index 110aaf9ce2..3a1b43c3ed 100644 --- a/src/corelib/kernel/qmetaobjectbuilder_p.h +++ b/src/corelib/kernel/qmetaobjectbuilder_p.h @@ -323,7 +323,7 @@ private: class Q_CORE_EXPORT QMetaStringTable { public: - QMetaStringTable(const QByteArray &className); + explicit QMetaStringTable(const QByteArray &className); int enter(const QByteArray &value); -- cgit v1.2.3 From a115fdbe024b7336910ba58c6e4f037b68e9622f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 6 Dec 2013 20:30:10 +0100 Subject: QWidgetTextControl: drop some actions when QT_NO_CLIPBOARD Drop the Cut, Copy, and Copy Link Address actions from the context menu for QT_NO_CLIPBOARD builds. This mirrors what QWidgetLineControl already does. Change-Id: Icd6e92c044a11d336fb8d7fbf54b826712bd240e Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qwidgettextcontrol.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 0255183c87..b8f8762240 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2158,11 +2158,14 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget setActionIcon(a, QStringLiteral("edit-redo")); menu->addSeparator(); +#ifndef QT_NO_CLIPBOARD a = menu->addAction(tr("Cu&t") + ACCEL_KEY(QKeySequence::Cut), this, SLOT(cut())); a->setEnabled(d->cursor.hasSelection()); setActionIcon(a, QStringLiteral("edit-cut")); +#endif } +#ifndef QT_NO_CLIPBOARD if (showTextSelectionActions) { a = menu->addAction(tr("&Copy") + ACCEL_KEY(QKeySequence::Copy), this, SLOT(copy())); a->setEnabled(d->cursor.hasSelection()); @@ -2175,9 +2178,10 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget a = menu->addAction(tr("Copy &Link Location"), this, SLOT(_q_copyLink())); a->setEnabled(!d->linkToCopy.isEmpty()); } +#endif // QT_NO_CLIPBOARD if (d->interactionFlags & Qt::TextEditable) { -#if !defined(QT_NO_CLIPBOARD) +#ifndef QT_NO_CLIPBOARD a = menu->addAction(tr("&Paste") + ACCEL_KEY(QKeySequence::Paste), this, SLOT(paste())); a->setEnabled(canPaste()); setActionIcon(a, QStringLiteral("edit-paste")); -- cgit v1.2.3 From e6799c6e336ef1e79ce4ade33db336f67b7f588b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 6 Dec 2013 22:35:29 -0800 Subject: Remove unused function "quadraticRoots" qbezier.cpp(122): warning #177: function "quadraticRoots" was declared but never referenced Change-Id: I590f59ed6e41462d0a14a9239adb8bd0acbeeae4 Reviewed-by: Gunnar Sletta Reviewed-by: Frederik Gladhorn Reviewed-by: Lars Knoll --- src/gui/painting/qbezier.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp index 2762560da7..33075b640d 100644 --- a/src/gui/painting/qbezier.cpp +++ b/src/gui/painting/qbezier.cpp @@ -119,37 +119,6 @@ QBezier QBezier::getSubRange(qreal t0, qreal t1) const return result; } -static inline int quadraticRoots(qreal a, qreal b, qreal c, - qreal *x1, qreal *x2) -{ - if (qFuzzyIsNull(a)) { - if (qFuzzyIsNull(b)) - return 0; - *x1 = *x2 = (-c / b); - return 1; - } else { - const qreal det = b * b - 4 * a * c; - if (qFuzzyIsNull(det)) { - *x1 = *x2 = -b / (2 * a); - return 1; - } - if (det > 0) { - if (qFuzzyIsNull(b)) { - *x2 = qSqrt(-c / a); - *x1 = -(*x2); - return 2; - } - const qreal stableA = b / (2 * a); - const qreal stableB = c / (a * stableA * stableA); - const qreal stableC = -1 - qSqrt(1 - stableB); - *x2 = stableA * stableC; - *x1 = (stableA * stableB) / stableC; - return 2; - } else - return 0; - } -} - void QBezier::addToPolygon(QPolygonF *polygon, qreal bezier_flattening_threshold) const { QBezier beziers[10]; -- cgit v1.2.3 From 6d8b84e8d574ea583d54b3de5cb3d275c41f2caf Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 5 Dec 2013 10:36:00 +0200 Subject: GitIgnore updates * ANGLE artifacts * qfeatures Change-Id: I3cb8f78bf02119233f115ec53d536c05dd9776e7 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- .gitignore | 5 ++++- src/angle/src/.gitignore | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 src/angle/src/.gitignore diff --git a/.gitignore b/.gitignore index cc6102b64e..d7d38f265b 100644 --- a/.gitignore +++ b/.gitignore @@ -63,7 +63,7 @@ Makefile* *.gcov *.gcda *.gcno -bin/Qt*.dll +bin/*.dll bin/assistant* bin/designer* bin/dumpcpp* @@ -112,6 +112,7 @@ mkspecs/default mkspecs/default-host mkspecs/qconfig.pri mkspecs/qdevice.pri +mkspecs/qfeatures.pri moc_*.cpp qmake/qmake.exe qmake/Makefile.bak @@ -119,6 +120,7 @@ qmake/qmake_pch.pch src/corelib/global/qconfig.cpp src/corelib/global/qconfig.h src/corelib/global/qconfig.h.qmake +src/corelib/global/qfeatures.h src/platformsupport/*_interface.* src/platformsupport/*_adaptor.* ui_*.h @@ -183,6 +185,7 @@ src/3rdparty/webkit/includes2.txt # generated files in configure.exe bootstrapping tools/configure/configure.intermediate.manifest tools/configure/configure_pch.pch +/configure.exe # Symlinks generated by configure tools/qvfb/qvfbhdr.h diff --git a/src/angle/src/.gitignore b/src/angle/src/.gitignore new file mode 100644 index 0000000000..9cbadb59ef --- /dev/null +++ b/src/angle/src/.gitignore @@ -0,0 +1,6 @@ +/libGLESv2/renderer/ +/compiler/glslang_lex.cpp +/compiler/glslang_tab.cpp +/compiler/glslang_tab.h +/compiler/preprocessor/ExpressionParser.cpp +/compiler/preprocessor/Tokenizer.cpp -- cgit v1.2.3 From a071ba629b89dbbe458d0865a0c4ebc3f92d3524 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 8 Dec 2013 11:58:44 -0800 Subject: Cascade detection of SSE3 support and up If SSE2 isn't supported, then SSE3 can't be either. Onwards and upwards for SSSE3, SSE4.1, SSE4.2 and AVX. The test for AVX2 was already there. Task-number: QTBUG-24773 Change-Id: I005258db52d8abcd407a99b8ebcc23cdea8e3d9f Reviewed-by: Oswald Buddenhagen --- configure | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure b/configure index 99023dc8b5..6f540fa814 100755 --- a/configure +++ b/configure @@ -4224,6 +4224,9 @@ if [ "${CFG_SSE2}" = "auto" ]; then fi # detect sse3 support +if [ "${CFG_SSE2}" = "no" ]; then + CFG_SSE3=no +fi if [ "${CFG_SSE3}" = "auto" ]; then if compileTest common/sse3 "sse3"; then CFG_SSE3=yes @@ -4233,6 +4236,9 @@ if [ "${CFG_SSE3}" = "auto" ]; then fi # detect ssse3 support +if [ "${CFG_SSE3}" = "no" ]; then + CFG_SSSE3=no +fi if [ "${CFG_SSSE3}" = "auto" ]; then if compileTest common/ssse3 "ssse3"; then CFG_SSSE3=yes @@ -4242,6 +4248,9 @@ if [ "${CFG_SSSE3}" = "auto" ]; then fi # detect sse4.1 support +if [ "${CFG_SSSE3}" = "no" ]; then + CFG_SSE4_1=no +fi if [ "${CFG_SSE4_1}" = "auto" ]; then if compileTest common/sse4_1 "sse4_1"; then CFG_SSE4_1=yes @@ -4251,6 +4260,9 @@ if [ "${CFG_SSE4_1}" = "auto" ]; then fi # detect sse4.2 support +if [ "${CFG_SSE4_1}" = "no" ]; then + CFG_SSE4_2=no +fi if [ "${CFG_SSE4_2}" = "auto" ]; then if compileTest common/sse4_2 "sse4_2"; then CFG_SSE4_2=yes @@ -4260,6 +4272,9 @@ if [ "${CFG_SSE4_2}" = "auto" ]; then fi # detect avx support +if [ "${CFG_SSE4_2}" = "no" ]; then + CFG_AVX=no +fi if [ "${CFG_AVX}" = "auto" ]; then if compileTest common/avx "avx"; then case "$XQMAKESPEC" in -- cgit v1.2.3 From 98663a8311751d1486a0ecf4f83a4cd7185874a2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 8 Dec 2013 11:52:55 -0800 Subject: Remove unused -sse (CFG_SSE) option This is a left-over from the cleanup of MMX/3dNow!/SSE support, which we no longer have in Qt. Change-Id: I48388710a499bddb518ae3c2b8a4ad989482f58c Reviewed-by: Oswald Buddenhagen --- configure | 8 -------- 1 file changed, 8 deletions(-) diff --git a/configure b/configure index 6f540fa814..3ebc0d76b4 100755 --- a/configure +++ b/configure @@ -611,7 +611,6 @@ CFG_OPENVG_LC_INCLUDES=no CFG_OPENVG_SHIVA=auto CFG_OPENVG_ON_OPENGL=auto CFG_EGL=auto -CFG_SSE=auto CFG_FONTCONFIG=auto CFG_FREETYPE=auto CFG_HARFBUZZ=no @@ -1157,13 +1156,6 @@ while [ "$#" -gt 0 ]; do libexecdir) QT_INSTALL_LIBEXECS="$VAL" ;; - sse) - if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then - CFG_SSE="$VAL" - else - UNKNOWN_OPT=yes - fi - ;; opengl) if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || -- cgit v1.2.3 From fed439c243fa2342d21100fbf3c9101dbe0d69a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hunold?= Date: Sat, 7 Dec 2013 14:37:10 +0100 Subject: Add mkspec for clang using libc++ on Linux. libc++ is an alternative stdlib implementation for clang. See http://libcxx.llvm.org/ for further details. The library is enabled by adding -stdlib=libc++ to the command line. Change-Id: I07d09cbb69b59b579d3754c99d717d2ac6d44d67 Reviewed-by: Olivier Goffart Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- mkspecs/linux-clang-libc++/qmake.conf | 10 +++++++ mkspecs/linux-clang-libc++/qplatformdefs.h | 42 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 mkspecs/linux-clang-libc++/qmake.conf create mode 100644 mkspecs/linux-clang-libc++/qplatformdefs.h diff --git a/mkspecs/linux-clang-libc++/qmake.conf b/mkspecs/linux-clang-libc++/qmake.conf new file mode 100644 index 0000000000..c5b0b57b78 --- /dev/null +++ b/mkspecs/linux-clang-libc++/qmake.conf @@ -0,0 +1,10 @@ +# +# qmake configuration for linux-clang and libc++ +# + +include(../linux-clang/qmake.conf) + +QMAKE_CXXFLAGS += -stdlib=libc++ +QMAKE_LFLAGS += -stdlib=libc++ + +load(qt_config) diff --git a/mkspecs/linux-clang-libc++/qplatformdefs.h b/mkspecs/linux-clang-libc++/qplatformdefs.h new file mode 100644 index 0000000000..471c98a6e4 --- /dev/null +++ b/mkspecs/linux-clang-libc++/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../linux-clang/qplatformdefs.h" -- cgit v1.2.3 From cb2549740e53e6aa04a3112febf95f99173198a0 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Wed, 26 Jun 2013 13:51:08 +0200 Subject: Styles: Fix upRule used instead of downRule Change-Id: Icd157fa522836fab9128322f98b2916cfff35c61 Reviewed-by: J-P Nurmi --- src/widgets/styles/qstylesheetstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index ab98dfbdcf..2f36e0e53c 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -5271,7 +5271,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp QRenderRule downRule = renderRule(w, opt, PseudoElement_SpinBoxDownButton); bool ruleMatch = rule.hasBox() || !rule.hasNativeBorder(); bool upRuleMatch = upRule.hasGeometry() || upRule.hasPosition(); - bool downRuleMatch = downRule.hasGeometry() || upRule.hasPosition(); + bool downRuleMatch = downRule.hasGeometry() || downRule.hasPosition(); if (ruleMatch || upRuleMatch || downRuleMatch) { switch (sc) { case SC_SpinBoxFrame: -- cgit v1.2.3 From 639b4e85ae72224133a978236331989796e7431c Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Mon, 9 Dec 2013 11:29:16 +0100 Subject: Disable the eglfs input handlers by Environment variable Added a Enironment variable to make it possible to disable the automatic installation of EVDEV input handlers. This is needed if you want to use your own generic plugin instead, which also uses evdev Change-Id: I17d47008c10999bf918db62a22a3b6a38d7abb80 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/eglfs/qeglfsintegration.cpp | 5 ++++- src/plugins/platforms/eglfs/qeglfsintegration.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 55a822b887..d6832493f1 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -87,6 +87,8 @@ QEglFSIntegration::QEglFSIntegration() , mScreen(0) , mInputContext(0) { + mDisableInputHandlers = qgetenv("QT_QPA_EGLFS_DISABLE_INPUT").toInt(); + initResources(); } @@ -176,7 +178,8 @@ void QEglFSIntegration::initialize() mInputContext = QPlatformInputContextFactory::create(); - createInputHandlers(); + if (!mDisableInputHandlers) + createInputHandlers(); } QEglFSScreen *QEglFSIntegration::createScreen() const diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index f685eec2d4..12c8158bd1 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -97,6 +97,7 @@ private: QScopedPointer mServices; QEglFSScreen *mScreen; QPlatformInputContext *mInputContext; + bool mDisableInputHandlers; }; QT_END_NAMESPACE -- cgit v1.2.3 From 1171175a567eb6ad515f98e0074dda12c9712264 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Dec 2013 11:19:16 +0100 Subject: Add QFileDialog::ShowDirsOnly to manual dialog test. Task-number: QTBUG-35396 Change-Id: I6ccb59d6bd3857aea66911e03200f28d093e57b4 Reviewed-by: J-P Nurmi --- tests/manual/dialogs/filedialogpanel.cpp | 5 +++++ tests/manual/dialogs/filedialogpanel.h | 1 + 2 files changed, 6 insertions(+) diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp index 2ae6241849..57624a0d37 100644 --- a/tests/manual/dialogs/filedialogpanel.cpp +++ b/tests/manual/dialogs/filedialogpanel.cpp @@ -124,6 +124,7 @@ private: FileDialogPanel::FileDialogPanel(QWidget *parent) : QWidget(parent) + , m_showDirsOnly(new QCheckBox(tr("Show dirs only"))) , m_readOnly(new QCheckBox(tr("Read only"))) , m_confirmOverWrite(new QCheckBox(tr("Confirm overwrite"))) , m_nameFilterDetailsVisible(new QCheckBox(tr("Name filter details visible"))) @@ -150,6 +151,7 @@ FileDialogPanel::FileDialogPanel(QWidget *parent) optionsLayout->addRow(tr("FileMode:"), m_fileMode); optionsLayout->addRow(tr("ViewMode:"), m_viewMode); optionsLayout->addRow(tr("Allowed Schemes:"), m_allowedSchemes); + optionsLayout->addRow(m_showDirsOnly); optionsLayout->addRow(m_native); optionsLayout->addRow(m_confirmOverWrite); optionsLayout->addRow(m_nameFilterDetailsVisible); @@ -293,6 +295,8 @@ QString FileDialogPanel::filterString() const QFileDialog::Options FileDialogPanel::options() const { QFileDialog::Options result; + if (m_showDirsOnly->isChecked()) + result |= QFileDialog::ShowDirsOnly; if (!m_nameFilterDetailsVisible->isChecked()) result |= QFileDialog::HideNameFilterDetails; if (!m_resolveSymLinks->isChecked()) @@ -439,6 +443,7 @@ void FileDialogPanel::restoreDefaults() setComboBoxValue(m_acceptMode, d.acceptMode()); setComboBoxValue(m_fileMode, d.fileMode()); setComboBoxValue(m_viewMode, d.viewMode()); + m_showDirsOnly->setChecked(d.testOption(QFileDialog::ShowDirsOnly)); m_allowedSchemes->setText(QString()); m_confirmOverWrite->setChecked(d.confirmOverwrite()); m_nameFilterDetailsVisible->setChecked(d.isNameFilterDetailsVisible()); diff --git a/tests/manual/dialogs/filedialogpanel.h b/tests/manual/dialogs/filedialogpanel.h index 1e86e0f18e..8a9d93da03 100644 --- a/tests/manual/dialogs/filedialogpanel.h +++ b/tests/manual/dialogs/filedialogpanel.h @@ -92,6 +92,7 @@ private: void applySettings(QFileDialog *d) const; QFormLayout *filesLayout; + QCheckBox *m_showDirsOnly; QCheckBox *m_readOnly; QCheckBox *m_confirmOverWrite; QCheckBox *m_nameFilterDetailsVisible; -- cgit v1.2.3 From 7eecbb07184bc8b2c5e7645af2805ba0a2488082 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 10 Dec 2013 09:21:43 +0100 Subject: SSL: blacklist ANSSI intermediate certificate ... because it was used to operate a man-in-the-middle proxy. Task-number: QTBUG-35474 Change-Id: Ic7f19708b278b866e4f06533cbd84e0ff43357e9 Reviewed-by: Richard J. Moore --- src/network/ssl/qsslcertificate.cpp | 2 ++ .../more-certificates/blacklisted-anssi-tresor.pem | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-anssi-tresor.pem diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 286a6fd668..b4c593fa73 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -1214,6 +1214,8 @@ static const char *certificate_blacklist[] = { "08:27", "*.EGO.GOV.TR", // Turktrust mis-issued intermediate certificate "08:64", "e-islem.kktcmerkezbankasi.org", // Turktrust mis-issued intermediate certificate + + "03:1d:a7", "AC DG Tr\xC3\xA9sor SSL", // intermediate certificate linking back to ANSSI French National Security Agency 0 }; diff --git a/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-anssi-tresor.pem b/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-anssi-tresor.pem new file mode 100644 index 0000000000..cf212f117e --- /dev/null +++ b/tests/auto/network/ssl/qsslcertificate/more-certificates/blacklisted-anssi-tresor.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDbDCCAlSgAwIBAgIDAx2nMA0GCSqGSIb3DQEBBQUAMEsxCzAJBgNVBAYTAkZS +MQ4wDAYDVQQKEwVER1RQRTEsMCoGA1UEAxMjQUMgREdUUEUgU2lnbmF0dXJlIEF1 +dGhlbnRpZmljYXRpb24wHhcNMTMwNzE4MTAwNTI4WhcNMTQwNzE4MTAwNTI4WjA+ +MQswCQYDVQQGEwJGUjETMBEGA1UECgwKREcgVHLDqXNvcjEaMBgGA1UEAwwRQUMg +REcgVHLDqXNvciBTU0wwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDI +0WFSUyY+MmtFkqFjTefoFyDgh9b1C/2YvSIvT8oCH62JWT5rpeTCZwaXbqWcjaNf +zggqaFsokqfhBif43HNHNtNJmvKE32VcuLB0SpsLR/1VeTd9F99C1JeHVa+nelum +OHEfouX8rRFrxNXNIYTVeiENT8Y2YqRb/XAril9g7i674uFzLiNR/t/N/F8Exujv +9U8m8rmgud/+tG9WDRaDJwoj3ZFCOnL5qLnSUEcS6TzWpozLmC2JVO5GZKGGd7qC +9FjdBkVilkbVIEGSrYvz2Uz2v5IGqMBIQaFL/kSYWxGTaedTOk2drFEApp9AEPTf +v1NwCWBfegsGQrHUROM3AgMBAAGjZjBkMBIGA1UdEwEB/wQIMAYBAf8CAQQwHQYD +VR0OBBYEFAAMW8lJqJW0DtAv5p3Mjogxvh9lMB8GA1UdIwQYMBaAFOnbkI/9W5nk +FTvwYlyn5A1Y6IeZMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEA +tDfGHkHOLW2d9fiMtwtkEwDauISJLJyCjoRmawzmQbIZXq7HaLliVfE0sdfKUm0i +Q0im1/CpnJLPoTeKyBHvNu1ubLc2m+9dabAYhF3pVdKC+gNaAzBXZ9Gt0p1CLk1l +f8Hg+R10HN2IPCv7V/crz2Ga+c234P3pfwYW8+Nd7alGCuvqot6UYXOlheF7zWUk +Hn6z6tvY+9oMDHKSUAthhA/FB50JgJU89zyTv1egY3ldKwvYBW3W3yNZdTHbPyNs +PJdhqA55mDNsteE5YTp1PyySDb1MSVrbxDEruoH6ZE99Hob4Ih8Amn7MHZatGClE +CgjXWFZ2Gxa7OUCaQpcH8g== +-----END CERTIFICATE----- -- cgit v1.2.3 From aa3eaf9d2ec4927df51e7d773a66f68ec5e4fce9 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 10 Dec 2013 11:15:34 +0100 Subject: QUdpSocket auto test: disable Socks5 over UDP for new test server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... because they fail on the new test server. This commit can be reverted once the Socks5 socket engine is fixed. Task-number: QTBUG-35490 Change-Id: I85635d4b44d26168d40a56b7a121693297564f0f Reviewed-by: Tony Sarajärvi Reviewed-by: Richard J. Moore --- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 8de66f0f2c..f08afaa9a5 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -144,11 +145,25 @@ tst_QUdpSocket::~tst_QUdpSocket() void tst_QUdpSocket::initTestCase_data() { + // hack: we only enable the Socks5 over UDP tests on the old + // test server, because they fail on the new one. See QTBUG-35490 + bool newTestServer = true; + QTcpSocket socket; + socket.connectToHost(QtNetworkSettings::serverName(), 22); + if (socket.waitForConnected(10000)) { + socket.waitForReadyRead(5000); + QByteArray ba = socket.readAll(); + if (ba.startsWith("SSH-2.0-OpenSSH_5.8p1")) + newTestServer = false; + socket.disconnectFromHost(); + } + QTest::addColumn("setProxy"); QTest::addColumn("proxyType"); QTest::newRow("WithoutProxy") << false << 0; - QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); + if (!newTestServer) + QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); #ifndef QT_NO_BEARERMANAGEMENT netConfMan = new QNetworkConfigurationManager(this); -- cgit v1.2.3 From a134b57152964e1279f62606cce0a7e7f521c32a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 3 Dec 2013 12:45:29 +0100 Subject: Windows: Show context menu on mouse release. Introduce a hint to QPlatformTheme to control the behavior. Task-number: QTBUG-35231 Change-Id: Ia28e153a8dd3f1931321a222d8906ca87166ed62 Reviewed-by: Shawn Rutledge Reviewed-by: Joerg Bornemann --- src/gui/kernel/qplatformtheme.cpp | 3 +++ src/gui/kernel/qplatformtheme.h | 3 ++- src/plugins/platforms/windows/qwindowstheme.cpp | 2 ++ src/widgets/kernel/qwidgetwindow.cpp | 8 ++++++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 1844232efe..3548ec0199 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -142,6 +142,8 @@ QT_BEGIN_NAMESPACE \value DialogSnapToDefaultButton (bool) Whether the mouse should snap to the default button when a dialog becomes visible. + \value ContextMenuOnMouseRelease (bool) Whether the context menu should be shown on mouse release. + \sa themeHint(), QStyle::pixelMetric() */ @@ -487,6 +489,7 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) case IconPixmapSizes: return QVariant::fromValue(QList()); case DialogSnapToDefaultButton: + case ContextMenuOnMouseRelease: return QVariant(false); } return QVariant(); diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 4bddac5b1b..5cdec48ca3 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -106,7 +106,8 @@ public: TabAllWidgets, IconPixmapSizes, PasswordMaskCharacter, - DialogSnapToDefaultButton + DialogSnapToDefaultButton, + ContextMenuOnMouseRelease }; enum DialogType { diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index eb1bbd1ab0..00a5da8f44 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -383,6 +383,8 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const } case DialogSnapToDefaultButton: return QVariant(booleanSystemParametersInfo(SPI_GETSNAPTODEFBUTTON, false)); + case ContextMenuOnMouseRelease: + return QVariant(true); default: break; } diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 2e96247873..167102c633 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -49,6 +49,7 @@ #endif #include #include +#include #include QT_BEGIN_NAMESPACE @@ -354,6 +355,9 @@ void QWidgetWindow::handleNonClientAreaMouseEvent(QMouseEvent *e) void QWidgetWindow::handleMouseEvent(QMouseEvent *event) { + static const QEvent::Type contextMenuTrigger = + QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::ContextMenuOnMouseRelease).toBool() ? + QEvent::MouseButtonRelease : QEvent::MouseButtonPress; if (qApp->d_func()->inPopupMode()) { QWidget *activePopupWidget = qApp->activePopupWidget(); QWidget *popup = activePopupWidget; @@ -438,7 +442,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) } qt_replay_popup_mouse_event = false; #ifndef QT_NO_CONTEXTMENU - } else if (event->type() == QEvent::MouseButtonPress + } else if (event->type() == contextMenuTrigger && event->button() == Qt::RightButton && (openPopupCount == oldOpenPopupCount)) { QWidget *popupEvent = popup; @@ -487,7 +491,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) qt_last_mouse_receiver); #ifndef QT_NO_CONTEXTMENU - if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::RightButton) { + if (event->type() == contextMenuTrigger && event->button() == Qt::RightButton) { QContextMenuEvent e(QContextMenuEvent::Mouse, mapped, event->globalPos(), event->modifiers()); QGuiApplication::sendSpontaneousEvent(receiver, &e); } -- cgit v1.2.3 From 7009843ae3b12fe86d21040ad96add335c7df5a5 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 9 Dec 2013 10:54:12 +0100 Subject: QProcess/Win: allow child processes to change modes of the stdin pipe To be able to call SetNamedPipeHandleState on stdin in a child process, we must create a read-end pipe handle with the FILE_WRITE_ATTRIBUTES flag set. This can't be done with CreateNamedPipe but only with CreateFile. Therefore we're creating the handles for the child process always with CreateFile now. Besides, it's conceptually cleaner to have the server handle of the named pipe in the calling process. [ChangeLog][QtCore][Windows] Fix regression from Qt4 in QProcess. It wasn't possible anymore to alter pipe modes of stdin in child processes. Task-number: QTBUG-35357 Change-Id: I85f09753d0c924bdc8a6cef1ea5dbe6b2299c604 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess_win.cpp | 70 +++++++++++++--------- tests/auto/corelib/io/qprocess/qprocess.pro | 6 +- .../qprocess/testSetNamedPipeHandleState/main.cpp | 50 ++++++++++++++++ .../testSetNamedPipeHandleState.pro | 4 ++ tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 12 ++++ 5 files changed, 113 insertions(+), 29 deletions(-) create mode 100644 tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/main.cpp create mode 100644 tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/testSetNamedPipeHandleState.pro diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index dba9f62b98..fc2adb783e 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -73,10 +73,11 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) // Anomymous pipes do not support asynchronous I/O. Thus we // create named pipes for redirecting stdout, stderr and stdin. + // The write handle must be non-inheritable for input pipes. + // The read handle must be non-inheritable for output pipes. SECURITY_ATTRIBUTES secAtt = { sizeof(SECURITY_ATTRIBUTES), 0, false }; - secAtt.bInheritHandle = isInputPipe; // The read handle must be non-inheritable for output pipes. - HANDLE hRead; + HANDLE hServer; wchar_t pipeName[256]; unsigned int attempts = 1000; forever { @@ -85,19 +86,29 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) _snwprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]), L"\\\\.\\pipe\\qt-%X", qrand()); + DWORD dwOpenMode = FILE_FLAG_OVERLAPPED; + DWORD dwOutputBufferSize = 0; + DWORD dwInputBufferSize = 0; + const DWORD dwPipeBufferSize = 1024 * 1024; + if (isInputPipe) { + dwOpenMode |= PIPE_ACCESS_OUTBOUND; + dwOutputBufferSize = dwPipeBufferSize; + } else { + dwOpenMode |= PIPE_ACCESS_INBOUND; + dwInputBufferSize = dwPipeBufferSize; + } DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT; if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) dwPipeFlags |= PIPE_REJECT_REMOTE_CLIENTS; - const DWORD dwPipeBufferSize = 1024 * 1024; - hRead = CreateNamedPipe(pipeName, - PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, - dwPipeFlags, - 1, // only one pipe instance - 0, // output buffer size - dwPipeBufferSize, // input buffer size - 0, - &secAtt); - if (hRead != INVALID_HANDLE_VALUE) + hServer = CreateNamedPipe(pipeName, + dwOpenMode, + dwPipeFlags, + 1, // only one pipe instance + dwOutputBufferSize, + dwInputBufferSize, + 0, + &secAtt); + if (hServer != INVALID_HANDLE_VALUE) break; DWORD dwError = GetLastError(); if (dwError != ERROR_PIPE_BUSY || !--attempts) { @@ -106,28 +117,31 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) } } - // The write handle must be non-inheritable for input pipes. - secAtt.bInheritHandle = !isInputPipe; - - HANDLE hWrite = INVALID_HANDLE_VALUE; - hWrite = CreateFile(pipeName, - GENERIC_WRITE, - 0, - &secAtt, - OPEN_EXISTING, - FILE_FLAG_OVERLAPPED, - NULL); - if (hWrite == INVALID_HANDLE_VALUE) { + secAtt.bInheritHandle = TRUE; + const HANDLE hClient = CreateFile(pipeName, + (isInputPipe ? (GENERIC_READ | FILE_WRITE_ATTRIBUTES) + : GENERIC_WRITE), + 0, + &secAtt, + OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, + NULL); + if (hClient == INVALID_HANDLE_VALUE) { qErrnoWarning("QProcess: CreateFile failed."); - CloseHandle(hRead); + CloseHandle(hServer); return; } // Wait until connection is in place. - ConnectNamedPipe(hRead, NULL); + ConnectNamedPipe(hServer, NULL); - pipe[0] = hRead; - pipe[1] = hWrite; + if (isInputPipe) { + pipe[0] = hClient; + pipe[1] = hServer; + } else { + pipe[0] = hServer; + pipe[1] = hClient; + } } static void duplicateStdWriteChannel(Q_PIPE *pipe, DWORD nStdHandle) diff --git a/tests/auto/corelib/io/qprocess/qprocess.pro b/tests/auto/corelib/io/qprocess/qprocess.pro index 4155e3f73d..6ba54b1e92 100644 --- a/tests/auto/corelib/io/qprocess/qprocess.pro +++ b/tests/auto/corelib/io/qprocess/qprocess.pro @@ -8,7 +8,11 @@ SUBDIRS += testProcessSpacesArgs/nospace.pro \ testProcessSpacesArgs/twospaces.pro \ testSpaceInName -win32:!wince*:SUBDIRS+=testProcessEchoGui +win32:!wince* { + SUBDIRS += \ + testProcessEchoGui \ + testSetNamedPipeHandleState +} test.depends += $$SUBDIRS SUBDIRS += test diff --git a/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/main.cpp b/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/main.cpp new file mode 100644 index 0000000000..b2cc793b51 --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/main.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main() +{ + DWORD mode = PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT; + if (SetNamedPipeHandleState(GetStdHandle(STD_INPUT_HANDLE), &mode, NULL, NULL)) + return 0; + return GetLastError(); +} diff --git a/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/testSetNamedPipeHandleState.pro b/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/testSetNamedPipeHandleState.pro new file mode 100644 index 0000000000..e236e05c7d --- /dev/null +++ b/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/testSetNamedPipeHandleState.pro @@ -0,0 +1,4 @@ +SOURCES = main.cpp +CONFIG -= qt app_bundle +CONFIG += console +DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index d141c11a90..37f224ff28 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -93,6 +93,7 @@ private slots: void echoTest2(); #ifdef Q_OS_WIN void echoTestGui(); + void testSetNamedPipeHandleState(); void batFiles_data(); void batFiles(); #endif @@ -555,6 +556,17 @@ void tst_QProcess::echoTestGui() QCOMPARE(process.readAllStandardOutput(), QByteArray("Hello")); QCOMPARE(process.readAllStandardError(), QByteArray("Hello")); } + +void tst_QProcess::testSetNamedPipeHandleState() +{ + QProcess process; + process.setProcessChannelMode(QProcess::SeparateChannels); + process.start("testSetNamedPipeHandleState/testSetNamedPipeHandleState"); + QVERIFY2(process.waitForStarted(5000), qPrintable(process.errorString())); + QVERIFY(process.waitForFinished(5000)); + QCOMPARE(process.exitCode(), 0); + QCOMPARE(process.exitStatus(), QProcess::NormalExit); +} #endif // !Q_OS_WINCE && Q_OS_WIN //----------------------------------------------------------------------------- -- cgit v1.2.3 From 2f284d3632cb786446b0b95bf30afdaaf2c1a7ff Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 5 Dec 2013 02:43:53 +0100 Subject: Move notification of layout change up from QApplication to QGuiApplication. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QGuiApplication-using things (like QtQuick) need to know about this, too -- this makes QGuiApplication::setLayoutDirection actually work. Task-number: QTBUG-21573 Change-Id: I2d2ac7dc07f11be5c7e501a3575b1d0978d8ac31 Reviewed-by: Friedemann Kleint Reviewed-by: Jan Arve Sæther --- src/gui/kernel/qguiapplication.cpp | 5 +++++ src/widgets/kernel/qapplication.cpp | 10 ---------- src/widgets/kernel/qapplication_p.h | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index bc4a135e03..1db252ca61 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2548,6 +2548,11 @@ void QGuiApplication::setFont(const QFont &font) void QGuiApplicationPrivate::notifyLayoutDirectionChange() { + const QWindowList list = QGuiApplication::topLevelWindows(); + for (int i = 0; i < list.size(); ++i) { + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(list.at(i), &ev); + } } void QGuiApplicationPrivate::notifyActiveWindowChange(QWindow *) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 9056ffe461..d8c37d6ca0 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1888,16 +1888,6 @@ bool QApplication::event(QEvent *e) \obsolete */ -void QApplicationPrivate::notifyLayoutDirectionChange() -{ - QWidgetList list = QApplication::topLevelWidgets(); - for (int i = 0; i < list.size(); ++i) { - QWidget *w = list.at(i); - QEvent ev(QEvent::ApplicationLayoutDirectionChange); - QCoreApplication::sendEvent(w, &ev); - } -} - /*! \fn void QApplication::setActiveWindow(QWidget* active) diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 29c6902c78..860e89bb4f 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -116,7 +116,6 @@ public: QApplicationPrivate(int &argc, char **argv, int flags); ~QApplicationPrivate(); - virtual void notifyLayoutDirectionChange(); virtual void notifyActiveWindowChange(QWindow *); virtual bool shouldQuit(); -- cgit v1.2.3 From 7fef5fe2932401294dea8edac7a64f4e5864c98f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 10 Dec 2013 18:30:08 +0100 Subject: Stabilize tst_qabstractitemview Attempt to fix FAIL! : tst_QAbstractItemView::task200665_itemEntered() Compared values are not the same Actual (spy.count()): 0 Expected (1) : 1 Loc: [tst_qabstractitemview.cpp(1292)] which might have been introduced by removing the absolute qWait(200) in favor of qWaitForWindowExposed() in afe8e368, so trying to compensate with a QTRY_COMPARE. Change-Id: Id437acd810b54e005daaf66ffffd4dd586075ab6 Reviewed-by: Friedemann Kleint --- .../auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 36bf76564f..97ea7d7d32 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -1289,7 +1289,7 @@ void tst_QAbstractItemView::task200665_itemEntered() QSignalSpy spy(&view, SIGNAL(entered(QModelIndex))); view.verticalScrollBar()->setValue(view.verticalScrollBar()->maximum()); - QCOMPARE(spy.count(), 1); + QTRY_COMPARE(spy.count(), 1); } void tst_QAbstractItemView::task257481_emptyEditor() -- cgit v1.2.3 From 37f99502f9006c5681686e4a43bc80c2b1d0b089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 9 Dec 2013 15:09:29 +0100 Subject: iOS: Fix failing assert in QUIView displayLayer() In layoutSubviews we take the root viewcontroller position into account when determening the new QWindow geometry, but we were missing this logic in displayLayer, and would assert if the in-call statusbar was visible. Since we don't really need the position of the window in displayLayer, we change the assert to only check the size of the exposed area, which is independent of the position of the root viewcontroller. Change-Id: I774b8d9b075518e729f488a789b3a9e584c3f4d3 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qioswindow.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 1acd9ee354..7a0ff055ec 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -204,11 +204,12 @@ - (void)displayLayer:(CALayer *)layer { - QRect geometry = fromCGRect(layer.frame).toRect(); - Q_ASSERT(m_qioswindow->geometry() == geometry); + QSize bounds = fromCGRect(layer.bounds).toRect().size(); + + Q_ASSERT(m_qioswindow->geometry().size() == bounds); Q_ASSERT(self.hidden == !m_qioswindow->window()->isVisible()); - QRegion region = self.hidden ? QRegion() : QRect(QPoint(), geometry.size()); + QRegion region = self.hidden ? QRegion() : QRect(QPoint(), bounds); QWindowSystemInterface::handleExposeEvent(m_qioswindow->window(), region); QWindowSystemInterface::flushWindowSystemEvents(); } -- cgit v1.2.3 From 4d8a12904a49d6724098610f7e39b11821377b3a Mon Sep 17 00:00:00 2001 From: ABBAPOH Date: Sat, 30 Nov 2013 21:06:57 +0400 Subject: Check if device is opened before trying to create image handler. Change-Id: I60f1f6890fdd73e489da4aab9928370163f55f58 Reviewed-by: Friedemann Kleint Reviewed-by: aavit --- src/gui/image/qimagewriter.cpp | 49 +++++++++++++++------- .../gui/image/qimagewriter/tst_qimagewriter.cpp | 24 +++++++++++ 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index 900093b51b..8dd5fdd111 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -245,6 +245,8 @@ class QImageWriterPrivate public: QImageWriterPrivate(QImageWriter *qq); + bool canWriteHelper(); + // device QByteArray format; QIODevice *device; @@ -282,6 +284,31 @@ QImageWriterPrivate::QImageWriterPrivate(QImageWriter *qq) q = qq; } +bool QImageWriterPrivate::canWriteHelper() +{ + if (!device) { + imageWriterError = QImageWriter::DeviceError; + errorString = QT_TRANSLATE_NOOP(QImageWriter, + QLatin1String("Device is not set")); + return false; + } + if (!device->isOpen()) + device->open(QIODevice::WriteOnly); + if (!device->isWritable()) { + imageWriterError = QImageWriter::DeviceError; + errorString = QT_TRANSLATE_NOOP(QImageWriter, + QLatin1String("Device not writable")); + return false; + } + if (!handler && (handler = createWriteHandlerHelper(device, format)) == 0) { + imageWriterError = QImageWriter::UnsupportedFormatError; + errorString = QT_TRANSLATE_NOOP(QImageWriter, + QLatin1String("Unsupported image format")); + return false; + } + return true; +} + /*! Constructs an empty QImageWriter object. Before writing, you must call setFormat() to set an image format, then setDevice() or @@ -561,21 +588,15 @@ void QImageWriter::setText(const QString &key, const QString &text) */ bool QImageWriter::canWrite() const { - if (d->device && !d->handler && (d->handler = createWriteHandlerHelper(d->device, d->format)) == 0) { - d->imageWriterError = QImageWriter::UnsupportedFormatError; - d->errorString = QT_TRANSLATE_NOOP(QImageWriter, - QLatin1String("Unsupported image format")); - return false; + if (QFile *file = qobject_cast(d->device)) { + const bool remove = !file->isOpen() && !file->exists(); + const bool result = d->canWriteHelper(); + if (!result && remove) + file->remove(); + return result; } - if (d->device && !d->device->isOpen()) - d->device->open(QIODevice::WriteOnly); - if (!d->device || !d->device->isWritable()) { - d->imageWriterError = QImageWriter::DeviceError; - d->errorString = QT_TRANSLATE_NOOP(QImageWriter, - QLatin1String("Device not writable")); - return false; - } - return true; + + return d->canWriteHelper(); } /*! diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp index f1d0e227f6..b10b5704c3 100644 --- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #ifdef Q_OS_UNIX // for geteuid() # include @@ -84,6 +85,7 @@ private slots: void supportedMimeTypes(); void writeToInvalidDevice(); + void testCanWrite(); void supportsOption_data(); void supportsOption(); @@ -402,6 +404,28 @@ void tst_QImageWriter::writeToInvalidDevice() } } +void tst_QImageWriter::testCanWrite() +{ + { + // device is not set + QImageWriter writer; + QVERIFY(!writer.canWrite()); + QCOMPARE(writer.error(), QImageWriter::DeviceError); + } + + { + // check if canWrite won't leave an empty file + QTemporaryDir dir; + QVERIFY(dir.isValid()); + QString fileName(dir.path() + QLatin1String("/001.garble")); + QVERIFY(!QFileInfo(fileName).exists()); + QImageWriter writer(fileName); + QVERIFY(!writer.canWrite()); + QCOMPARE(writer.error(), QImageWriter::UnsupportedFormatError); + QVERIFY(!QFileInfo(fileName).exists()); + } +} + void tst_QImageWriter::supportsOption_data() { QTest::addColumn("fileName"); -- cgit v1.2.3 From 70c70aef7ee35009bb00614fdd6d4d282f9c4e57 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 11 Dec 2013 13:14:18 +0100 Subject: Make QTemporaryDir file name more random qrand() returns a number between 0 and RAND_MAX, which is only guaranteed to be bigger than 32767. Dividing it repeatedly means that the last bytes are always 0. [ChangeLog][QtCore][QTemporaryDir] Fixed bug in QTemporaryDir name generator that dramatically reduced randomness of the name. Change-Id: I90613a652e6384296aed827e2714fe63cd8797ee Reviewed-by: Rafael Roquetto Reviewed-by: Tim Jenssen --- src/corelib/io/qtemporarydir.cpp | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index 483a76fa82..2c526847b4 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -94,9 +94,19 @@ static QString defaultTemplateName() return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String("-XXXXXX"); } +#if defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID) + +static int nextRand(int &v) +{ + int r = v % 62; + v /= 62; + if (v < 62) + v = qrand(); + return r; +} + static char *q_mkdtemp(char *templateName) { -#if defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID) static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; const size_t length = strlen(templateName); @@ -110,16 +120,11 @@ static char *q_mkdtemp(char *templateName) int v = qrand(); /* Fill in the random bits. */ - XXXXXX[0] = letters[v % 62]; - v /= 62; - XXXXXX[1] = letters[v % 62]; - v /= 62; - XXXXXX[2] = letters[v % 62]; - v /= 62; - XXXXXX[3] = letters[v % 62]; - v /= 62; - XXXXXX[4] = letters[v % 62]; - v /= 62; + XXXXXX[0] = letters[nextRand(v)]; + XXXXXX[1] = letters[nextRand(v)]; + XXXXXX[2] = letters[nextRand(v)]; + XXXXXX[3] = letters[nextRand(v)]; + XXXXXX[4] = letters[nextRand(v)]; XXXXXX[5] = letters[v % 62]; QString templateNameStr = QFile::decodeName(templateName); @@ -137,11 +142,17 @@ static char *q_mkdtemp(char *templateName) } } return 0; -#else - return mkdtemp(templateName); -#endif } +#else // defined(Q_OS_QNX ) || defined(Q_OS_WIN) || defined(Q_OS_ANDROID) + +static char *q_mkdtemp(char *templateName) +{ + return mkdtemp(templateName); +} + +#endif + void QTemporaryDirPrivate::create(const QString &templateName) { QByteArray buffer = QFile::encodeName(templateName); -- cgit v1.2.3 From 444914839541154b0927cd1d49890677b8368148 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 12 Dec 2013 17:30:44 +0100 Subject: QMetaType: Rename template type of type-erased iterator operations. This struct is a specialization for the case that the const_iterator is a pointer to the value type. Reflect that in the type name. Change-Id: I0a4ac03840658056285080860baec8313746c71c Reviewed-by: Simon Hausmann --- src/corelib/kernel/qmetatype.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index a2e6960949..06adf7cffd 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -805,17 +805,17 @@ struct IteratorOwner return &*it; } }; -template -struct IteratorOwner +template +struct IteratorOwner { - static void assign(void **ptr, const const_iterator *iterator ) + static void assign(void **ptr, const value_type *iterator ) { - *ptr = const_cast(iterator); + *ptr = const_cast(iterator); } static void advance(void **iterator, int step) { - const_iterator *it = static_cast(*iterator); + value_type *it = static_cast(*iterator); std::advance(it, step); *iterator = it; } @@ -829,7 +829,7 @@ struct IteratorOwner return *iterator; } - static const void *getData(const const_iterator *it) + static const void *getData(const value_type *it) { return it; } -- cgit v1.2.3 From 0da7e0fa8fa0f4e216899e24b3cedf1e09759628 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 12 Dec 2013 17:33:09 +0100 Subject: QMetaType: Fix copy of type erased iterator Behavior differs depending on whether the iterator is a value_type*, or a different class entirely. Ensure that the correct behavior is used when copying. Task-number: QTBUG-33997 Change-Id: Ib6db2a3c4a5aa861b851833a7f0ecb855a3e828f Reviewed-by: Simon Hausmann --- src/corelib/kernel/qmetatype.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 06adf7cffd..986d22b5a6 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -783,6 +783,10 @@ struct IteratorOwner { *ptr = new const_iterator(iterator); } + static void assign(void **ptr, void * const * src) + { + *ptr = new const_iterator(*static_cast(*src)); + } static void advance(void **iterator, int step) { @@ -812,6 +816,10 @@ struct IteratorOwner { *ptr = const_cast(iterator); } + static void assign(void **ptr, void * const * src) + { + *ptr = static_cast(*src); + } static void advance(void **iterator, int step) { @@ -942,7 +950,7 @@ public: template static void copyIterImpl(void **dest, void * const * src) - { IteratorOwner::assign(dest, *static_cast(*src)); } + { IteratorOwner::assign(dest, src); } public: template QSequentialIterableImpl(const T*p) @@ -1122,7 +1130,7 @@ public: template static void copyIterImpl(void **dest, void * const * src) - { IteratorOwner::assign(dest, *static_cast(*src)); } + { IteratorOwner::assign(dest, src); } public: template QAssociativeIterableImpl(const T*p) -- cgit v1.2.3 From b7cb0613f0dc92a5abfd7eedc44ba9f0ee310cae Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 12 Dec 2013 17:45:34 +0100 Subject: QMetaType: Fix equality comparison of type-erased iterators. Task-number: QTBUG-33997 Change-Id: I0d4da562540df0e3732769881ba124cb980f6b82 Reviewed-by: Simon Hausmann --- src/corelib/kernel/qmetatype.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 986d22b5a6..745487627e 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -808,6 +808,11 @@ struct IteratorOwner { return &*it; } + + static bool equal(void * const *it, void * const *other) + { + return *static_cast(*it) == *static_cast(*other); + } }; template struct IteratorOwner @@ -841,6 +846,11 @@ struct IteratorOwner { return it; } + + static bool equal(void * const *it, void * const *other) + { + return static_cast(*it) == static_cast(*other); + } }; enum IteratorCapability @@ -942,7 +952,7 @@ public: template static bool equalIterImpl(void * const *iterator, void * const *other) - { return *static_cast(*iterator) == *static_cast(*other); } + { return IteratorOwner::equal(iterator, other); } template static VariantData getImpl(void * const *iterator, int metaTypeId, uint flags) @@ -1126,7 +1136,7 @@ public: template static bool equalIterImpl(void * const *iterator, void * const *other) - { return *static_cast(*iterator) == *static_cast(*other); } + { return IteratorOwner::equal(iterator, other); } template static void copyIterImpl(void **dest, void * const * src) -- cgit v1.2.3 From 9b621f38619d8d9b3e61723f4cd4e821f909697a Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Fri, 13 Dec 2013 12:36:45 +0100 Subject: Partially revert "Move notification of layout change up from QApplication to QGuiApplication." We can't rely on QGuiApplication::topLevelWindows containing top level QWidgets, because they only exist as actual windows once QWidgetPrivate::create_sys is called. Thus, make sure to send notifications to all top level widgets, if a QApplication is being used. This reverts commit f82ed5b3e30282bb8dc1da321a0d04ad4d463e59. Task-number: QTBUG-35589 Change-Id: Iac517089af1c22f20094ba6e185d5ed44ebe3d6f Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qapplication.cpp | 25 +++++++++++++++++++++++++ src/widgets/kernel/qapplication_p.h | 1 + 2 files changed, 26 insertions(+) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index d8c37d6ca0..c9d6593662 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1888,6 +1888,31 @@ bool QApplication::event(QEvent *e) \obsolete */ +// ### FIXME: topLevelWindows does not contain QWidgets without a parent +// until create_sys is called. So we have to override the +// QGuiApplication::notifyLayoutDirectionChange +// to do the right thing. +void QApplicationPrivate::notifyLayoutDirectionChange() +{ + const QWidgetList list = QApplication::topLevelWidgets(); + QWindowList windowList = QGuiApplication::topLevelWindows(); + + // send to all top-level QWidgets + for (int i = 0; i < list.size(); ++i) { + QWidget *w = list.at(i); + windowList.removeAll(w->windowHandle()); + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(w, &ev); + } + + // in case there are any plain QWindows in this QApplication-using + // application, also send the notification to them + for (int i = 0; i < windowList.size(); ++i) { + QEvent ev(QEvent::ApplicationLayoutDirectionChange); + QCoreApplication::sendEvent(windowList.at(i), &ev); + } +} + /*! \fn void QApplication::setActiveWindow(QWidget* active) diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 860e89bb4f..29c6902c78 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -116,6 +116,7 @@ public: QApplicationPrivate(int &argc, char **argv, int flags); ~QApplicationPrivate(); + virtual void notifyLayoutDirectionChange(); virtual void notifyActiveWindowChange(QWindow *); virtual bool shouldQuit(); -- cgit v1.2.3 From fc10bfd55035d27c9352c1678c3aad87c4be2e09 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 27 Nov 2013 16:10:20 +0100 Subject: Correct debug bit setting with WGL No need to tie the debug bit to OpenGL 3.0+. xcb is correct in this respect, let's correct the windows plugin too. Change-Id: I13ea48de067d3fb61575be8f71b97bb547d8eb02 Reviewed-by: Friedemann Kleint Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowsglcontext.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp index b7de368fa8..82deb0f473 100644 --- a/src/plugins/platforms/windows/qwindowsglcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp @@ -586,15 +586,17 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext, attributes[attribIndex++] = WGL_CONTEXT_MINOR_VERSION_ARB; attributes[attribIndex++] = minorVersion; } + + int flags = 0; + if (format.testOption(QSurfaceFormat::DebugContext)) + flags |= WGL_CONTEXT_DEBUG_BIT_ARB; if (requestedVersion >= 0x0300) { - attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; - attributes[attribIndex] = 0; if (!format.testOption(QSurfaceFormat::DeprecatedFunctions)) - attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - if (format.testOption(QSurfaceFormat::DebugContext)) - attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB; - attribIndex++; + flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; } + attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; + attributes[attribIndex++] = flags; + if (requestedVersion >= 0x0302) { switch (format.profile()) { case QSurfaceFormat::NoProfile: -- cgit v1.2.3 From a935b3fbd8297e6e2ae6ffdf8ed2790fdf0d46f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Dec 2013 17:42:22 +0100 Subject: Windows: Fix printing. Clear custom paper size flag in QWin32PrintEnginePrivate::updateCustomPaperSize(). Breakage introduced by 3396ba5612c1047d1b21a90c4996dff848c00114 . Task-number: QTBUG-35500 Change-Id: I7e7708444cd7201af35e0f5d9b16d6c73fee77f6 Reviewed-by: John Layt --- src/printsupport/kernel/qprintengine_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index 67e7c34fca..fc462e9a0a 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -1959,8 +1959,9 @@ static void draw_text_item_win(const QPointF &pos, const QTextItemInt &ti, HDC h void QWin32PrintEnginePrivate::updateCustomPaperSize() { const uint paperSize = devMode->dmPaperSize; - has_custom_paper_size = true; + has_custom_paper_size = false; if (paperSize > 0 && mapDevmodePaperSize(paperSize) == QPrinter::Custom) { + has_custom_paper_size = true; const QList > paperSizes = printerPaperSizes(name); for (int i=0; i Date: Mon, 16 Dec 2013 12:17:33 +0800 Subject: Fix QBackingStore object leaking Check q->isTopLevel() before calling setBackingStore() in QWidgetPrivate::create_sys() to prevent QBackingStore leaking. This is because QWidget::setBackingStore() will return if isTopLevel() is true and the newly created QBackingStore object will be leaked. Change-Id: I2777acd4c317d5019f5b266feae005042026b8be Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qwidget_qpa.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 93234f3958..3b6127e4e7 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -148,10 +148,12 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO QBackingStore *store = q->backingStore(); if (!store) { - if (win && q->windowType() != Qt::Desktop) - q->setBackingStore(new QBackingStore(win)); - else + if (win && q->windowType() != Qt::Desktop) { + if (q->isTopLevel()) + q->setBackingStore(new QBackingStore(win)); + } else { q->setAttribute(Qt::WA_PaintOnScreen, true); + } } setWindowModified_helper(); -- cgit v1.2.3