Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13
This commit is contained in:
commit
2e8987b7ec
19
mkspecs/winrt-arm-msvc2019/qmake.conf
Normal file
19
mkspecs/winrt-arm-msvc2019/qmake.conf
Normal file
@ -0,0 +1,19 @@
|
||||
#
|
||||
# qmake configuration for winrt-arm-msvc2019
|
||||
#
|
||||
# Written for Microsoft Visual C++ 2019
|
||||
#
|
||||
|
||||
include(../common/winrt_winphone/qmake.conf)
|
||||
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__
|
||||
|
||||
QMAKE_CFLAGS += -FS
|
||||
QMAKE_CXXFLAGS += -FS
|
||||
QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
|
||||
|
||||
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
|
||||
|
||||
VCPROJ_ARCH = ARM
|
||||
WINSDK_VER = 10.0
|
||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||
WINRT_MANIFEST.architecture = arm
|
40
mkspecs/winrt-arm-msvc2019/qplatformdefs.h
Normal file
40
mkspecs/winrt-arm-msvc2019/qplatformdefs.h
Normal file
@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the qmake spec of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "../common/winrt_winphone/qplatformdefs.h"
|
19
mkspecs/winrt-arm64-msvc2019/qmake.conf
Normal file
19
mkspecs/winrt-arm64-msvc2019/qmake.conf
Normal file
@ -0,0 +1,19 @@
|
||||
#
|
||||
# qmake configuration for winrt-arm64-msvc2019
|
||||
#
|
||||
# Written for Microsoft Visual C++ 2019
|
||||
#
|
||||
|
||||
include(../common/winrt_winphone/qmake.conf)
|
||||
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 arm64 __arm64__ __arm64__
|
||||
|
||||
QMAKE_CFLAGS += -FS
|
||||
QMAKE_CXXFLAGS += -FS
|
||||
QMAKE_LFLAGS += /MACHINE:arm64 /NODEFAULTLIB:kernel32.lib
|
||||
|
||||
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
|
||||
|
||||
VCPROJ_ARCH = arm64
|
||||
WINSDK_VER = 10.0
|
||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||
WINRT_MANIFEST.architecture = arm64
|
40
mkspecs/winrt-arm64-msvc2019/qplatformdefs.h
Normal file
40
mkspecs/winrt-arm64-msvc2019/qplatformdefs.h
Normal file
@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the qmake spec of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "../common/winrt_winphone/qplatformdefs.h"
|
19
mkspecs/winrt-x64-msvc2019/qmake.conf
Normal file
19
mkspecs/winrt-x64-msvc2019/qmake.conf
Normal file
@ -0,0 +1,19 @@
|
||||
#
|
||||
# qmake configuration for winrt-x64-msvc2019
|
||||
#
|
||||
# Written for Microsoft Visual C++ 2019
|
||||
#
|
||||
|
||||
include(../common/winrt_winphone/qmake.conf)
|
||||
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__
|
||||
|
||||
QMAKE_CFLAGS += -FS
|
||||
QMAKE_CXXFLAGS += -FS
|
||||
QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib
|
||||
|
||||
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
|
||||
|
||||
VCPROJ_ARCH = x64
|
||||
WINSDK_VER = 10.0
|
||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||
WINRT_MANIFEST.architecture = x64
|
40
mkspecs/winrt-x64-msvc2019/qplatformdefs.h
Normal file
40
mkspecs/winrt-x64-msvc2019/qplatformdefs.h
Normal file
@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the qmake spec of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "../common/winrt_winphone/qplatformdefs.h"
|
18
mkspecs/winrt-x86-msvc2019/qmake.conf
Normal file
18
mkspecs/winrt-x86-msvc2019/qmake.conf
Normal file
@ -0,0 +1,18 @@
|
||||
#
|
||||
# qmake configuration for winrt-x86-msvc2019
|
||||
#
|
||||
# Written for Microsoft Visual C++ 2019
|
||||
#
|
||||
|
||||
include(../common/winrt_winphone/qmake.conf)
|
||||
DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__
|
||||
|
||||
QMAKE_CFLAGS += -FS
|
||||
QMAKE_CXXFLAGS += -FS
|
||||
QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
|
||||
|
||||
QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib
|
||||
VCPROJ_ARCH = Win32
|
||||
WINSDK_VER = 10.0
|
||||
WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
|
||||
WINRT_MANIFEST.architecture = x86
|
40
mkspecs/winrt-x86-msvc2019/qplatformdefs.h
Normal file
40
mkspecs/winrt-x86-msvc2019/qplatformdefs.h
Normal file
@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the qmake spec of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "../common/winrt_winphone/qplatformdefs.h"
|
@ -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 \
|
||||
|
@ -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
|
||||
|
@ -604,11 +604,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);
|
||||
@ -662,8 +665,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()
|
||||
@ -726,11 +729,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();
|
||||
|
@ -244,6 +244,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) {
|
||||
@ -321,46 +356,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,
|
||||
|
@ -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();
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Δεν ήταν δυνατή η εύρεση της υπηρεσίας Ministro. Δεν είναι δυνατή η εκκίνηση της εφαρμογής.</string>
|
||||
<string name="ministro_needed_msg">Η εφαρμογή απαιτεί την υπηρεσία Ministro. Να εγκατασταθεί η υπηρεσία?</string>
|
||||
<string name="fatal_error_msg">Παρουσιάστηκε ένα κρίσιμο σφάλμα και η εφαρμογή δεν μπορεί να συνεχίσει.</string>
|
||||
<string name="unsupported_android_version">Αυτή η έκδοση του Android δεν υποστηρίζεται.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Servicio Ministro inesistente. Imposible ejecutar la aplicación.</string>
|
||||
<string name="ministro_needed_msg">Esta aplicación requiere el servicio Ministro. Instalarlo?</string>
|
||||
<string name="fatal_error_msg">La aplicación ha causado un error grave y no es posible continuar.</string>
|
||||
<string name="unsupported_android_version">Esta versión de Android no es compatible.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Ei suuda leida Ministro teenust.\nProgrammi ei saa käivitada.</string>
|
||||
<string name="ministro_needed_msg">See programm vajab Ministro teenust.\nKas soovite paigaldada?</string>
|
||||
<string name="fatal_error_msg">Programmiga juhtus fataalne viga.\nKahjuks ei saa jätkata.</string>
|
||||
<string name="unsupported_android_version">Seda Androidi versiooni ei toetata.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">سرویس Ministro را پیدا نمیکند. برنامه نمیتواند آغاز شود.</string>
|
||||
<string name="ministro_needed_msg">این نرمافزار به سرویس Ministro احتیاج دارد. آیا دوست دارید آن را نصب کنید؟</string>
|
||||
<string name="fatal_error_msg">خطایی اساسی در برنامهتان رخ داد و اجرای برنامه نمیتواند ادامه یابد.</string>
|
||||
<string name="unsupported_android_version">این نسخه از Android پشتیبانی نمی شود</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Layanan Ministro tidak bisa ditemukan.\nAplikasi tidak bisa dimulai.</string>
|
||||
<string name="ministro_needed_msg">Aplikasi ini membutuhkan layanan Ministro. Apakah Anda ingin menginstalnya?</string>
|
||||
<string name="fatal_error_msg">Aplikasi Anda mengalami kesalahan fatal dan tidak dapat melanjutkan.</string>
|
||||
<string name="unsupported_android_version">Versi Android ini tidak didukung.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Servizio Ministro inesistente. Impossibile eseguire \nl\'applicazione.</string>
|
||||
<string name="ministro_needed_msg">Questa applicazione richiede il servizio Ministro.Installarlo?</string>
|
||||
<string name="fatal_error_msg">L\'applicazione ha provocato un errore grave e non puo\' continuare.</string>
|
||||
<string name="unsupported_android_version">Questa versione di Android non è supportata.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Ministroサービスが見つかりません。\nアプリケーションが起動できません。</string>
|
||||
<string name="ministro_needed_msg">このアプリケーションにはMinistroサービスが必要です。 インストールしてもよろしいですか?</string>
|
||||
<string name="fatal_error_msg">アプリケーションで致命的なエラーが発生したため続行できません。</string>
|
||||
<string name="unsupported_android_version">このバージョンのAndroidはサポートされていません。</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Tidak jumpa servis Ministro.\nAplikasi tidak boleh dimulakan.</string>
|
||||
<string name="ministro_needed_msg">Aplikasi ini memerlukan servis Ministro. Adakah anda ingin pasang servis itu?</string>
|
||||
<string name="fatal_error_msg">Aplikasi anda menemui ralat muat dan tidak boleh diteruskan.</string>
|
||||
<string name="unsupported_android_version">Versi Android ini tidak disokong.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Kan ikke finne tjenesten Ministro. Applikasjonen kan ikke starte.</string>
|
||||
<string name="ministro_needed_msg">Denne applikasjonen krever tjenesten Ministro. Vil du installere denne?</string>
|
||||
<string name="fatal_error_msg">Applikasjonen fikk en kritisk feil og kan ikke fortsette</string>
|
||||
<string name="unsupported_android_version">Denne versjonen av Android støttes ikke.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">De Ministro service is niet gevonden.\nDe applicatie kan niet starten.</string>
|
||||
<string name="ministro_needed_msg">Deze applicatie maakt gebruik van de Ministro service. Wilt u deze installeren?</string>
|
||||
<string name="fatal_error_msg">Er is een fatale fout in de applicatie opgetreden. De applicatie kan niet verder gaan.</string>
|
||||
<string name="unsupported_android_version">Deze versie van Android wordt niet ondersteund.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Usługa Ministro nie została znaleziona.\nAplikacja nie może zostać uruchomiona.</string>
|
||||
<string name="ministro_needed_msg">Aplikacja wymaga usługi Ministro. Czy chcesz ją zainstalować?</string>
|
||||
<string name="fatal_error_msg">Wystąpił błąd krytyczny. Aplikacja zostanie zamknięta.</string>
|
||||
<string name="unsupported_android_version">Ta wersja Androida nie jest obsługiwana.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Não foi possível encontrar o serviço Ministro.\nA aplicação não pode iniciar.</string>
|
||||
<string name="ministro_needed_msg">Essa aplicação requer o serviço Ministro. Gostaria de instalá-lo?</string>
|
||||
<string name="fatal_error_msg">Sua aplicação encontrou um erro fatal e não pode continuar.</string>
|
||||
<string name="unsupported_android_version">Esta versão do Android não é suportada.</string>
|
||||
</resources>
|
||||
|
@ -3,5 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Serviciul Ministro nu poate fi găsit.\nAplicaţia nu poate porni.</string>
|
||||
<string name="ministro_needed_msg">Această aplicaţie necesită serviciul Ministro.\nDoriţi să-l instalaţi?</string>
|
||||
<string name="fatal_error_msg">Aplicaţia dumneavoastră a întâmpinat o eroare fatală şi nu poate continua.</string>
|
||||
<string name="unsupported_android_version">Versiune Android nesuportată.</string>
|
||||
<string name="unsupported_android_version">Această versiune de Android nu este suportată.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Ministro servise nije pronađen. Aplikacija ne može biti pokrenuta.</string>
|
||||
<string name="ministro_needed_msg">Ova aplikacija zahteva Ministro servis. Želite li da ga instalirate?</string>
|
||||
<string name="fatal_error_msg">Vaša aplikacija je naišla na fatalnu grešku i ne može nastaviti sa radom.</string>
|
||||
<string name="unsupported_android_version">Ova verzija Android-a nije podržana.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">Сервис Ministro не найден.\nПриложение нельзя запустить.</string>
|
||||
<string name="ministro_needed_msg">Этому приложению необходим сервис Ministro. Вы хотите его установить?</string>
|
||||
<string name="fatal_error_msg">Ваше приложение столкнулось с фатальной ошибкой и не может более работать.</string>
|
||||
<string name="unsupported_android_version">Эта версия Android не поддерживается.</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">无法找到Ministro服务。\n应用程序无法启动。</string>
|
||||
<string name="ministro_needed_msg">此应用程序需要Ministro服务。您想安装它吗?</string>
|
||||
<string name="fatal_error_msg">您的应用程序遇到一个致命错误导致它无法继续。</string>
|
||||
<string name="unsupported_android_version">这个版本的安卓系统不被支持。</string>
|
||||
</resources>
|
||||
|
@ -3,4 +3,5 @@
|
||||
<string name="ministro_not_found_msg">無法找到Ministro服務。\n應用程序無法啟動。</string>
|
||||
<string name="ministro_needed_msg">此應用程序需要Ministro服務。您想安裝它嗎?</string>
|
||||
<string name="fatal_error_msg">您的應用程序遇到一個致命錯誤導致它無法繼續。</string>
|
||||
<string name="unsupported_android_version">這個版本的安卓系統不被支持。</string>
|
||||
</resources>
|
||||
|
@ -4,5 +4,5 @@
|
||||
<string name="ministro_not_found_msg">Can\'t find Ministro service.\nThe application can\'t start.</string>
|
||||
<string name="ministro_needed_msg">This application requires Ministro service. Would you like to install it?</string>
|
||||
<string name="fatal_error_msg">Your application encountered a fatal error and cannot continue.</string>
|
||||
<string name="unsupported_android_version">Unsupported Android version.</string>
|
||||
<string name="unsupported_android_version">This version of Android is not supported.</string>
|
||||
</resources>
|
||||
|
@ -2167,6 +2167,9 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
|
||||
|
||||
\snippet settings/settings.cpp 15
|
||||
|
||||
Note that type information is not preserved when reading settings from INI
|
||||
files; all values will be returned as QString.
|
||||
|
||||
The \l{tools/settingseditor}{Settings Editor} example lets you
|
||||
experiment with different settings location and with fallbacks
|
||||
turned on or off.
|
||||
@ -2448,7 +2451,10 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
|
||||
On 32-bit Windows or from a 64-bit application on 64-bit Windows,
|
||||
this works the same as specifying NativeFormat.
|
||||
This enum value was added in Qt 5.7.
|
||||
\value IniFormat Store the settings in INI files.
|
||||
\value IniFormat Store the settings in INI files. Note that type information
|
||||
is not preserved when reading settings from INI files;
|
||||
all values will be returned as QString.
|
||||
|
||||
\value InvalidFormat Special value returned by registerFormat().
|
||||
\omitvalue CustomFormat1
|
||||
\omitvalue CustomFormat2
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -94,7 +94,6 @@ QT_USE_NAMESPACE
|
||||
bool startedQuit;
|
||||
NSObject <NSApplicationDelegate> *reflectionDelegate;
|
||||
bool inLaunch;
|
||||
QWindowList hiddenWindows;
|
||||
}
|
||||
|
||||
+ (instancetype)sharedDelegate
|
||||
@ -116,22 +115,10 @@ QT_USE_NAMESPACE
|
||||
self = [super init];
|
||||
if (self) {
|
||||
inLaunch = true;
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver:self
|
||||
selector:@selector(updateScreens:)
|
||||
name:NSApplicationDidChangeScreenParametersNotification
|
||||
object:NSApp];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)updateScreens:(NSNotification *)notification
|
||||
{
|
||||
Q_UNUSED(notification);
|
||||
if (QCocoaIntegration *ci = QCocoaIntegration::instance())
|
||||
ci->updateScreens();
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_dockMenu release];
|
||||
@ -311,41 +298,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
|
||||
|
@ -144,6 +144,7 @@ private:
|
||||
#endif
|
||||
QScopedPointer<QPlatformTheme> mPlatformTheme;
|
||||
QList<QCocoaScreen *> mScreens;
|
||||
QMacScopedObserver m_screensObserver;
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
QCocoaClipboard *mCocoaClipboard;
|
||||
#endif
|
||||
|
@ -206,6 +206,9 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList)
|
||||
// by explicitly setting the presentation option to the magic 'default value',
|
||||
// which will resolve to an actual value and result in screen invalidation.
|
||||
cocoaApplication.presentationOptions = NSApplicationPresentationDefault;
|
||||
|
||||
m_screensObserver = QMacScopedObserver([NSApplication sharedApplication],
|
||||
NSApplicationDidChangeScreenParametersNotification, [&]() { updateScreens(); });
|
||||
updateScreens();
|
||||
|
||||
QMacInternalPasteboardMime::initializeMimeTypes();
|
||||
|
@ -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();
|
||||
|
@ -401,6 +401,11 @@ 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] && !eventDispatcher()->hasModalSession()) {
|
||||
@ -1540,7 +1545,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");
|
||||
|
@ -60,15 +60,10 @@ QT_FORWARD_DECLARE_CLASS(QCocoaWindow)
|
||||
#define QNSWindowProtocol QT_MANGLE_NAMESPACE(QNSWindowProtocol)
|
||||
|
||||
@protocol QNSWindowProtocol
|
||||
@optional
|
||||
- (BOOL)canBecomeKeyWindow;
|
||||
- (BOOL)worksWhenModal;
|
||||
- (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
|
||||
|
||||
|
@ -37,6 +37,8 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(QNSWINDOW_PROTOCOL_IMPLMENTATION)
|
||||
|
||||
#include "qnswindow.h"
|
||||
#include "qcocoawindow.h"
|
||||
#include "qcocoahelpers.h"
|
||||
@ -89,183 +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)worksWhenModal
|
||||
{
|
||||
if ([self isKindOfClass:[QNSPanel class]]) {
|
||||
if (QCocoaWindow *pw = self.platformWindow) {
|
||||
Qt::WindowType type = pw->window()->type();
|
||||
if (type == Qt::Popup || type == Qt::Dialog || type == Qt::Tool)
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
return qt_objcDynamicSuper();
|
||||
}
|
||||
|
||||
- (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
|
||||
{
|
||||
@ -326,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
|
||||
|
@ -475,6 +475,8 @@ void QTestLog::addBXFail(const char *msg, const char *file, int line)
|
||||
QTEST_ASSERT(msg);
|
||||
QTEST_ASSERT(file);
|
||||
|
||||
++QTest::blacklists;
|
||||
|
||||
QTest::TestLoggers::addIncident(QAbstractTestLogger::BlacklistedXFail, msg, file, line);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
@ -1252,7 +1261,7 @@ bool updateStringsXml(const Options &options)
|
||||
fprintf(stderr, "Can't open %s for writing.\n", qPrintable(fileName));
|
||||
return false;
|
||||
}
|
||||
file.write(QByteArray("<?xml version='1.0' encoding='utf-8'?><resources><string name=\"app_name\">")
|
||||
file.write(QByteArray("<?xml version='1.0' encoding='utf-8'?><resources><string name=\"app_name\" translatable=\"false\">")
|
||||
.append(QFileInfo(options.applicationBinary).baseName().mid(sizeof("lib") - 1).toLatin1())
|
||||
.append("</string></resources>\n"));
|
||||
return true;
|
||||
@ -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;
|
||||
|
@ -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
|
||||
|
@ -431,6 +431,13 @@ void Http2Server::readReady()
|
||||
if (connectionError)
|
||||
return;
|
||||
|
||||
if (redirectSent) {
|
||||
// We are a "single shot" server, working in 'h2' mode,
|
||||
// responding with a redirect code. Don't bother to handle
|
||||
// anything else now.
|
||||
return;
|
||||
}
|
||||
|
||||
if (upgradeProtocol) {
|
||||
handleProtocolUpgrade();
|
||||
} else if (waitingClientPreface) {
|
||||
@ -800,6 +807,13 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody)
|
||||
|
||||
HttpHeader header;
|
||||
if (redirectWhileReading) {
|
||||
if (redirectSent) {
|
||||
// This is a "single-shot" server responding with a redirect code.
|
||||
return;
|
||||
}
|
||||
|
||||
redirectSent = true;
|
||||
|
||||
qDebug("server received HEADERS frame (followed by DATA frames), redirecting ...");
|
||||
Q_ASSERT(targetPort);
|
||||
header.push_back({":status", "308"});
|
||||
|
@ -193,6 +193,7 @@ private:
|
||||
// Redirect, with status code 308, as soon as we've seen headers, while client
|
||||
// may still be sending DATA frames. See tst_Http2::earlyResponse().
|
||||
bool redirectWhileReading = false;
|
||||
bool redirectSent = false;
|
||||
quint16 targetPort = 0;
|
||||
QAtomicInt interrupted;
|
||||
protected slots:
|
||||
|
@ -474,7 +474,7 @@ void tst_Http2::earlyResponse()
|
||||
runEventLoop();
|
||||
|
||||
QVERIFY(serverPort);
|
||||
sendRequest(1, QNetworkRequest::NormalPriority, {10000000, Qt::Uninitialized});
|
||||
sendRequest(1, QNetworkRequest::NormalPriority, {1000000, Qt::Uninitialized});
|
||||
|
||||
runEventLoop();
|
||||
|
||||
|
@ -913,7 +913,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"),
|
||||
|
@ -1,8 +1,8 @@
|
||||
TEMPLATE=subdirs
|
||||
SUBDIRS=\
|
||||
qtHaveModule(widgets): SUBDIRS = \
|
||||
qsqlquerymodel \
|
||||
qsqlrelationaltablemodel \
|
||||
qsqlrelationaldelegate
|
||||
|
||||
SUBDIRS += qsqlrelationaltablemodel \
|
||||
qsqltablemodel \
|
||||
|
||||
!qtHaveModule(widgets): SUBDIRS -= \
|
||||
qsqlquerymodel
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user