summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf3
-rw-r--r--mkspecs/common/qcc-base-qnx.conf3
-rw-r--r--mkspecs/features/ctest_testcase.prf8
-rw-r--r--mkspecs/features/moc.prf14
-rw-r--r--mkspecs/features/qt_docs.prf8
-rw-r--r--mkspecs/features/qt_module.prf3
-rw-r--r--qmake/generators/metamakefile.cpp16
-rw-r--r--qmake/generators/metamakefile.h2
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
-rw-r--r--qmake/main.cpp2
-rw-r--r--src/corelib/Qt5CTestMacros.cmake11
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in5
-rw-r--r--src/corelib/global/qtypetraits.h4
-rw-r--r--src/corelib/io/qprocess_win.cpp6
-rw-r--r--src/corelib/io/qwindowspipereader.cpp12
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp5
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/plugin/qplugin.qdoc2
-rw-r--r--src/corelib/tools/qlist.cpp3
-rw-r--r--src/corelib/tools/qlocale.cpp4
-rw-r--r--src/corelib/tools/qstring.cpp32
-rw-r--r--src/corelib/tools/qstringlist.cpp3
-rw-r--r--src/corelib/tools/qvector.cpp3
-rw-r--r--src/gui/QtGui.dynlist5
-rw-r--r--src/gui/gui.pro1
-rw-r--r--src/gui/image/qicon.cpp1
-rw-r--r--src/gui/image/qpixmap_raster.cpp5
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qwindow.cpp5
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp28
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp26
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h1
-rw-r--r--src/gui/painting/qrasterizer.cpp2
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp16
-rw-r--r--src/gui/text/qfontengine_ft.cpp26
-rw-r--r--src/network/kernel/qnetworkproxy.cpp2
-rw-r--r--src/opengl/qgl.cpp8
-rw-r--r--src/platformsupport/eglconvenience/eglconvenience.pri1
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp8
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp7
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch.cpp8
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch_p.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuloader.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuloader.mm10
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm35
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h4
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm32
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp11
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp2
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp38
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp3
-rw-r--r--src/tools/qdoc/codemarker.cpp5
-rw-r--r--src/tools/qdoc/main.cpp4
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp25
-rw-r--r--src/widgets/QtGui.dynlist8
-rw-r--r--src/widgets/QtWidgets.dynlist5
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp2
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp3
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp3
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm35
-rw-r--r--src/widgets/widgets.pro2
-rw-r--r--tests/auto/cmake/CMakeLists.txt37
-rw-r--r--tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt6
-rw-r--r--tests/auto/cmake/test_concurrent_module/CMakeLists.txt2
-rw-r--r--tests/auto/cmake/test_dbus_module/CMakeLists.txt10
-rw-r--r--tests/auto/cmake/test_testlib_definitions/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/test_use_modules_function/CMakeLists.txt2
-rw-r--r--tests/auto/cmake/test_use_modules_function/three.cpp4
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp10
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp5
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp38
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp9
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp15
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp50
-rw-r--r--tests/auto/tools/moc/parse-defines.h11
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp2
-rw-r--r--tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp4
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp14
-rw-r--r--tests/auto/widgets/util/qscroller/tst_qscroller.cpp6
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp2
87 files changed, 583 insertions, 213 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 5de255cb69..17dbc553bb 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,2 +1,5 @@
load(qt_build_config)
CONFIG += qt_example_installs
+
+# In qtbase, all modules follow qglobal.h
+MODULE_VERSION = $$QT_VERSION
diff --git a/mkspecs/common/qcc-base-qnx.conf b/mkspecs/common/qcc-base-qnx.conf
index b1bae7122d..88b82ccd71 100644
--- a/mkspecs/common/qcc-base-qnx.conf
+++ b/mkspecs/common/qcc-base-qnx.conf
@@ -37,9 +37,8 @@ QMAKE_LIBS_EGL = -lEGL
# against the NDK's target directory which is referenced by the QNX_TARGET environment
# variable, and which is guaranteed by the NDK to be set.
QNX_DIR = $$(QNX_TARGET)
-
isEmpty(QNX_DIR) {
- error(QNX_TARGET environment variable not set)
+ error("QNX_TARGET environment variable not set")
}
QMAKE_INCDIR = $${QNX_DIR}/usr/include $${QNX_DIR}/usr/include/freetype2
diff --git a/mkspecs/features/ctest_testcase.prf b/mkspecs/features/ctest_testcase.prf
index 7e841de790..58c683ff05 100644
--- a/mkspecs/features/ctest_testcase.prf
+++ b/mkspecs/features/ctest_testcase.prf
@@ -42,6 +42,10 @@ isEmpty(CMAKE_VERSION) {
for(d, $$list($$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR))) {
CMAKE_PREFIX_PATH *= $$dirname(d)
}
+ CMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\"
+
+ !qtHaveModule(widgets): CMAKE_MODULE_DEFINES += -DNO_WIDGETS=True
+ !qtHaveModule(dbus): CMAKE_MODULE_DEFINES += -DNO_DBUS=True
dependentmodules = $$resolve_depends(CMAKE_QT_MODULES_UNDER_TEST, "QT.")
dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST
@@ -49,7 +53,7 @@ isEmpty(CMAKE_VERSION) {
check.commands = \
$(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \
- cmake $$_PRO_FILE_PWD_ $$CMAKE_GENERATOR -DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} -DCMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\" -DQt5_MODULE_TEST_DEPENDS=\"$${dependentmodules}\" && \
+ cmake $$_PRO_FILE_PWD_ $$CMAKE_GENERATOR $$CMAKE_MODULE_DEFINES -DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} -DCMAKE_PREFIX_PATH=$$CMAKE_PREFIX_PATH -DQt5_MODULE_TEST_DEPENDS=\"$${dependentmodules}\" && \
$(TESTRUNNER) ctest --output-on-failure
}
@@ -60,6 +64,4 @@ insignificant_test:!isEmpty(check.commands) {
check.commands = -$${check.commands}
}
-!qtHaveModule(widgets): CONFIG += insignificant_test # QTBUG-28540
-
QMAKE_EXTRA_TARGETS *= check
diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf
index 8bd512844d..3b0e511edb 100644
--- a/mkspecs/features/moc.prf
+++ b/mkspecs/features/moc.prf
@@ -9,7 +9,7 @@ isEmpty(QMAKE_EXT_CPP_MOC):QMAKE_EXT_CPP_MOC = .moc
# has too many includes. We do this to overcome a command-line limit on Win < XP
INCLUDETEMP=
WIN_INCLUDETEMP=
-win32:count($$list($$INCLUDEPATH), 40, >) {
+win32:count(INCLUDEPATH, 40, >) {
INCLUDETEMP = $$MOC_DIR/mocinclude.tmp
WIN_INCLUDETEMP=$$INCLUDETEMP
@@ -23,7 +23,7 @@ win32:count($$list($$INCLUDEPATH), 40, >) {
unset(INCFILELIST)
RET =
- for(incfile, $$list($$INCLUDEPATH)) {
+ for(incfile, INCLUDEPATH) {
INCFILELIST = -I$$incfile
isEmpty(RET): RET += @echo $$INCFILELIST> $$WIN_INCLUDETEMP $$EOC
else: RET += @echo $$INCFILELIST>> $$WIN_INCLUDETEMP $$EOC
@@ -38,15 +38,17 @@ win32:count($$list($$INCLUDEPATH), 40, >) {
}
defineReplace(mocCmdBase) {
+ RET =
!isEmpty(WIN_INCLUDETEMP) {
- RET =
contains(TEMPLATE, "vc.*") {
RET += $$mocinclude.commands
}
- RET += $$QMAKE_MOC $(DEFINES) @$$WIN_INCLUDETEMP $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$QMAKE_MOC_OPTIONS
- return($$RET)
+ incvar = @$$WIN_INCLUDETEMP
+ } else {
+ incvar = $(INCPATH)
}
- return($$QMAKE_MOC $(DEFINES) $(INCPATH) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$QMAKE_MOC_OPTIONS)
+ RET += $$QMAKE_MOC $(DEFINES) $$join(QMAKE_COMPILER_DEFINES, " -D", -D) $$incvar $$join(QMAKE_DEFAULT_INCDIRS, " -I", -I) $$QMAKE_MOC_OPTIONS
+ return($$RET)
}
#moc headers
diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
index 31f7b65c38..c80efb03e0 100644
--- a/mkspecs/features/qt_docs.prf
+++ b/mkspecs/features/qt_docs.prf
@@ -25,11 +25,13 @@ QDOC += -outputdir $$QMAKE_DOCS_OUTPUTDIR
!build_online_docs: \
QDOC += -installdir $$[QT_INSTALL_DOCS]
qtver.name = QT_VERSION
-qtver.value = $$QT_VERSION
+qtver.value = $$VERSION
+isEmpty(qtver.value): qtver.value = $$MODULE_VERSION
+isEmpty(qtver.value): error("No version for documentation specified.")
qtmver.name = QT_VER
-qtmver.value = $${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}
+qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1)
qtvertag.name = QT_VERSION_TAG
-qtvertag.value = $$replace(QT_VERSION, \.,)
+qtvertag.value = $$replace(qtver.value, \.,)
qtAddToolEnv(QDOC, qtver qtmver qtvertag)
doc_command = $$QDOC $$QMAKE_DOCS
prepare_docs {
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index ff74901a4a..ba109864f6 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -20,7 +20,8 @@
load(qt_build_config) # loads qmodule.pri if hasn't been loaded already
isEmpty(MODULE):MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
-isEmpty(VERSION):VERSION = $$QT_VERSION
+isEmpty(VERSION): VERSION = $$MODULE_VERSION
+isEmpty(VERSION): error("Module does not define version.")
# Compile as shared/DLL or static according to the option given to configure
# unless overridden. Host builds are always static
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 8c10d7d306..e3fa39c7e4 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -79,7 +79,7 @@ public:
virtual bool init();
virtual int type() const { return BUILDSMETATYPE; }
- virtual bool write(const QString &);
+ virtual bool write();
};
void
@@ -149,7 +149,7 @@ BuildsMetaMakefileGenerator::init()
}
bool
-BuildsMetaMakefileGenerator::write(const QString &oldpwd)
+BuildsMetaMakefileGenerator::write()
{
Build *glue = 0;
if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()) {
@@ -181,7 +181,6 @@ BuildsMetaMakefileGenerator::write(const QString &oldpwd)
if(Option::output.fileName().isEmpty() &&
Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE)
Option::output.setFileName(project->first("QMAKE_MAKEFILE").toQString());
- Option::output_dir = oldpwd;
QString build_name = build->name;
if(!build->build.isEmpty()) {
if(!build_name.isEmpty())
@@ -268,7 +267,7 @@ public:
virtual bool init();
virtual int type() const { return SUBDIRSMETATYPE; }
- virtual bool write(const QString &);
+ virtual bool write();
};
bool
@@ -349,7 +348,7 @@ SubdirsMetaMakefileGenerator::init()
} else {
const QString output_name = Option::output.fileName();
Option::output.setFileName(sub->output_file);
- hasError |= !sub->makefile->write(sub->output_dir);
+ hasError |= !sub->makefile->write();
delete sub;
qmakeClearCaches();
sub = 0;
@@ -378,7 +377,7 @@ SubdirsMetaMakefileGenerator::init()
}
bool
-SubdirsMetaMakefileGenerator::write(const QString &oldpwd)
+SubdirsMetaMakefileGenerator::write()
{
bool ret = true;
const QString &pwd = qmake_getpwd();
@@ -397,10 +396,7 @@ SubdirsMetaMakefileGenerator::write(const QString &oldpwd)
printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+
Option::output.fileName()).toLatin1().constData());
}
- QString writepwd = Option::fixPathToLocalOS(qmake_getpwd());
- if(!writepwd.startsWith(Option::fixPathToLocalOS(oldpwd)))
- writepwd = oldpwd;
- if(!(ret = subs.at(i)->makefile->write(writepwd)))
+ if (!(ret = subs.at(i)->makefile->write()))
break;
//restore because I'm paranoid
qmake_setpwd(pwd);
diff --git a/qmake/generators/metamakefile.h b/qmake/generators/metamakefile.h
index 85106a674d..aff2f422a6 100644
--- a/qmake/generators/metamakefile.h
+++ b/qmake/generators/metamakefile.h
@@ -69,7 +69,7 @@ public:
virtual bool init() = 0;
virtual int type() const { return -1; }
- virtual bool write(const QString &oldpwd) = 0;
+ virtual bool write() = 0;
};
QT_END_NAMESPACE
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index cac63ed932..c6a70c7539 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -122,7 +122,7 @@ Win32MakefileGenerator::findLibraries()
if(opt.startsWith("/LIBPATH:")) {
dirs.append(QMakeLocalFileName(opt.mid(9)));
} else if(opt.startsWith("-L") || opt.startsWith("/L")) {
- QString libpath = opt.mid(2);
+ QString libpath = Option::fixPathToTargetOS(opt.mid(2), false, false);
QMakeLocalFileName l(libpath);
if(!dirs.contains(l)) {
dirs.append(l);
diff --git a/qmake/main.cpp b/qmake/main.cpp
index 6ef0707da9..2056e36322 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -192,7 +192,7 @@ int runQMake(int argc, char **argv)
if (!success)
exit_val = 3;
- if(mkfile && !mkfile->write(oldpwd)) {
+ if (mkfile && !mkfile->write()) {
if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT)
fprintf(stderr, "Unable to generate project file.\n");
else
diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake
index 60b98a7138..b313cd5c08 100644
--- a/src/corelib/Qt5CTestMacros.cmake
+++ b/src/corelib/Qt5CTestMacros.cmake
@@ -19,6 +19,13 @@ if (CMAKE_TOOLCHAIN_FILE)
list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()
+if (NO_WIDGETS)
+ list(APPEND BUILD_OPTIONS_LIST "-DNO_WIDGETS=True")
+endif()
+if (NO_DBUS)
+ list(APPEND BUILD_OPTIONS_LIST "-DNO_DBUS=True")
+endif()
+
macro(expect_pass _dir)
string(REPLACE "(" "_" testname "${_dir}")
string(REPLACE ")" "_" testname "${testname}")
@@ -80,7 +87,7 @@ function(test_module_includes)
set(packages_string
"
${packages_string}
- find_package(Qt5${_package} REQUIRED)
+ find_package(Qt5${_package} 5.0.0 REQUIRED)
"
)
endforeach()
@@ -90,7 +97,7 @@ function(test_module_includes)
list(REMOVE_AT all_args 0 1)
set(packages_string
"${packages_string}
- find_package(Qt5${qtmodule} REQUIRED)
+ find_package(Qt5${qtmodule} 5.0.0 REQUIRED)
include_directories(\${Qt5${qtmodule}_INCLUDE_DIRS})
add_definitions(\${Qt5${qtmodule}_DEFINITIONS})\n"
)
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 4e0fcda20e..29e37be64a 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -41,6 +41,11 @@ set(Qt5Core_QMAKE_EXECUTABLE Qt5::qmake)
set(Qt5Core_MOC_EXECUTABLE Qt5::moc)
set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)
+set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_MAJOR_VERSION 5)
+set_property(TARGET Qt5::Core APPEND PROPERTY
+ COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
+)
+
!!IF isEmpty(CMAKE_ARCHDATA_DIR_IS_ABSOLUTE)
list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5Core_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5Core_install_prefix}/$${CMAKE_ARCHDATA_DIR}/mkspecs/$${CMAKE_MKSPEC}\")
!!ELSE
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
index 7ccad067d0..2ae66da92b 100644
--- a/src/corelib/global/qtypetraits.h
+++ b/src/corelib/global/qtypetraits.h
@@ -245,6 +245,10 @@ template<> struct is_integral<unsigned long long> : true_type { };
template <class T> struct is_integral<const T> : is_integral<T> { };
template <class T> struct is_integral<volatile T> : is_integral<T> { };
template <class T> struct is_integral<const volatile T> : is_integral<T> { };
+#if defined (Q_COMPILER_UNICODE_STRINGS)
+template<> struct is_integral<char16_t> : true_type { };
+template<> struct is_integral<char32_t> : true_type { };
+#endif
// is_floating_point is false except for the built-in floating-point types.
// A cv-qualified type is integral if and only if the underlying type is.
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 693778e629..ab1f05777a 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -312,11 +312,13 @@ void QProcessPrivate::destroyChannel(Channel *channel)
}
} else if (channel == &stdoutChannel) {
if (stdoutReader) {
+ stdoutReader->stop();
stdoutReader->deleteLater();
stdoutReader = 0;
}
} else if (channel == &stderrChannel) {
if (stderrReader) {
+ stderrReader->stop();
stderrReader->deleteLater();
stderrReader = 0;
}
@@ -795,8 +797,8 @@ void QProcessPrivate::findExitCode()
DWORD theExitCode;
if (GetExitCodeProcess(pid->hProcess, &theExitCode)) {
exitCode = theExitCode;
- //### for now we assume a crash if exit code is less than -1 or the magic number
- crashed = (exitCode == 0xf291 || (int)exitCode < 0);
+ crashed = (exitCode == 0xf291 // our magic number, see killProcess
+ || (theExitCode >= 0x80000000 && theExitCode < 0xD0000000));
}
}
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index efadb357a9..2cb5845768 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -64,7 +64,7 @@ QWindowsPipeReader::QWindowsPipeReader(QObject *parent)
connect(dataReadNotifier, &QWinOverlappedIoNotifier::notified, this, &QWindowsPipeReader::notified);
}
-static void qt_cancelIo(HANDLE handle, OVERLAPPED *overlapped)
+static bool qt_cancelIo(HANDLE handle, OVERLAPPED *overlapped)
{
typedef BOOL (WINAPI *PtrCancelIoEx)(HANDLE, LPOVERLAPPED);
static PtrCancelIoEx ptrCancelIoEx = 0;
@@ -74,16 +74,18 @@ static void qt_cancelIo(HANDLE handle, OVERLAPPED *overlapped)
ptrCancelIoEx = PtrCancelIoEx(GetProcAddress(kernel32, "CancelIoEx"));
}
if (ptrCancelIoEx)
- ptrCancelIoEx(handle, overlapped);
+ return ptrCancelIoEx(handle, overlapped);
else
- CancelIo(handle);
+ return CancelIo(handle);
}
QWindowsPipeReader::~QWindowsPipeReader()
{
if (readSequenceStarted) {
- qt_cancelIo(handle, &overlapped);
- dataReadNotifier->waitForNotified(-1, &overlapped);
+ if (qt_cancelIo(handle, &overlapped))
+ dataReadNotifier->waitForNotified(-1, &overlapped);
+ else
+ qErrnoWarning("QWindowsPipeReader: qt_cancelIo on handle %x failed.", handle);
}
}
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 989456efbb..0d67c1f17b 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -2109,9 +2109,8 @@ void QAbstractItemModel::fetchMore(const QModelIndex &)
The default implementation always returns false.
- If canFetchMore() returns true, QAbstractItemView will call fetchMore().
- However, the fetchMore() function is only called when the model is being
- populated incrementally.
+ If canFetchMore() returns true, the fetchMore() function should
+ be called. This is the behavior of QAbstractItemView, for example.
\sa fetchMore()
*/
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 3540e3163d..cce8c30d81 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -725,6 +725,10 @@ void QCoreApplication::init()
qt_call_pre_routines();
qt_startup_hook();
+
+#ifndef QT_NO_QOBJECT
+ QCoreApplicationPrivate::is_app_running = true; // No longer starting up.
+#endif
}
/*!
diff --git a/src/corelib/plugin/qplugin.qdoc b/src/corelib/plugin/qplugin.qdoc
index 74c4289017..eacfe995ae 100644
--- a/src/corelib/plugin/qplugin.qdoc
+++ b/src/corelib/plugin/qplugin.qdoc
@@ -43,7 +43,7 @@
to the interface class called \a ClassName. The \a Identifier must
be unique. For example:
- \snippet tools/plugandpaint/interfaces.h 3
+ \snippet plugins/interfaces.h 3
This macro is normally used right after the class definition for
\a ClassName, in a header file. See the
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 49f5ae4210..760c944c29 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -511,7 +511,8 @@ void **QListData::erase(void **xi)
Construct a list from the std::initializer_list specified by \a args.
- This constructor is only enabled if the compiler supports C++0x
+ This constructor is only enabled if the compiler supports C++11 initializer
+ lists.
*/
/*! \fn QList::~QList()
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 63028cff66..21a01c4867 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -736,13 +736,13 @@ QLocale::QLocale(QLocalePrivate &dd)
The separator can be either underscore or a minus sign.
If the string violates the locale format, or language is not
- a valid ISO 369 code, the "C" locale is used instead. If country
+ a valid ISO 639 code, the "C" locale is used instead. If country
is not present, or is not a valid ISO 3166 code, the most
appropriate country is chosen for the specified language.
The language, script and country codes are converted to their respective
\c Language, \c Script and \c Country enums. After this conversion is
- performed the constructor behaves exactly like QLocale(Country, Script,
+ performed, the constructor behaves exactly like QLocale(Country, Script,
Language).
This constructor is much slower than QLocale(Country, Script, Language).
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index eb8750838b..a3f6a0b075 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -4128,6 +4128,13 @@ QString::Data *QString::fromAscii_helper(const char *str, int size)
\sa toLatin1(), fromUtf8(), fromLocal8Bit()
*/
+/*!
+ \fn QString QString::fromLatin1(const QByteArray &str)
+ \overload
+ \since 5.0
+
+ Returns a QString initialized with the Latin-1 string \a str.
+*/
/*! \fn QString QString::fromLocal8Bit(const char *str, int size)
Returns a QString initialized with the first \a size characters
@@ -4140,6 +4147,14 @@ QString::Data *QString::fromAscii_helper(const char *str, int size)
\sa toLocal8Bit(), fromLatin1(), fromUtf8()
*/
+
+/*!
+ \fn QString QString::fromLocal8Bit(const QByteArray &str)
+ \overload
+ \since 5.0
+
+ Returns a QString initialized with the 8-bit string \a str.
+*/
QString QString::fromLocal8Bit_helper(const char *str, int size)
{
if (!str)
@@ -4172,6 +4187,15 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
\sa toAscii(), fromLatin1(), fromUtf8(), fromLocal8Bit()
*/
+/*!
+ \fn QString QString::fromAscii(const QByteArray &str)
+ \deprecated
+ \overload
+ \since 5.0
+
+ Returns a QString initialized with the string \a str.
+*/
+
/*! \fn QString QString::fromUtf8(const char *str, int size)
Returns a QString initialized with the first \a size bytes
of the UTF-8 string \a str.
@@ -4193,6 +4217,14 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
\sa toUtf8(), fromLatin1(), fromLocal8Bit()
*/
+
+/*!
+ \fn QString QString::fromUtf8(const QByteArray &str)
+ \overload
+ \since 5.0
+
+ Returns a QString initialized with the UTF-8 string \a str.
+*/
QString QString::fromUtf8_helper(const char *str, int size)
{
if (!str)
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index fa2e12b67b..a5559a181b 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -738,7 +738,8 @@ int QtPrivate::QStringList_removeDuplicates(QStringList *that)
Construct a list from a std::initializer_list given by \a args.
- This constructor is only enabled if the compiler supports C++0x
+ This constructor is only enabled if the compiler supports C++11 initializer
+ lists.
*/
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index 725cf894c6..a443a6b4e8 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -230,7 +230,8 @@
Construct a vector from the std::initilizer_list given by \a args.
- This constructor is only enabled if the compiler supports C++0x
+ This constructor is only enabled if the compiler supports C++11 initializer
+ lists.
*/
diff --git a/src/gui/QtGui.dynlist b/src/gui/QtGui.dynlist
new file mode 100644
index 0000000000..7e15e37845
--- /dev/null
+++ b/src/gui/QtGui.dynlist
@@ -0,0 +1,5 @@
+{
+ extern "C++" {
+ "QGuiApplication::notify(QObject*, QEvent*)";
+ };
+};
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index f21c7a5ce7..14c267df70 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -35,3 +35,4 @@ include(itemmodels/itemmodels.pri)
QMAKE_LIBS += $$QMAKE_LIBS_GUI
+QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 6b91ead666..1b36fa257a 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -946,6 +946,7 @@ void QIcon::setThemeName(const QString &name)
*/
QString QIcon::themeName()
{
+ QIconLoader::instance()->ensureInitialized();
return QIconLoader::instance()->themeName();
}
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 554b31debf..8d5891aae2 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -239,8 +239,9 @@ QImage QRasterPlatformPixmap::toImage(const QRect &rect) const
return image;
QRect clipped = rect.intersected(QRect(0, 0, w, h));
- if (d % 8 == 0)
- return QImage(image.scanLine(clipped.y()) + clipped.x() * (d / 8),
+ const uint du = uint(d);
+ if ((du % 8 == 0) && (((uint(clipped.x()) * du)) % 32 == 0))
+ return QImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8),
clipped.width(), clipped.height(),
image.bytesPerLine(), image.format());
else
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 51d1d76302..a1c9af45b8 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -928,6 +928,8 @@ static bool runningUnderDebugger()
void QGuiApplicationPrivate::init()
{
+ QCoreApplicationPrivate::is_app_running = false; // Starting up.
+
bool doGrabUnderDebugger = false;
QList<QByteArray> pluginList;
// Get command line params
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 6aff1cac9e..f09edfe88e 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1435,7 +1435,12 @@ void QWindow::resize(const QSize &newSize)
if (d->platformWindow) {
d->platformWindow->setGeometry(QRect(position(), newSize));
} else {
+ const QSize oldSize = d->geometry.size();
d->geometry.setSize(newSize);
+ if (newSize.width() != oldSize.width())
+ emit widthChanged(newSize.width());
+ if (newSize.height() != oldSize.height())
+ emit heightChanged(newSize.height());
}
}
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
index 1ba55aa7f1..7f53bec52f 100644
--- a/src/gui/painting/qcosmeticstroker.cpp
+++ b/src/gui/painting/qcosmeticstroker.cpp
@@ -290,11 +290,14 @@ void QCosmeticStroker::setup()
ppl = buffer->bytesPerLine()>>2;
}
+ // dashes are sensitive to clips, so we need to clip consistently when painting to the same device
+ QRect clipRect = strokeSelection & Dashed ? deviceRect : clip;
+
// setup FP clip bounds
- xmin = clip.left() - 1;
- xmax = clip.right() + 2;
- ymin = clip.top() - 1;
- ymax = clip.bottom() + 2;
+ xmin = clipRect.left() - 1;
+ xmax = clipRect.right() + 2;
+ ymin = clipRect.top() - 1;
+ ymax = clipRect.bottom() + 2;
lastPixel.x = -1;
}
@@ -580,6 +583,7 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
patternOffset = state->lastPen.dashOffset()*64;
lastPixel.x = -1;
+ const qreal *begin = points;
const qreal *end = points + 2*path.elementCount();
// handle closed path case
bool closed = path.hasImplicitClose() || (points[0] == end[-2] && points[1] == end[-1]);
@@ -589,6 +593,7 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
calculateLastPoint(p2.x(), p2.y(), p.x(), p.y());
}
+ bool fastPenAliased = (state->flags.fast_pen && !state->flags.antialiased);
points += 2;
while (points < end) {
QPointF p2 = QPointF(points[0], points[1]) * state->matrix;
@@ -596,9 +601,22 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
if (!closed && drawCaps && points == end - 2)
caps |= CapEnd;
+ QCosmeticStroker::Point last = this->lastPixel;
stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps);
- p = p2;
+ /* fix for gaps in polylines with fastpen and aliased in a sequence
+ of points with small distances: if current point p2 has been dropped
+ out, keep last non dropped point p. */
+ if (fastPenAliased) {
+ if (last.x != lastPixel.x || last.y != lastPixel.y ||
+ points == begin + 2 || points == end - 2 ) {
+ {
+ p = p2;
+ }
+ }
+ } else {
+ p = p2;
+ }
points += 2;
caps = NoCaps;
}
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
index fb37b70ba5..05c8a2b0cf 100644
--- a/src/gui/painting/qcosmeticstroker_p.h
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -83,8 +83,9 @@ public:
HorizontalMask = 0xc
};
- QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr)
+ QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr, const QRect &dr_unclipped)
: state(s),
+ deviceRect(dr_unclipped),
clip(dr),
pattern(0),
reversePattern(0),
@@ -108,6 +109,7 @@ public:
QRasterPaintEngineState *state;
+ QRect deviceRect;
QRect clip;
// clip bounds in real
qreal xmin, xmax;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 801a5689c1..a123c147a2 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1054,20 +1054,20 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
void QRasterPaintEnginePrivate::systemStateChanged()
{
- QRect clipRect(0, 0,
+ deviceRectUnclipped = QRect(0, 0,
qMin(QT_RASTER_COORD_LIMIT, device->width()),
qMin(QT_RASTER_COORD_LIMIT, device->height()));
if (!systemClip.isEmpty()) {
- QRegion clippedDeviceRgn = systemClip & clipRect;
+ QRegion clippedDeviceRgn = systemClip & deviceRectUnclipped;
deviceRect = clippedDeviceRgn.boundingRect();
baseClip->setClipRegion(clippedDeviceRgn);
} else {
- deviceRect = clipRect;
+ deviceRect = deviceRectUnclipped;
baseClip->setClipRect(deviceRect);
}
#ifdef QT_DEBUG_DRAW
- qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << clipRect << systemClip;
+ qDebug() << "systemStateChanged" << this << "deviceRect" << deviceRect << deviceRectUnclipped << systemClip;
#endif
exDeviceRect = deviceRect;
@@ -1529,7 +1529,7 @@ void QRasterPaintEngine::drawRects(const QRect *rects, int rectCount)
if (s->penData.blend) {
QRectVectorPath path;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
for (int i = 0; i < rectCount; ++i) {
path.set(rects[i]);
@@ -1576,7 +1576,7 @@ void QRasterPaintEngine::drawRects(const QRectF *rects, int rectCount)
if (s->penData.blend) {
QRectVectorPath path;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
for (int i = 0; i < rectCount; ++i) {
path.set(rects[i]);
@@ -1610,7 +1610,7 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
return;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPath(path);
} else if (s->flags.non_complex_pen && path.shape() == QVectorPath::LinesHint) {
@@ -1953,7 +1953,7 @@ void QRasterPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly
if (s->penData.blend) {
QVectorPath vp((qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode));
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPath(vp);
} else {
@@ -2018,7 +2018,7 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPath(vp);
} else {
@@ -3126,7 +3126,7 @@ void QRasterPaintEngine::drawPoints(const QPointF *points, int pointCount)
return;
}
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPoints(points, pointCount);
}
@@ -3146,7 +3146,7 @@ void QRasterPaintEngine::drawPoints(const QPoint *points, int pointCount)
return;
}
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
stroker.drawPoints(points, pointCount);
}
@@ -3167,7 +3167,7 @@ void QRasterPaintEngine::drawLines(const QLine *lines, int lineCount)
return;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
for (int i=0; i<lineCount; ++i) {
const QLine &l = lines[i];
@@ -3239,7 +3239,7 @@ void QRasterPaintEngine::drawLines(const QLineF *lines, int lineCount)
if (!s->penData.blend)
return;
if (s->flags.fast_pen) {
- QCosmeticStroker stroker(s, d->deviceRect);
+ QCosmeticStroker stroker(s, d->deviceRect, d->deviceRectUnclipped);
stroker.setLegacyRoundingEnabled(s->flags.legacy_rounding);
for (int i=0; i<lineCount; ++i) {
QLineF line = lines[i];
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index e5bb0406ae..00a9ae750c 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -323,6 +323,7 @@ public:
#endif
QRect deviceRect;
+ QRect deviceRectUnclipped;
QStroker basicStroker;
QScopedPointer<QDashStroker> dashStroker;
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 8483a05d60..a6be7c6c78 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -891,6 +891,8 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width,
const Q16Dot16 rowHeight = qMin(yFP + Q16Dot16Factor, yPb)
- qMax(yFP, yPa);
const int y = Q16Dot16ToInt(yFP);
+ if (y > d->clipRect.bottom())
+ break;
for (int i = 0; i < n; ++i) {
buffer.addSpan(x[i], len[i], y,
Q16Dot16ToInt(Q16Dot16Multiply(rowHeight, coverage[i])));
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 81c9c676ba..6676d3daa6 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -109,7 +109,8 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
m_current_fontengine = fontEngine;
const int margin = m_current_fontengine->glyphMargin(m_type);
- const int paddingDoubled = glyphPadding() * 2;
+ const int padding = glyphPadding();
+ const int paddingDoubled = padding * 2;
bool supportsSubPixelPositions = fontEngine->supportsSubPixelPositions();
if (fontEngine->m_subPixelPositionCount == 0) {
@@ -122,6 +123,11 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
}
}
+ if (m_cx == 0 && m_cy == 0) {
+ m_cx = padding;
+ m_cy = padding;
+ }
+
QHash<GlyphAndSubPixelPosition, Coord> listItemCoordinates;
int rowHeight = 0;
@@ -203,21 +209,21 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
m_currentRowHeight = qMax(m_currentRowHeight, c.h + margin * 2);
- if (m_cx + c.w > requiredWidth) {
+ if (m_cx + c.w + padding > requiredWidth) {
int new_width = requiredWidth*2;
- while (new_width < m_cx + c.w)
+ while (new_width < m_cx + c.w + padding)
new_width *= 2;
if (new_width <= maxTextureWidth()) {
requiredWidth = new_width;
} else {
// no room on the current line, start new glyph strip
- m_cx = 0;
+ m_cx = padding;
m_cy += m_currentRowHeight + paddingDoubled;
m_currentRowHeight = c.h + margin * 2; // New row
}
}
- if (maxTextureHeight() > 0 && m_cy + c.h > maxTextureHeight()) {
+ if (maxTextureHeight() > 0 && m_cy + c.h + padding > maxTextureHeight()) {
// We can't make a cache of the required size, so we bail out
return false;
}
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 8486810299..19b4411b47 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -899,18 +899,28 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
info.yOff = 0;
if ((set && set->outline_drawing) || fetchMetricsOnly) {
- // If the advance doesn't fit in signed char, don't cache it
- if (qAbs(info.xOff) >= 128)
- return 0;
- g = new Glyph;
- g->data = 0;
- g->linearAdvance = slot->linearHoriAdvance >> 10;
int left = FLOOR(slot->metrics.horiBearingX);
int right = CEIL(slot->metrics.horiBearingX + slot->metrics.width);
int top = CEIL(slot->metrics.horiBearingY);
int bottom = FLOOR(slot->metrics.horiBearingY - slot->metrics.height);
- g->width = TRUNC(right-left);
- g->height = TRUNC(top-bottom);
+ int width = right-left;
+ int height = top-bottom;
+
+ // If any of the metrics are too large to fit, don't cache them
+ if (qAbs(info.xOff) >= 128
+ || qAbs(TRUNC(top)) >= 128
+ || TRUNC(width) >= 256
+ || TRUNC(height) >= 256
+ || qAbs(TRUNC(left)) >= 128
+ || qAbs(TRUNC(ROUND(slot->advance.x))) >= 128) {
+ return 0;
+ }
+
+ g = new Glyph;
+ g->data = 0;
+ g->linearAdvance = slot->linearHoriAdvance >> 10;
+ g->width = TRUNC(width);
+ g->height = TRUNC(height);
g->x = TRUNC(left);
g->y = TRUNC(top);
g->advance = TRUNC(ROUND(slot->advance.x));
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 931c52eab0..a38655d244 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -706,7 +706,7 @@ quint16 QNetworkProxy::port() const
If a QAbstractSocket or QTcpSocket has the
QNetworkProxy::DefaultProxy type, then the QNetworkProxy set with
this function is used. If you want more flexibility in determining
- which the proxy, use the QNetworkProxyFactory class.
+ which proxy is used, use the QNetworkProxyFactory class.
Setting a default proxy value with this function will override the
application proxy factory set with
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 4345804da8..def0470622 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -3810,7 +3810,7 @@ void QGLWidget::setFormat(const QGLFormat &format)
attributes that were requested.
*/
-/*
+/*!
\fn void QGLWidget::setContext(QGLContext *context,
const QGLContext* shareContext,
bool deleteOldContext)
@@ -3836,6 +3836,12 @@ void QGLWidget::setFormat(const QGLFormat &format)
to the old context (as returned by context()), and want to restore
that context later.
+ \note This function is obsolete and should no longer be used. If you were
+ using it to recreate the context for a QGLWidget, you should instead create a
+ new QGLWidget or use the QOpenGLContext API in conjunction with QWindow.
+ There is currently no officially supported way to substitute QGLWidget's
+ context with your own implementation of QGLContext.
+
\sa context(), isSharing()
*/
diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri
index 22ade42816..506f4ab4ea 100644
--- a/src/platformsupport/eglconvenience/eglconvenience.pri
+++ b/src/platformsupport/eglconvenience/eglconvenience.pri
@@ -14,5 +14,6 @@ contains(QT_CONFIG,egl) {
SOURCES += \
$$PWD/qxlibeglintegration.cpp
}
+ CONFIG += egl
}
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
index 81acc161fe..4932087c5f 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
@@ -57,7 +57,13 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &
{
Q_UNUSED(key);
- QStringList args = specification.split(QLatin1Char(':'));
+
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_KEYBOARD_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
+ QStringList args = spec.split(QLatin1Char(':'));
QStringList devices;
foreach (const QString &arg, args) {
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index 415cffa4ae..6c430091c1 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -59,7 +59,12 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif
{
Q_UNUSED(key);
- QStringList args = specification.split(QLatin1Char(':'));
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_MOUSE_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
+ QStringList args = spec.split(QLatin1Char(':'));
QStringList devices;
foreach (const QString &arg, args) {
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
index 8c86eee469..2c93da147e 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
@@ -159,7 +159,7 @@ static inline bool testBit(long bit, const long *array)
return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1;
}
-QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &spec, QObject *parent)
+QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, QObject *parent)
: QObject(parent), m_notify(0), m_fd(-1), d(0)
#ifdef USE_MTDEV
, m_mtdev(0)
@@ -170,7 +170,13 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &spec, QObject
QString dev;
// only the first device argument is used for now
+ QString spec = QString::fromLocal8Bit(qgetenv("QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS"));
+
+ if (spec.isEmpty())
+ spec = specification;
+
QStringList args = spec.split(QLatin1Char(':'));
+
for (int i = 0; i < args.count(); ++i) {
if (args.at(i).startsWith(QLatin1String("/dev/"))) {
dev = args.at(i);
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
index ceb57bdf05..be7dbfba14 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch_p.h
@@ -61,7 +61,7 @@ class QEvdevTouchScreenHandler : public QObject
Q_OBJECT
public:
- explicit QEvdevTouchScreenHandler(const QString &spec = QString(), QObject *parent = 0);
+ explicit QEvdevTouchScreenHandler(const QString &specification = QString(), QObject *parent = 0);
~QEvdevTouchScreenHandler();
private slots:
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 55f94df45a..e756c375f3 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -202,6 +202,14 @@ static void cleanupCocoaApplicationDelegate()
if ([self canQuit]) {
if (!startedQuit) {
startedQuit = true;
+ // Close open windows. This is done in order to deliver de-expose
+ // events while the event loop is still running.
+ const QWindowList topLevels = QGuiApplication::topLevelWindows();
+ for (int i = 0; i < topLevels.size(); ++i) {
+ QWindow *window = topLevels.at(i);
+ topLevels.at(i)->close();
+ }
+
QGuiApplication::exit(0);
startedQuit = false;
}
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
index bdcad6f490..40cffab3c9 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
@@ -195,7 +195,7 @@ NSMenuItem *QCocoaMenuItem::sync()
QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader();
switch (m_role) {
case ApplicationSpecificRole:
- mergeItem = [loader appSpecificMenuItem];
+ mergeItem = [loader appSpecificMenuItem:reinterpret_cast<NSInteger>(this)];
break;
case AboutRole:
mergeItem = [loader aboutMenuItem];
diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.h b/src/plugins/platforms/cocoa/qcocoamenuloader.h
index f95f684e8c..a45ec0fa89 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuloader.h
+++ b/src/plugins/platforms/cocoa/qcocoamenuloader.h
@@ -79,7 +79,7 @@
- (NSMenuItem *)aboutMenuItem;
- (NSMenuItem *)aboutQtMenuItem;
- (NSMenuItem *)hideMenuItem;
-- (NSMenuItem *)appSpecificMenuItem;
+- (NSMenuItem *)appSpecificMenuItem:(NSInteger)tag;
- (IBAction)terminate:(id)sender;
- (IBAction)orderFrontStandardAboutPanel:(id)sender;
- (IBAction)hideOtherApplications:(id)sender;
diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm
index 2a9dcec64b..726fe5c6d2 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm
@@ -246,11 +246,17 @@ QT_END_NAMESPACE
return [[hideItem retain] autorelease];
}
-- (NSMenuItem *)appSpecificMenuItem
+- (NSMenuItem *)appSpecificMenuItem:(NSInteger)tag
{
+ NSMenuItem *item = [appMenu itemWithTag:tag];
+
+ // No reason to create the item if it already exists. See QTBUG-27202.
+ if (item)
+ return [[item retain] autorelease];
+
// Create an App-Specific menu item, insert it into the menu and return
// it as an autorelease item.
- NSMenuItem *item = [[NSMenuItem alloc] init];
+ item = [[NSMenuItem alloc] init];
NSInteger location;
if (lastAppSpecificItem == nil) {
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index 6f8d0fa22a..8b0c14a984 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -179,14 +179,14 @@ QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
if (mac_widget_colors[i].active != 0) {
qc = qt_mac_colorForThemeTextColor(mac_widget_colors[i].active);
pal.setColor(QPalette::Active, QPalette::Text, qc);
+ pal.setColor(QPalette::Inactive, QPalette::Text, qc);
pal.setColor(QPalette::Active, QPalette::WindowText, qc);
+ pal.setColor(QPalette::Inactive, QPalette::WindowText, qc);
pal.setColor(QPalette::Active, QPalette::HighlightedText, qc);
+ pal.setColor(QPalette::Inactive, QPalette::HighlightedText, qc);
qc = qt_mac_colorForThemeTextColor(mac_widget_colors[i].inactive);
- pal.setColor(QPalette::Inactive, QPalette::Text, qc);
pal.setColor(QPalette::Disabled, QPalette::Text, qc);
- pal.setColor(QPalette::Inactive, QPalette::WindowText, qc);
pal.setColor(QPalette::Disabled, QPalette::WindowText, qc);
- pal.setColor(QPalette::Inactive, QPalette::HighlightedText, qc);
pal.setColor(QPalette::Disabled, QPalette::HighlightedText, qc);
}
if (mac_widget_colors[i].paletteRole == QPlatformTheme::MenuPalette) {
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 84dcaad206..fdb3f4672f 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -108,6 +108,7 @@ public:
void setWindowIcon(const QIcon &icon);
void raise();
void lower();
+ bool isExposed() const;
void propagateSizeHints();
void setOpacity(qreal level);
void setMask(const QRegion &region);
@@ -146,6 +147,8 @@ public:
QCocoaMenuBar *menubar() const;
qreal devicePixelRatio() const;
+ void exposeWindow();
+ void obscureWindow();
protected:
// NSWindow handling. The QCocoaWindow/QNSView can either be displayed
// in an existing NSWindow or in one created by Qt.
@@ -182,6 +185,7 @@ public: // for QNSView
bool m_hasModalSession;
bool m_frameStrutEventsEnabled;
+ bool m_isExposed;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 5eab036661..9466b68bec 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -200,6 +200,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
, m_menubar(0)
, m_hasModalSession(false)
, m_frameStrutEventsEnabled(false)
+ , m_isExposed(false)
{
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
qDebug() << "QCocoaWindow::QCocoaWindow" << this;
@@ -284,9 +285,12 @@ void QCocoaWindow::setVisible(bool visible)
}
- // Make sure the QWindow has a frame ready before we show the NSWindow.
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
- QWindowSystemInterface::flushWindowSystemEvents();
+ // This call is here to handle initial window show correctly:
+ // - top-level windows need to have backing store content ready when the
+ // window is shown, sendin the expose event here makes that more likely.
+ // - QNSViews for child windows are initialy not hidden and won't get the
+ // viewDidUnhide message.
+ exposeWindow();
if (m_nsWindow) {
// setWindowState might have been called while the window was hidden and
@@ -338,8 +342,6 @@ void QCocoaWindow::setVisible(bool visible)
} else {
[m_contentView setHidden:YES];
}
- if (!QCoreApplication::closingDown())
- QWindowSystemInterface::handleExposeEvent(window(), QRegion());
}
}
@@ -376,7 +378,7 @@ NSUInteger QCocoaWindow::windowStyleMask(Qt::WindowFlags flags)
NSInteger styleMask = NSBorderlessWindowMask;
if ((type & Qt::Popup) == Qt::Popup) {
- if (!windowIsPopupType(type))
+ if (!windowIsPopupType(type) && !(flags & Qt::FramelessWindowHint))
styleMask = (NSUtilityWindowMask | NSResizableWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSTitledWindowMask);
} else {
@@ -491,6 +493,11 @@ void QCocoaWindow::lower()
[m_nsWindow orderBack: m_nsWindow];
}
+bool QCocoaWindow::isExposed() const
+{
+ return m_isExposed;
+}
+
void QCocoaWindow::propagateSizeHints()
{
QCocoaAutoReleasePool pool;
@@ -898,6 +905,22 @@ qreal QCocoaWindow::devicePixelRatio() const
}
}
+void QCocoaWindow::exposeWindow()
+{
+ if (!m_isExposed) {
+ m_isExposed = true;
+ QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
+ }
+}
+
+void QCocoaWindow::obscureWindow()
+{
+ if (m_isExposed) {
+ m_isExposed = false;
+ QWindowSystemInterface::handleExposeEvent(window(), QRegion());
+ }
+}
+
QMargins QCocoaWindow::frameMargins() const
{
NSRect frameW = [m_nsWindow frame];
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 5fe0861e0a..5ccea3c387 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -59,6 +59,7 @@ QT_END_NAMESPACE
QPoint m_backingStoreOffset;
CGImageRef m_maskImage;
uchar *m_maskData;
+ bool m_shouldInvalidateWindowShadow;
QWindow *m_window;
QCocoaWindow *m_platformWindow;
Qt::MouseButtons m_buttons;
@@ -76,9 +77,12 @@ QT_END_NAMESPACE
- (void)setQCocoaGLContext:(QCocoaGLContext *)context;
- (void)flushBackingStore:(QCocoaBackingStore *)backingStore region:(const QRegion &)region offset:(QPoint)offset;
- (void)setMaskRegion:(const QRegion *)region;
+- (void)invalidateWindowShadowIfNeeded;
- (void)drawRect:(NSRect)dirtyRect;
- (void)updateGeometry;
- (void)windowNotification : (NSNotification *) windowNotification;
+- (void)viewDidHide;
+- (void)viewDidUnhide;
- (BOOL)isFlipped;
- (BOOL)acceptsFirstResponder;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 18714ddbae..e608731cc1 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -80,6 +80,7 @@ static QTouchDevice *touchDevice = 0;
m_backingStore = 0;
m_maskImage = 0;
m_maskData = 0;
+ m_shouldInvalidateWindowShadow = false;
m_window = 0;
m_buttons = Qt::NoButton;
m_sendKeyEvent = false;
@@ -266,10 +267,10 @@ static QTouchDevice *touchDevice = 0;
QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowMinimized);
} else if (notificationName == NSWindowDidDeminiaturizeNotification) {
QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowNoState);
- // Qt expects an expose event after restore/deminiaturize. This also needs
- // to be a non-synchronous event to make sure it gets processed after
- // the state change event sent above.
- QWindowSystemInterface::handleExposeEvent(m_window, QRegion(m_window->geometry()));
+ } else if ([notificationName isEqualToString: @"NSWindowDidOrderOffScreenNotification"]) {
+ m_platformWindow->obscureWindow();
+ } else if ([notificationName isEqualToString: @"NSWindowDidOrderOnScreenAndFinishAnimatingNotification"]) {
+ m_platformWindow->exposeWindow();
} else {
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
@@ -285,6 +286,16 @@ static QTouchDevice *touchDevice = 0;
}
}
+- (void)viewDidHide
+{
+ m_platformWindow->obscureWindow();
+}
+
+- (void)viewDidUnhide
+{
+ m_platformWindow->exposeWindow();
+}
+
- (void) flushBackingStore:(QCocoaBackingStore *)backingStore region:(const QRegion &)region offset:(QPoint)offset
{
m_backingStore = backingStore;
@@ -300,13 +311,14 @@ static QTouchDevice *touchDevice = 0;
- (void) setMaskRegion:(const QRegion *)region
{
+ m_shouldInvalidateWindowShadow = true;
if (m_maskImage)
CGImageRelease(m_maskImage);
if (region->isEmpty()) {
m_maskImage = 0;
}
- const QRect &rect = qt_mac_toQRect([self frame]);
+ const QRect &rect = region->boundingRect();
QImage maskImage(rect.size(), QImage::Format_RGB888);
maskImage.fill(Qt::white);
QPainter p(&maskImage);
@@ -319,6 +331,14 @@ static QTouchDevice *touchDevice = 0;
m_maskImage = qt_mac_toCGImage(maskImage, true, &m_maskData);
}
+- (void)invalidateWindowShadowIfNeeded
+{
+ if (m_shouldInvalidateWindowShadow && m_platformWindow->m_nsWindow) {
+ [m_platformWindow->m_nsWindow invalidateShadow];
+ m_shouldInvalidateWindowShadow = false;
+ }
+}
+
- (void) drawRect:(NSRect)dirtyRect
{
if (!m_backingStore)
@@ -373,6 +393,8 @@ static QTouchDevice *touchDevice = 0;
CGContextRestoreGState(cgContext);
CGImageRelease(cleanImg);
CGImageRelease(subMask);
+
+ [self invalidateWindowShadowIfNeeded];
}
- (BOOL) isFlipped
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 20d312216a..5af6a9ec9d 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -186,6 +186,7 @@ QXcbWindow::QXcbWindow(QWindow *window)
, m_gravity(XCB_GRAVITY_STATIC)
, m_mapped(false)
, m_transparent(false)
+ , m_usingSyncProtocol(false)
, m_deferredActivation(false)
, m_embedded(false)
, m_netWmUserTimeWindow(XCB_NONE)
@@ -354,7 +355,9 @@ void QXcbWindow::create()
properties[propertyCount++] = atom(QXcbAtom::WM_TAKE_FOCUS);
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_PING);
- if (m_screen->syncRequestSupported())
+ m_usingSyncProtocol = m_screen->syncRequestSupported() && window()->surfaceType() != QSurface::OpenGLSurface;
+
+ if (m_usingSyncProtocol)
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_SYNC_REQUEST);
if (window()->flags() & Qt::WindowContextHelpButtonHint)
@@ -371,7 +374,7 @@ void QXcbWindow::create()
m_syncValue.hi = 0;
m_syncValue.lo = 0;
- if (m_screen->syncRequestSupported()) {
+ if (m_usingSyncProtocol) {
m_syncCounter = xcb_generate_id(xcb_connection());
Q_XCB_CALL(xcb_sync_create_counter(xcb_connection(), m_syncCounter, m_syncValue));
@@ -463,7 +466,7 @@ void QXcbWindow::destroy()
if (connection()->focusWindow() == this)
connection()->setFocusWindow(0);
- if (m_syncCounter && m_screen->syncRequestSupported())
+ if (m_syncCounter && m_usingSyncProtocol)
Q_XCB_CALL(xcb_sync_destroy_counter(xcb_connection(), m_syncCounter));
if (m_window) {
if (m_netWmUserTimeWindow) {
@@ -1824,7 +1827,7 @@ void QXcbWindow::handleFocusOutEvent(const xcb_focus_out_event_t *)
void QXcbWindow::updateSyncRequestCounter()
{
- if (m_screen->syncRequestSupported() && (m_syncValue.lo != 0 || m_syncValue.hi != 0)) {
+ if (m_usingSyncProtocol && (m_syncValue.lo != 0 || m_syncValue.hi != 0)) {
Q_XCB_CALL(xcb_sync_set_counter(xcb_connection(), m_syncCounter, m_syncValue));
xcb_flush(xcb_connection());
connection()->sync();
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 1810a58c7b..f4bd2d96ff 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -189,6 +189,7 @@ private:
bool m_mapped;
bool m_transparent;
+ bool m_usingSyncProtocol;
bool m_deferredActivation;
bool m_deferredExpose;
bool m_configureNotifyPending;
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index a7f583c3b8..f0f1f64141 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -1407,7 +1407,7 @@ bool QODBCResult::exec()
// (How many leading digits do we want to keep? With SQL Server 2005, this should be 3: 123000000)
int keep = (int)qPow(10.0, 9 - qMin(9, precision));
- dt->fraction /= keep * keep;
+ dt->fraction = (dt->fraction / keep) * keep;
}
r = SQLBindParameter(d->hStmt,
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 7d844fa1bd..4749b8b97b 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -124,7 +124,16 @@ inline void qPQfreemem(void *buffer)
class QPSQLDriverPrivate
{
public:
- QPSQLDriverPrivate(QPSQLDriver *qq) : q(qq), connection(0), isUtf8(false), pro(QPSQLDriver::Version6), sn(0), pendingNotifyCheck(false) {}
+ QPSQLDriverPrivate(QPSQLDriver *qq)
+ : q(qq),
+ connection(0),
+ isUtf8(false),
+ pro(QPSQLDriver::Version6),
+ sn(0),
+ pendingNotifyCheck(false),
+ hasBackslashEscape(false)
+ { }
+
QPSQLDriver *q;
PGconn *connection;
bool isUtf8;
@@ -132,6 +141,7 @@ public:
QSocketNotifier *sn;
QStringList seid;
mutable bool pendingNotifyCheck;
+ bool hasBackslashEscape;
void appendTables(QStringList &tl, QSqlQuery &t, QChar type);
PGresult * exec(const char * stmt) const;
@@ -139,6 +149,7 @@ public:
QPSQLDriver::Protocol getPSQLVersion();
bool setEncodingUtf8();
void setDatestyle();
+ void detectBackslashEscape();
};
void QPSQLDriverPrivate::appendTables(QStringList &tl, QSqlQuery &t, QChar type)
@@ -621,6 +632,23 @@ void QPSQLDriverPrivate::setDatestyle()
PQclear(result);
}
+void QPSQLDriverPrivate::detectBackslashEscape()
+{
+ // standard_conforming_strings option introduced in 8.2
+ // http://www.postgresql.org/docs/8.2/static/runtime-config-compatible.html
+ if (pro < QPSQLDriver::Version82) {
+ hasBackslashEscape = true;
+ } else {
+ hasBackslashEscape = false;
+ PGresult* result = exec(QLatin1Literal("SELECT '\\\\' x"));
+ int status = PQresultStatus(result);
+ if (status == PGRES_COMMAND_OK || status == PGRES_TUPLES_OK)
+ if (QString::fromLatin1(PQgetvalue(result, 0, 0)) == QLatin1Literal("\\"))
+ hasBackslashEscape = true;
+ PQclear(result);
+ }
+}
+
static QPSQLDriver::Protocol qMakePSQLVersion(int vMaj, int vMin)
{
switch (vMaj) {
@@ -732,6 +760,7 @@ QPSQLDriver::QPSQLDriver(PGconn *conn, QObject *parent)
d->connection = conn;
if (conn) {
d->pro = d->getPSQLVersion();
+ d->detectBackslashEscape();
setOpen(true);
setOpenError(false);
}
@@ -833,6 +862,7 @@ bool QPSQLDriver::open(const QString & db,
}
d->pro = d->getPSQLVersion();
+ d->detectBackslashEscape();
d->isUtf8 = d->setEncodingUtf8();
d->setDatestyle();
@@ -1218,12 +1248,10 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
}
break;
case QVariant::String:
- {
- // Escape '\' characters
r = QSqlDriver::formatValue(field, trimStrings);
- r.replace(QLatin1String("\\"), QLatin1String("\\\\"));
+ if (d->hasBackslashEscape)
+ r.replace(QLatin1String("\\"), QLatin1String("\\\\"));
break;
- }
case QVariant::Bool:
if (field.value().toBool())
r = QLatin1String("TRUE");
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 1af5d6274e..854705b3f6 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -234,8 +234,7 @@ void QSQLiteResultPrivate::initColumns(bool emptyResultset)
}
}
- int dotIdx = colName.lastIndexOf(QLatin1Char('.'));
- QSqlField fld(colName.mid(dotIdx == -1 ? 0 : dotIdx + 1), fieldType);
+ QSqlField fld(colName, fieldType);
fld.setSqlType(stp);
rInf.append(fld);
}
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
index ff36064941..6095d0d2fa 100644
--- a/src/tools/qdoc/codemarker.cpp
+++ b/src/tools/qdoc/codemarker.cpp
@@ -382,7 +382,7 @@ QString CodeMarker::sortName(const Node *node, const QString* name)
(node->type() == Node::QmlSignal) ||
(node->type() == Node::QmlSignalHandler)) {
const FunctionNode* func = static_cast<const FunctionNode *>(node);
- return QLatin1Char('E') + func->signature();
+ return QLatin1Char('E') + func->name();
}
return QLatin1Char('B') + nodeName;
@@ -438,8 +438,7 @@ void CodeMarker::insert(FastSection &fastSection,
if (!irrelevant) {
if (!inheritedMember || style == Subpage) {
QString key = sortName(node);
- if (!fastSection.memberMap.contains(key))
- fastSection.memberMap.insert(key, node);
+ fastSection.memberMap.insertMulti(key, node);
}
else {
if (node->parent()->type() == Node::Class) {
diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp
index 50632f1da4..6c8b947c46 100644
--- a/src/tools/qdoc/main.cpp
+++ b/src/tools/qdoc/main.cpp
@@ -371,7 +371,9 @@ static void processQdocconfFile(const QString &fileName)
excludedDirsList = config.getCanonicalRelativePathList(CONFIG_EXCLUDEDIRS);
foreach (const QString &excludeDir, excludedDirsList) {
QString p = QDir::fromNativeSeparators(excludeDir);
- excludedDirs.insert(p);
+ QDir tmp(p);
+ if (tmp.exists())
+ excludedDirs.insert(p);
}
Generator::debugSegfault("Reading excludefiles");
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index 058ab9a725..ffe1afe28b 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -88,6 +88,7 @@ QmlDocVisitor::QmlDocVisitor(const QString &filePath,
QSet<QString> &topics)
: nestingLevel(0)
{
+ lastEndOffset = 0;
this->filePath = filePath;
this->name = QFileInfo(filePath).baseName();
document = code;
@@ -117,21 +118,21 @@ QQmlJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) cons
QQmlJS::AST::SourceLocation loc = it.previous();
- if (loc.begin() <= lastEndOffset)
+ if (loc.begin() <= lastEndOffset) {
// Return if we reach the end of the preceding structure.
break;
-
- else if (usedComments.contains(loc.begin()))
+ }
+ else if (usedComments.contains(loc.begin())) {
// Return if we encounter a previously used comment.
break;
-
+ }
else if (loc.begin() > lastEndOffset && loc.end() < offset) {
-
// Only examine multiline comments in order to avoid snippet markers.
if (document.at(loc.offset - 1) == QLatin1Char('*')) {
QString comment = document.mid(loc.offset, loc.length);
- if (comment.startsWith(QLatin1Char('!')) || comment.startsWith(QLatin1Char('*')))
+ if (comment.startsWith(QLatin1Char('!')) || comment.startsWith(QLatin1Char('*'))) {
return loc;
+ }
}
}
}
@@ -165,8 +166,9 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod
node->setDoc(doc);
applyMetacommands(loc, node, doc);
usedComments.insert(loc.offset);
- if (doc.isEmpty())
+ if (doc.isEmpty()) {
return false;
+ }
return true;
}
Location codeLoc(filePath);
@@ -601,9 +603,15 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::FunctionDeclaration* fd)
/*!
Begin the visit of the signal handler declaration \a sb, but only
if the nesting level is 1.
+
+ This visit is now deprecated. It has been decided to document
+ public signals. If a signal handler must be discussed in the
+ documentation, that discussion must take place in the comment
+ for the signal.
*/
-bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* sb)
+bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* )
{
+#if 0
if (nestingLevel > 1) {
return true;
}
@@ -617,6 +625,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* sb)
}
}
}
+#endif
return true;
}
diff --git a/src/widgets/QtGui.dynlist b/src/widgets/QtGui.dynlist
deleted file mode 100644
index ea47f598a7..0000000000
--- a/src/widgets/QtGui.dynlist
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- extern "C++" {
- "qt_x11ft_convert_pattern(_FcPattern*, QByteArray*, int*, bool*)";
- "QApplication::x11ClientMessage(QWidget*, _XEvent*, bool)";
- "QApplication::notify(QObject*, QEvent*)";
- "QApplication::qwsEventFilter(QWSEvent*)";
- };
-};
diff --git a/src/widgets/QtWidgets.dynlist b/src/widgets/QtWidgets.dynlist
new file mode 100644
index 0000000000..94fd207dde
--- /dev/null
+++ b/src/widgets/QtWidgets.dynlist
@@ -0,0 +1,5 @@
+{
+ extern "C++" {
+ "QApplication::notify(QObject*, QEvent*)";
+ };
+};
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index e8da8aa651..213aefe5f5 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -238,7 +238,7 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
#endif
#ifdef Q_OS_WIN
- if (fileInfo.isSymLink() && m_resolveSymlinks) {
+ if (m_resolveSymlinks && fileInfo.isSymLink()) {
QFileInfo resolvedInfo(fileInfo.symLinkTarget());
resolvedInfo = resolvedInfo.canonicalFilePath();
if (resolvedInfo.exists()) {
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 5bf5356d89..d91ac424e2 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -800,7 +800,7 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const
if (!index.isValid())
return QString();
QFileSystemNode *dirNode = node(index);
- if (dirNode->isSymLink() && fileInfoGatherer.resolveSymlinks()) {
+ if (fileInfoGatherer.resolveSymlinks() && !resolvedSymLinks.isEmpty() && dirNode->isSymLink()) {
QString fullPath = QDir::fromNativeSeparators(filePath(index));
if (resolvedSymLinks.contains(fullPath))
return resolvedSymLinks[fullPath];
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index ea474f14ab..f2c3c4702f 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -1299,6 +1299,9 @@ QStyleOptionViewItem QItemDelegate::setOptions(const QModelIndex &index,
if (value.canConvert<QBrush>())
opt.palette.setBrush(QPalette::Text, qvariant_cast<QBrush>(value));
+ // disable style animations for checkboxes etc. within itemviews (QTBUG-30146)
+ opt.styleObject = 0;
+
return opt;
}
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index 2b3ea35cb0..e92ccc2455 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -388,6 +388,9 @@ void QStyledItemDelegate::initStyleOption(QStyleOptionViewItem *option,
}
option->backgroundBrush = qvariant_cast<QBrush>(index.data(Qt::BackgroundRole));
+
+ // disable style animations for checkboxes etc. within itemviews (QTBUG-30146)
+ option->styleObject = 0;
}
/*!
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index eefacc4864..4adda2f151 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -1205,7 +1205,6 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn,
const ThemeDrawState tds,
HIThemeButtonDrawInfo *bdi) const
{
- bool drawColorless = btn->palette.currentColorGroup() == QPalette::Active;
ThemeDrawState tdsModified = tds;
if (btn->state & QStyle::State_On)
tdsModified = kThemeStatePressed;
@@ -1213,7 +1212,7 @@ void QMacStylePrivate::initHIThemePushButton(const QStyleOptionButton *btn,
bdi->state = tdsModified;
bdi->value = kThemeButtonOff;
- if (drawColorless && tdsModified == kThemeStateInactive)
+ if (tds == kThemeStateInactive)
bdi->state = kThemeStateActive;
if (btn->state & QStyle::State_HasFocus)
bdi->adornment = kThemeAdornmentFocus;
@@ -1284,10 +1283,9 @@ void QMacStylePrivate::initComboboxBdi(const QStyleOptionComboBox *combo, HIThem
bdi->value = kThemeButtonOff;
if (combo->state & QStyle::State_HasFocus)
bdi->adornment = kThemeAdornmentFocus;
- bool drawColorless = combo->palette.currentColorGroup() == QPalette::Active && tds == kThemeStateInactive;
if (combo->activeSubControls & QStyle::SC_ComboBoxArrow)
bdi->state = kThemeStatePressed;
- else if (drawColorless)
+ else if (tds == kThemeStateInactive)
bdi->state = kThemeStateActive;
else
bdi->state = tds;
@@ -1608,8 +1606,6 @@ void QMacStylePrivate::getSliderInfo(QStyle::ComplexControl cc, const QStyleOpti
tdi->enableState = (slider->state & QStyle::State_Enabled) ? kThemeTrackActive
: kThemeTrackDisabled;
- if (!(slider->state & QStyle::State_Active))
- tdi->enableState = kThemeTrackInactive;
if (!isScrollbar) {
if (slider->state & QStyle::QStyle::State_HasFocus)
tdi->attributes |= kThemeTrackHasFocus;
@@ -3027,12 +3023,11 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
case PE_IndicatorViewItemCheck:
case PE_IndicatorRadioButton:
case PE_IndicatorCheckBox: {
- bool drawColorless = (!(opt->state & State_Active))
- && opt->palette.currentColorGroup() == QPalette::Active;
+ bool drawColorless = tds == kThemeStateInactive;
HIThemeButtonDrawInfo bdi;
bdi.version = qt_mac_hitheme_version;
bdi.state = tds;
- if (drawColorless && tds == kThemeStateInactive)
+ if (drawColorless)
bdi.state = kThemeStateActive;
bdi.adornment = kThemeDrawIndicatorOnly;
if (opt->state & State_HasFocus)
@@ -3554,13 +3549,10 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
int arrowYOffset = bdi.kind == kThemePushButton ? 4 : 2;
HIRect arrowRect = CGRectMake(ir.right() - mbi - QMacStylePrivate::PushButtonRightOffset,
ir.height() / 2 - arrowYOffset, mbi, ir.height() / 2);
- bool drawColorless = btn->palette.currentColorGroup() == QPalette::Active;
- if (drawColorless && tds == kThemeStateInactive)
- tds = kThemeStateActive;
HIThemePopupArrowDrawInfo pdi;
pdi.version = qt_mac_hitheme_version;
- pdi.state = tds;
+ pdi.state = tds == kThemeStateInactive ? kThemeStateActive : tds;
pdi.orientation = kThemeArrowDown;
if (arrowRect.size.width < 8.)
pdi.size = kThemeArrow5pt;
@@ -5118,7 +5110,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
HIThemeFrameDrawInfo fdi;
fdi.version = qt_mac_hitheme_version;
- fdi.state = tds;
+ fdi.state = tds == kThemeStateInactive ? kThemeStateActive : tds;
fdi.kind = kHIThemeFrameTextFieldSquare;
fdi.isFocused = false;
HIRect hirect = qt_hirectForQRect(lineeditRect);
@@ -5149,11 +5141,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
else if (sb->activeSubControls == SC_SpinBoxUp
&& (sb->state & State_Sunken))
tds = kThemeStatePressedUp;
- bdi.state = tds;
- if (!(sb->state & State_Active)
- && sb->palette.currentColorGroup() == QPalette::Active
- && tds == kThemeStateInactive)
+ if (tds == kThemeStateInactive)
bdi.state = kThemeStateActive;
+ else
+ bdi.state = tds;
bdi.value = kThemeButtonOff;
bdi.adornment = kThemeAdornmentNone;
@@ -5170,7 +5161,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
int(outRect.size.height - newRect.size.height));
newRect = qt_hirectForQRect(updown, off_rct);
- HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
+ if (tds == kThemeStateInactive)
+ d->drawColorlessButton(newRect, &bdi, p, sb);
+ else
+ HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
}
}
break;
@@ -5178,8 +5172,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)){
HIThemeButtonDrawInfo bdi;
d->initComboboxBdi(combo, &bdi, widget, d->getDrawState(opt->state));
- bool drawColorless = combo->palette.currentColorGroup() == QPalette::Active && tds == kThemeStateInactive;
- if (!drawColorless)
+ if (!tds == kThemeStateInactive)
QMacStylePrivate::drawCombobox(qt_hirectForQRect(combo->rect), bdi, p);
else
d->drawColorlessButton(qt_hirectForQRect(combo->rect), &bdi, p, opt);
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index 6b9aa92fd9..18a4d57900 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -32,7 +32,7 @@ QMAKE_LIBS += $$QMAKE_LIBS_GUI
contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri)
-QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist
+QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtWidgets.dynlist
# Code coverage with TestCocoon
# The following is required as extra compilers use $$QMAKE_CXX instead of $(CXX).
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index f9291a7eb3..8f97c0eb7a 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -57,16 +57,16 @@ else()
endif()
expect_pass(test_wrap_cpp_and_resources)
-expect_pass(test_dependent_modules)
+if (NOT NO_WIDGETS)
+ expect_pass(test_dependent_modules)
+ expect_pass("test(needsquoting)dirname")
+endif()
expect_fail(test_add_resource_options)
expect_fail(test_wrap_cpp_options)
-expect_pass("test(needsquoting)dirname")
expect_pass(test_platform_defs_include)
expect_pass(test_qtmainwin_library)
-# If Qt D-Bus has been installed then run the tests for its macros.
-find_package(Qt5DBus QUIET)
-if (Qt5DBus_FOUND AND NOT APPLE)
+if (NOT NO_DBUS)
expect_pass(test_dbus_module)
endif()
expect_pass(test_multiple_find_package)
@@ -80,30 +80,37 @@ expect_pass(test_testlib_definitions)
expect_pass(test_json_plugin_includes)
expect_fail(test_testlib_no_link_gui)
-expect_fail(test_testlib_no_link_widgets)
-
execute_process(COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/"
)
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy
- "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
- "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_widgets/test_testlib_no_link_widgets/"
-)
+
+if (NOT NO_WIDGETS)
+ expect_fail(test_testlib_no_link_widgets)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_widgets/test_testlib_no_link_widgets/"
+ )
+endif()
set(qt_module_includes
Core QObject
Gui QImage
- Widgets QWidget
Network QHostInfo
- OpenGL QGLBuffer
Sql QSqlError
Test QTestEventList
Xml QDomDocument
- PrintSupport QPrintDialog
)
-if (UNIX AND NOT APPLE AND NOT QNXNTO)
+if (NOT NO_WIDGETS)
+ list(APPEND qt_module_includes
+ Widgets QWidget
+ OpenGL QGLBuffer
+ PrintSupport QPrintDialog
+ )
+endif()
+
+if (NOT NO_DBUS)
list(APPEND qt_module_includes
DBus QDBusMessage
)
diff --git a/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt b/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt
index 12ce93ca26..e4c7f07256 100644
--- a/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt
+++ b/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt
@@ -3,13 +3,11 @@ cmake_minimum_required(VERSION 2.8)
project("test(needsquoting)dirname")
-find_package(Qt5Core REQUIRED)
-find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
-include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
+include_directories(${Qt5Widgets_INCLUDE_DIRS})
-add_definitions(${Qt5Core_DEFINITIONS})
+add_definitions(${Qt5Widgets_DEFINITIONS})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
diff --git a/tests/auto/cmake/test_concurrent_module/CMakeLists.txt b/tests/auto/cmake/test_concurrent_module/CMakeLists.txt
index efd7b725ea..7014fe51cd 100644
--- a/tests/auto/cmake/test_concurrent_module/CMakeLists.txt
+++ b/tests/auto/cmake/test_concurrent_module/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8)
project(test_concurrent_module)
-find_package(Qt5Concurrent REQUIRED)
+find_package(Qt5Concurrent 5.0.0 REQUIRED)
include_directories(
${Qt5Concurrent_INCLUDE_DIRS}
diff --git a/tests/auto/cmake/test_dbus_module/CMakeLists.txt b/tests/auto/cmake/test_dbus_module/CMakeLists.txt
index 6bbb52697c..36480e85e8 100644
--- a/tests/auto/cmake/test_dbus_module/CMakeLists.txt
+++ b/tests/auto/cmake/test_dbus_module/CMakeLists.txt
@@ -3,17 +3,15 @@ cmake_minimum_required(VERSION 2.8)
project(test_dbus_module)
-find_package(Qt5Core REQUIRED)
-find_package(Qt5DBus REQUIRED)
+find_package(Qt5DBus 5.0.0 REQUIRED)
include_directories(
- ${Qt5Core_INCLUDE_DIRS}
${Qt5DBus_INCLUDE_DIRS}
)
-add_definitions(${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS})
+add_definitions(${Qt5DBus_DEFINITIONS})
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5DBus_EXECUTABLE_COMPILE_FLAGS}")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -33,4 +31,4 @@ qt5_add_dbus_adaptor(my_srcs
)
add_executable(myobject ${my_srcs} ${moc_files})
-target_link_libraries(myobject ${Qt5DBus_LIBRARIES} ${Qt5Core_LIBRARIES})
+target_link_libraries(myobject ${Qt5DBus_LIBRARIES})
diff --git a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt
index c370e8effa..cc54bf5bc3 100644
--- a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt
+++ b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt
@@ -35,4 +35,6 @@ endmacro()
add_subdirectory(core_only)
add_subdirectory(gui)
-add_subdirectory(widgets)
+if(NOT NO_WIDGETS)
+ add_subdirectory(widgets)
+endif()
diff --git a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
index 4ce01938cb..bfcdd9d1d7 100644
--- a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
+++ b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
@@ -13,4 +13,4 @@ add_executable(three three.cpp)
find_package(Qt5Core)
qt5_use_modules(two Test)
-qt5_use_modules(three Widgets Test)
+qt5_use_modules(three Gui Test)
diff --git a/tests/auto/cmake/test_use_modules_function/three.cpp b/tests/auto/cmake/test_use_modules_function/three.cpp
index c3aff71b03..42ae910981 100644
--- a/tests/auto/cmake/test_use_modules_function/three.cpp
+++ b/tests/auto/cmake/test_use_modules_function/three.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <QtTest>
-#include <QWidget>
+#include <QWindow>
class Three : public QObject
{
@@ -48,7 +48,7 @@ class Three : public QObject
public:
Three(QObject *parent = 0)
{
- QWidget *w = new QWidget;
+ QWindow *w = new QWindow;
w->show();
}
};
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index b9b61425da..531ec68fdc 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -168,6 +168,8 @@ private slots:
void scaled_QTBUG19157();
void detachOnLoad_QTBUG29639();
+
+ void copyOnNonAlignedBoundary();
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -1526,5 +1528,13 @@ void tst_QPixmap::detachOnLoad_QTBUG29639()
QVERIFY(a.toImage() != b.toImage());
}
+void tst_QPixmap::copyOnNonAlignedBoundary()
+{
+ QImage img(8, 2, QImage::Format_RGB16);
+
+ QPixmap pm1 = QPixmap::fromImage(img, Qt::NoFormatConversion);
+ QPixmap pm2 = pm1.copy(QRect(5, 0, 3, 2)); // When copying second line: 2 bytes too many are read which might cause an access violation.
+}
+
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index 4470961f7b..89807f3747 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -208,11 +208,12 @@ static bool runHelper(const QString &program, const QStringList &arguments, QByt
// Windows: Due to implementation changes, the event loop needs
// to be spun since we ourselves also need to answer the
// WM_DRAWCLIPBOARD message as we are in the chain of clipboard
- // viewers.
+ // viewers. Check for running before waitForFinished() in case
+ // the process terminated while processEvents() was executed.
bool running = true;
for (int i = 0; i < 60 && running; ++i) {
QGuiApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
- if (process.waitForFinished(500))
+ if (process.state() != QProcess::Running || process.waitForFinished(500))
running = false;
}
if (running) {
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 2e5f43807a..6c37f1fc27 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -277,6 +277,7 @@ private slots:
void drawTextWithComplexBrush();
void QTBUG26013_squareCapStroke();
void QTBUG25153_drawLine();
+ void dashing_systemClip();
private:
void fillData();
@@ -4458,6 +4459,43 @@ void tst_QPainter::QTBUG25153_drawLine()
}
}
+static void dashing_systemClip_paint(QPainter *p)
+{
+ p->setPen(QPen(Qt::black, 1, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin));
+ p->drawLine(8, 8, 42, 8);
+ p->drawLine(42, 8, 42, 42);
+ p->drawLine(42, 42, 8, 42);
+ p->drawLine(8, 42, 8, 8);
+}
+
+void tst_QPainter::dashing_systemClip()
+{
+ QImage image(50, 50, QImage::Format_RGB32);
+ image.fill(Qt::white);
+
+ QPainter p(&image);
+ dashing_systemClip_paint(&p);
+ p.end();
+
+ QImage old = image.copy();
+
+ image.paintEngine()->setSystemClip(QRect(10, 0, image.width() - 10, image.height()));
+
+ p.begin(&image);
+ dashing_systemClip_paint(&p);
+
+ // doing same paint operation again with different system clip should not change the image
+ QCOMPARE(old, image);
+
+ old = image;
+
+ p.setClipRect(QRect(20, 20, 30, 30));
+ dashing_systemClip_paint(&p);
+
+ // ditto for regular clips
+ QCOMPARE(old, image);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index d1ff60ea70..c94e5c7ffd 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -1641,7 +1641,14 @@ void tst_QSslSocket::setReadBufferSize_task_250027()
setReadBufferSize_task_250027_handler.waitSomeMore(socket.data());
QByteArray secondRead = socket->readAll();
// second read should be some more data
- QVERIFY(secondRead.size() > 0);
+
+ int secondReadSize = secondRead.size();
+
+ if (secondReadSize <= 0) {
+ QEXPECT_FAIL("", "QTBUG-29730", Continue);
+ }
+
+ QVERIFY(secondReadSize > 0);
socket->close();
}
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 3bae5d5103..00973cf533 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -832,10 +832,19 @@ static void fuzzyCompareImages(const QImage &testImage, const QImage &referenceI
class UnclippedWidget : public QWidget
{
public:
+ bool painted;
+
+ UnclippedWidget()
+ : painted(false)
+ {
+ }
+
void paintEvent(QPaintEvent *)
{
QPainter p(this);
p.fillRect(rect().adjusted(-1000, -1000, 1000, 1000), Qt::black);
+
+ painted = true;
}
};
@@ -866,10 +875,8 @@ void tst_QGL::graphicsViewClipping()
scene.setSceneRect(view.viewport()->rect());
QVERIFY(QTest::qWaitForWindowExposed(&view));
- #ifdef Q_OS_MAC
- // The black rectangle jumps from the center to the upper left for some reason.
- QTest::qWait(100);
- #endif
+
+ QTRY_VERIFY(widget->painted);
QImage image = viewport->grabFrameBuffer();
QImage expected = image;
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 1d2a60506f..6c3591de6f 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -221,6 +221,9 @@ private slots:
void QTBUG_16967(); //clean close
void QTBUG_23895_data() { generic_data("QSQLITE"); }
void QTBUG_23895(); //sqlite boolean type
+ void QTBUG_14904_data() { generic_data("QSQLITE"); }
+ void QTBUG_14904();
+
void QTBUG_2192_data() { generic_data(); }
void QTBUG_2192();
@@ -3407,6 +3410,42 @@ void tst_QSqlQuery::QTBUG_23895()
QVERIFY(!q.next());
}
+/**
+ * Test for aliases with dots
+ */
+void tst_QSqlQuery::QTBUG_14904()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ QSqlQuery q(db);
+
+ QString tableName(qTableName("bug14904", __FILE__ ));
+ tst_Databases::safeDropTable( db, tableName );
+
+ q.prepare("create table " + tableName + "(val1 bool)");
+ QVERIFY_SQL(q, exec());
+ q.prepare("insert into " + tableName + "(val1) values(?);");
+ q.addBindValue(true);
+ QVERIFY_SQL(q, exec());
+
+ QString sql="select val1 AS value1 from " + tableName;
+ QVERIFY_SQL(q, exec(sql));
+ QVERIFY_SQL(q, next());
+
+ QCOMPARE(q.record().indexOf("value1"), 0);
+ QCOMPARE(q.record().field(0).type(), QVariant::Bool);
+ QCOMPARE(q.value(0).toBool(), true);
+
+ sql="select val1 AS 'value.one' from " + tableName;
+ QVERIFY_SQL(q, exec(sql));
+ QVERIFY_SQL(q, next());
+ QCOMPARE(q.record().indexOf("value.one"), 0); // was -1 before bug fix
+ QCOMPARE(q.record().field(0).type(), QVariant::Bool);
+ QCOMPARE(q.value(0).toBool(), true);
+}
+
void tst_QSqlQuery::QTBUG_2192()
{
QFETCH( QString, dbName );
@@ -3419,14 +3458,19 @@ void tst_QSqlQuery::QTBUG_2192()
QSqlQuery q(db);
QVERIFY_SQL(q, exec(QString("CREATE TABLE " + tableName + " (dt %1)").arg(tst_Databases::dateTimeTypeName(db))));
+ QDateTime dt = QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999));
QVERIFY_SQL(q, prepare("INSERT INTO " + tableName + " (dt) VALUES (?)"));
- q.bindValue(0, QVariant(QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999))));
+ q.bindValue(0, dt);
QVERIFY_SQL(q, exec());
- // Check if value was stored with at least second precision.
QVERIFY_SQL(q, exec("SELECT dt FROM " + tableName));
QVERIFY_SQL(q, next());
- QVERIFY(q.value(0).toDateTime().msecsTo(QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999))) < 1000 );
+
+ // Check if retrieved value preserves reported precision
+ int precision = qMax(0, q.record().field("dt").precision());
+ int diff = qAbs(q.value(0).toDateTime().msecsTo(dt));
+ int keep = qMin(1000, (int)qPow(10.0, precision));
+ QVERIFY(diff <= 1000 - keep);
}
}
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index f12899e368..aaadcef601 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -64,7 +64,7 @@
#define PD_CLASSINFO Q_CLASSINFO
-#if defined(Q_COMPILER_VARIADIC_MACROS)
+#if defined(Q_COMPILER_VARIADIC_MACROS) || defined (Q_MOC_RUN)
#define PD_VARARG(x, ...) x(__VA_ARGS__)
#if defined(Q_CC_GNU) || defined(Q_MOC_RUN)
@@ -104,7 +104,7 @@ public slots:
PD_TEST_IDENTIFIER_ARG(void, combined6()) {}
-#if defined(Q_COMPILER_VARIADIC_MACROS)
+#if defined(Q_COMPILER_VARIADIC_MACROS) || defined (Q_MOC_RUN)
PD_VARARG(void vararg1) {}
PD_VARARG(void vararg2, int) {}
PD_VARARG(void vararg3, int, int) {}
@@ -112,6 +112,13 @@ public slots:
PD_VARARGEXT(void vararg4) {}
PD_VARARGEXT(void vararg5, int) {}
PD_VARARGEXT(void vararg6, int, int) {}
+#else
+ void vararg1() {}
+ void vararg2(int) {}
+ void vararg3(int,int) {}
+ void vararg4() {}
+ void vararg5(int) {}
+ void vararg6(int,int) {}
#endif
#define OUTERFUNCTION(x) x
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 5fc46d195b..3cd2f1f936 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -2902,7 +2902,6 @@ void tst_Moc::parseDefines()
index = mo->indexOfSlot("combined6()");
QVERIFY(index != -1);
-#if defined(Q_COMPILER_VARIADIC_MACROS)
index = mo->indexOfSlot("vararg1()");
QVERIFY(index != -1);
index = mo->indexOfSlot("vararg2(int)");
@@ -2915,7 +2914,6 @@ void tst_Moc::parseDefines()
QVERIFY(index != -1);
index = mo->indexOfSlot("vararg6(int,int)");
QVERIFY(index != -1);
-#endif
index = mo->indexOfSlot("INNERFUNCTION(int)");
QVERIFY(index != -1);
diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
index cb403bac20..441277ef53 100644
--- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
+++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
@@ -103,6 +103,10 @@ void tst_QToolTip::task183679()
QFETCH(Qt::Key, key);
QFETCH(bool, visible);
+#ifdef Q_OS_MAC
+ QSKIP("This test fails in the CI system, QTBUG-30040");
+#endif
+
Widget_task183679 widget;
widget.show();
QApplication::setActiveWindow(&widget);
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 3d7cc14a5d..252d47f698 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -4240,8 +4240,11 @@ void tst_QWidget::isOpaque()
*/
void tst_QWidget::scroll()
{
+ const int w = qMin(500, qApp->desktop()->availableGeometry().width() / 2);
+ const int h = qMin(500, qApp->desktop()->availableGeometry().height() / 2);
+
UpdateWidget updateWidget;
- updateWidget.resize(500, 500);
+ updateWidget.resize(w, h);
updateWidget.reset();
updateWidget.show();
qApp->setActiveWindow(&updateWidget);
@@ -4252,8 +4255,8 @@ void tst_QWidget::scroll()
updateWidget.reset();
updateWidget.scroll(10, 10);
qApp->processEvents();
- QRegion dirty(QRect(0, 0, 500, 10));
- dirty += QRegion(QRect(0, 10, 10, 490));
+ QRegion dirty(QRect(0, 0, w, 10));
+ dirty += QRegion(QRect(0, 10, 10, h - 10));
QCOMPARE(updateWidget.paintedRegion, dirty);
}
@@ -4262,11 +4265,14 @@ void tst_QWidget::scroll()
updateWidget.update(0, 0, 10, 10);
updateWidget.scroll(0, 10);
qApp->processEvents();
- QRegion dirty(QRect(0, 0, 500, 10));
+ QRegion dirty(QRect(0, 0, w, 10));
dirty += QRegion(QRect(0, 10, 10, 10));
QCOMPARE(updateWidget.paintedRegion, dirty);
}
+ if (updateWidget.width() < 200 || updateWidget.height() < 200)
+ QSKIP("Skip this test due to too small screen geometry.");
+
{
updateWidget.reset();
updateWidget.update(0, 0, 100, 100);
diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
index beb1d27620..bbd71a9284 100644
--- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
+++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
@@ -153,7 +153,6 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint
QCOMPARE( s1->state(), QScroller::Inactive );
QScrollerProperties sp1 = QScroller::scroller(sw)->scrollerProperties();
- int fps = 60;
QTouchEvent::TouchPoint rawTouchPoint;
rawTouchPoint.setId(0);
@@ -192,8 +191,7 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint
QCOMPARE( sw->receivedPrepare, true );
- QTest::qWait(1000 / fps * 2); // wait until the first scroll move
- QCOMPARE( sw->receivedFirst, true );
+ QTRY_COMPARE( sw->receivedFirst, true );
QCOMPARE( sw->receivedScroll, true );
QCOMPARE( sw->receivedOvershoot, false );
@@ -407,7 +405,7 @@ void tst_QScroller::scroll()
QScroller *s1 = QScroller::scroller(sw);
kineticScroll(sw, QPointF(500, 500), QPoint(0, 0), QPoint(100, 100), QPoint(200, 200));
// now we should be scrolling
- QCOMPARE( s1->state(), QScroller::Scrolling );
+ QTRY_COMPARE( s1->state(), QScroller::Scrolling );
// wait until finished, check that no further first scroll is send
sw->receivedFirst = false;
diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
index 92b16ac155..6ab7cb4491 100644
--- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
@@ -735,7 +735,7 @@ void tst_QDockWidget::task169808_setFloating()
QSize sizeHint() const
{
const QRect& deskRect = qApp->desktop()->availableGeometry();
- return QSize(qMin(300, deskRect.width()), 300);
+ return QSize(qMin(300, deskRect.width() / 2), qMin(300, deskRect.height() / 2));
}
QSize minimumSizeHint() const