diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2019-02-20 12:37:31 +0200 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2019-02-20 12:37:31 +0200 |
commit | 33707f5b2fa45eea6c1163d98cf9d23015bacf02 (patch) | |
tree | 6e24046e64432bccf11d00177f425de1f4d2c9c7 | |
parent | 655e8623afed01de63ce43f55227fb019e800fe9 (diff) | |
parent | 2fc4635e9889ade1ae79b787cc18aae654e65e3b (diff) |
Merge 5.12 into 5.12.2
Change-Id: I3a5721aebd3afd8fa08d3f3df6bf61502fa9c347
122 files changed, 549 insertions, 559 deletions
@@ -7,4 +7,3 @@ or follow one of these links: Mac OS X: http://doc.qt.io/qt-%SHORTVERSION%/osx-building.html Windows: http://doc.qt.io/qt-%SHORTVERSION%/windows-building.html X11 Platforms: http://doc.qt.io/qt-%SHORTVERSION%/linux-building.html -Windows CE: http://doc.qt.io/qt-%SHORTVERSION%/install-wince.html diff --git a/examples/corelib/serialization/cbordump/cbordump.pro b/examples/corelib/serialization/cbordump/cbordump.pro index 7fb2ef69f0..8149cb1d4c 100644 --- a/examples/corelib/serialization/cbordump/cbordump.pro +++ b/examples/corelib/serialization/cbordump/cbordump.pro @@ -2,8 +2,7 @@ QT += core QT -= gui TARGET = cbordump -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline TEMPLATE = app diff --git a/examples/corelib/serialization/convert/convert.pro b/examples/corelib/serialization/convert/convert.pro index d9b1de41e3..4c6b0b557a 100644 --- a/examples/corelib/serialization/convert/convert.pro +++ b/examples/corelib/serialization/convert/convert.pro @@ -2,8 +2,7 @@ QT += core QT -= gui TARGET = convert -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline TEMPLATE = app diff --git a/examples/corelib/serialization/savegame/savegame.pro b/examples/corelib/serialization/savegame/savegame.pro index 15a38c32ef..69e6b216f2 100644 --- a/examples/corelib/serialization/savegame/savegame.pro +++ b/examples/corelib/serialization/savegame/savegame.pro @@ -2,8 +2,7 @@ QT += core QT -= gui TARGET = savegame -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline TEMPLATE = app diff --git a/examples/corelib/threads/semaphores/semaphores.pro b/examples/corelib/threads/semaphores/semaphores.pro index 69154e57eb..de909508c4 100644 --- a/examples/corelib/threads/semaphores/semaphores.pro +++ b/examples/corelib/threads/semaphores/semaphores.pro @@ -1,8 +1,7 @@ SOURCES += semaphores.cpp QT = core -CONFIG -= app_bundle -CONFIG += console +CONFIG += cmdline # install target.path = $$[QT_INSTALL_EXAMPLES]/corelib/threads/semaphores diff --git a/examples/corelib/threads/waitconditions/waitconditions.pro b/examples/corelib/threads/waitconditions/waitconditions.pro index 2dbe7df68a..19b56a246d 100644 --- a/examples/corelib/threads/waitconditions/waitconditions.pro +++ b/examples/corelib/threads/waitconditions/waitconditions.pro @@ -1,6 +1,6 @@ QT = core -CONFIG -= moc app_bundle -CONFIG += console +CONFIG -= moc +CONFIG += cmdline SOURCES += waitconditions.cpp diff --git a/examples/network/dnslookup/dnslookup.pro b/examples/network/dnslookup/dnslookup.pro index 0c6b512d3b..c72301420c 100644 --- a/examples/network/dnslookup/dnslookup.pro +++ b/examples/network/dnslookup/dnslookup.pro @@ -1,7 +1,6 @@ TEMPLATE = app QT = core network -mac:CONFIG -= app_bundle -win32:CONFIG += console +CONFIG += cmdline HEADERS += dnslookup.h SOURCES += dnslookup.cpp diff --git a/examples/network/download/download.pro b/examples/network/download/download.pro index 2c784c4197..63d80a0e7c 100644 --- a/examples/network/download/download.pro +++ b/examples/network/download/download.pro @@ -1,6 +1,5 @@ QT = core network -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/examples/network/downloadmanager/downloadmanager.pro b/examples/network/downloadmanager/downloadmanager.pro index 68972610fa..cd1a977e5d 100644 --- a/examples/network/downloadmanager/downloadmanager.pro +++ b/examples/network/downloadmanager/downloadmanager.pro @@ -1,6 +1,5 @@ QT = core network -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline HEADERS += downloadmanager.h textprogressbar.h SOURCES += downloadmanager.cpp main.cpp textprogressbar.cpp diff --git a/examples/qmake/precompile/precompile.pro b/examples/qmake/precompile/precompile.pro index 6a23d82c32..27564cd390 100644 --- a/examples/qmake/precompile/precompile.pro +++ b/examples/qmake/precompile/precompile.pro @@ -6,8 +6,7 @@ #! [0] TEMPLATE = app LANGUAGE = C++ -CONFIG += console precompile_header -CONFIG -= app_bundle +CONFIG += cmdline precompile_header QT += widgets # Use Precompiled headers (PCH) diff --git a/examples/qtconcurrent/map/map.pro b/examples/qtconcurrent/map/map.pro index 166f596909..7f267beb22 100644 --- a/examples/qtconcurrent/map/map.pro +++ b/examples/qtconcurrent/map/map.pro @@ -1,8 +1,7 @@ TEMPLATE = app TARGET = mapdemo QT += concurrent -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/examples/qtconcurrent/runfunction/runfunction.pro b/examples/qtconcurrent/runfunction/runfunction.pro index 5624c87df7..42c05551ba 100644 --- a/examples/qtconcurrent/runfunction/runfunction.pro +++ b/examples/qtconcurrent/runfunction/runfunction.pro @@ -1,6 +1,5 @@ QT += concurrent widgets -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/examples/qtconcurrent/wordcount/wordcount.pro b/examples/qtconcurrent/wordcount/wordcount.pro index 771efadc4a..18545b1a65 100644 --- a/examples/qtconcurrent/wordcount/wordcount.pro +++ b/examples/qtconcurrent/wordcount/wordcount.pro @@ -1,6 +1,5 @@ QT += concurrent widgets -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/examples/widgets/statemachine/factorial/factorial.pro b/examples/widgets/statemachine/factorial/factorial.pro index f200c738ba..bf285acf4d 100644 --- a/examples/widgets/statemachine/factorial/factorial.pro +++ b/examples/widgets/statemachine/factorial/factorial.pro @@ -1,6 +1,5 @@ QT = core -win32: CONFIG += console -mac:CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/examples/widgets/statemachine/pingpong/pingpong.pro b/examples/widgets/statemachine/pingpong/pingpong.pro index 7cc27a13f5..18dee0400d 100644 --- a/examples/widgets/statemachine/pingpong/pingpong.pro +++ b/examples/widgets/statemachine/pingpong/pingpong.pro @@ -1,6 +1,5 @@ QT = core -win32: CONFIG += console -mac:CONFIG -= app_bundle +CONFIG += cmdline SOURCES = main.cpp diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro index e106c69b52..8fea3b38dd 100644 --- a/examples/xml/htmlinfo/htmlinfo.pro +++ b/examples/xml/htmlinfo/htmlinfo.pro @@ -1,10 +1,9 @@ SOURCES += main.cpp QT -= gui -CONFIG -= app_bundle RESOURCES = resources.qrc -win32: CONFIG += console +CONFIG += cmdline # install target.path = $$[QT_INSTALL_EXAMPLES]/xml/htmlinfo diff --git a/examples/xml/xmlstreamlint/xmlstreamlint.pro b/examples/xml/xmlstreamlint/xmlstreamlint.pro index cf03c4817a..90a6387afe 100644 --- a/examples/xml/xmlstreamlint/xmlstreamlint.pro +++ b/examples/xml/xmlstreamlint/xmlstreamlint.pro @@ -1,5 +1,4 @@ -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline QT -= gui SOURCES += main.cpp diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf index e000d1026b..b77494ec9b 100644 --- a/mkspecs/common/mac.conf +++ b/mkspecs/common/mac.conf @@ -17,7 +17,7 @@ QMAKE_EXTENSION_SHLIB = dylib QMAKE_EXTENSIONS_AUX_SHLIB = tbd QMAKE_LIBDIR = -# The proper SDK sysroot will be automatically prepended +# sdk.prf will prefix the proper SDK sysroot QMAKE_INCDIR_OPENGL = \ /System/Library/Frameworks/OpenGL.framework/Headers \ /System/Library/Frameworks/AGL.framework/Headers/ diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf index de8ba56b7b..06af6abf13 100644 --- a/mkspecs/common/msvc-version.conf +++ b/mkspecs/common/msvc-version.conf @@ -113,4 +113,9 @@ greaterThan(QMAKE_MSC_VER, 1910) { COMPAT_MKSPEC = } +greaterThan(QMAKE_MSC_VER, 1919) { + # Visual Studio 2019 (16.0) / Visual C++ 19.20 and up + MSVC_VER = 16.0 +} + !isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC diff --git a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf index b72091373d..6ec7817efb 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf @@ -20,6 +20,10 @@ QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL} QMAKE_LIBS_EGL = -lEGL -lGLESv2 QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2 +QMAKE_INCDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/include +QMAKE_LIBDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/lib +QMAKE_LIBS_BCM_HOST = -lbcm_host + contains(DISTRO, squeeze) { #Debian Squeeze: Legacy everything QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 -lEGL diff --git a/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf index ffe8f5739a..3b49f19a5b 100644 --- a/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf @@ -16,6 +16,11 @@ QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL} QMAKE_LIBS_EGL = -lEGL -lGLESv2 QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2 + +QMAKE_INCDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/include +QMAKE_LIBDIR_BCM_HOST = $$[QT_SYSROOT]/opt/vc/lib +QMAKE_LIBS_BCM_HOST = -lbcm_host + QMAKE_CFLAGS += -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux QMAKE_CXXFLAGS = $$QMAKE_CFLAGS diff --git a/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf index 2bb70ffb5a..b215833486 100644 --- a/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf @@ -31,6 +31,10 @@ QMAKE_LIBS_OPENGL_ES2 = $${VC_LINK_LINE} -lGLESv2 # The official opt vc EGL references GLESv2 symbols: need to link it QMAKE_LIBS_EGL = $${VC_LINK_LINE} -lEGL -lGLESv2 +QMAKE_LIBDIR_BCM_HOST = $$VC_LIBRARY_PATH +QMAKE_INCDIR_BCM_HOST = $$VC_INCLUDE_PATH +QMAKE_LIBS_BCM_HOST = -lbcm_host + QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 QMAKE_CXXFLAGS = $$QMAKE_CFLAGS diff --git a/mkspecs/features/cmdline.prf b/mkspecs/features/cmdline.prf new file mode 100644 index 0000000000..f9d90d3a50 --- /dev/null +++ b/mkspecs/features/cmdline.prf @@ -0,0 +1,2 @@ +win32: CONFIG *= console +macos: CONFIG -= app_bundle diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf index 50a41657d8..8360dd8b38 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -33,6 +33,10 @@ QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path) QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath) QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion) +sysrootified = +for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val +QMAKE_INCDIR_OPENGL = $$sysrootified + QMAKESPEC_NAME = $$basename(QMAKESPEC) # Resolve SDK version of various tools diff --git a/mkspecs/features/qt_test_helper.prf b/mkspecs/features/qt_test_helper.prf index 5daa14731d..86b65dd884 100644 --- a/mkspecs/features/qt_test_helper.prf +++ b/mkspecs/features/qt_test_helper.prf @@ -16,8 +16,7 @@ # Additionally the helper's executable is suffixed with "_helper" to # avoid name clashes with its folder. -CONFIG -= app_bundle -CONFIG += console +CONFIG += cmdline debug_and_release { CONFIG(debug, debug|release) { diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h index 3c80cbdfad..b1887aae7f 100644 --- a/mkspecs/hurd-g++/qplatformdefs.h +++ b/mkspecs/hurd-g++/qplatformdefs.h @@ -59,6 +59,7 @@ // We are hot - unistd.h should have turned on the specific APIs we requested +#include <features.h> #include <pthread.h> #include <dirent.h> #include <fcntl.h> diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 3f13df884a..506e9deb19 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -13,7 +13,7 @@ QMKSRC = $(SOURCE_PATH)\qmake !if "$(QMAKESPEC)" == "win32-icc" CXX = icl LINKER = xilink -CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 +CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 /O3 !elseif "$(QMAKESPEC)" == "win32-clang-msvc" CXX = clang-cl LINKER = lld-link @@ -30,7 +30,7 @@ PCH_OBJECT = qmake_pch.obj !endif CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \ - -W2 -nologo -O1 \ + -W2 -nologo -O2 \ $(CFLAGS_EXTRA) \ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac \ -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index fb8bad32a2..84e3fb6df4 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -1060,8 +1060,12 @@ proper include paths, compiler flags and libraries will automatically be added to the project. \row \li console \li The target is a Win32 console application (app only). The - proper include paths, compiler flags and libraries will - automatically be added to the project. + proper include paths, compiler flags and libraries will automatically be + added to the project. Consider using the option \c{cmdline} for + cross-platform applications. + \row \li cmdline \li The target is a cross-platform command line application. + On Windows, this implies \c{CONFIG += console}. + On macOS, this implies \c{CONFIG -= app_bundle}. \row \li shared \li{1,2} The target is a shared object/DLL. The proper include paths, compiler flags and libraries will automatically be added to the project. Note that \c dll can also be used on all platforms; @@ -4887,8 +4891,7 @@ \code TEMPLATE = app LANGUAGE = C++ - CONFIG += console precompile_header - CONFIG -= app_bundle + CONFIG += cmdline precompile_header # Use Precompiled headers (PCH) PRECOMPILED_HEADER = stable.h diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 6a46df1af6..7762e47f41 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -81,8 +81,8 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const { - QString edir = escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir; - return "@" + makedir.arg(edir); + return "@" + makedir.arg( + escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir); } bool MakefileGenerator::mkdir(const QString &in_path) const diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 4cbe06d9dc..7f42fbe09e 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -506,17 +506,14 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) if (opt.startsWith("-Xarch")) opt = l.at(++lit); // The user has done the right thing and prefixed each part } - bool found = false; for(int x = 0; x < lflags[arch].size(); ++x) { if (lflags[arch].at(x) == "-framework" && lflags[arch].at(++x) == opt) { - found = true; + lflags[arch].remove(x - 1, 2); break; } } - if(!found) { - lflags[arch].append("-framework"); - lflags[arch].append(opt); - } + lflags[arch].append("-framework"); + lflags[arch].append(opt); } else { lflags[arch].append(opt); } diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 4f0cee65e1..7335211f30 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -55,7 +55,8 @@ static DotNET vsVersionFromString(const char *versionString) { "11.0", NET2012 }, { "12.0", NET2013 }, { "14.0", NET2015 }, - { "15.0", NET2017 } + { "15.0", NET2017 }, + { "16.0", NET2019 } }; DotNET result = NETUnknown; for (const auto entry : mapping) { diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 9d1a170489..41a6ffafa7 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -52,7 +52,8 @@ enum DotNET { NET2012 = 0xb0, NET2013 = 0xc0, NET2015 = 0xd0, - NET2017 = 0xe0 + NET2017 = 0xe0, + NET2019 }; DotNET vsVersionFromString(const ProString &versionString); diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 95c16661e7..713a55d16b 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -73,7 +73,9 @@ const char _slnHeader120[] = "Microsoft Visual Studio Solution File, Format const char _slnHeader140[] = "Microsoft Visual Studio Solution File, Format Version 12.00" "\n# Visual Studio 2015"; const char _slnHeader141[] = "Microsoft Visual Studio Solution File, Format Version 12.00" - "\n# Visual Studio 2017"; + "\n# Visual Studio 15"; +const char _slnHeader142[] = "Microsoft Visual Studio Solution File, Format Version 12.00" + "\n# Visual Studio Version 16"; // The following UUID _may_ change for later servicepacks... // If so we need to search through the registry at // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects @@ -301,6 +303,8 @@ QString VcprojGenerator::retrievePlatformToolSet() const return QStringLiteral("v140"); case NET2017: return QStringLiteral("v141"); + case NET2019: + return QStringLiteral("v142"); default: return QString(); } @@ -527,6 +531,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } switch (vcProject.Configuration.CompilerVersion) { + case NET2019: + t << _slnHeader142; + break; case NET2017: t << _slnHeader141; break; @@ -874,6 +881,9 @@ void VcprojGenerator::initProject() // Own elements ----------------------------- vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString(); switch (vcProject.Configuration.CompilerVersion) { + case NET2019: + vcProject.Version = "16.00"; + break; case NET2017: vcProject.Version = "15.00"; break; @@ -1541,14 +1551,14 @@ void VcprojGenerator::initExtraCompilerOutputs() extraCompile.Filter = ""; extraCompile.Guid = QString(_GUIDExtraCompilerFiles) + "-" + (*it); - // If the extra compiler has a variable_out set the output file - // is added to an other file list, and does not need its own.. bool addOnInput = hasBuiltinCompiler(firstExpandedOutputFileName(*it)); - const ProString &tmp_other_out = project->first(ProKey(*it + ".variable_out")); - if (!tmp_other_out.isEmpty() && !addOnInput) - continue; - if (!addOnInput) { + // If the extra compiler has a variable_out set that is already handled + // some other place, ignore it. + const ProString &outputVar = project->first(ProKey(*it + ".variable_out")); + if (!outputVar.isEmpty() && otherFilters.contains(outputVar)) + continue; + QString tmp_out = project->first(ProKey(*it + ".output")).toQString(); if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) { // Combined output, only one file result diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index 2b2c6d0078..3e49a99cd5 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -77,7 +77,12 @@ bool IoUtils::isRelativePath(const QString &path) && (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) { return false; } - // (... unless, of course, they're UNC, which qmake fails on anyway) + // ... unless, of course, they're UNC: + if (path.length() >= 2 + && (path.at(0).unicode() == '\\' || path.at(0).unicode() == '/') + && path.at(1) == path.at(0)) { + return false; + } #else if (path.startsWith(QLatin1Char('/'))) return false; diff --git a/qmake/qmake.pro b/qmake/qmake.pro index ebd61751b7..5399e8c298 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -3,8 +3,8 @@ # and the configures. option(host_build) -CONFIG += console -CONFIG -= qt app_bundle +CONFIG += cmdline +CONFIG -= qt DEFINES += \ PROEVALUATOR_FULL \ diff --git a/src/3rdparty/freetype/src/sfnt/pngshim.c b/src/3rdparty/freetype/src/sfnt/pngshim.c index 16020266af..cd110776c8 100644 --- a/src/3rdparty/freetype/src/sfnt/pngshim.c +++ b/src/3rdparty/freetype/src/sfnt/pngshim.c @@ -68,6 +68,7 @@ ( ( __clang_major__ >= 4 ) || \ ( ( __clang_major__ == 3 ) && ( __clang_minor__ >= 2 ) ) ) ) ) && \ defined( __OPTIMIZE__ ) && \ + !defined( __EMSCRIPTEN__ ) && \ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #ifdef __clang__ diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 02033859e9..4b87c25787 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -606,11 +606,14 @@ public class QtActivityDelegate } QtNative.loadQtLibraries(loaderParams.getStringArrayList(NATIVE_LIBRARIES_KEY)); ArrayList<String> libraries = loaderParams.getStringArrayList(BUNDLED_LIBRARIES_KEY); - QtNative.loadBundledLibraries(libraries, QtNativeLibrariesDir.nativeLibrariesDir(m_activity)); + String nativeLibsDir = QtNativeLibrariesDir.nativeLibrariesDir(m_activity); + QtNative.loadBundledLibraries(libraries, nativeLibsDir); m_mainLib = loaderParams.getString(MAIN_LIBRARY_KEY); // older apps provide the main library as the last bundled library; look for this if the main library isn't provided - if (null == m_mainLib && libraries.size() > 0) + if (null == m_mainLib && libraries.size() > 0) { m_mainLib = libraries.get(libraries.size() - 1); + libraries.remove(libraries.size() - 1); + } if (loaderParams.containsKey(EXTRACT_STYLE_KEY)) { String path = loaderParams.getString(EXTRACT_STYLE_KEY); @@ -664,8 +667,8 @@ public class QtActivityDelegate } catch (Exception e) { e.printStackTrace(); } - - return true; + m_mainLib = QtNative.loadMainLibrary(m_mainLib, nativeLibsDir); + return m_mainLib != null; } public boolean startApplication() @@ -728,11 +731,7 @@ public class QtActivityDelegate @Override public void run() { try { - String nativeLibraryDir = QtNativeLibrariesDir.nativeLibrariesDir(m_activity); - QtNative.startApplication(m_applicationParameters, - m_environmentVariables, - m_mainLib, - nativeLibraryDir); + QtNative.startApplication(m_applicationParameters, m_environmentVariables, m_mainLib); m_started = true; } catch (Exception e) { e.printStackTrace(); diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 5562c010aa..1d2b70ab5f 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -231,6 +231,41 @@ public class QtNative }); } + public static String loadMainLibrary(final String mainLibrary, final String nativeLibraryDir) + { + final String[] res = new String[1]; + res[0] = null; + m_qtThread.run(new Runnable() { + @Override + public void run() { + try { + String mainLibNameTemplate = "lib" + mainLibrary + ".so"; + File f = new File(nativeLibraryDir + mainLibNameTemplate); + if (!f.exists()) { + try { + ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), + PackageManager.GET_META_DATA); + String systemLibraryDir = QtNativeLibrariesDir.systemLibrariesDir; + if (info.metaData.containsKey("android.app.system_libs_prefix")) + systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix"); + f = new File(systemLibraryDir + mainLibNameTemplate); + } catch (Exception e) { + e.printStackTrace(); + return; + } + } + if (!f.exists()) + return; + System.load(f.getAbsolutePath()); + res[0] = f.getAbsolutePath(); + } catch (Exception e) { + Log.e(QtTAG, "Can't load '" + mainLibrary + "'", e); + } + } + }); + return res[0]; + } + public static void setActivity(Activity qtMainActivity, QtActivityDelegate qtActivityDelegate) { synchronized (m_mainActivityMutex) { @@ -308,46 +343,20 @@ public class QtNative }); } - public static boolean startApplication(String params, - final String environment, - String mainLibrary, - String nativeLibraryDir) throws Exception + public static boolean startApplication(String params, final String environment, String mainLib) throws Exception { - String mainLibNameTemplate = "lib" + mainLibrary + ".so"; - File f = new File(nativeLibraryDir + mainLibNameTemplate); - if (!f.exists()) { - try { - ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), - PackageManager.GET_META_DATA); - String systemLibraryDir = QtNativeLibrariesDir.systemLibrariesDir; - if (info.metaData.containsKey("android.app.system_libs_prefix")) - systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix"); - f = new File(systemLibraryDir + mainLibNameTemplate); - } catch (Exception e) { - - } - } - if (!f.exists()) - throw new Exception("Can't find main library '" + mainLibrary + "'"); - if (params == null) params = "-platform\tandroid"; - final String mainLibraryPath = f.getAbsolutePath(); final boolean[] res = new boolean[1]; res[0] = false; synchronized (m_mainActivityMutex) { if (params.length() > 0 && !params.startsWith("\t")) params = "\t" + params; - final String qtParams = f.getAbsolutePath() + params; + final String qtParams = mainLib + params; m_qtThread.run(new Runnable() { @Override public void run() { - try { - System.load(mainLibraryPath); - } catch (Exception e) { - Log.i(QtTAG, "Can't load '" + mainLibraryPath + "'", e); - } res[0] = startQtAndroidPlugin(qtParams, environment); setDisplayMetrics(m_displayMetricsScreenWidthPixels, m_displayMetricsScreenHeightPixels, diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java index ae06fa6268..33bcb364de 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java @@ -98,8 +98,8 @@ public class QtServiceDelegate private static final String APP_DISPLAY_METRIC_SCREEN_YDPI_KEY = "display.screen.dpi.y"; private static final String APP_DISPLAY_METRIC_SCREEN_DENSITY_KEY = "display.screen.density"; + private String m_mainLib = null; private Service m_service = null; - private String m_mainLib; private static String m_environmentVariables = null; private static String m_applicationParameters = null; @@ -142,9 +142,9 @@ public class QtServiceDelegate } QtNative.loadQtLibraries(loaderParams.getStringArrayList(NATIVE_LIBRARIES_KEY)); ArrayList<String> libraries = loaderParams.getStringArrayList(BUNDLED_LIBRARIES_KEY); - QtNative.loadBundledLibraries(libraries, QtNativeLibrariesDir.nativeLibrariesDir(m_service)); + String nativeLibsDir = QtNativeLibrariesDir.nativeLibrariesDir(m_service); + QtNative.loadBundledLibraries(libraries, nativeLibsDir); m_mainLib = loaderParams.getString(MAIN_LIBRARY_KEY); - m_environmentVariables = loaderParams.getString(ENVIRONMENT_VARIABLES_KEY); String additionalEnvironmentVariables = "QT_ANDROID_FONTS_MONOSPACE=Droid Sans Mono;Droid Sans;Droid Sans Fallback" + "\tQT_ANDROID_FONTS_SERIF=Droid Serif" @@ -165,7 +165,8 @@ public class QtServiceDelegate else m_applicationParameters = ""; - return true; + m_mainLib = QtNative.loadMainLibrary(m_mainLib, nativeLibsDir); + return m_mainLib != null; } public boolean startApplication() @@ -173,10 +174,7 @@ public class QtServiceDelegate // start application try { String nativeLibraryDir = QtNativeLibrariesDir.nativeLibrariesDir(m_service); - QtNative.startApplication(m_applicationParameters, - m_environmentVariables, - m_mainLib, - nativeLibraryDir); + QtNative.startApplication(m_applicationParameters, m_environmentVariables, m_mainLib); return true; } catch (Exception e) { e.printStackTrace(); diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index 140c60a080..4550891e2a 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -48,6 +48,11 @@ #include <UIKit/UIKit.h> #endif +#include <execinfo.h> +#include <dlfcn.h> +#include <cxxabi.h> +#include <objc/runtime.h> + #include <qdebug.h> QT_BEGIN_NAMESPACE @@ -127,22 +132,54 @@ QT_USE_NAMESPACE } @end QT_NAMESPACE_ALIAS_OBJC_CLASS(QMacAutoReleasePoolTracker); -QT_BEGIN_NAMESPACE - -/* - Manages a scoped auto-release pool. - - To track autoreleases without any pools in place, such as in main() - before the runloop has started, export OBJC_DEBUG_MISSING_POOLS=YES - and break in objc_autoreleaseNoPool, e.g.: +QT_BEGIN_NAMESPACE - br set -n objc_autoreleaseNoPool -c "[((NSObject*)$r14) class] == [QNSWindow class]" -*/ QMacAutoReleasePool::QMacAutoReleasePool() : pool([[NSAutoreleasePool alloc] init]) { - [[[QMacAutoReleasePoolTracker alloc] initWithPool: + Class trackerClass = [QMacAutoReleasePoolTracker class]; + +#ifdef QT_DEBUG + void *poolFrame = nullptr; + if (__builtin_available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)) { + void *frame; + if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1)) + poolFrame = frame; + } else { + static const int maxFrames = 3; + void *callstack[maxFrames]; + if (backtrace(callstack, maxFrames) == maxFrames) + poolFrame = callstack[maxFrames - 1]; + } + + if (poolFrame) { + Dl_info info; + if (dladdr(poolFrame, &info) && info.dli_sname) { + const char *symbolName = info.dli_sname; + if (symbolName[0] == '_') { + int status; + if (char *demangled = abi::__cxa_demangle(info.dli_sname, nullptr, 0, &status)) + symbolName = demangled; + } + + char *className = nullptr; + asprintf(&className, " ^-- allocated in function: %s", symbolName); + + if (Class existingClass = objc_getClass(className)) + trackerClass = existingClass; + else + trackerClass = objc_duplicateClass(trackerClass, className, 0); + + free(className); + + if (symbolName != info.dli_sname) + free((char*)symbolName); + } + } +#endif + + [[[trackerClass alloc] initWithPool: reinterpret_cast<NSAutoreleasePool **>(&pool)] autorelease]; } diff --git a/src/gui/configure.json b/src/gui/configure.json index 70d0817791..44140bc7b6 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -59,8 +59,9 @@ }, "bcm_host": { "export": "", + "headers": ["bcm_host.h"], "sources": [ - "-lbcm_host" + { "type": "makeSpec", "spec": "BCM_HOST" } ] }, "dxguid": { diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 0dfb52e7c3..d935deb4d6 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -62,7 +62,7 @@ public: } QWindow *window; - QPlatformBackingStore *platformBackingStore; + QPlatformBackingStore *platformBackingStore = nullptr; QScopedPointer<QImage> highDpiBackingstore; QRegion staticContents; QSize size; @@ -95,8 +95,6 @@ public: QBackingStore::QBackingStore(QWindow *window) : d_ptr(new QBackingStorePrivate(window)) { - d_ptr->platformBackingStore = QGuiApplicationPrivate::platformIntegration()->createPlatformBackingStore(window); - d_ptr->platformBackingStore->setBackingStore(this); } /*! @@ -131,7 +129,8 @@ void QBackingStore::beginPaint(const QRegion ®ion) d_ptr->highDpiBackingstore->devicePixelRatio() != d_ptr->window->devicePixelRatio()) resize(size()); - d_ptr->platformBackingStore->beginPaint(QHighDpi::toNativeLocalRegion(region, d_ptr->window)); + QPlatformBackingStore *platformBackingStore = handle(); + platformBackingStore->beginPaint(QHighDpi::toNativeLocalRegion(region, d_ptr->window)); // When QtGui is applying a high-dpi scale factor the backing store // creates a "large" backing store image. This image needs to be @@ -139,7 +138,7 @@ void QBackingStore::beginPaint(const QRegion ®ion) // devicePixelRatio. Do this on a separate image instance that shares // the image data to avoid having the new devicePixelRatio be propagated // back to the platform plugin. - QPaintDevice *device = d_ptr->platformBackingStore->paintDevice(); + QPaintDevice *device = platformBackingStore->paintDevice(); if (QHighDpiScaling::isActive() && device->devType() == QInternal::Image) { QImage *source = static_cast<QImage *>(device); const bool needsNewImage = d_ptr->highDpiBackingstore.isNull() @@ -168,7 +167,7 @@ void QBackingStore::beginPaint(const QRegion ®ion) */ QPaintDevice *QBackingStore::paintDevice() { - QPaintDevice *device = d_ptr->platformBackingStore->paintDevice(); + QPaintDevice *device = handle()->paintDevice(); if (QHighDpiScaling::isActive() && device->devType() == QInternal::Image) return d_ptr->highDpiBackingstore.data(); @@ -189,7 +188,7 @@ void QBackingStore::endPaint() if (paintDevice()->paintingActive()) qWarning() << "QBackingStore::endPaint() called with active painter on backingstore paint device"; - d_ptr->platformBackingStore->endPaint(); + handle()->endPaint(); } static bool isRasterSurface(QWindow *window) @@ -247,7 +246,7 @@ void QBackingStore::flush(const QRegion ®ion, QWindow *window, const QPoint & Q_ASSERT(window == topLevelWindow || topLevelWindow->isAncestorOf(window, QWindow::ExcludeTransients)); - d_ptr->platformBackingStore->flush(window, QHighDpi::toNativeLocalRegion(region, window), + handle()->flush(window, QHighDpi::toNativeLocalRegion(region, window), QHighDpi::toNativeLocalPosition(offset, window)); } @@ -259,7 +258,7 @@ void QBackingStore::flush(const QRegion ®ion, QWindow *window, const QPoint & void QBackingStore::resize(const QSize &size) { d_ptr->size = size; - d_ptr->platformBackingStore->resize(QHighDpi::toNativePixels(size, d_ptr->window), d_ptr->staticContents); + handle()->resize(QHighDpi::toNativePixels(size, d_ptr->window), d_ptr->staticContents); } /*! @@ -286,7 +285,7 @@ bool QBackingStore::scroll(const QRegion &area, int dx, int dy) if (qFloor(nativeDx) != nativeDx || qFloor(nativeDy) != nativeDy) return false; - return d_ptr->platformBackingStore->scroll(QHighDpi::toNativeLocalRegion(area, d_ptr->window), + return handle()->scroll(QHighDpi::toNativeLocalRegion(area, d_ptr->window), nativeDx, nativeDy); } @@ -367,6 +366,10 @@ void Q_GUI_EXPORT qt_scrollRectInImage(QImage &img, const QRect &rect, const QPo */ QPlatformBackingStore *QBackingStore::handle() const { + if (!d_ptr->platformBackingStore) { + d_ptr->platformBackingStore = QGuiApplicationPrivate::platformIntegration()->createPlatformBackingStore(d_ptr->window); + d_ptr->platformBackingStore->setBackingStore(const_cast<QBackingStore*>(this)); + } return d_ptr->platformBackingStore; } diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp index e7eaa54a45..6b3604afb5 100644 --- a/src/gui/text/qtextdocumentfragment.cpp +++ b/src/gui/text/qtextdocumentfragment.cpp @@ -1139,7 +1139,8 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode() // #################### // block.setFloatPosition(node->cssFloat); - if (wsm == QTextHtmlParserNode::WhiteSpacePre) { + if (wsm == QTextHtmlParserNode::WhiteSpacePre + || wsm == QTextHtmlParserNode::WhiteSpaceNoWrap) { block.setNonBreakableLines(true); modifiedBlockFormat = true; } diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index 40ac46df85..bd4338feb8 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -1429,8 +1429,8 @@ QT_WARNING_POP reinterpret_cast<const OS2Table *>(fontData.constData() + qFromBigEndian<quint32>(os2TableEntry->offset)); - bool italic = qFromBigEndian<quint16>(os2Table->selection) & 1; - bool oblique = qFromBigEndian<quint16>(os2Table->selection) & 128; + bool italic = qFromBigEndian<quint16>(os2Table->selection) & (1 << 0); + bool oblique = qFromBigEndian<quint16>(os2Table->selection) & (1 << 9); if (italic) fontEngine->fontDef.style = QFont::StyleItalic; diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp index f68ea54dcf..db2186644b 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp @@ -115,30 +115,33 @@ static FontKeys &fontKeys() { static FontKeys result; if (result.isEmpty()) { - const QSettings fontRegistry(QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"), - QSettings::NativeFormat); - const QStringList allKeys = fontRegistry.allKeys(); - const QString trueType = QStringLiteral("(TrueType)"); + const QStringList keys = { QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"), + QStringLiteral("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts") }; + for (const auto key : keys) { + const QSettings fontRegistry(key, QSettings::NativeFormat); + const QStringList allKeys = fontRegistry.allKeys(); + const QString trueType = QStringLiteral("(TrueType)"); #if QT_CONFIG(regularexpression) - const QRegularExpression sizeListMatch(QStringLiteral("\\s(\\d+,)+\\d+")); + const QRegularExpression sizeListMatch(QStringLiteral("\\s(\\d+,)+\\d+")); #else - const QRegExp sizeListMatch(QLatin1String("\\s(\\d+,)+\\d+")); + const QRegExp sizeListMatch(QLatin1String("\\s(\\d+,)+\\d+")); #endif - Q_ASSERT(sizeListMatch.isValid()); - const int size = allKeys.size(); - result.reserve(size); - for (int i = 0; i < size; ++i) { - FontKey fontKey; - const QString ®istryFontKey = allKeys.at(i); - fontKey.fileName = fontRegistry.value(registryFontKey).toString(); - QString realKey = registryFontKey; - realKey.remove(trueType); - realKey.remove(sizeListMatch); - const auto fontNames = QStringRef(&realKey).trimmed().split(QLatin1Char('&')); - fontKey.fontNames.reserve(fontNames.size()); - for (const QStringRef &fontName : fontNames) - fontKey.fontNames.append(fontName.trimmed().toString()); - result.append(fontKey); + Q_ASSERT(sizeListMatch.isValid()); + const int size = allKeys.size(); + result.reserve(result.size() + size); + for (int i = 0; i < size; ++i) { + FontKey fontKey; + const QString ®istryFontKey = allKeys.at(i); + fontKey.fileName = fontRegistry.value(registryFontKey).toString(); + QString realKey = registryFontKey; + realKey.remove(trueType); + realKey.remove(sizeListMatch); + const auto fontNames = QStringRef(&realKey).trimmed().split(QLatin1Char('&')); + fontKey.fontNames.reserve(fontNames.size()); + for (const QStringRef &fontName : fontNames) + fontKey.fontNames.append(fontName.trimmed().toString()); + result.append(fontKey); + } } } return result; diff --git a/src/plugins/platforms/android/qandroidsystemlocale.cpp b/src/plugins/platforms/android/qandroidsystemlocale.cpp index 7fe36aa9bc..f9d566ff1a 100644 --- a/src/plugins/platforms/android/qandroidsystemlocale.cpp +++ b/src/plugins/platforms/android/qandroidsystemlocale.cpp @@ -40,6 +40,7 @@ #include "qandroidsystemlocale.h" #include "androidjnimain.h" #include <QtCore/private/qjni_p.h> +#include <QtCore/private/qjnihelpers_p.h> #include "qdatetime.h" #include "qstringlist.h" #include "qvariant.h" @@ -162,6 +163,23 @@ QVariant QAndroidSystemLocale::query(QueryType type, QVariant in) const return m_locale.createSeparatedList(in.value<QStringList>()); case LocaleChanged: Q_ASSERT_X(false, Q_FUNC_INFO, "This can't happen."); + case UILanguages: { + if (QtAndroidPrivate::androidSdkVersion() >= 24) { + QJNIObjectPrivate localeListObject = + QJNIObjectPrivate::callStaticObjectMethod("android/os/LocaleList", "getDefault", + "()Landroid/os/LocaleList;"); + if (localeListObject.isValid()) { + QString lang = localeListObject.callObjectMethod("toLanguageTags", + "()Ljava/lang/String;").toString(); + // Some devices return with it enclosed in []'s so check if both exists before + // removing to ensure it is formatted correctly + if (lang.startsWith(QChar('[')) && lang.endsWith(QChar(']'))) + lang = lang.mid(1, lang.length() - 2); + return lang.split(QChar(',')); + } + } + return QVariant(); + } default: break; } diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index 44ab16d300..e255719cc1 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -94,7 +94,6 @@ QT_USE_NAMESPACE bool startedQuit; NSObject <NSApplicationDelegate> *reflectionDelegate; bool inLaunch; - QWindowList hiddenWindows; } + (instancetype)sharedDelegate @@ -311,41 +310,6 @@ QT_USE_NAMESPACE return NO; // Someday qApp->quitOnLastWindowClosed(); when QApp and NSApp work closer together. } -- (void)applicationWillHide:(NSNotification *)notification -{ - if (reflectionDelegate - && [reflectionDelegate respondsToSelector:@selector(applicationWillHide:)]) { - [reflectionDelegate applicationWillHide:notification]; - } - - // When the application is hidden Qt will hide the popup windows associated with - // it when it has lost the activation for the application. However, when it gets - // to this point it believes the popup windows to be hidden already due to the - // fact that the application itself is hidden, which will cause a problem when - // the application is made visible again. - const QWindowList topLevelWindows = QGuiApplication::topLevelWindows(); - for (QWindow *topLevelWindow : topLevelWindows) { - if ((topLevelWindow->type() & Qt::Popup) == Qt::Popup && topLevelWindow->isVisible()) { - topLevelWindow->hide(); - - if ((topLevelWindow->type() & Qt::Tool) == Qt::Tool) - hiddenWindows << topLevelWindow; - } - } -} - -- (void)applicationDidUnhide:(NSNotification *)notification -{ - if (reflectionDelegate - && [reflectionDelegate respondsToSelector:@selector(applicationDidUnhide:)]) - [reflectionDelegate applicationDidUnhide:notification]; - - for (QWindow *window : qAsConst(hiddenWindows)) - window->show(); - - hiddenWindows.clear(); -} - - (void)applicationDidBecomeActive:(NSNotification *)notification { if (reflectionDelegate @@ -353,21 +317,6 @@ QT_USE_NAMESPACE [reflectionDelegate applicationDidBecomeActive:notification]; QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive); -/* - onApplicationChangedActivation(true); - - if (!QWidget::mouseGrabber()){ - // Update enter/leave immidiatly, don't wait for a move event. But only - // if no grab exists (even if the grab points to this widget, it seems, ref X11) - QPoint qlocal, qglobal; - QWidget *widgetUnderMouse = 0; - qt_mac_getTargetForMouseEvent(0, QEvent::Enter, qlocal, qglobal, 0, &widgetUnderMouse); - QApplicationPrivate::dispatchEnterLeave(widgetUnderMouse, 0); - qt_last_mouse_receiver = widgetUnderMouse; - qt_last_native_mouse_receiver = widgetUnderMouse ? - (widgetUnderMouse->internalWinId() ? widgetUnderMouse : widgetUnderMouse->nativeParentWidget()) : 0; - } -*/ } - (void)applicationDidResignActive:(NSNotification *)notification @@ -377,15 +326,6 @@ QT_USE_NAMESPACE [reflectionDelegate applicationDidResignActive:notification]; QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive); -/* - onApplicationChangedActivation(false); - - if (!QWidget::mouseGrabber()) - QApplicationPrivate::dispatchEnterLeave(0, qt_last_mouse_receiver); - qt_last_mouse_receiver = 0; - qt_last_native_mouse_receiver = 0; - qt_button_down = 0; -*/ } - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h index ebf33cf4e2..9771cd0289 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h @@ -168,10 +168,10 @@ public: uint processEventsCalled; NSModalSession currentModalSessionCached; NSModalSession currentModalSession(); - void updateChildrenWorksWhenModal(); void temporarilyStopAllModalSessions(); void beginModalSession(QWindow *widget); void endModalSession(QWindow *widget); + bool hasModalSession() const; void cleanupModalSessions(); void cancelWaitForMoreEvents(); diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index b0f2b6d940..84ffadea83 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -672,43 +672,9 @@ NSModalSession QCocoaEventDispatcherPrivate::currentModalSession() return currentModalSessionCached; } -static void setChildrenWorksWhenModal(QWindow *window, bool worksWhenModal) +bool QCocoaEventDispatcherPrivate::hasModalSession() const { - Q_UNUSED(window) - Q_UNUSED(worksWhenModal) - - // For NSPanels (but not NSWindows, sadly), we can set the flag - // worksWhenModal, so that they are active even when they are not modal. -/* - ### not ported - QList<QDialog *> dialogs = window->findChildren<QDialog *>(); - for (int i=0; i<dialogs.size(); ++i){ - NSWindow *window = qt_mac_window_for(dialogs[i]); - if (window && [window isKindOfClass:[NSPanel class]]) { - [static_cast<NSPanel *>(window) setWorksWhenModal:worksWhenModal]; - if (worksWhenModal && [window isVisible]){ - [window orderFront:window]; - } - } - } -*/ -} - -void QCocoaEventDispatcherPrivate::updateChildrenWorksWhenModal() -{ - // Make the dialog children of the window - // active. And make the dialog children of - // the previous modal dialog unactive again: - QMacAutoReleasePool pool; - int size = cocoaModalSessionStack.size(); - if (size > 0){ - if (QWindow *prevModal = cocoaModalSessionStack[size-1].window) - setChildrenWorksWhenModal(prevModal, true); - if (size > 1){ - if (QWindow *prevModal = cocoaModalSessionStack[size-2].window) - setChildrenWorksWhenModal(prevModal, false); - } - } + return !cocoaModalSessionStack.isEmpty(); } void QCocoaEventDispatcherPrivate::cleanupModalSessions() @@ -743,7 +709,6 @@ void QCocoaEventDispatcherPrivate::cleanupModalSessions() cocoaModalSessionStack.remove(i); } - updateChildrenWorksWhenModal(); cleanupModalSessionsNeeded = false; } @@ -764,7 +729,6 @@ void QCocoaEventDispatcherPrivate::beginModalSession(QWindow *window) // stopped in cleanupModalSessions()). QCocoaModalSessionInfo info = {window, nullptr, nullptr}; cocoaModalSessionStack.push(info); - updateChildrenWorksWhenModal(); currentModalSessionCached = nullptr; } diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm index 830a387fd1..6a5b0e6e3e 100644 --- a/src/plugins/platforms/cocoa/qcocoascreen.mm +++ b/src/plugins/platforms/cocoa/qcocoascreen.mm @@ -410,8 +410,7 @@ QWindow *QCocoaScreen::topLevelAt(const QPoint &point) const if (![nsWindow conformsToProtocol:@protocol(QNSWindowProtocol)]) continue; - id<QNSWindowProtocol> proto = static_cast<id<QNSWindowProtocol> >(nsWindow); - QCocoaWindow *cocoaWindow = proto.platformWindow; + QCocoaWindow *cocoaWindow = qnsview_cast(nsWindow.contentView).platformWindow; if (!cocoaWindow) continue; window = cocoaWindow->window(); diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 0a913ef66e..fef72bc496 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -253,7 +253,6 @@ public: // for QNSView bool m_needsInvalidateShadow; - bool m_hasModalSession; bool m_frameStrutEventsEnabled; QRect m_exposedRect; int m_registerTouchCount; diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index ebdd51acb4..50adbad518 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -153,7 +153,6 @@ QCocoaWindow::QCocoaWindow(QWindow *win, WId nativeHandle) , m_inSetStyleMask(false) , m_menubar(nullptr) , m_needsInvalidateShadow(false) - , m_hasModalSession(false) , m_frameStrutEventsEnabled(false) , m_registerTouchCount(0) , m_resizableTransientParent(false) @@ -303,13 +302,17 @@ void QCocoaWindow::setVisible(bool visible) { qCDebug(lcQpaWindow) << "QCocoaWindow::setVisible" << window() << visible; - m_inSetVisible = true; + QScopedValueRollback<bool> rollback(m_inSetVisible, true); QMacAutoReleasePool pool; QCocoaWindow *parentCocoaWindow = nullptr; if (window()->transientParent()) parentCocoaWindow = static_cast<QCocoaWindow *>(window()->transientParent()->handle()); + auto eventDispatcher = [] { + return static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(qApp->eventDispatcher())); + }; + if (visible) { // We need to recreate if the modality has changed as the style mask will need updating recreateWindowIfNeeded(); @@ -350,68 +353,46 @@ void QCocoaWindow::setVisible(bool visible) applyWindowState(window()->windowStates()); if (window()->windowState() != Qt::WindowMinimized) { - if ((window()->modality() == Qt::WindowModal - || window()->type() == Qt::Sheet) - && parentCocoaWindow) { - // show the window as a sheet + if (parentCocoaWindow && (window()->modality() == Qt::WindowModal || window()->type() == Qt::Sheet)) { + // Show the window as a sheet [parentCocoaWindow->nativeWindow() beginSheet:m_view.window completionHandler:nil]; - } else if (window()->modality() != Qt::NonModal) { - // show the window as application modal - QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher()); - Q_ASSERT(cocoaEventDispatcher); - QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(cocoaEventDispatcher)); - cocoaEventDispatcherPrivate->beginModalSession(window()); - m_hasModalSession = true; - } else if ([m_view.window canBecomeKeyWindow]) { - QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher()); - QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = nullptr; - if (cocoaEventDispatcher) - cocoaEventDispatcherPrivate = static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(cocoaEventDispatcher)); - - if (cocoaEventDispatcherPrivate && cocoaEventDispatcherPrivate->cocoaModalSessionStack.isEmpty()) - [m_view.window makeKeyAndOrderFront:nil]; - else - [m_view.window orderFront:nil]; + } else if (window()->modality() == Qt::ApplicationModal) { + // Show the window as application modal + eventDispatcher()->beginModalSession(window()); + } else if (m_view.window.canBecomeKeyWindow && !eventDispatcher()->hasModalSession()) { + [m_view.window makeKeyAndOrderFront:nil]; } else { [m_view.window orderFront:nil]; } - // We want the events to properly reach the popup, dialog, and tool - if ((window()->type() == Qt::Popup || window()->type() == Qt::Dialog || window()->type() == Qt::Tool) - && [m_view.window isKindOfClass:[NSPanel class]]) { - ((NSPanel *)m_view.window).worksWhenModal = YES; - if (!(parentCocoaWindow && window()->transientParent()->isActive()) && window()->type() == Qt::Popup) { - removeMonitor(); - NSEventMask eventMask = NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown - | NSEventMaskOtherMouseDown | NSEventMaskMouseMoved; - monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:eventMask handler:^(NSEvent *e) { - const auto button = cocoaButton2QtButton(e); - const auto buttons = currentlyPressedMouseButtons(); - const auto eventType = cocoaEvent2QtMouseEvent(e); - const auto globalPoint = QCocoaScreen::mapFromNative(NSEvent.mouseLocation); - const auto localPoint = window()->mapFromGlobal(globalPoint.toPoint()); - QWindowSystemInterface::handleMouseEvent(window(), localPoint, globalPoint, buttons, button, eventType); - }]; - } + // Close popup when clicking outside it + if (window()->type() == Qt::Popup && !(parentCocoaWindow && window()->transientParent()->isActive())) { + removeMonitor(); + NSEventMask eventMask = NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown + | NSEventMaskOtherMouseDown | NSEventMaskMouseMoved; + monitor = [NSEvent addGlobalMonitorForEventsMatchingMask:eventMask handler:^(NSEvent *e) { + const auto button = cocoaButton2QtButton(e); + const auto buttons = currentlyPressedMouseButtons(); + const auto eventType = cocoaEvent2QtMouseEvent(e); + const auto globalPoint = QCocoaScreen::mapFromNative(NSEvent.mouseLocation); + const auto localPoint = window()->mapFromGlobal(globalPoint.toPoint()); + QWindowSystemInterface::handleMouseEvent(window(), localPoint, globalPoint, buttons, button, eventType); + }]; } } } + // In some cases, e.g. QDockWidget, the content view is hidden before moving to its own // Cocoa window, and then shown again. Therefore, we test for the view being hidden even // if it's attached to an NSWindow. if ([m_view isHidden]) [m_view setHidden:NO]; + } else { - // qDebug() << "close" << this; - QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher()); - QCocoaEventDispatcherPrivate *cocoaEventDispatcherPrivate = nullptr; - if (cocoaEventDispatcher) - cocoaEventDispatcherPrivate = static_cast<QCocoaEventDispatcherPrivate *>(QObjectPrivate::get(cocoaEventDispatcher)); + // Window not visible, hide it if (isContentView()) { - if (m_hasModalSession) { - if (cocoaEventDispatcherPrivate) - cocoaEventDispatcherPrivate->endModalSession(window()); - m_hasModalSession = false; + if (eventDispatcher()->hasModalSession()) { + eventDispatcher()->endModalSession(window()); } else { if ([m_view.window isSheet]) { Q_ASSERT_X(parentCocoaWindow, "QCocoaWindow", "Window modal dialog has no transient parent."); @@ -419,10 +400,14 @@ void QCocoaWindow::setVisible(bool visible) } } + // Note: We do not guard the order out by checking NSWindow.visible, as AppKit will + // in some cases, such as when hiding the application, order out and make a window + // invisible, but keep it in a list of "hidden windows", that it then restores again + // when the application is unhidden. We need to call orderOut explicitly, to bring + // the window out of this "hidden list". [m_view.window orderOut:nil]; - if (m_view.window == [NSApp keyWindow] - && !(cocoaEventDispatcherPrivate && cocoaEventDispatcherPrivate->currentModalSession())) { + if (m_view.window == [NSApp keyWindow] && !eventDispatcher()->hasModalSession()) { // Probably because we call runModalSession: outside [NSApp run] in QCocoaEventDispatcher // (e.g., when show()-ing a modal QDialog instead of exec()-ing it), it can happen that // the current NSWindow is still key after being ordered out. Then, after checking we @@ -434,6 +419,7 @@ void QCocoaWindow::setVisible(bool visible) } else { [m_view setHidden:YES]; } + removeMonitor(); if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip) @@ -447,8 +433,6 @@ void QCocoaWindow::setVisible(bool visible) nativeParentWindow.styleMask |= NSWindowStyleMaskResizable; } } - - m_inSetVisible = false; } NSInteger QCocoaWindow::windowLevel(Qt::WindowFlags flags) @@ -1560,7 +1544,8 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel) // Deferring window creation breaks OpenGL (the GL context is // set up before the window is shown and needs a proper window) backing:NSBackingStoreBuffered defer:NO - screen:cocoaScreen->nativeScreen()]; + screen:cocoaScreen->nativeScreen() + platformWindow:this]; Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow", "Resulting NSScreen should match the requested NSScreen"); diff --git a/src/plugins/platforms/cocoa/qnswindow.h b/src/plugins/platforms/cocoa/qnswindow.h index 64f1ed0802..5fc48d826f 100644 --- a/src/plugins/platforms/cocoa/qnswindow.h +++ b/src/plugins/platforms/cocoa/qnswindow.h @@ -60,14 +60,10 @@ QT_FORWARD_DECLARE_CLASS(QCocoaWindow) #define QNSWindowProtocol QT_MANGLE_NAMESPACE(QNSWindowProtocol) @protocol QNSWindowProtocol -@optional -- (BOOL)canBecomeKeyWindow; -- (void)sendEvent:(NSEvent*)theEvent; +- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)style + backing:(NSBackingStoreType)backingStoreType defer:(BOOL)flag screen:(NSScreen *)screen + platformWindow:(QCocoaWindow*)window; - (void)closeAndRelease; -- (void)dealloc; -- (BOOL)isOpaque; -- (NSColor *)backgroundColor; -- (NSString *)description; @property (nonatomic, readonly) QCocoaWindow *platformWindow; @end diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm index c17ad47aba..52f765eb31 100644 --- a/src/plugins/platforms/cocoa/qnswindow.mm +++ b/src/plugins/platforms/cocoa/qnswindow.mm @@ -37,6 +37,8 @@ ** ****************************************************************************/ +#if !defined(QNSWINDOW_PROTOCOL_IMPLMENTATION) + #include "qnswindow.h" #include "qcocoawindow.h" #include "qcocoahelpers.h" @@ -89,44 +91,104 @@ static bool isMouseEvent(NSEvent *ev) } @end -#define super USE_qt_objcDynamicSuper_INSTEAD - @implementation QNSWindow +#define QNSWINDOW_PROTOCOL_IMPLMENTATION 1 +#include "qnswindow.mm" +#undef QNSWINDOW_PROTOCOL_IMPLMENTATION -+ (void)load ++ (void)applicationActivationChanged:(NSNotification*)notification { - const Class windowClass = [self class]; - const Class panelClass = [QNSPanel class]; - - unsigned int protocolCount; - Protocol **protocols = class_copyProtocolList(windowClass, &protocolCount); - for (unsigned int i = 0; i < protocolCount; ++i) { - Protocol *protocol = protocols[i]; - - unsigned int methodDescriptionsCount; - objc_method_description *methods = protocol_copyMethodDescriptionList( - protocol, NO, YES, &methodDescriptionsCount); - - for (unsigned int j = 0; j < methodDescriptionsCount; ++j) { - objc_method_description method = methods[j]; - class_addMethod(panelClass, method.name, - class_getMethodImplementation(windowClass, method.name), - method.types); + const id sender = self; + NSEnumerator<NSWindow*> *windowEnumerator = nullptr; + NSApplication *application = [NSApplication sharedApplication]; + + // Unfortunately there's no NSWindowListOrderedBackToFront, + // so we have to manually reverse the order using an array. + NSMutableArray<NSWindow *> *windows = [NSMutableArray<NSWindow *> new]; + [application enumerateWindowsWithOptions:NSWindowListOrderedFrontToBack + usingBlock:^(NSWindow *window, BOOL *) { + // For some reason AppKit will give us nil-windows, skip those + if (!window) + return; + + [windows addObject:window]; + } + ]; + + windowEnumerator = windows.reverseObjectEnumerator; + + for (NSWindow *window in windowEnumerator) { + // We're meddling with normal and floating windows, so leave others alone + if (!(window.level == NSNormalWindowLevel || window.level == NSFloatingWindowLevel)) + continue; + + // Windows that hide automatically will keep their NSFloatingWindowLevel, + // and hence be on top of the window stack. We don't want to affect these + // windows, as otherwise we might end up with key windows being ordered + // behind these auto-hidden windows when activating the application by + // clicking on a new tool window. + if (window.hidesOnDeactivate) + continue; + + if ([window conformsToProtocol:@protocol(QNSWindowProtocol)]) { + QCocoaWindow *cocoaWindow = static_cast<QCocoaNSWindow *>(window).platformWindow; + window.level = notification.name == NSApplicationWillResignActiveNotification ? + NSNormalWindowLevel : cocoaWindow->windowLevel(cocoaWindow->window()->flags()); } - free(methods); + + // The documentation says that "when a window enters a new level, it’s ordered + // in front of all its peers in that level", but that doesn't seem to be the + // case in practice. To keep the order correct after meddling with the window + // levels, we explicitly order each window to the front. Since we are iterating + // the windows in back-to-front order, this is okey. The call also triggers AppKit + // to re-evaluate the level in relation to windows from other applications, + // working around an issue where our tool windows would stay on top of other + // application windows if activation was transferred to another application by + // clicking on it instead of via the application switcher or Dock. Finally, we + // do this re-ordering for all windows (except auto-hiding ones), otherwise we would + // end up triggering a bug in AppKit where the tool windows would disappear behind + // the application window. + [window orderFront:sender]; } +} + +@end + +@implementation QNSPanel +#define QNSWINDOW_PROTOCOL_IMPLMENTATION 1 +#include "qnswindow.mm" +#undef QNSWINDOW_PROTOCOL_IMPLMENTATION +@end - free(protocols); +#else // QNSWINDOW_PROTOCOL_IMPLMENTATION + +// The following content is mixed in to the QNSWindow and QNSPanel classes via includes + +{ + // Member variables + QPointer<QCocoaWindow> m_platformWindow; +} + +- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)style + backing:(NSBackingStoreType)backingStoreType defer:(BOOL)defer screen:(NSScreen *)screen + platformWindow:(QCocoaWindow*)window +{ + // Initializing the window will end up in [NSWindow _commonAwake], which calls many + // of the getters below. We need to set up the platform window reference first, so + // we can properly reflect the window's state during initialization. + m_platformWindow = window; + + return [super initWithContentRect:contentRect styleMask:style backing:backingStoreType defer:defer screen:screen]; } - (QCocoaWindow *)platformWindow { - return qnsview_cast(self.contentView).platformWindow; + return m_platformWindow; } - (NSString *)description { - NSMutableString *description = [NSMutableString stringWithString:qt_objcDynamicSuper()]; + NSMutableString *description = [NSMutableString stringWithString:[super description]]; #ifndef QT_NO_DEBUG_STREAM QString contentViewDescription; @@ -142,16 +204,15 @@ static bool isMouseEvent(NSEvent *ev) - (BOOL)canBecomeKeyWindow { - QCocoaWindow *pw = self.platformWindow; - if (!pw) + if (!m_platformWindow) return NO; - if (pw->shouldRefuseKeyWindowAndFirstResponder()) + if (m_platformWindow->shouldRefuseKeyWindowAndFirstResponder()) return NO; if ([self isKindOfClass:[QNSPanel class]]) { // Only tool or dialog windows should become key: - Qt::WindowType type = pw->window()->type(); + Qt::WindowType type = m_platformWindow->window()->type(); if (type == Qt::Tool || type == Qt::Dialog) return YES; @@ -170,17 +231,26 @@ static bool isMouseEvent(NSEvent *ev) // Windows with a transient parent (such as combobox popup windows) // cannot become the main window: - QCocoaWindow *pw = self.platformWindow; - if (!pw || pw->window()->transientParent()) + if (!m_platformWindow || m_platformWindow->window()->transientParent()) canBecomeMain = NO; return canBecomeMain; } +- (BOOL)worksWhenModal +{ + if (m_platformWindow && [self isKindOfClass:[QNSPanel class]]) { + Qt::WindowType type = m_platformWindow->window()->type(); + if (type == Qt::Popup || type == Qt::Dialog || type == Qt::Tool) + return YES; + } + + return [super worksWhenModal]; +} + - (BOOL)isOpaque { - return self.platformWindow ? - self.platformWindow->isOpaque() : qt_objcDynamicSuper(); + return m_platformWindow ? m_platformWindow->isOpaque() : [super isOpaque]; } /*! @@ -196,7 +266,7 @@ static bool isMouseEvent(NSEvent *ev) - (NSColor *)backgroundColor { return self.styleMask == NSWindowStyleMaskBorderless - ? [NSColor clearColor] : qt_objcDynamicSuper(); + ? [NSColor clearColor] : [super backgroundColor]; } - (void)sendEvent:(NSEvent*)theEvent @@ -208,7 +278,7 @@ static bool isMouseEvent(NSEvent *ev) // e.g. if being retained by other parts of AppKit, or in an auto-release // pool. We guard against this in QNSView as well, as not all callbacks // come via events, but if they do there's no point in propagating them. - if (!self.platformWindow) + if (!m_platformWindow) return; // Prevent deallocation of this NSWindow during event delivery, as we @@ -216,23 +286,22 @@ static bool isMouseEvent(NSEvent *ev) [[self retain] autorelease]; const char *eventType = object_getClassName(theEvent); - if (QWindowSystemInterface::handleNativeEvent(self.platformWindow->window(), + if (QWindowSystemInterface::handleNativeEvent(m_platformWindow->window(), QByteArray::fromRawData(eventType, qstrlen(eventType)), theEvent, nullptr)) { return; } - qt_objcDynamicSuper(theEvent); + [super sendEvent:theEvent]; - if (!self.platformWindow) + if (!m_platformWindow) return; // Platform window went away while processing event - QCocoaWindow *pw = self.platformWindow; - if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) { + if (m_platformWindow->frameStrutEventsEnabled() && isMouseEvent(theEvent)) { NSPoint loc = [theEvent locationInWindow]; NSRect windowFrame = [self convertRectFromScreen:self.frame]; NSRect contentFrame = self.contentView.frame; if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO)) - [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent]; + [qnsview_cast(m_platformWindow->view()) handleFrameStrutMouseEvent:theEvent]; } } @@ -243,77 +312,12 @@ static bool isMouseEvent(NSEvent *ev) [self release]; } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-missing-super-calls" - (void)dealloc { qCDebug(lcQpaWindow) << "Deallocating" << self; self.delegate = nil; - qt_objcDynamicSuper(); + [super dealloc]; } -#pragma clang diagnostic pop - -+ (void)applicationActivationChanged:(NSNotification*)notification -{ - const id sender = self; - NSEnumerator<NSWindow*> *windowEnumerator = nullptr; - NSApplication *application = [NSApplication sharedApplication]; - - // Unfortunately there's no NSWindowListOrderedBackToFront, - // so we have to manually reverse the order using an array. - NSMutableArray<NSWindow *> *windows = [NSMutableArray<NSWindow *> new]; - [application enumerateWindowsWithOptions:NSWindowListOrderedFrontToBack - usingBlock:^(NSWindow *window, BOOL *) { - // For some reason AppKit will give us nil-windows, skip those - if (!window) - return; - - [windows addObject:window]; - } - ]; - - windowEnumerator = windows.reverseObjectEnumerator; - for (NSWindow *window in windowEnumerator) { - // We're meddling with normal and floating windows, so leave others alone - if (!(window.level == NSNormalWindowLevel || window.level == NSFloatingWindowLevel)) - continue; - - // Windows that hide automatically will keep their NSFloatingWindowLevel, - // and hence be on top of the window stack. We don't want to affect these - // windows, as otherwise we might end up with key windows being ordered - // behind these auto-hidden windows when activating the application by - // clicking on a new tool window. - if (window.hidesOnDeactivate) - continue; - - if ([window conformsToProtocol:@protocol(QNSWindowProtocol)]) { - QCocoaWindow *cocoaWindow = static_cast<QCocoaNSWindow *>(window).platformWindow; - window.level = notification.name == NSApplicationWillResignActiveNotification ? - NSNormalWindowLevel : cocoaWindow->windowLevel(cocoaWindow->window()->flags()); - } - - // The documentation says that "when a window enters a new level, it’s ordered - // in front of all its peers in that level", but that doesn't seem to be the - // case in practice. To keep the order correct after meddling with the window - // levels, we explicitly order each window to the front. Since we are iterating - // the windows in back-to-front order, this is okey. The call also triggers AppKit - // to re-evaluate the level in relation to windows from other applications, - // working around an issue where our tool windows would stay on top of other - // application windows if activation was transferred to another application by - // clicking on it instead of via the application switcher or Dock. Finally, we - // do this re-ordering for all windows (except auto-hiding ones), otherwise we would - // end up triggering a bug in AppKit where the tool windows would disappear behind - // the application window. - [window orderFront:sender]; - } -} - -@end - -@implementation QNSPanel -// Implementation shared with QNSWindow, see +[QNSWindow load] above -@end - -#undef super +#endif diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 7f1854c601..e611c7be24 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -511,6 +511,7 @@ public: QWindow *currentPressWindow = nullptr; QWindow *currentTargetWindow = nullptr; bool firstMouseMove = true; + bool resizePending = false; }; // To be called from the XAML thread @@ -1402,6 +1403,18 @@ void QWinRTScreen::emulateMouseMove(const QPointF &point, MousePositionTransitio Qt::NoModifier); } +void QWinRTScreen::setResizePending() +{ + Q_D(QWinRTScreen); + d->resizePending = true; +} + +bool QWinRTScreen::resizePending() const +{ + Q_D(const QWinRTScreen); + return d->resizePending; +} + HRESULT QWinRTScreen::onActivated(ICoreWindow *, IWindowActivatedEventArgs *args) { Q_D(QWinRTScreen); @@ -1507,7 +1520,7 @@ HRESULT QWinRTScreen::onRedirectReleased(ICorePointerRedirector *, IPointerEvent return onPointerUpdated(nullptr, args); } -HRESULT QWinRTScreen::onWindowSizeChanged(IApplicationView *, IInspectable *) +HRESULT QWinRTScreen::onWindowSizeChanged(IApplicationView *w, IInspectable *) { Q_D(QWinRTScreen); @@ -1527,6 +1540,9 @@ HRESULT QWinRTScreen::onWindowSizeChanged(IApplicationView *, IInspectable *) QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), availableGeometry()); QPlatformScreen::resizeMaximizedWindows(); handleExpose(); + // If we "emulate" a resize, w will be nullptr.Checking w shows whether it's a real resize + if (w) + d->resizePending = false; return S_OK; } diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h index e28cfd8cc8..63c254940d 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.h +++ b/src/plugins/platforms/winrt/qwinrtscreen.h @@ -136,6 +136,9 @@ public: void emulateMouseMove(const QPointF &point, MousePositionTransition transition); + void setResizePending(); + bool resizePending() const; + private: void handleExpose(); diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp index 83c3715bfd..73816b6512 100644 --- a/src/plugins/platforms/winrt/qwinrtwindow.cpp +++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp @@ -225,7 +225,8 @@ bool QWinRTWindow::isActive() const bool QWinRTWindow::isExposed() const { - const bool exposed = isActive(); + Q_D(const QWinRTWindow); + const bool exposed = isActive() && !d->screen->resizePending(); return exposed; } @@ -360,6 +361,7 @@ void QWinRTWindow::setWindowState(Qt::WindowStates state) qCDebug(lcQpaWindows) << "Failed to enter full screen mode."; return; } + d->screen->setResizePending(); d->state = state; return; } @@ -384,6 +386,7 @@ void QWinRTWindow::setWindowState(Qt::WindowStates state) qCDebug(lcQpaWindows) << "Failed to exit full screen mode."; return; } + d->screen->setResizePending(); } if (d->state & Qt::WindowMinimized || state == Qt::WindowNoState || state == Qt::WindowActive) diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 6f08238bcc..cf85c244cd 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -43,6 +43,15 @@ #include <QRegExp> #include <algorithm> + +#ifdef Q_CC_MSVC +#define popen _popen +#define QT_POPEN_READ "rb" +#define pclose _pclose +#else +#define QT_POPEN_READ "r" +#endif + static const bool mustReadOutputAnyway = true; // pclose seems to return the wrong error code unless we read the output void deleteRecursively(const QString &dirName) @@ -70,7 +79,7 @@ FILE *openProcess(const QString &command) QString processedCommand = command; #endif - return popen(processedCommand.toLocal8Bit().constData(), "r"); + return popen(processedCommand.toLocal8Bit().constData(), QT_POPEN_READ); } struct QtDependency @@ -1721,7 +1730,7 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies) .arg(shellQuote(rootPath)) .arg(importPaths.join(QLatin1Char(' '))); - FILE *qmlImportScannerCommand = popen(qmlImportScanner.toLocal8Bit().constData(), "r"); + FILE *qmlImportScannerCommand = popen(qmlImportScanner.toLocal8Bit().constData(), QT_POPEN_READ); if (qmlImportScannerCommand == 0) { fprintf(stderr, "Couldn't run qmlimportscanner.\n"); return false; @@ -2160,7 +2169,7 @@ bool createAndroidProject(const Options &options) if (options.verbose) fprintf(stdout, " -- Command: %s\n", qPrintable(androidTool)); - FILE *androidToolCommand = popen(androidTool.toLocal8Bit().constData(), "r"); + FILE *androidToolCommand = popen(androidTool.toLocal8Bit().constData(), QT_POPEN_READ); if (androidToolCommand == 0) { fprintf(stderr, "Cannot run command '%s'\n", qPrintable(androidTool)); return false; diff --git a/src/tools/moc/util/generate_keywords.pro b/src/tools/moc/util/generate_keywords.pro index 88e5553f54..2bbc3ced61 100644 --- a/src/tools/moc/util/generate_keywords.pro +++ b/src/tools/moc/util/generate_keywords.pro @@ -1,4 +1,4 @@ CONFIG -= moc -mac:CONFIG -= app_bundle +CONFIG += cmdline SOURCES += generate_keywords.cpp diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index c66400f423..41d9faa5c2 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1092,6 +1092,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) d->setSelected(d->currentSectionIndex, true); event->ignore(); emit editingFinished(); + emit d->edit->returnPressed(); return; default: #ifdef QT_KEYPAD_NAVIGATION diff --git a/tests/auto/corelib/global/qlogging/app/app.pro b/tests/auto/corelib/global/qlogging/app/app.pro index b90b685749..3ada382ff4 100644 --- a/tests/auto/corelib/global/qlogging/app/app.pro +++ b/tests/auto/corelib/global/qlogging/app/app.pro @@ -14,8 +14,7 @@ QT = core DESTDIR = ./ -CONFIG -= app_bundle -CONFIG += console +CONFIG += cmdline SOURCES += main.cpp DEFINES += QT_MESSAGELOGCONTEXT diff --git a/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/qlockfile_test_helper.pro b/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/qlockfile_test_helper.pro index 3ac3be9c9b..97135d279e 100644 --- a/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/qlockfile_test_helper.pro +++ b/tests/auto/corelib/io/qlockfile/qlockfiletesthelper/qlockfile_test_helper.pro @@ -1,7 +1,6 @@ TARGET = qlockfile_test_helper SOURCES += qlockfile_test_helper.cpp -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline QT = core DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro index 947dc916f2..2744491151 100644 --- a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro +++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro @@ -1,5 +1,4 @@ SOURCES = main.cpp -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline QT = core DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro index 8d1fcba624..3d80b668df 100644 --- a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro +++ b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro @@ -1,6 +1,5 @@ SOURCES = main.cpp QT = core -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline INSTALLS = DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro index b08371804f..5eaf8dc881 100644 --- a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro +++ b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro @@ -1,5 +1,5 @@ SOURCES += main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testForwarding/testForwarding.pro b/tests/auto/corelib/io/qprocess/testForwarding/testForwarding.pro index 45b498c32a..4d91e0cf36 100644 --- a/tests/auto/corelib/io/qprocess/testForwarding/testForwarding.pro +++ b/tests/auto/corelib/io/qprocess/testForwarding/testForwarding.pro @@ -1,5 +1,4 @@ SOURCES = main.cpp -CONFIG -= app_bundle -CONFIG += console +CONFIG += cmdline DESTDIR = ./ QT = core diff --git a/tests/auto/corelib/io/qprocess/testForwardingHelper/testForwardingHelper.pro b/tests/auto/corelib/io/qprocess/testForwardingHelper/testForwardingHelper.pro index e236e05c7d..6a23e52d95 100644 --- a/tests/auto/corelib/io/qprocess/testForwardingHelper/testForwardingHelper.pro +++ b/tests/auto/corelib/io/qprocess/testForwardingHelper/testForwardingHelper.pro @@ -1,4 +1,4 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro index 8778da7ffe..ef438d6399 100644 --- a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro +++ b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro @@ -1,5 +1,4 @@ SOURCES += main.cpp QT += widgets -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro index 7ccc976efc..640ce4cd09 100644 --- a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro +++ b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro @@ -1,5 +1,5 @@ SOURCES = main.cpp -CONFIG += console -CONFIG -= qt app_bundle +CONFIG += cmdline +CONFIG -= qt DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro index fbb3411d47..c7be60a82d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro +++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro @@ -1,5 +1,5 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro index 98fe78c8b9..ab1394a5c9 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro @@ -1,6 +1,6 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline win32:!mingw:!equals(TEMPLATE_PREFIX, "vc"):QMAKE_CXXFLAGS += /GS- DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro index e236e05c7d..6a23e52d95 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro @@ -1,4 +1,4 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro index e236e05c7d..6a23e52d95 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro @@ -1,4 +1,4 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro index e236e05c7d..6a23e52d95 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro @@ -1,4 +1,4 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro index a07ae00605..6a23e52d95 100644 --- a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro +++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro @@ -1,8 +1,4 @@ SOURCES = main.cpp CONFIG -= qt -CONFIG += console +CONFIG += cmdline DESTDIR = ./ - -mac { - CONFIG -= app_bundle -} diff --git a/tests/auto/corelib/io/qprocess/testProcessHang/testProcessHang.pro b/tests/auto/corelib/io/qprocess/testProcessHang/testProcessHang.pro index e236e05c7d..6a23e52d95 100644 --- a/tests/auto/corelib/io/qprocess/testProcessHang/testProcessHang.pro +++ b/tests/auto/corelib/io/qprocess/testProcessHang/testProcessHang.pro @@ -1,4 +1,4 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro index c6db9d1bac..7e1119c117 100644 --- a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro +++ b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro @@ -1,6 +1,6 @@ SOURCES = main.cpp -CONFIG += console -CONFIG -= qt app_bundle +CONFIG += cmdline +CONFIG -= qt DESTDIR = ./ QT = core diff --git a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro index 95191098bd..0bbb6b3c0e 100644 --- a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro +++ b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro @@ -1,5 +1,5 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ QT = core diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro index dd7e8e4a85..7954a2f74b 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro @@ -1,6 +1,6 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ OBJECTS_DIR = $${OBJECTS_DIR}-nospace DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro index d18a683e1c..44a365c9a5 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro @@ -1,6 +1,6 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ OBJECTS_DIR = $${OBJECTS_DIR}-onespace diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro index 8b16f65e34..bd2db9fb6d 100644 --- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro +++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro @@ -1,6 +1,6 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ OBJECTS_DIR = $${OBJECTS_DIR}-twospaces diff --git a/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/testSetNamedPipeHandleState.pro b/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/testSetNamedPipeHandleState.pro index e236e05c7d..6a23e52d95 100644 --- a/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/testSetNamedPipeHandleState.pro +++ b/tests/auto/corelib/io/qprocess/testSetNamedPipeHandleState/testSetNamedPipeHandleState.pro @@ -1,4 +1,4 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro index 21a115b536..4d91e0cf36 100644 --- a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro +++ b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro @@ -1,5 +1,4 @@ SOURCES = main.cpp -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline DESTDIR = ./ QT = core diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro index 80e8bcad98..2cfcb4794e 100644 --- a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro +++ b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro @@ -6,7 +6,7 @@ unix { SOURCES = main_unix.cpp } -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ QT = core diff --git a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro index afa4f32a85..48f28c4c8b 100644 --- a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro +++ b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro @@ -1,9 +1,5 @@ SOURCES = main.cpp CONFIG -= qt -CONFIG += console +CONFIG += cmdline DESTDIR = "../test Space In Name" - -mac { - CONFIG -= app_bundle -} QT = core diff --git a/tests/auto/corelib/serialization/qtextstream/readAllStdinProcess/readAllStdinProcess.pro b/tests/auto/corelib/serialization/qtextstream/readAllStdinProcess/readAllStdinProcess.pro index 4a4c091dcb..f2b5aa619f 100644 --- a/tests/auto/corelib/serialization/qtextstream/readAllStdinProcess/readAllStdinProcess.pro +++ b/tests/auto/corelib/serialization/qtextstream/readAllStdinProcess/readAllStdinProcess.pro @@ -1,7 +1,6 @@ SOURCES += main.cpp QT = core -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline DESTDIR = ./ # This app is testdata for tst_qtextstream diff --git a/tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/readLineStdinProcess.pro b/tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/readLineStdinProcess.pro index 4a4c091dcb..f2b5aa619f 100644 --- a/tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/readLineStdinProcess.pro +++ b/tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/readLineStdinProcess.pro @@ -1,7 +1,6 @@ SOURCES += main.cpp QT = core -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline DESTDIR = ./ # This app is testdata for tst_qtextstream diff --git a/tests/auto/corelib/serialization/qtextstream/stdinProcess/stdinProcess.pro b/tests/auto/corelib/serialization/qtextstream/stdinProcess/stdinProcess.pro index 4a4c091dcb..f2b5aa619f 100644 --- a/tests/auto/corelib/serialization/qtextstream/stdinProcess/stdinProcess.pro +++ b/tests/auto/corelib/serialization/qtextstream/stdinProcess/stdinProcess.pro @@ -1,7 +1,6 @@ SOURCES += main.cpp QT = core -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline DESTDIR = ./ # This app is testdata for tst_qtextstream diff --git a/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro b/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro index d5c09ebc84..57bd78bcee 100644 --- a/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro +++ b/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro @@ -9,8 +9,7 @@ debug_and_release { TARGET = ../crashOnExit_helper } QT = core -CONFIG -= app_bundle -CONFIG += console +CONFIG += cmdline # This app is testdata for tst_qthreadstorage target.path = $$[QT_INSTALL_TESTS]/tst_qthreadstorage/$$TARGET diff --git a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.pro b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.pro index dce1ac0d37..5020658835 100644 --- a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.pro +++ b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.pro @@ -1,5 +1,4 @@ -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline QT = core DESTDIR = ./ diff --git a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro index b61f51d53a..3e283c05a4 100644 --- a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro +++ b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro @@ -1,8 +1,7 @@ SOURCES += syslocaleapp.cpp DESTDIR = ./ -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline QT = core diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp index 4dc620e6ab..d1bb89f549 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp @@ -470,9 +470,8 @@ namespace QTest { "TEMPLATE = app\n" "\n" "TARGET = externaltest\n" - "CONFIG -= app_bundle\n" // for the Mac "CONFIG -= debug_and_release\n" - "CONFIG += console\n" + "CONFIG += cmdline\n" "DESTDIR = .\n" "OBJECTS_DIR = .\n" "UI_DIR = .\n" diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.pro b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.pro index 206522b557..a876cbfa33 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.pro +++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.pro @@ -2,6 +2,5 @@ SOURCES = qpinger.cpp ../interface.cpp HEADERS = ../interface.h TARGET = qpinger DESTDIR = ./ -CONFIG -= app_bundle -CONFIG += console +CONFIG += cmdline QT = core dbus diff --git a/tests/auto/dbus/qdbusmarshall/qpong/qpong.pro b/tests/auto/dbus/qdbusmarshall/qpong/qpong.pro index 57f8b2a598..97a5e7e19d 100644 --- a/tests/auto/dbus/qdbusmarshall/qpong/qpong.pro +++ b/tests/auto/dbus/qdbusmarshall/qpong/qpong.pro @@ -2,6 +2,4 @@ SOURCES = qpong.cpp TARGET = qpong DESTDIR = ./ QT = core dbus -CONFIG -= app_bundle -CONFIG += console - +CONFIG += cmdline diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index d744d37280..722c99ee0b 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -8,4 +8,4 @@ QT += gui-private core-private testlib SOURCES += tst_qopengl.cpp -linux:qtConfig(xcb):qtConfig(xcb-glx):qtConfig(xcb-xlib):!qtConfig(egl): DEFINES += USE_GLX +linux:qtConfig(xcb):qtConfig(xcb-glx-plugin): DEFINES += USE_GLX diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp index 3e354b7523..d652bb066d 100644 --- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp +++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp @@ -195,6 +195,8 @@ private slots: void css_linkPseudo(); void css_pageBreaks(); void css_cellPaddings(); + void css_whiteSpace_data(); + void css_whiteSpace(); void universalSelectors_data(); void universalSelectors(); void screenMedia(); @@ -1770,6 +1772,26 @@ void tst_QTextDocumentFragment::css_cellPaddings() QCOMPARE(cell.format().toTableCellFormat().bottomPadding(), qreal(15)); } +void tst_QTextDocumentFragment::css_whiteSpace_data() +{ + QTest::addColumn<QString>("htmlText"); + QTest::addColumn<bool>("nowrap"); + + QTest::newRow("default") << QString("<p>Normal Text</p>") << false; + QTest::newRow("white-space:nowrap") << QString("<p style=white-space:nowrap>Normal Text</p>") << true; + QTest::newRow("white-space:pre") << QString("<p style=white-space:pre>Normal Text</p>") << true; +} + +void tst_QTextDocumentFragment::css_whiteSpace() +{ + QFETCH(QString, htmlText); + QFETCH(bool, nowrap); + + doc->setHtml(htmlText); + QCOMPARE(doc->blockCount(), 1); + QCOMPARE(doc->begin().blockFormat().nonBreakableLines(), nowrap); +} + void tst_QTextDocumentFragment::html_blockLevelDiv() { const char html[] = "<div align=right><b>Hello World"; diff --git a/tests/auto/network/access/qnetworkreply/echo/echo.pro b/tests/auto/network/access/qnetworkreply/echo/echo.pro index 1f05fd9a54..3e304f4105 100644 --- a/tests/auto/network/access/qnetworkreply/echo/echo.pro +++ b/tests/auto/network/access/qnetworkreply/echo/echo.pro @@ -1,4 +1,4 @@ SOURCES += main.cpp QT = core -CONFIG -= app_bundle debug_and_release_target -CONFIG += console +CONFIG -= debug_and_release_target +CONFIG += cmdline diff --git a/tests/auto/network/bearer/qnetworksession/lackey/lackey.pro b/tests/auto/network/bearer/qnetworksession/lackey/lackey.pro index 1605b31d94..dd83d905e6 100644 --- a/tests/auto/network/bearer/qnetworksession/lackey/lackey.pro +++ b/tests/auto/network/bearer/qnetworksession/lackey/lackey.pro @@ -5,5 +5,4 @@ QT = core network DESTDIR = ./ -win32:CONFIG += console -mac:CONFIG -= app_bundle +CONFIG += cmdline diff --git a/tests/auto/network/socket/qlocalsocket/socketprocess/socketprocess.pro b/tests/auto/network/socket/qlocalsocket/socketprocess/socketprocess.pro index 643c4c5733..e11ed5644b 100644 --- a/tests/auto/network/socket/qlocalsocket/socketprocess/socketprocess.pro +++ b/tests/auto/network/socket/qlocalsocket/socketprocess/socketprocess.pro @@ -3,7 +3,6 @@ QT = core network testlib DESTDIR = ./ TARGET = socketprocess -win32:CONFIG += console -mac:CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/tests/auto/network/socket/qtcpsocket/stressTest/stressTest.pro b/tests/auto/network/socket/qtcpsocket/stressTest/stressTest.pro index 2eb00593e0..6afc008e7d 100644 --- a/tests/auto/network/socket/qtcpsocket/stressTest/stressTest.pro +++ b/tests/auto/network/socket/qtcpsocket/stressTest/stressTest.pro @@ -2,8 +2,7 @@ HEADERS += Test.h SOURCES += main.cpp Test.cpp QT = core network testlib -CONFIG -= app_bundle -CONFIG += console +CONFIG += cmdline DESTDIR = ./ MOC_DIR = .moc/ TMP_DIR = .tmp/ diff --git a/tests/auto/network/socket/qudpsocket/clientserver/clientserver.pro b/tests/auto/network/socket/qudpsocket/clientserver/clientserver.pro index a1b0021232..83a31b11e9 100644 --- a/tests/auto/network/socket/qudpsocket/clientserver/clientserver.pro +++ b/tests/auto/network/socket/qudpsocket/clientserver/clientserver.pro @@ -1,6 +1,5 @@ QT = core network SOURCES += main.cpp -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline TARGET = clientserver DESTDIR = ./ diff --git a/tests/auto/network/socket/qudpsocket/udpServer/udpServer.pro b/tests/auto/network/socket/qudpsocket/udpServer/udpServer.pro index cf707aa14a..c8f9ebf648 100644 --- a/tests/auto/network/socket/qudpsocket/udpServer/udpServer.pro +++ b/tests/auto/network/socket/qudpsocket/udpServer/udpServer.pro @@ -1,5 +1,3 @@ SOURCES += main.cpp QT = core network -CONFIG -= app_bundle -CONFIG += console - +CONFIG += cmdline diff --git a/tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro b/tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro index e236e05c7d..6a23e52d95 100644 --- a/tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro +++ b/tests/auto/other/qprocess_and_guieventloop/write-read-write/write-read-write.pro @@ -1,4 +1,4 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline DESTDIR = ./ diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp index 8cf43e243b..af6b6ca881 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp @@ -909,7 +909,7 @@ void tst_QSqlDatabase::recordMySQL() FieldDef("date", QVariant::Date, QDate::currentDate()), FieldDef("datetime", QVariant::DateTime, dt), FieldDef("timestamp", QVariant::DateTime, dt, false), - FieldDef("time", QVariant::Time, dt.time()), + FieldDef("time", QVariant::String, dt.time()), FieldDef("year", QVariant::Int, 2003), FieldDef("char(20)", QVariant::String, "Blah"), FieldDef("varchar(20)", QVariant::String, "BlahBlah"), diff --git a/tests/auto/sql/models/models.pro b/tests/auto/sql/models/models.pro index 2c3ae4ef0a..da807f4351 100644 --- a/tests/auto/sql/models/models.pro +++ b/tests/auto/sql/models/models.pro @@ -1,8 +1,8 @@ TEMPLATE=subdirs -SUBDIRS=\ +qtHaveModule(widgets): SUBDIRS = \ qsqlquerymodel \ - qsqlrelationaltablemodel \ + qsqlrelationaldelegate + +SUBDIRS += qsqlrelationaltablemodel \ qsqltablemodel \ -!qtHaveModule(widgets): SUBDIRS -= \ - qsqlquerymodel diff --git a/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp b/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp index 36f592395e..a7089c06a1 100644 --- a/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp +++ b/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp @@ -158,12 +158,13 @@ void tst_QSqlRelationalDelegate::comboBoxEditor() QTest::keyClick(editor, Qt::Key_Down); QTest::keyClick(editor, Qt::Key_Enter); QCOMPARE(editor->currentText(), "mister"); + QTest::keyClick(tv.viewport(), Qt::Key_Tab); QVERIFY_SQL(model, submitAll()); QSqlQuery qry(db); QVERIFY_SQL(qry, exec("SELECT title_key FROM " + reltest1 + " WHERE id=1")); QVERIFY(qry.next()); - QCOMPARE(qry.value(0).toString(), "mister"); + QCOMPARE(qry.value(0).toString(), "2"); } QTEST_MAIN(tst_QSqlRelationalDelegate) diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST deleted file mode 100644 index 071ccaaff4..0000000000 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/BLACKLIST +++ /dev/null @@ -1,3 +0,0 @@ -[cursor] -# QTBUG-73545 -winrt diff --git a/tests/baselineserver/src/baselineserver.pro b/tests/baselineserver/src/baselineserver.pro index a77014c1e6..2d8438cb51 100644 --- a/tests/baselineserver/src/baselineserver.pro +++ b/tests/baselineserver/src/baselineserver.pro @@ -5,8 +5,7 @@ QT += core network TARGET = baselineserver DESTDIR = ../bin -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline TEMPLATE = app diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro index cb8dfdcdcb..a0230e1cb8 100644 --- a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro +++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro @@ -1,5 +1,5 @@ SOURCES = main.cpp -CONFIG -= qt app_bundle -CONFIG += console +CONFIG -= qt +CONFIG += cmdline winrt: QMAKE_LFLAGS += /ENTRY:mainCRTStartup DESTDIR = ./ diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/qcryptographichash.pro b/tests/benchmarks/corelib/tools/qcryptographichash/qcryptographichash.pro index 9c55de8b47..cf9d640f7e 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/qcryptographichash.pro +++ b/tests/benchmarks/corelib/tools/qcryptographichash/qcryptographichash.pro @@ -1,5 +1,5 @@ TARGET = tst_bench_qcryptographichash -CONFIG -= debug app_bundle -CONFIG += release console +CONFIG -= debug +CONFIG += release cmdline QT = core testlib SOURCES += main.cpp diff --git a/tests/manual/embeddedintoforeignwindow/embeddedintoforeignwindow.pro b/tests/manual/embeddedintoforeignwindow/embeddedintoforeignwindow.pro index 93da4b8c91..dba33a139e 100644 --- a/tests/manual/embeddedintoforeignwindow/embeddedintoforeignwindow.pro +++ b/tests/manual/embeddedintoforeignwindow/embeddedintoforeignwindow.pro @@ -1,7 +1,6 @@ TEMPLATE = app QT += gui-private -CONFIG += console c++11 -CONFIG -= app_bundle +CONFIG += cmdline c++11 SOURCES += main.cpp itemwindow.cpp HEADERS += itemwindow.h include(../diaglib/diaglib.pri) diff --git a/tests/manual/filetest/filetest.pro b/tests/manual/filetest/filetest.pro index 5d2ba9b82b..b91689e0ff 100644 --- a/tests/manual/filetest/filetest.pro +++ b/tests/manual/filetest/filetest.pro @@ -1,6 +1,5 @@ TEMPLATE = app QT = core -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/tests/manual/foreignwindows/foreignwindows.pro b/tests/manual/foreignwindows/foreignwindows.pro index 6a370a6813..15bf2395f8 100644 --- a/tests/manual/foreignwindows/foreignwindows.pro +++ b/tests/manual/foreignwindows/foreignwindows.pro @@ -1,6 +1,5 @@ TEMPLATE = app QT += widgets -CONFIG += console c++11 -CONFIG -= app_bundle +CONFIG += cmdline c++11 SOURCES += main.cpp include(../diaglib/diaglib.pri) diff --git a/tests/manual/highdpi/highdpi.pro b/tests/manual/highdpi/highdpi.pro index 7d6b42535e..9db083cd82 100644 --- a/tests/manual/highdpi/highdpi.pro +++ b/tests/manual/highdpi/highdpi.pro @@ -2,8 +2,7 @@ TEMPLATE = app TARGET = highdpi INCLUDEPATH += . QT += widgets gui-private -CONFIG +=console -CONFIG -= app_bundle +CONFIG += cmdline CONFIG += c++11 # Input SOURCES += \ diff --git a/tests/manual/lance/lance.pro b/tests/manual/lance/lance.pro index 312106c2f0..78ca2f56e5 100644 --- a/tests/manual/lance/lance.pro +++ b/tests/manual/lance/lance.pro @@ -1,6 +1,5 @@ LANCELOT_DIR = $$PWD/../../auto/other/lancelot -CONFIG+=console moc -CONFIG -= app_bundle +CONFIG += cmdline moc TEMPLATE = app INCLUDEPATH += . $$LANCELOT_DIR QT += core-private gui-private widgets printsupport diff --git a/tests/manual/qdesktopservices/qdesktopservices.pro b/tests/manual/qdesktopservices/qdesktopservices.pro index c96287e159..baa3c325ff 100644 --- a/tests/manual/qdesktopservices/qdesktopservices.pro +++ b/tests/manual/qdesktopservices/qdesktopservices.pro @@ -1,8 +1,7 @@ QT += testlib TARGET = tst_qdesktopservices -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline TEMPLATE = app diff --git a/tests/manual/qmimedatabase/qmimedatabase.pro b/tests/manual/qmimedatabase/qmimedatabase.pro index 5473330edf..fd931d5eec 100644 --- a/tests/manual/qmimedatabase/qmimedatabase.pro +++ b/tests/manual/qmimedatabase/qmimedatabase.pro @@ -1,5 +1,4 @@ TEMPLATE = app QT = core -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/tests/manual/qstorageinfo/qstorageinfo.pro b/tests/manual/qstorageinfo/qstorageinfo.pro index 25acd24c80..e47ecc5b3e 100644 --- a/tests/manual/qstorageinfo/qstorageinfo.pro +++ b/tests/manual/qstorageinfo/qstorageinfo.pro @@ -1,4 +1,3 @@ QT = core -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/tests/manual/qsysinfo/qsysinfo.pro b/tests/manual/qsysinfo/qsysinfo.pro index c73d8282cb..ff0a09d42e 100644 --- a/tests/manual/qsysinfo/qsysinfo.pro +++ b/tests/manual/qsysinfo/qsysinfo.pro @@ -1,7 +1,6 @@ QT = core TARGET = qsysinfo TEMPLATE = app -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline SOURCES += main.cpp diff --git a/tests/manual/widgets/styles/styles.pro b/tests/manual/widgets/styles/styles.pro index ef8217a9a3..d302ae0691 100644 --- a/tests/manual/widgets/styles/styles.pro +++ b/tests/manual/widgets/styles/styles.pro @@ -1,7 +1,6 @@ TEMPLATE = app QT = widgets -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline CONFIG += c++11 SOURCES += main.cpp diff --git a/util/glgen/glgen.pro b/util/glgen/glgen.pro index 11018e942d..22c377e5f1 100644 --- a/util/glgen/glgen.pro +++ b/util/glgen/glgen.pro @@ -1,6 +1,5 @@ QT -= gui -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline # Uncomment following to enable debug output #DEFINES += SPECPARSER_DEBUG diff --git a/util/gradientgen/tobinaryjson.pro b/util/gradientgen/tobinaryjson.pro index 8ed3509278..8aa9d0d008 100644 --- a/util/gradientgen/tobinaryjson.pro +++ b/util/gradientgen/tobinaryjson.pro @@ -1,4 +1,3 @@ SOURCES += tobinaryjson.cpp QT = core -CONFIG += console -CONFIG -= app_bundle +CONFIG += cmdline |