Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: qmake/generators/unix/unixmake2.cpp src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
This commit is contained in:
commit
f3b28e8021
@ -261,7 +261,7 @@ xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identif
|
|||||||
QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
|
QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
|
||||||
|
|
||||||
!macx-xcode {
|
!macx-xcode {
|
||||||
generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_)
|
generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_) $$QMAKE_ARGS
|
||||||
generate_xcode_project.target = xcodeproj
|
generate_xcode_project.target = xcodeproj
|
||||||
QMAKE_EXTRA_VARIABLES += _PRO_FILE_
|
QMAKE_EXTRA_VARIABLES += _PRO_FILE_
|
||||||
QMAKE_EXTRA_TARGETS += generate_xcode_project
|
QMAKE_EXTRA_TARGETS += generate_xcode_project
|
||||||
|
@ -1454,7 +1454,36 @@ UnixMakefileGenerator::libtoolFileName(bool fixify)
|
|||||||
void
|
void
|
||||||
UnixMakefileGenerator::writeLibtoolFile()
|
UnixMakefileGenerator::writeLibtoolFile()
|
||||||
{
|
{
|
||||||
|
auto fixDependencyLibs
|
||||||
|
= [this](const ProStringList &libs)
|
||||||
|
{
|
||||||
|
ProStringList result;
|
||||||
|
for (auto lib : libs) {
|
||||||
|
auto fi = fileInfo(lib.toQString());
|
||||||
|
if (fi.isAbsolute()) {
|
||||||
|
const QString libDirArg = "-L" + fi.path();
|
||||||
|
if (!result.contains(libDirArg))
|
||||||
|
result += libDirArg;
|
||||||
|
QString namespec = fi.fileName();
|
||||||
|
int dotPos = namespec.lastIndexOf('.');
|
||||||
|
if (dotPos != -1 && namespec.startsWith("lib")) {
|
||||||
|
namespec.truncate(dotPos);
|
||||||
|
namespec.remove(0, 3);
|
||||||
|
} else {
|
||||||
|
debug_msg(1, "Ignoring dependency library %s",
|
||||||
|
lib.toLatin1().constData());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
result += "-l" + namespec;
|
||||||
|
} else {
|
||||||
|
result += lib;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
QString fname = libtoolFileName(), lname = fname;
|
QString fname = libtoolFileName(), lname = fname;
|
||||||
|
debug_msg(1, "Writing libtool file %s", fname.toLatin1().constData());
|
||||||
mkdir(fileInfo(fname).path());
|
mkdir(fileInfo(fname).path());
|
||||||
int slsh = lname.lastIndexOf(Option::dir_sep);
|
int slsh = lname.lastIndexOf(Option::dir_sep);
|
||||||
if(slsh != -1)
|
if(slsh != -1)
|
||||||
@ -1492,12 +1521,11 @@ UnixMakefileGenerator::writeLibtoolFile()
|
|||||||
<< ".a'\n\n";
|
<< ".a'\n\n";
|
||||||
|
|
||||||
t << "# Libraries that this one depends upon.\n";
|
t << "# Libraries that this one depends upon.\n";
|
||||||
|
static const ProKey libVars[] = { "LIBS", "QMAKE_LIBS" };
|
||||||
ProStringList libs;
|
ProStringList libs;
|
||||||
libs << "LIBS" << "QMAKE_LIBS";
|
for (auto var : libVars)
|
||||||
t << "dependency_libs='";
|
libs += fixLibFlags(var);
|
||||||
for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it)
|
t << "dependency_libs='" << fixDependencyLibs(libs).join(' ') << "'\n\n";
|
||||||
t << fixLibFlags((*it).toKey()).join(' ') << ' ';
|
|
||||||
t << "'\n\n";
|
|
||||||
|
|
||||||
t << "# Version information for " << lname << "\n";
|
t << "# Version information for " << lname << "\n";
|
||||||
int maj = project->first("VER_MAJ").toInt();
|
int maj = project->first("VER_MAJ").toInt();
|
||||||
|
@ -437,6 +437,14 @@ const QOperatingSystemVersion QOperatingSystemVersion::MacOSHighSierra =
|
|||||||
const QOperatingSystemVersion QOperatingSystemVersion::MacOSMojave =
|
const QOperatingSystemVersion QOperatingSystemVersion::MacOSMojave =
|
||||||
QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 14);
|
QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 14);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\variable QOperatingSystemVersion::MacOSCatalina
|
||||||
|
\brief a version corresponding to macOS Catalina (version 10.15).
|
||||||
|
\since 5.12.5
|
||||||
|
*/
|
||||||
|
const QOperatingSystemVersion QOperatingSystemVersion::MacOSCatalina =
|
||||||
|
QOperatingSystemVersion(QOperatingSystemVersion::MacOS, 10, 15);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\variable QOperatingSystemVersion::AndroidJellyBean
|
\variable QOperatingSystemVersion::AndroidJellyBean
|
||||||
\brief a version corresponding to Android Jelly Bean (version 4.1, API level 16).
|
\brief a version corresponding to Android Jelly Bean (version 4.1, API level 16).
|
||||||
|
@ -71,6 +71,7 @@ public:
|
|||||||
static const QOperatingSystemVersion MacOSSierra;
|
static const QOperatingSystemVersion MacOSSierra;
|
||||||
static const QOperatingSystemVersion MacOSHighSierra;
|
static const QOperatingSystemVersion MacOSHighSierra;
|
||||||
static const QOperatingSystemVersion MacOSMojave;
|
static const QOperatingSystemVersion MacOSMojave;
|
||||||
|
static const QOperatingSystemVersion MacOSCatalina;
|
||||||
|
|
||||||
static const QOperatingSystemVersion AndroidJellyBean;
|
static const QOperatingSystemVersion AndroidJellyBean;
|
||||||
static const QOperatingSystemVersion AndroidJellyBean_MR1;
|
static const QOperatingSystemVersion AndroidJellyBean_MR1;
|
||||||
|
@ -231,17 +231,23 @@
|
|||||||
# if !defined(__MAC_10_14)
|
# if !defined(__MAC_10_14)
|
||||||
# define __MAC_10_14 101400
|
# define __MAC_10_14 101400
|
||||||
# endif
|
# endif
|
||||||
|
# if !defined(__MAC_10_15)
|
||||||
|
# define __MAC_10_15 101500
|
||||||
|
# endif
|
||||||
# if !defined(MAC_OS_X_VERSION_10_11)
|
# if !defined(MAC_OS_X_VERSION_10_11)
|
||||||
# define MAC_OS_X_VERSION_10_11 101100
|
# define MAC_OS_X_VERSION_10_11 __MAC_10_11
|
||||||
# endif
|
# endif
|
||||||
# if !defined(MAC_OS_X_VERSION_10_12)
|
# if !defined(MAC_OS_X_VERSION_10_12)
|
||||||
# define MAC_OS_X_VERSION_10_12 101200
|
# define MAC_OS_X_VERSION_10_12 __MAC_10_12
|
||||||
# endif
|
# endif
|
||||||
# if !defined(MAC_OS_X_VERSION_10_13)
|
# if !defined(MAC_OS_X_VERSION_10_13)
|
||||||
# define MAC_OS_X_VERSION_10_13 101300
|
# define MAC_OS_X_VERSION_10_13 __MAC_10_13
|
||||||
# endif
|
# endif
|
||||||
# if !defined(MAC_OS_X_VERSION_10_14)
|
# if !defined(MAC_OS_X_VERSION_10_14)
|
||||||
# define MAC_OS_X_VERSION_10_14 101400
|
# define MAC_OS_X_VERSION_10_14 __MAC_10_14
|
||||||
|
# endif
|
||||||
|
# if !defined(MAC_OS_X_VERSION_10_15)
|
||||||
|
# define MAC_OS_X_VERSION_10_15 __MAC_10_15
|
||||||
# endif
|
# endif
|
||||||
#
|
#
|
||||||
# if !defined(__IPHONE_10_0)
|
# if !defined(__IPHONE_10_0)
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
#include <QtCore/qloggingcategory.h>
|
#include <QtCore/qloggingcategory.h>
|
||||||
#include <QtGui/qregion.h>
|
#include <QtGui/qregion.h>
|
||||||
#include <QtGui/qscreen.h>
|
#include <QtGui/qscreen.h>
|
||||||
|
#include <QtGui/qvector2d.h>
|
||||||
#include <QtGui/qwindow.h>
|
#include <QtGui/qwindow.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -117,13 +118,26 @@ private:
|
|||||||
|
|
||||||
namespace QHighDpi {
|
namespace QHighDpi {
|
||||||
|
|
||||||
template <typename T>
|
inline qreal scale(qreal value, qreal scaleFactor, QPointF /* origin */ = QPointF(0, 0))
|
||||||
inline T scale(const T &value, qreal scaleFactor, QPoint origin = QPoint(0, 0))
|
|
||||||
{
|
{
|
||||||
Q_UNUSED(origin)
|
|
||||||
return value * scaleFactor;
|
return value * scaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline QSize scale(const QSize &value, qreal scaleFactor, QPointF /* origin */ = QPointF(0, 0))
|
||||||
|
{
|
||||||
|
return value * scaleFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QSizeF scale(const QSizeF &value, qreal scaleFactor, QPointF /* origin */ = QPointF(0, 0))
|
||||||
|
{
|
||||||
|
return value * scaleFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline QVector2D scale(const QVector2D &value, qreal scaleFactor, QPointF /* origin */ = QPointF(0, 0))
|
||||||
|
{
|
||||||
|
return value * float(scaleFactor);
|
||||||
|
}
|
||||||
|
|
||||||
inline QPointF scale(const QPointF &pos, qreal scaleFactor, QPointF origin = QPointF(0, 0))
|
inline QPointF scale(const QPointF &pos, qreal scaleFactor, QPointF origin = QPointF(0, 0))
|
||||||
{
|
{
|
||||||
return (pos - origin) * scaleFactor + origin;
|
return (pos - origin) * scaleFactor + origin;
|
||||||
|
@ -554,10 +554,6 @@ int QSurfaceFormat::alphaBufferSize() const
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
Set the desired \a size in bits of the red channel of the color buffer.
|
Set the desired \a size in bits of the red channel of the color buffer.
|
||||||
|
|
||||||
\note On Mac OSX, be sure to set the buffer size of all color channels,
|
|
||||||
otherwise this setting will have no effect. If one of the buffer sizes is not set,
|
|
||||||
the current bit-depth of the screen is used.
|
|
||||||
*/
|
*/
|
||||||
void QSurfaceFormat::setRedBufferSize(int size)
|
void QSurfaceFormat::setRedBufferSize(int size)
|
||||||
{
|
{
|
||||||
@ -569,10 +565,6 @@ void QSurfaceFormat::setRedBufferSize(int size)
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
Set the desired \a size in bits of the green channel of the color buffer.
|
Set the desired \a size in bits of the green channel of the color buffer.
|
||||||
|
|
||||||
\note On Mac OSX, be sure to set the buffer size of all color channels,
|
|
||||||
otherwise this setting will have no effect. If one of the buffer sizes is not set,
|
|
||||||
the current bit-depth of the screen is used.
|
|
||||||
*/
|
*/
|
||||||
void QSurfaceFormat::setGreenBufferSize(int size)
|
void QSurfaceFormat::setGreenBufferSize(int size)
|
||||||
{
|
{
|
||||||
@ -584,10 +576,6 @@ void QSurfaceFormat::setGreenBufferSize(int size)
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
Set the desired \a size in bits of the blue channel of the color buffer.
|
Set the desired \a size in bits of the blue channel of the color buffer.
|
||||||
|
|
||||||
\note On Mac OSX, be sure to set the buffer size of all color channels,
|
|
||||||
otherwise this setting will have no effect. If one of the buffer sizes is not set,
|
|
||||||
the current bit-depth of the screen is used.
|
|
||||||
*/
|
*/
|
||||||
void QSurfaceFormat::setBlueBufferSize(int size)
|
void QSurfaceFormat::setBlueBufferSize(int size)
|
||||||
{
|
{
|
||||||
|
@ -1763,8 +1763,10 @@ void QT_FASTCALL comp_func_Lighten_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QR
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if Sca.Da + Dca.Sa >= Sa.Da
|
if Sca.Da + Dca.Sa > Sa.Da
|
||||||
Dca' = Sa.Da + Sca.(1 - Da) + Dca.(1 - Sa)
|
Dca' = Sa.Da + Sca.(1 - Da) + Dca.(1 - Sa)
|
||||||
|
else if Sca == Sa
|
||||||
|
Dca' = Dca.Sa + Sca.(1 - Da) + Dca.(1 - Sa)
|
||||||
otherwise
|
otherwise
|
||||||
Dca' = Dca.Sa/(1-Sca/Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
|
Dca' = Dca.Sa/(1-Sca/Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
|
||||||
*/
|
*/
|
||||||
@ -1775,8 +1777,10 @@ static inline int color_dodge_op(int dst, int src, int da, int sa)
|
|||||||
const int src_da = src * da;
|
const int src_da = src * da;
|
||||||
|
|
||||||
const int temp = src * (255 - da) + dst * (255 - sa);
|
const int temp = src * (255 - da) + dst * (255 - sa);
|
||||||
if (src_da + dst_sa >= sa_da)
|
if (src_da + dst_sa > sa_da)
|
||||||
return qt_div_255(sa_da + temp);
|
return qt_div_255(sa_da + temp);
|
||||||
|
else if (src == sa || sa == 0)
|
||||||
|
return qt_div_255(temp);
|
||||||
else
|
else
|
||||||
return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp);
|
return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp);
|
||||||
}
|
}
|
||||||
@ -1788,8 +1792,10 @@ static inline uint color_dodge_op_rgb64(qint64 dst, qint64 src, qint64 da, qint6
|
|||||||
const qint64 src_da = src * da;
|
const qint64 src_da = src * da;
|
||||||
|
|
||||||
const qint64 temp = src * (65535 - da) + dst * (65535 - sa);
|
const qint64 temp = src * (65535 - da) + dst * (65535 - sa);
|
||||||
if (src_da + dst_sa >= sa_da)
|
if (src_da + dst_sa > sa_da)
|
||||||
return qt_div_65535(sa_da + temp);
|
return qt_div_65535(sa_da + temp);
|
||||||
|
else if (src == sa || sa == 0)
|
||||||
|
return qt_div_65535(temp);
|
||||||
else
|
else
|
||||||
return qt_div_65535(65535 * dst_sa / (65535 - 65535 * src / sa) + temp);
|
return qt_div_65535(65535 * dst_sa / (65535 - 65535 * src / sa) + temp);
|
||||||
}
|
}
|
||||||
@ -1915,8 +1921,10 @@ void QT_FASTCALL comp_func_ColorDodge_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if Sca.Da + Dca.Sa <= Sa.Da
|
if Sca.Da + Dca.Sa < Sa.Da
|
||||||
Dca' = Sca.(1 - Da) + Dca.(1 - Sa)
|
Dca' = Sca.(1 - Da) + Dca.(1 - Sa)
|
||||||
|
else if Sca == 0
|
||||||
|
Dca' = Dca.Sa + Sca.(1 - Da) + Dca.(1 - Sa)
|
||||||
otherwise
|
otherwise
|
||||||
Dca' = Sa.(Sca.Da + Dca.Sa - Sa.Da)/Sca + Sca.(1 - Da) + Dca.(1 - Sa)
|
Dca' = Sa.(Sca.Da + Dca.Sa - Sa.Da)/Sca + Sca.(1 - Da) + Dca.(1 - Sa)
|
||||||
*/
|
*/
|
||||||
@ -1928,8 +1936,10 @@ static inline int color_burn_op(int dst, int src, int da, int sa)
|
|||||||
|
|
||||||
const int temp = src * (255 - da) + dst * (255 - sa);
|
const int temp = src * (255 - da) + dst * (255 - sa);
|
||||||
|
|
||||||
if (src == 0 || src_da + dst_sa <= sa_da)
|
if (src_da + dst_sa < sa_da)
|
||||||
return qt_div_255(temp);
|
return qt_div_255(temp);
|
||||||
|
else if (src == 0)
|
||||||
|
return qt_div_255(dst_sa + temp);
|
||||||
return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp);
|
return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1941,8 +1951,10 @@ static inline uint color_burn_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64
|
|||||||
|
|
||||||
const qint64 temp = src * (65535 - da) + dst * (65535 - sa);
|
const qint64 temp = src * (65535 - da) + dst * (65535 - sa);
|
||||||
|
|
||||||
if (src == 0 || src_da + dst_sa <= sa_da)
|
if (src_da + dst_sa < sa_da)
|
||||||
return qt_div_65535(temp);
|
return qt_div_65535(temp);
|
||||||
|
else if (src == 0)
|
||||||
|
return qt_div_65535(dst_sa + temp);
|
||||||
return qt_div_65535(sa * (src_da + dst_sa - sa_da) / src + temp);
|
return qt_div_65535(sa * (src_da + dst_sa - sa_da) / src + temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,12 +105,12 @@ public Q_SLOTS:
|
|||||||
inline void emitResultsReady(const QHostInfo &info)
|
inline void emitResultsReady(const QHostInfo &info)
|
||||||
{
|
{
|
||||||
if (slotObj) {
|
if (slotObj) {
|
||||||
// we used to have a context object, but it's already destroyed
|
// we either didn't have a context object, or it's still alive
|
||||||
if (withContextObject && !receiver)
|
if (!withContextObject || receiver) {
|
||||||
return;
|
QHostInfo copy = info;
|
||||||
QHostInfo copy = info;
|
void *args[2] = { 0, reinterpret_cast<void *>(©) };
|
||||||
void *args[2] = { 0, reinterpret_cast<void *>(©) };
|
slotObj->call(const_cast<QObject*>(receiver.data()), args);
|
||||||
slotObj->call(const_cast<QObject*>(receiver.data()), args);
|
}
|
||||||
slotObj->destroyIfLastRef();
|
slotObj->destroyIfLastRef();
|
||||||
} else {
|
} else {
|
||||||
emit resultsReady(info);
|
emit resultsReady(info);
|
||||||
|
@ -197,8 +197,15 @@ NSOpenGLPixelFormat *QCocoaGLContext::pixelFormatForSurfaceFormat(const QSurface
|
|||||||
attrs << NSOpenGLPFAStencilSize << format.stencilBufferSize();
|
attrs << NSOpenGLPFAStencilSize << format.stencilBufferSize();
|
||||||
if (format.alphaBufferSize() > 0)
|
if (format.alphaBufferSize() > 0)
|
||||||
attrs << NSOpenGLPFAAlphaSize << format.alphaBufferSize();
|
attrs << NSOpenGLPFAAlphaSize << format.alphaBufferSize();
|
||||||
if (format.redBufferSize() > 0 && format.greenBufferSize() > 0 && format.blueBufferSize() > 0) {
|
|
||||||
const int colorSize = format.redBufferSize() + format.greenBufferSize() + format.blueBufferSize();
|
auto rbz = format.redBufferSize();
|
||||||
|
auto gbz = format.greenBufferSize();
|
||||||
|
auto bbz = format.blueBufferSize();
|
||||||
|
if (rbz > 0 || gbz > 0 || bbz > 0) {
|
||||||
|
auto fallbackSize = qMax(rbz, qMax(gbz, bbz));
|
||||||
|
auto colorSize = (rbz > 0 ? rbz : fallbackSize)
|
||||||
|
+ (gbz > 0 ? gbz : fallbackSize)
|
||||||
|
+ (bbz > 0 ? bbz : fallbackSize);
|
||||||
attrs << NSOpenGLPFAColorSize << colorSize << NSOpenGLPFAMinimumPolicy;
|
attrs << NSOpenGLPFAColorSize << colorSize << NSOpenGLPFAMinimumPolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1544,12 +1544,6 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
|
|||||||
Qt::WindowType type = window()->type();
|
Qt::WindowType type = window()->type();
|
||||||
Qt::WindowFlags flags = window()->flags();
|
Qt::WindowFlags flags = window()->flags();
|
||||||
|
|
||||||
// Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow
|
|
||||||
// a window to be created within the area of the screen that has a Y coordinate (I quadrant)
|
|
||||||
// higher than the height of the screen in its non-rotated state, unless the window is
|
|
||||||
// created with the NSWindowStyleMaskBorderless style mask.
|
|
||||||
NSWindowStyleMask styleMask = windowStyleMask(flags);
|
|
||||||
|
|
||||||
QRect rect = geometry();
|
QRect rect = geometry();
|
||||||
|
|
||||||
QScreen *targetScreen = nullptr;
|
QScreen *targetScreen = nullptr;
|
||||||
@ -1560,35 +1554,57 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSWindowStyleMask styleMask = windowStyleMask(flags);
|
||||||
|
|
||||||
if (!targetScreen) {
|
if (!targetScreen) {
|
||||||
qCWarning(lcQpaWindow) << "Window position" << rect << "outside any known screen, using primary screen";
|
qCWarning(lcQpaWindow) << "Window position" << rect << "outside any known screen, using primary screen";
|
||||||
targetScreen = QGuiApplication::primaryScreen();
|
targetScreen = QGuiApplication::primaryScreen();
|
||||||
// AppKit will only reposition a window that's outside the target screen area if
|
// Unless the window is created as borderless AppKit won't find a position and
|
||||||
// the window has a title bar. If left out, the window ends up with no screen.
|
// screen that's close to the requested invalid position, and will always place
|
||||||
// The style mask will be corrected to the original style mask in setWindowFlags.
|
// the window on the primary screen.
|
||||||
styleMask |= NSWindowStyleMaskTitled;
|
styleMask = NSWindowStyleMaskBorderless;
|
||||||
}
|
}
|
||||||
|
|
||||||
rect.translate(-targetScreen->geometry().topLeft());
|
rect.translate(-targetScreen->geometry().topLeft());
|
||||||
QCocoaScreen *cocoaScreen = static_cast<QCocoaScreen *>(targetScreen->handle());
|
auto *targetCocoaScreen = static_cast<QCocoaScreen *>(targetScreen->handle());
|
||||||
NSRect frame = QCocoaScreen::mapToNative(rect, cocoaScreen);
|
NSRect contentRect = QCocoaScreen::mapToNative(rect, targetCocoaScreen);
|
||||||
|
|
||||||
|
if (targetScreen->primaryOrientation() == Qt::PortraitOrientation) {
|
||||||
|
// The macOS window manager has a bug, where if a screen is rotated, it will not allow
|
||||||
|
// a window to be created within the area of the screen that has a Y coordinate (I quadrant)
|
||||||
|
// higher than the height of the screen in its non-rotated state (including a magic padding
|
||||||
|
// of 24 points), unless the window is created with the NSWindowStyleMaskBorderless style mask.
|
||||||
|
if (styleMask && (contentRect.origin.y + 24 > targetScreen->geometry().width())) {
|
||||||
|
qCDebug(lcQpaWindow) << "Window positioned on portrait screen."
|
||||||
|
<< "Adjusting style mask during creation";
|
||||||
|
styleMask = NSWindowStyleMaskBorderless;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create NSWindow
|
// Create NSWindow
|
||||||
Class windowClass = shouldBePanel ? [QNSPanel class] : [QNSWindow class];
|
Class windowClass = shouldBePanel ? [QNSPanel class] : [QNSWindow class];
|
||||||
QCocoaNSWindow *nsWindow = [[windowClass alloc] initWithContentRect:frame
|
QCocoaNSWindow *nsWindow = [[windowClass alloc] initWithContentRect:contentRect
|
||||||
|
// Mask will be updated in setWindowFlags if not the final mask
|
||||||
styleMask:styleMask
|
styleMask:styleMask
|
||||||
// Deferring window creation breaks OpenGL (the GL context is
|
// Deferring window creation breaks OpenGL (the GL context is
|
||||||
// set up before the window is shown and needs a proper window)
|
// set up before the window is shown and needs a proper window)
|
||||||
backing:NSBackingStoreBuffered defer:NO
|
backing:NSBackingStoreBuffered defer:NO
|
||||||
screen:cocoaScreen->nativeScreen()
|
screen:targetCocoaScreen->nativeScreen()
|
||||||
platformWindow:this];
|
platformWindow:this];
|
||||||
|
|
||||||
Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow",
|
// The resulting screen can be different from the screen requested if
|
||||||
"Resulting NSScreen should match the requested NSScreen");
|
// for example the application has been assigned to a specific display.
|
||||||
|
auto resultingScreen = QCocoaScreen::get(nsWindow.screen);
|
||||||
|
|
||||||
if (targetScreen != window()->screen()) {
|
// But may not always be resolved at this point, in which case we fall back
|
||||||
|
// to the target screen. The real screen will be delivered as a screen change
|
||||||
|
// when resolved as part of ordering the window on screen.
|
||||||
|
if (!resultingScreen)
|
||||||
|
resultingScreen = targetCocoaScreen;
|
||||||
|
|
||||||
|
if (resultingScreen->screen() != window()->screen()) {
|
||||||
QWindowSystemInterface::handleWindowScreenChanged<
|
QWindowSystemInterface::handleWindowScreenChanged<
|
||||||
QWindowSystemInterface::SynchronousDelivery>(window(), targetScreen);
|
QWindowSystemInterface::SynchronousDelivery>(window(), resultingScreen->screen());
|
||||||
}
|
}
|
||||||
|
|
||||||
static QSharedPointer<QNSWindowDelegate> sharedDelegate([[QNSWindowDelegate alloc] init],
|
static QSharedPointer<QNSWindowDelegate> sharedDelegate([[QNSWindowDelegate alloc] init],
|
||||||
|
@ -2622,7 +2622,8 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re
|
|||||||
// QTBUG-32663, suppress resize cursor for fixed size windows.
|
// QTBUG-32663, suppress resize cursor for fixed size windows.
|
||||||
const QWindow *w = window();
|
const QWindow *w = window();
|
||||||
if (!w->isTopLevel() // Task 105852, minimized windows need to respond to user input.
|
if (!w->isTopLevel() // Task 105852, minimized windows need to respond to user input.
|
||||||
|| !(m_windowState & ~Qt::WindowActive)
|
|| (m_windowState != Qt::WindowNoState)
|
||||||
|
|| !isActive()
|
||||||
|| (m_data.flags & Qt::FramelessWindowHint)) {
|
|| (m_data.flags & Qt::FramelessWindowHint)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -2642,12 +2643,10 @@ bool QWindowsWindow::handleNonClientHitTest(const QPoint &globalPos, LRESULT *re
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (localPos.y() < 0) {
|
if (localPos.y() < 0) {
|
||||||
const QMargins margins = frameMargins();
|
const int topResizeBarPos = -frameMargins().top();
|
||||||
const int topResizeBarPos = margins.left() - margins.top();
|
if (localPos.y() >= topResizeBarPos)
|
||||||
if (localPos.y() < topResizeBarPos) {
|
|
||||||
*result = HTCAPTION; // Extend caption over top resize bar, let's user move the window.
|
*result = HTCAPTION; // Extend caption over top resize bar, let's user move the window.
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fixedWidth && (localPos.x() < 0 || localPos.x() >= size.width())) {
|
if (fixedWidth && (localPos.x() < 0 || localPos.x() >= size.width())) {
|
||||||
|
@ -295,6 +295,12 @@ void Automaton::build ()
|
|||||||
buildDefaultReduceActions ();
|
buildDefaultReduceActions ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__cpp_lib_not_fn) && __cpp_lib_not_fn >= 201603
|
||||||
|
# define Q_NOT_FN std::not_fn
|
||||||
|
#else
|
||||||
|
# define Q_NOT_FN std::not1
|
||||||
|
#endif
|
||||||
|
|
||||||
void Automaton::buildNullables ()
|
void Automaton::buildNullables ()
|
||||||
{
|
{
|
||||||
bool changed = true;
|
bool changed = true;
|
||||||
@ -305,7 +311,7 @@ void Automaton::buildNullables ()
|
|||||||
|
|
||||||
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
|
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
|
||||||
{
|
{
|
||||||
NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (Nullable (this)));
|
NameList::iterator nn = std::find_if(rule->rhs.begin(), rule->rhs.end(), Q_NOT_FN(Nullable(this)));
|
||||||
|
|
||||||
if (nn == rule->rhs.end ())
|
if (nn == rule->rhs.end ())
|
||||||
changed |= nullables.insert (rule->lhs).second;
|
changed |= nullables.insert (rule->lhs).second;
|
||||||
@ -646,7 +652,7 @@ void Automaton::buildIncludesDigraph ()
|
|||||||
if (! _M_grammar->isNonTerminal (*A))
|
if (! _M_grammar->isNonTerminal (*A))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (Nullable (this)));
|
NameList::iterator first_not_nullable = std::find_if(dot, rule->rhs.end(), Q_NOT_FN(Nullable(this)));
|
||||||
if (first_not_nullable != rule->rhs.end ())
|
if (first_not_nullable != rule->rhs.end ())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ SUBDIRS=\
|
|||||||
qguimetatype \
|
qguimetatype \
|
||||||
qguitimer \
|
qguitimer \
|
||||||
qguivariant \
|
qguivariant \
|
||||||
|
qhighdpiscaling \
|
||||||
qinputmethod \
|
qinputmethod \
|
||||||
qkeyevent \
|
qkeyevent \
|
||||||
qkeysequence \
|
qkeysequence \
|
||||||
@ -35,6 +36,8 @@ win32:!winrt:qtHaveModule(network): SUBDIRS += noqteventloop
|
|||||||
!qtHaveModule(network): SUBDIRS -= \
|
!qtHaveModule(network): SUBDIRS -= \
|
||||||
qguieventloop
|
qguieventloop
|
||||||
|
|
||||||
|
!qtConfig(highdpiscaling): SUBDIRS -= qhighdpiscaling
|
||||||
|
|
||||||
!qtConfig(opengl): SUBDIRS -= qopenglwindow
|
!qtConfig(opengl): SUBDIRS -= qopenglwindow
|
||||||
|
|
||||||
android|uikit: SUBDIRS -= qclipboard
|
android|uikit: SUBDIRS -= qclipboard
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
CONFIG += testcase
|
||||||
|
TARGET = tst_qhighdpiscaling
|
||||||
|
|
||||||
|
QT += core-private gui-private testlib
|
||||||
|
|
||||||
|
SOURCES += tst_qhighdpiscaling.cpp
|
@ -0,0 +1,77 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2019 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of the test suite of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
|
||||||
|
** 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 General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** 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-3.0.html.
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <private/qhighdpiscaling_p.h>
|
||||||
|
#include <qpa/qplatformscreen.h>
|
||||||
|
|
||||||
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
|
class tst_QHighDpiScaling: public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void scale();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Emulate the case of a High DPI secondary screen
|
||||||
|
class MyPlatformScreen : public QPlatformScreen
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QRect geometry() const override { return QRect(3840, 0, 3840, 1920); }
|
||||||
|
QRect availableGeometry() const override { return geometry(); }
|
||||||
|
|
||||||
|
int depth() const override { return 32; }
|
||||||
|
QImage::Format format() const override { return QImage::Format_ARGB32_Premultiplied; }
|
||||||
|
};
|
||||||
|
|
||||||
|
// QTBUG-77255: Test some scaling overloads
|
||||||
|
void tst_QHighDpiScaling::scale()
|
||||||
|
{
|
||||||
|
QHighDpiScaling::setGlobalFactor(2);
|
||||||
|
QScopedPointer<QPlatformScreen> screen(new MyPlatformScreen);
|
||||||
|
|
||||||
|
qreal nativeValue = 10;
|
||||||
|
const qreal value = QHighDpi::fromNativePixels(nativeValue, screen.data());
|
||||||
|
QCOMPARE(value, qreal(5));
|
||||||
|
QCOMPARE(QHighDpi::toNativePixels(value, screen.data()), nativeValue);
|
||||||
|
|
||||||
|
// 10, 10 within screen should translate to 5,5 with origin preserved
|
||||||
|
const QPoint nativePoint = screen->geometry().topLeft() + QPoint(10, 10);
|
||||||
|
const QPoint point = QHighDpi::fromNativePixels(nativePoint, screen.data());
|
||||||
|
QCOMPARE(point, QPoint(3845, 5));
|
||||||
|
QCOMPARE(QHighDpi::toNativePixels(point, screen.data()), nativePoint);
|
||||||
|
|
||||||
|
const QPointF nativePointF(nativePoint);
|
||||||
|
const QPointF pointF = QHighDpi::fromNativePixels(nativePointF, screen.data());
|
||||||
|
QCOMPARE(pointF, QPointF(3845, 5));
|
||||||
|
QCOMPARE(QHighDpi::toNativePixels(pointF, screen.data()), nativePointF);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "tst_qhighdpiscaling.moc"
|
||||||
|
QTEST_MAIN(tst_QHighDpiScaling);
|
3
tests/auto/network/access/http2/BLACKLIST
Normal file
3
tests/auto/network/access/http2/BLACKLIST
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
See qtbase/src/testlib/qtestblacklist.cpp for format
|
||||||
|
[connectToHost]
|
||||||
|
*
|
@ -592,6 +592,19 @@ void tst_Http2::connectToHost()
|
|||||||
|
|
||||||
#if QT_CONFIG(ssl)
|
#if QT_CONFIG(ssl)
|
||||||
Q_ASSERT(!clearTextHTTP2 || connectionType != H2Type::h2Alpn);
|
Q_ASSERT(!clearTextHTTP2 || connectionType != H2Type::h2Alpn);
|
||||||
|
|
||||||
|
#if QT_CONFIG(securetransport)
|
||||||
|
// Normally on macOS we use plain text only for SecureTransport
|
||||||
|
// does not support ALPN on the server side. With 'direct encrytped'
|
||||||
|
// we have to use TLS sockets (== private key) and thus suppress a
|
||||||
|
// keychain UI asking for permission to use a private key.
|
||||||
|
// Our CI has this, but somebody testing locally - will have a problem.
|
||||||
|
qputenv("QT_SSL_USE_TEMPORARY_KEYCHAIN", QByteArray("1"));
|
||||||
|
auto envRollback = qScopeGuard([](){
|
||||||
|
qunsetenv("QT_SSL_USE_TEMPORARY_KEYCHAIN");
|
||||||
|
});
|
||||||
|
#endif // QT_CONFIG(securetransport)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
Q_ASSERT(connectionType == H2Type::h2c || connectionType == H2Type::h2cDirect);
|
Q_ASSERT(connectionType == H2Type::h2c || connectionType == H2Type::h2cDirect);
|
||||||
Q_ASSERT(targetServer->isClearText());
|
Q_ASSERT(targetServer->isClearText());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user