Merge 5.12 into 5.12.2

Change-Id: I3a5721aebd3afd8fa08d3f3df6bf61502fa9c347
bb10
Kari Oikarinen 2019-02-20 12:37:31 +02:00
commit 33707f5b2f
122 changed files with 607 additions and 617 deletions

View File

@ -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

View File

@ -2,8 +2,7 @@ QT += core
QT -= gui
TARGET = cbordump
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
TEMPLATE = app

View File

@ -2,8 +2,7 @@ QT += core
QT -= gui
TARGET = convert
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
TEMPLATE = app

View File

@ -2,8 +2,7 @@ QT += core
QT -= gui
TARGET = savegame
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
TEMPLATE = app

View File

@ -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

View File

@ -1,6 +1,6 @@
QT = core
CONFIG -= moc app_bundle
CONFIG += console
CONFIG -= moc
CONFIG += cmdline
SOURCES += waitconditions.cpp

View File

@ -1,7 +1,6 @@
TEMPLATE = app
QT = core network
mac:CONFIG -= app_bundle
win32:CONFIG += console
CONFIG += cmdline
HEADERS += dnslookup.h
SOURCES += dnslookup.cpp

View File

@ -1,6 +1,5 @@
QT = core network
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
SOURCES += main.cpp

View File

@ -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

View File

@ -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)

View File

@ -1,8 +1,7 @@
TEMPLATE = app
TARGET = mapdemo
QT += concurrent
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
SOURCES += main.cpp

View File

@ -1,6 +1,5 @@
QT += concurrent widgets
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
SOURCES += main.cpp

View File

@ -1,6 +1,5 @@
QT += concurrent widgets
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
SOURCES += main.cpp

View File

@ -1,6 +1,5 @@
QT = core
win32: CONFIG += console
mac:CONFIG -= app_bundle
CONFIG += cmdline
SOURCES += main.cpp

View File

@ -1,6 +1,5 @@
QT = core
win32: CONFIG += console
mac:CONFIG -= app_bundle
CONFIG += cmdline
SOURCES = main.cpp

View File

@ -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

View File

@ -1,5 +1,4 @@
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
QT -= gui
SOURCES += main.cpp

View File

@ -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/

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,2 @@
win32: CONFIG *= console
macos: CONFIG -= app_bundle

View File

@ -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

View File

@ -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) {

View File

@ -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>

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -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) {

View File

@ -52,7 +52,8 @@ enum DotNET {
NET2012 = 0xb0,
NET2013 = 0xc0,
NET2015 = 0xd0,
NET2017 = 0xe0
NET2017 = 0xe0,
NET2019
};
DotNET vsVersionFromString(const ProString &versionString);

View File

@ -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

View File

@ -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;

View File

@ -3,8 +3,8 @@
# and the configures.
option(host_build)
CONFIG += console
CONFIG -= qt app_bundle
CONFIG += cmdline
CONFIG -= qt
DEFINES += \
PROEVALUATOR_FULL \

View File

@ -68,6 +68,7 @@
( ( __clang_major__ >= 4 ) || \
( ( __clang_major__ == 3 ) && ( __clang_minor__ >= 2 ) ) ) ) ) && \
defined( __OPTIMIZE__ ) && \
!defined( __EMSCRIPTEN__ ) && \
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#ifdef __clang__

View File

@ -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();

View File

@ -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,

View File

@ -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();

View File

@ -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.:
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];
}

View File

@ -59,8 +59,9 @@
},
"bcm_host": {
"export": "",
"headers": ["bcm_host.h"],
"sources": [
"-lbcm_host"
{ "type": "makeSpec", "spec": "BCM_HOST" }
]
},
"dxguid": {

View File

@ -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 &region)
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 &region)
// 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 &region)
*/
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 &region, 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 &region, 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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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 &registryFontKey = 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 &registryFontKey = 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;

View File

@ -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;
}

View File

@ -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

View File

@ -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();

View File

@ -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;
}

View File

@ -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();

View File

@ -253,7 +253,6 @@ public: // for QNSView
bool m_needsInvalidateShadow;
bool m_hasModalSession;
bool m_frameStrutEventsEnabled;
QRect m_exposedRect;
int m_registerTouchCount;

View File

@ -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");

View File

@ -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

View File

@ -37,6 +37,8 @@
**
****************************************************************************/
#if !defined(QNSWINDOW_PROTOCOL_IMPLMENTATION)
#include "qnswindow.h"
#include "qcocoawindow.h"
#include "qcocoahelpers.h"
@ -89,170 +91,10 @@ static bool isMouseEvent(NSEvent *ev)
}
@end
#define super USE_qt_objcDynamicSuper_INSTEAD
@implementation QNSWindow
+ (void)load
{
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);
}
free(methods);
}
free(protocols);
}
- (QCocoaWindow *)platformWindow
{
return qnsview_cast(self.contentView).platformWindow;
}
- (NSString *)description
{
NSMutableString *description = [NSMutableString stringWithString:qt_objcDynamicSuper()];
#ifndef QT_NO_DEBUG_STREAM
QString contentViewDescription;
QDebug debug(&contentViewDescription);
debug.nospace() << "; contentView=" << qnsview_cast(self.contentView) << ">";
NSRange lastCharacter = [description rangeOfComposedCharacterSequenceAtIndex:description.length - 1];
[description replaceCharactersInRange:lastCharacter withString:contentViewDescription.toNSString()];
#endif
return description;
}
- (BOOL)canBecomeKeyWindow
{
QCocoaWindow *pw = self.platformWindow;
if (!pw)
return NO;
if (pw->shouldRefuseKeyWindowAndFirstResponder())
return NO;
if ([self isKindOfClass:[QNSPanel class]]) {
// Only tool or dialog windows should become key:
Qt::WindowType type = pw->window()->type();
if (type == Qt::Tool || type == Qt::Dialog)
return YES;
return NO;
} else {
// The default implementation returns NO for title-bar less windows,
// override and return yes here to make sure popup windows such as
// the combobox popup can become the key window.
return YES;
}
}
- (BOOL)canBecomeMainWindow
{
BOOL canBecomeMain = YES; // By default, windows can become the main window
// Windows with a transient parent (such as combobox popup windows)
// cannot become the main window:
QCocoaWindow *pw = self.platformWindow;
if (!pw || pw->window()->transientParent())
canBecomeMain = NO;
return canBecomeMain;
}
- (BOOL)isOpaque
{
return self.platformWindow ?
self.platformWindow->isOpaque() : qt_objcDynamicSuper();
}
/*!
Borderless windows need a transparent background
Technically windows with NSWindowStyleMaskTexturedBackground
(such as windows with unified toolbars) need to draw the textured
background of the NSWindow, and can't have a transparent
background, but as NSWindowStyleMaskBorderless is 0, you can't
have a window with NSWindowStyleMaskTexturedBackground that is
also borderless.
*/
- (NSColor *)backgroundColor
{
return self.styleMask == NSWindowStyleMaskBorderless
? [NSColor clearColor] : qt_objcDynamicSuper();
}
- (void)sendEvent:(NSEvent*)theEvent
{
qCDebug(lcQpaEvents) << "Sending" << theEvent << "to" << self;
// We might get events for a NSWindow after the corresponding platform
// window has been deleted, as the NSWindow can outlive the QCocoaWindow
// 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)
return;
// Prevent deallocation of this NSWindow during event delivery, as we
// have logic further below that depends on the window being alive.
[[self retain] autorelease];
const char *eventType = object_getClassName(theEvent);
if (QWindowSystemInterface::handleNativeEvent(self.platformWindow->window(),
QByteArray::fromRawData(eventType, qstrlen(eventType)), theEvent, nullptr)) {
return;
}
qt_objcDynamicSuper(theEvent);
if (!self.platformWindow)
return; // Platform window went away while processing event
QCocoaWindow *pw = self.platformWindow;
if (pw->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];
}
}
- (void)closeAndRelease
{
qCDebug(lcQpaWindow) << "Closing and releasing" << self;
[self close];
[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();
}
#pragma clang diagnostic pop
#define QNSWINDOW_PROTOCOL_IMPLMENTATION 1
#include "qnswindow.mm"
#undef QNSWINDOW_PROTOCOL_IMPLMENTATION
+ (void)applicationActivationChanged:(NSNotification*)notification
{
@ -313,7 +155,169 @@ static bool isMouseEvent(NSEvent *ev)
@end
@implementation QNSPanel
// Implementation shared with QNSWindow, see +[QNSWindow load] above
#define QNSWINDOW_PROTOCOL_IMPLMENTATION 1
#include "qnswindow.mm"
#undef QNSWINDOW_PROTOCOL_IMPLMENTATION
@end
#undef super
#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 m_platformWindow;
}
- (NSString *)description
{
NSMutableString *description = [NSMutableString stringWithString:[super description]];
#ifndef QT_NO_DEBUG_STREAM
QString contentViewDescription;
QDebug debug(&contentViewDescription);
debug.nospace() << "; contentView=" << qnsview_cast(self.contentView) << ">";
NSRange lastCharacter = [description rangeOfComposedCharacterSequenceAtIndex:description.length - 1];
[description replaceCharactersInRange:lastCharacter withString:contentViewDescription.toNSString()];
#endif
return description;
}
- (BOOL)canBecomeKeyWindow
{
if (!m_platformWindow)
return NO;
if (m_platformWindow->shouldRefuseKeyWindowAndFirstResponder())
return NO;
if ([self isKindOfClass:[QNSPanel class]]) {
// Only tool or dialog windows should become key:
Qt::WindowType type = m_platformWindow->window()->type();
if (type == Qt::Tool || type == Qt::Dialog)
return YES;
return NO;
} else {
// The default implementation returns NO for title-bar less windows,
// override and return yes here to make sure popup windows such as
// the combobox popup can become the key window.
return YES;
}
}
- (BOOL)canBecomeMainWindow
{
BOOL canBecomeMain = YES; // By default, windows can become the main window
// Windows with a transient parent (such as combobox popup windows)
// cannot become the main window:
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 m_platformWindow ? m_platformWindow->isOpaque() : [super isOpaque];
}
/*!
Borderless windows need a transparent background
Technically windows with NSWindowStyleMaskTexturedBackground
(such as windows with unified toolbars) need to draw the textured
background of the NSWindow, and can't have a transparent
background, but as NSWindowStyleMaskBorderless is 0, you can't
have a window with NSWindowStyleMaskTexturedBackground that is
also borderless.
*/
- (NSColor *)backgroundColor
{
return self.styleMask == NSWindowStyleMaskBorderless
? [NSColor clearColor] : [super backgroundColor];
}
- (void)sendEvent:(NSEvent*)theEvent
{
qCDebug(lcQpaEvents) << "Sending" << theEvent << "to" << self;
// We might get events for a NSWindow after the corresponding platform
// window has been deleted, as the NSWindow can outlive the QCocoaWindow
// 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 (!m_platformWindow)
return;
// Prevent deallocation of this NSWindow during event delivery, as we
// have logic further below that depends on the window being alive.
[[self retain] autorelease];
const char *eventType = object_getClassName(theEvent);
if (QWindowSystemInterface::handleNativeEvent(m_platformWindow->window(),
QByteArray::fromRawData(eventType, qstrlen(eventType)), theEvent, nullptr)) {
return;
}
[super sendEvent:theEvent];
if (!m_platformWindow)
return; // Platform window went away while processing event
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(m_platformWindow->view()) handleFrameStrutMouseEvent:theEvent];
}
}
- (void)closeAndRelease
{
qCDebug(lcQpaWindow) << "Closing and releasing" << self;
[self close];
[self release];
}
- (void)dealloc
{
qCDebug(lcQpaWindow) << "Deallocating" << self;
self.delegate = nil;
[super dealloc];
}
#endif

View File

@ -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;
}

View File

@ -136,6 +136,9 @@ public:
void emulateMouseMove(const QPointF &point, MousePositionTransition transition);
void setResizePending();
bool resizePending() const;
private:
void handleExpose();

View File

@ -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)

View File

@ -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;

View File

@ -1,4 +1,4 @@
CONFIG -= moc
mac:CONFIG -= app_bundle
CONFIG += cmdline
SOURCES += generate_keywords.cpp

View File

@ -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

View File

@ -14,8 +14,7 @@ QT = core
DESTDIR = ./
CONFIG -= app_bundle
CONFIG += console
CONFIG += cmdline
SOURCES += main.cpp
DEFINES += QT_MESSAGELOGCONTEXT

View File

@ -1,7 +1,6 @@
TARGET = qlockfile_test_helper
SOURCES += qlockfile_test_helper.cpp
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
QT = core
DESTDIR = ./

View File

@ -1,5 +1,4 @@
SOURCES = main.cpp
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
QT = core
DESTDIR = ./

View File

@ -1,6 +1,5 @@
SOURCES = main.cpp
QT = core
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
INSTALLS =
DESTDIR = ./

View File

@ -1,5 +1,5 @@
SOURCES += main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./

View File

@ -1,5 +1,4 @@
SOURCES = main.cpp
CONFIG -= app_bundle
CONFIG += console
CONFIG += cmdline
DESTDIR = ./
QT = core

View File

@ -1,4 +1,4 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./

View File

@ -1,5 +1,4 @@
SOURCES += main.cpp
QT += widgets
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
DESTDIR = ./

View File

@ -1,5 +1,5 @@
SOURCES = main.cpp
CONFIG += console
CONFIG -= qt app_bundle
CONFIG += cmdline
CONFIG -= qt
DESTDIR = ./

View File

@ -1,5 +1,5 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./

View File

@ -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 = ./

View File

@ -1,4 +1,4 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./

View File

@ -1,4 +1,4 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./

View File

@ -1,4 +1,4 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./

View File

@ -1,8 +1,4 @@
SOURCES = main.cpp
CONFIG -= qt
CONFIG += console
CONFIG += cmdline
DESTDIR = ./
mac {
CONFIG -= app_bundle
}

View File

@ -1,4 +1,4 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./

View File

@ -1,6 +1,6 @@
SOURCES = main.cpp
CONFIG += console
CONFIG -= qt app_bundle
CONFIG += cmdline
CONFIG -= qt
DESTDIR = ./
QT = core

View File

@ -1,5 +1,5 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./
QT = core

View File

@ -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

View File

@ -1,6 +1,6 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./
OBJECTS_DIR = $${OBJECTS_DIR}-onespace

View File

@ -1,6 +1,6 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./
OBJECTS_DIR = $${OBJECTS_DIR}-twospaces

View File

@ -1,4 +1,4 @@
SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./

View File

@ -1,5 +1,4 @@
SOURCES = main.cpp
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
DESTDIR = ./
QT = core

View File

@ -6,7 +6,7 @@ unix {
SOURCES = main_unix.cpp
}
CONFIG -= qt app_bundle
CONFIG += console
CONFIG -= qt
CONFIG += cmdline
DESTDIR = ./
QT = core

View File

@ -1,9 +1,5 @@
SOURCES = main.cpp
CONFIG -= qt
CONFIG += console
CONFIG += cmdline
DESTDIR = "../test Space In Name"
mac {
CONFIG -= app_bundle
}
QT = core

View File

@ -1,7 +1,6 @@
SOURCES += main.cpp
QT = core
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
DESTDIR = ./
# This app is testdata for tst_qtextstream

View File

@ -1,7 +1,6 @@
SOURCES += main.cpp
QT = core
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
DESTDIR = ./
# This app is testdata for tst_qtextstream

View File

@ -1,7 +1,6 @@
SOURCES += main.cpp
QT = core
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
DESTDIR = ./
# This app is testdata for tst_qtextstream

View File

@ -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

View File

@ -1,5 +1,4 @@
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
QT = core
DESTDIR = ./

View File

@ -1,8 +1,7 @@
SOURCES += syslocaleapp.cpp
DESTDIR = ./
CONFIG += console
CONFIG -= app_bundle
CONFIG += cmdline
QT = core

View File

@ -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"

View File

@ -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

View File

@ -2,6 +2,4 @@ SOURCES = qpong.cpp
TARGET = qpong
DESTDIR = ./
QT = core dbus
CONFIG -= app_bundle
CONFIG += console
CONFIG += cmdline

View File

@ -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

View File

@ -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";

View File

@ -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

View File

@ -5,5 +5,4 @@ QT = core network
DESTDIR = ./
win32:CONFIG += console
mac:CONFIG -= app_bundle
CONFIG += cmdline

View File

@ -3,7 +3,6 @@ QT = core network testlib
DESTDIR = ./
TARGET = socketprocess
win32:CONFIG += console
mac:CONFIG -= app_bundle
CONFIG += cmdline
SOURCES += main.cpp

View File

@ -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/

Some files were not shown because too many files have changed in this diff Show More