Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: I3b51bb706e401edfda09a433c67aa58e44f33e83
This commit is contained in:
commit
e66d181e65
@ -234,7 +234,7 @@ sub classNames {
|
|||||||
}
|
}
|
||||||
if($line) {
|
if($line) {
|
||||||
$line =~ s,//.*$,,; #remove c++ comments
|
$line =~ s,//.*$,,; #remove c++ comments
|
||||||
$line .= ";" if($line =~ m/^Q_[A-Z_]*\(.*\)[\r\n]*$/); #qt macro
|
$line .= ";" if($line =~ m/^Q_[A-Z_0-9]*\(.*\)[\r\n]*$/); #qt macro
|
||||||
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro
|
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro
|
||||||
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE(_[A-Z]+)*[\r\n]*$/); #qt macro
|
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE(_[A-Z]+)*[\r\n]*$/); #qt macro
|
||||||
$line .= ";" if($line =~ m/^QT_MODULE\(.*\)[\r\n]*$/); # QT_MODULE macro
|
$line .= ";" if($line =~ m/^QT_MODULE\(.*\)[\r\n]*$/); # QT_MODULE macro
|
||||||
@ -366,7 +366,7 @@ sub check_header {
|
|||||||
$include = 0;
|
$include = 0;
|
||||||
}
|
}
|
||||||
if ($include && $public_header) {
|
if ($include && $public_header) {
|
||||||
print STDERR "$lib: ERROR: $iheader includes private header $include\n" if ($include =~ /_p.h$/);
|
print STDERR "$lib: ERROR: $iheader includes private header $include\n" if ($include =~ /_p\.h$/);
|
||||||
for my $trylib (keys(%modules)) {
|
for my $trylib (keys(%modules)) {
|
||||||
if (-e "$out_basedir/include/$trylib/$include") {
|
if (-e "$out_basedir/include/$trylib/$include") {
|
||||||
print STDERR "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n";
|
print STDERR "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n";
|
||||||
@ -1012,7 +1012,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
my $header_dirname = "";
|
my $header_dirname = "";
|
||||||
foreach my $header (@headers) {
|
foreach my $header (@headers) {
|
||||||
my $shadow = ($header =~ s/^\*//);
|
my $shadow = ($header =~ s/^\*//);
|
||||||
$header = 0 if($header =~ /^ui_.*.h/);
|
$header = 0 if ($header =~ /^ui_.*\.h$/);
|
||||||
foreach (@ignore_headers) {
|
foreach (@ignore_headers) {
|
||||||
$header = 0 if($header eq $_);
|
$header = 0 if($header eq $_);
|
||||||
}
|
}
|
||||||
@ -1024,7 +1024,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
if(isQpaHeader($public_header)) {
|
if(isQpaHeader($public_header)) {
|
||||||
$public_header = 0;
|
$public_header = 0;
|
||||||
$qpa_header = 1;
|
$qpa_header = 1;
|
||||||
} elsif($allheadersprivate || $thisprivate || $public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) {
|
} elsif ($allheadersprivate || $thisprivate || $public_header =~ /_p(ch)?\.h$/) {
|
||||||
$public_header = 0;
|
$public_header = 0;
|
||||||
} else {
|
} else {
|
||||||
foreach (@ignore_for_master_contents) {
|
foreach (@ignore_for_master_contents) {
|
||||||
|
47
dist/changes-5.6.2
vendored
47
dist/changes-5.6.2
vendored
@ -41,6 +41,11 @@ information about a particular change.
|
|||||||
* Library *
|
* Library *
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
|
||||||
|
General
|
||||||
|
-------
|
||||||
|
|
||||||
|
- [QTBUG-45291] Qt headers are now gcc -Wzero-as-null-pointer-constant clean.
|
||||||
|
|
||||||
QtCore
|
QtCore
|
||||||
------
|
------
|
||||||
|
|
||||||
@ -335,5 +340,47 @@ Windows
|
|||||||
|
|
||||||
moc
|
moc
|
||||||
---
|
---
|
||||||
|
|
||||||
- [QTBUG-53441] Fixed crash on file ending with a backslash followed by
|
- [QTBUG-53441] Fixed crash on file ending with a backslash followed by
|
||||||
carriage return
|
carriage return
|
||||||
|
|
||||||
|
configure & build system
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
- [QTBUG-35886][QTBUG-51417] Fixed Fontconfig vs. system FreeType
|
||||||
|
configuration.
|
||||||
|
- [QTBUG-43784][X11] Fixed detection of GLX with -qt-xcb.
|
||||||
|
- [QTBUG-52951] Fixed dynamic library support detection for platforms
|
||||||
|
without libdl.
|
||||||
|
- [QTBUG-53038] Fixed running of configure tests outside qtbase when
|
||||||
|
cross compiling on Windows (for example for Android).
|
||||||
|
- [QTBUG-53312] The flags supplied by the configure -D/-I/-L/-l options
|
||||||
|
are now applied after Qt's own flags. This helps in some cases when
|
||||||
|
the provided paths contain files which conflict with the Qt build.
|
||||||
|
- [QTBUG-55011][Unix] Fixed -no-pkg-config being ignored by some
|
||||||
|
configure tests, which led to build failures later on.
|
||||||
|
- Fixed configure tests outside qtbase when $MAKEFLAGS contains the
|
||||||
|
-i flag.
|
||||||
|
- [Android] Some unused plugins are not built anymore.
|
||||||
|
- [MinGW] Added support for -separate-debug-info.
|
||||||
|
- [Unix] Added configure -no-opengles3 option.
|
||||||
|
- [Unix] Fixed MySQL detection/use on RHEL 6.6.
|
||||||
|
|
||||||
|
qmake
|
||||||
|
-----
|
||||||
|
|
||||||
|
- [QTBUG-41830] Fixed nested custom functions inheriting their callers'
|
||||||
|
arguments.
|
||||||
|
- [QTBUG-53895][MSVC] Started using separate PDB files for compiling
|
||||||
|
and linking.
|
||||||
|
- [QTBUG-54036][Darwin] Fixed installation of debug symbols.
|
||||||
|
- [QTBUG-54550] Fixed access to freed memory in $$absolute_path().
|
||||||
|
- [QTBUG-55183][nmake] _WINDLL is now automatically defined when building
|
||||||
|
a DLL, consistently with Visual Studio.
|
||||||
|
- [QTBUG-55649][QTBUG-55915][Xcode] Fixed support for Xcode 8.
|
||||||
|
- Fixed several cases where the error() function would not abort qmake.
|
||||||
|
- Interrupting a command run via system() will now abort qmake as well.
|
||||||
|
- The packagesExist() function will now warn when used when Qt was
|
||||||
|
configured with -no-pkg-config.
|
||||||
|
- [Android] The default compiler flags were adjusted to match newer
|
||||||
|
NDK versions.
|
||||||
|
@ -31,6 +31,7 @@ macro.mdash.HTML = "—"
|
|||||||
macro.pi.HTML = "Π"
|
macro.pi.HTML = "Π"
|
||||||
macro.beginqdoc.HTML = "/*!"
|
macro.beginqdoc.HTML = "/*!"
|
||||||
macro.endqdoc.HTML = "*/"
|
macro.endqdoc.HTML = "*/"
|
||||||
|
macro.borderedimage = "\\div {class=\"border\"} \\image \1\n\\enddiv"
|
||||||
|
|
||||||
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
|
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
|
||||||
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
|
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
|
||||||
|
@ -185,8 +185,10 @@ defineTest(qtAddTargetEnv) {
|
|||||||
deps = $$replace($$2, -private$, _private)
|
deps = $$replace($$2, -private$, _private)
|
||||||
deps = $$resolve_depends(deps, "QT.", ".depends" ".run_depends")
|
deps = $$resolve_depends(deps, "QT.", ".depends" ".run_depends")
|
||||||
!isEmpty(deps) {
|
!isEmpty(deps) {
|
||||||
|
libs = libs
|
||||||
deppath.CONFIG = prepend
|
deppath.CONFIG = prepend
|
||||||
equals(QMAKE_HOST.os, Windows) {
|
equals(QMAKE_HOST.os, Windows) {
|
||||||
|
libs = bins
|
||||||
deppath.CONFIG = always_prepend
|
deppath.CONFIG = always_prepend
|
||||||
deppath.name = PATH
|
deppath.name = PATH
|
||||||
} else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) {
|
} else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) {
|
||||||
@ -206,9 +208,9 @@ defineTest(qtAddTargetEnv) {
|
|||||||
ptypes =
|
ptypes =
|
||||||
for(dep, deps) {
|
for(dep, deps) {
|
||||||
isEmpty(3): \
|
isEmpty(3): \
|
||||||
deppath += $$shell_path($$eval(QT.$${dep}.libs))
|
deppath += $$shell_path($$eval(QT.$${dep}.$$libs))
|
||||||
else: \
|
else: \
|
||||||
deppath += $$system_path($$eval(QT.$${dep}.libs))
|
deppath += $$system_path($$eval(QT.$${dep}.$$libs))
|
||||||
ptypes += $$eval(QT.$${dep}.plugin_types)
|
ptypes += $$eval(QT.$${dep}.plugin_types)
|
||||||
}
|
}
|
||||||
deppath.value = $$unique(deppath)
|
deppath.value = $$unique(deppath)
|
||||||
|
@ -74,7 +74,7 @@ header_module {
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
}
|
}
|
||||||
DESTDIR = $$MODULE_BASE_OUTDIR/lib
|
DESTDIR = $$MODULE_BASE_OUTDIR/lib
|
||||||
win32:!prefix_build: DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
|
DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
|
||||||
|
|
||||||
CONFIG += qmake_cache target_qt
|
CONFIG += qmake_cache target_qt
|
||||||
|
|
||||||
|
@ -77,6 +77,12 @@ GENERIC_SIMULATOR_DESTINATION := "id=$(shell $(MAKEFILE_DIR)devices.pl '$(EXPORT
|
|||||||
%-simulator: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(GENERIC_SIMULATOR_DESTINATION))
|
%-simulator: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(GENERIC_SIMULATOR_DESTINATION))
|
||||||
%-device: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(GENERIC_DEVICE_DESTINATION))
|
%-device: DESTINATION = $(if $(DESTINATION_ID),"id=$(DESTINATION_ID)",$(GENERIC_DEVICE_DESTINATION))
|
||||||
|
|
||||||
|
XCODE_VERSION_MAJOR := $(shell xcodebuild -version | grep Xcode | sed -e 's/Xcode //' | sed -e 's/\..*//')
|
||||||
|
|
||||||
|
ifeq ($(shell test $(XCODE_VERSION_MAJOR) -gt 7; echo $$?),0)
|
||||||
|
XCODEBUILD_FLAGS += $(shell echo "$(MAKEFLAGS)" | sed -e 's/\([^ ]*\).*/\1/' | grep -qv 's' || echo -quiet)
|
||||||
|
endif
|
||||||
|
|
||||||
# Xcodebuild
|
# Xcodebuild
|
||||||
|
|
||||||
DESTINATION_MESSAGE = "Running $(call tolower,$(CONFIGURATION)) $(ACTION) \
|
DESTINATION_MESSAGE = "Running $(call tolower,$(CONFIGURATION)) $(ACTION) \
|
||||||
@ -84,7 +90,7 @@ DESTINATION_MESSAGE = "Running $(call tolower,$(CONFIGURATION)) $(ACTION) \
|
|||||||
|
|
||||||
xcodebuild-%:
|
xcodebuild-%:
|
||||||
@$(if $(DESTINATION_NAME), echo $(DESTINATION_MESSAGE),)
|
@$(if $(DESTINATION_NAME), echo $(DESTINATION_MESSAGE),)
|
||||||
xcodebuild $(ACTION) -project $(TARGET).xcodeproj -scheme $(TARGET) $(if $(SDK), -sdk $(SDK),) $(if $(CONFIGURATION), -configuration $(CONFIGURATION),) $(if $(DESTINATION), -destination $(DESTINATION) -destination-timeout 1,) $(if $(INSTALL_ROOT), DSTROOT=$(INSTALL_ROOT),)
|
xcodebuild $(ACTION) $(XCODEBUILD_FLAGS) -project $(TARGET).xcodeproj -scheme $(TARGET) $(if $(SDK), -sdk $(SDK),) $(if $(CONFIGURATION), -configuration $(CONFIGURATION),) $(if $(DESTINATION), -destination $(DESTINATION) -destination-timeout 1,) $(if $(INSTALL_ROOT), DSTROOT=$(INSTALL_ROOT),)
|
||||||
|
|
||||||
xcodebuild-check-device_%: DESTINATION_ID=$(lastword $(subst _, ,$@))
|
xcodebuild-check-device_%: DESTINATION_ID=$(lastword $(subst _, ,$@))
|
||||||
|
|
||||||
|
@ -491,6 +491,32 @@ static QString xcodeFiletypeForFilename(const QString &filename)
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool compareProvisioningTeams(const QVariantMap &a, const QVariantMap &b)
|
||||||
|
{
|
||||||
|
int aFree = a.value(QLatin1String("isFreeProvisioningTeam")).toBool() ? 1 : 0;
|
||||||
|
int bFree = b.value(QLatin1String("isFreeProvisioningTeam")).toBool() ? 1 : 0;
|
||||||
|
return aFree < bFree;
|
||||||
|
}
|
||||||
|
|
||||||
|
static QList<QVariantMap> provisioningTeams()
|
||||||
|
{
|
||||||
|
const QSettings xcodeSettings(
|
||||||
|
QDir::homePath() + QLatin1String("/Library/Preferences/com.apple.dt.Xcode.plist"),
|
||||||
|
QSettings::NativeFormat);
|
||||||
|
const QVariantMap teamMap = xcodeSettings.value(QLatin1String("IDEProvisioningTeams")).toMap();
|
||||||
|
QList<QVariantMap> flatTeams;
|
||||||
|
for (QVariantMap::const_iterator it = teamMap.begin(), end = teamMap.end(); it != end; ++it) {
|
||||||
|
const QString emailAddress = it.key();
|
||||||
|
QVariantMap team = it.value().toMap();
|
||||||
|
team[QLatin1String("emailAddress")] = emailAddress;
|
||||||
|
flatTeams.append(team);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sort teams so that Free Provisioning teams come last
|
||||||
|
std::sort(flatTeams.begin(), flatTeams.end(), ::compareProvisioningTeams);
|
||||||
|
return flatTeams;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||||
{
|
{
|
||||||
@ -1451,25 +1477,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
|
|
||||||
QMap<QString, QString> settings;
|
QMap<QString, QString> settings;
|
||||||
if (!project->isActiveConfig("no_xcode_development_team")) {
|
if (!project->isActiveConfig("no_xcode_development_team")) {
|
||||||
const QSettings xcodeSettings(
|
const QList<QVariantMap> teams = provisioningTeams();
|
||||||
QDir::homePath() + QLatin1String("/Library/Preferences/com.apple.dt.Xcode.plist"),
|
|
||||||
QSettings::NativeFormat);
|
|
||||||
const QVariantMap teams = xcodeSettings.value(QLatin1String("IDEProvisioningTeams")).toMap();
|
|
||||||
if (!teams.isEmpty()) {
|
if (!teams.isEmpty()) {
|
||||||
for (QVariantMap::const_iterator it = teams.begin(), end = teams.end(); it != end; ++it) {
|
// first suitable team we find is the one we'll use by default
|
||||||
const QVariantMap team = it.value().toMap();
|
settings.insert("DEVELOPMENT_TEAM",
|
||||||
const QString teamType = team.value(QLatin1String("teamType")).toString();
|
teams.first().value(QLatin1String("teamID")).toString());
|
||||||
|
|
||||||
// Skip Company teams because signing permissions may not be available under all
|
|
||||||
// circumstances for users who are not the Team Agent
|
|
||||||
if (teamType != QLatin1String("Company")) {
|
|
||||||
const QString teamId = team.value(QLatin1String("teamID")).toString();
|
|
||||||
settings.insert("DEVELOPMENT_TEAM", teamId);
|
|
||||||
|
|
||||||
// first suitable team we found is the one we'll use by default
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO"));
|
settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO"));
|
||||||
|
@ -1138,6 +1138,7 @@ void QMessagePattern::setPattern(const QString &pattern)
|
|||||||
backtraceArgs.append(backtraceParams);
|
backtraceArgs.append(backtraceParams);
|
||||||
#else
|
#else
|
||||||
error += QLatin1String("QT_MESSAGE_PATTERN: %{backtrace} is not supported by this Qt build\n");
|
error += QLatin1String("QT_MESSAGE_PATTERN: %{backtrace} is not supported by this Qt build\n");
|
||||||
|
tokens[i] = "";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,6 +254,7 @@ void QDirIteratorPrivate::advance()
|
|||||||
|
|
||||||
if (entryMatches(nextEntry.fileName(), info))
|
if (entryMatches(nextEntry.fileName(), info))
|
||||||
return;
|
return;
|
||||||
|
nextMetaData = QFileSystemMetaData();
|
||||||
}
|
}
|
||||||
|
|
||||||
nativeIterators.pop();
|
nativeIterators.pop();
|
||||||
|
@ -87,8 +87,8 @@ Q_DECL_CONST_FUNCTION static inline QPair<qint64, qint64> toSecsAndNSecs(qint64
|
|||||||
other Qt functions named \c{waitFor} or similar:
|
other Qt functions named \c{waitFor} or similar:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\o 0: no time left, expired
|
\li 0: no time left, expired
|
||||||
\o -1: infinite time left, timer never expires
|
\li -1: infinite time left, timer never expires
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 Reference Clocks
|
\section1 Reference Clocks
|
||||||
@ -169,20 +169,20 @@ Q_DECL_CONST_FUNCTION static inline QPair<qint64, qint64> toSecsAndNSecs(qint64
|
|||||||
cannot be used in calculation of how long it is overdue. If that
|
cannot be used in calculation of how long it is overdue. If that
|
||||||
functionality is required, use QDeadlineTimer::current().
|
functionality is required, use QDeadlineTimer::current().
|
||||||
|
|
||||||
\sa hasExpired(), remainingTime(), timerType(), current()
|
\sa hasExpired(), remainingTime(), Qt::TimerType, current()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QDeadlineTimer::QDeadlineTimer(ForeverConstant, Qt::TimerType timerType)
|
\fn QDeadlineTimer::QDeadlineTimer(ForeverConstant, Qt::TimerType timerType)
|
||||||
|
|
||||||
Constructs a QDeadlineTimer object that never expires. For this object,
|
QDeadlineTimer objects created with parameter \a ForeverConstant never expire.
|
||||||
remainingTime() will return -1, deadline() will return the maximum value,
|
For such objects, remainingTime() will return -1, deadline() will return the
|
||||||
and isForever() will return true.
|
maximum value, and isForever() will return true.
|
||||||
|
|
||||||
The timer type \a timerType may be ignored, since the timer is already
|
The timer type \a timerType may be ignored, since the timer is already
|
||||||
expired.
|
expired.
|
||||||
|
|
||||||
\sa hasExpired(), isForever(), remainingTime(), timerType()
|
\sa ForeverConstant, hasExpired(), isForever(), remainingTime(), timerType()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -194,8 +194,7 @@ Q_DECL_CONST_FUNCTION static inline QPair<qint64, qint64> toSecsAndNSecs(qint64
|
|||||||
never expire, causing remainingTime() to return -1 and deadline() to return
|
never expire, causing remainingTime() to return -1 and deadline() to return
|
||||||
the maximum value.
|
the maximum value.
|
||||||
|
|
||||||
The QDeadlineTimer object will be constructed with a timer type of \a
|
The QDeadlineTimer object will be constructed with the specified timer \a type.
|
||||||
timerType.
|
|
||||||
|
|
||||||
For optimization purposes, if \a msecs is zero, this function may skip
|
For optimization purposes, if \a msecs is zero, this function may skip
|
||||||
obtaining the current time and may instead use a value known to be in the
|
obtaining the current time and may instead use a value known to be in the
|
||||||
@ -223,10 +222,9 @@ QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
|
|||||||
expired, whereas if \a deadline is equal to \c{Duration::max()}, then this
|
expired, whereas if \a deadline is equal to \c{Duration::max()}, then this
|
||||||
object is set to never expire.
|
object is set to never expire.
|
||||||
|
|
||||||
The QDeadlineTimer object will be constructed with a timer type of \a
|
The QDeadlineTimer object will be constructed with the specified timer \a type.
|
||||||
timerType.
|
|
||||||
|
|
||||||
\sa hasExpired(), isForever(), remainingTime<Duration>(), setDeadline()
|
\sa hasExpired(), isForever(), remainingTime(), setDeadline()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -237,8 +235,7 @@ QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
|
|||||||
mark as expired, whereas if \a remaining is equal to \c{duration::max()},
|
mark as expired, whereas if \a remaining is equal to \c{duration::max()},
|
||||||
the object will be set to never expire.
|
the object will be set to never expire.
|
||||||
|
|
||||||
The QDeadlineTimer object will be constructed with a timer type of \a
|
The QDeadlineTimer object will be constructed with the specified timer \a type.
|
||||||
timerType.
|
|
||||||
|
|
||||||
This constructor can be used with C++14's user-defined literals for time, such as in:
|
This constructor can be used with C++14's user-defined literals for time, such as in:
|
||||||
|
|
||||||
@ -254,7 +251,7 @@ QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
|
|||||||
it is overdue. If that functionality is required, use
|
it is overdue. If that functionality is required, use
|
||||||
QDeadlineTimer::current() and add time to it.
|
QDeadlineTimer::current() and add time to it.
|
||||||
|
|
||||||
\sa hasExpired(), isForever(), remainingTime<Duration>(), setRemainingTime()
|
\sa hasExpired(), isForever(), remainingTime(), setRemainingTime()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -268,9 +265,9 @@ QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
|
|||||||
expired, whereas if \a deadline is equal to \c{Duration::max()}, then this
|
expired, whereas if \a deadline is equal to \c{Duration::max()}, then this
|
||||||
object is set to never expire.
|
object is set to never expire.
|
||||||
|
|
||||||
The timer type for this QDeadlineTimer object will be set to \a timerType type.
|
The timer type for this QDeadlineTimer object will be set to the specified \a type.
|
||||||
|
|
||||||
\sa hasExpired(), isForever(), remainingTime<Duration>(),
|
\sa hasExpired(), isForever(), remainingTime(),
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -279,7 +276,7 @@ QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
|
|||||||
zero, this QDeadlineTimer object will be marked as expired, whereas a value
|
zero, this QDeadlineTimer object will be marked as expired, whereas a value
|
||||||
of -1 will set it to never expire.
|
of -1 will set it to never expire.
|
||||||
|
|
||||||
The timer type for this QDeadlineTimer object will be set to \a timerType type.
|
The timer type for this QDeadlineTimer object will be set to the specified \a timerType.
|
||||||
|
|
||||||
\sa setPreciseRemainingTime(), hasExpired(), isForever(), remainingTime()
|
\sa setPreciseRemainingTime(), hasExpired(), isForever(), remainingTime()
|
||||||
*/
|
*/
|
||||||
@ -297,7 +294,8 @@ void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) Q_D
|
|||||||
secs is -1, this QDeadlineTimer will be set it to never expire. If both
|
secs is -1, this QDeadlineTimer will be set it to never expire. If both
|
||||||
parameters are zero, this QDeadlineTimer will be marked as expired.
|
parameters are zero, this QDeadlineTimer will be marked as expired.
|
||||||
|
|
||||||
The timer type for this QDeadlineTimer object will be set to \a timerType type.
|
The timer type for this QDeadlineTimer object will be set to the specified
|
||||||
|
\a type.
|
||||||
|
|
||||||
\sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
|
\sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
|
||||||
*/
|
*/
|
||||||
@ -330,7 +328,7 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time
|
|||||||
as expired, whereas if \a remaining is equal to \c{duration::max()}, the
|
as expired, whereas if \a remaining is equal to \c{duration::max()}, the
|
||||||
object will be set to never expire.
|
object will be set to never expire.
|
||||||
|
|
||||||
The timer type for this QDeadlineTimer object will be set to \a timerType type.
|
The timer type for this QDeadlineTimer object will be set to the specified \a type.
|
||||||
|
|
||||||
This function can be used with C++14's user-defined literals for time, such as in:
|
This function can be used with C++14's user-defined literals for time, such as in:
|
||||||
|
|
||||||
@ -339,7 +337,7 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time
|
|||||||
deadline.setRemainingTime(250ms);
|
deadline.setRemainingTime(250ms);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\sa setDeadline(), remainingTime<Duration>(), hasExpired(), isForever()
|
\sa setDeadline(), remainingTime(), hasExpired(), isForever()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -353,7 +351,7 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time
|
|||||||
If value of \a nsecs is more than 1 billion nanoseconds (1 second), this
|
If value of \a nsecs is more than 1 billion nanoseconds (1 second), this
|
||||||
function will adjust \a secs accordingly.
|
function will adjust \a secs accordingly.
|
||||||
|
|
||||||
The timer type for this QDeadlineTimer object will be set to \a timerType type.
|
The timer type for this QDeadlineTimer object will be set to the specified \a type.
|
||||||
|
|
||||||
\sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
|
\sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
|
||||||
*/
|
*/
|
||||||
@ -422,7 +420,7 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time
|
|||||||
remains time left. For objects that have expired, remainingTime() will
|
remains time left. For objects that have expired, remainingTime() will
|
||||||
return zero and deadline() will return a time point in the past.
|
return zero and deadline() will return a time point in the past.
|
||||||
|
|
||||||
QDeadlineTimer objects created with the \ref{ForeverConstant} never expire
|
QDeadlineTimer objects created with the \l {ForeverConstant} never expire
|
||||||
and this function always returns false for them.
|
and this function always returns false for them.
|
||||||
|
|
||||||
\sa isForever(), remainingTime()
|
\sa isForever(), remainingTime()
|
||||||
@ -435,7 +433,7 @@ bool QDeadlineTimer::hasExpired() const Q_DECL_NOTHROW
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn Qt::TimerType QDeadlineTimer::timerType() const Q_DECL_NOTHROW
|
\fn Qt::TimerType QDeadlineTimer::timerType() const
|
||||||
|
|
||||||
Returns the timer type is active for this object.
|
Returns the timer type is active for this object.
|
||||||
|
|
||||||
@ -451,7 +449,7 @@ bool QDeadlineTimer::hasExpired() const Q_DECL_NOTHROW
|
|||||||
will try to use a more coarse timer for Qt::CoarseTimer and
|
will try to use a more coarse timer for Qt::CoarseTimer and
|
||||||
Qt::VeryCoarseTimer.
|
Qt::VeryCoarseTimer.
|
||||||
|
|
||||||
\sa timerType()
|
\sa Qt::TimerType
|
||||||
*/
|
*/
|
||||||
void QDeadlineTimer::setTimerType(Qt::TimerType timerType)
|
void QDeadlineTimer::setTimerType(Qt::TimerType timerType)
|
||||||
{
|
{
|
||||||
@ -466,13 +464,13 @@ void QDeadlineTimer::setTimerType(Qt::TimerType timerType)
|
|||||||
returns -1.
|
returns -1.
|
||||||
|
|
||||||
This function is suitable for use in Qt APIs that take a millisecond
|
This function is suitable for use in Qt APIs that take a millisecond
|
||||||
timeout, such as the many \ref QIODevice \c waitFor functions or the timed
|
timeout, such as the many \l QIODevice \c waitFor functions or the timed
|
||||||
lock functions in \ref QMutex, \ref QWaitCondition, \ref QSemaphore, or
|
lock functions in \l QMutex, \l QWaitCondition, \l QSemaphore, or
|
||||||
\ref QReadWriteLock. For example:
|
\l QReadWriteLock. For example:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
mutex.tryLock(deadline.remainingTime());
|
mutex.tryLock(deadline.remainingTime());
|
||||||
\code
|
\endcode
|
||||||
|
|
||||||
\sa remainingTimeNSecs(), isForever(), hasExpired()
|
\sa remainingTimeNSecs(), isForever(), hasExpired()
|
||||||
*/
|
*/
|
||||||
@ -658,24 +656,12 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
current time. Objects created by this function can participate in the
|
current time. Objects created by this function can participate in the
|
||||||
calculation of how long a timer is overdue, using the deadline() function.
|
calculation of how long a timer is overdue, using the deadline() function.
|
||||||
|
|
||||||
The QDeadlineTimer object will be constructed with a timer type of \a
|
The QDeadlineTimer object will be constructed with the specified \a timerType.
|
||||||
timerType.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn qint64 QDeadlineTimer::resolution(Qt::TimerType timerType)
|
|
||||||
|
|
||||||
Returns the resolution in nanoseconds of the system clock that backs timers
|
|
||||||
of type \a timerType, or 0 if the resolution could not be determined.
|
|
||||||
|
|
||||||
The resolution is not a guarantee that applications will get time values
|
|
||||||
with an accuracy down to that level. It is only the minimum change value
|
|
||||||
that can be expected.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool operator==(QDeadlineTimer d1, QDeadlineTimer d2)
|
\fn bool operator==(QDeadlineTimer d1, QDeadlineTimer d2)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns true if the deadline on \a d1 and the deadline in \a d2 are the
|
Returns true if the deadline on \a d1 and the deadline in \a d2 are the
|
||||||
same, false otherwise. The timer type used to create the two deadlines is
|
same, false otherwise. The timer type used to create the two deadlines is
|
||||||
@ -691,7 +677,7 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2)
|
\fn bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns true if the deadline on \a d1 and the deadline in \a d2 are
|
Returns true if the deadline on \a d1 and the deadline in \a d2 are
|
||||||
diferent, false otherwise. The timer type used to create the two deadlines
|
diferent, false otherwise. The timer type used to create the two deadlines
|
||||||
@ -707,7 +693,7 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool operator<(QDeadlineTimer d1, QDeadlineTimer d2)
|
\fn bool operator<(QDeadlineTimer d1, QDeadlineTimer d2)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns true if the deadline on \a d1 is earlier than the deadline in \a
|
Returns true if the deadline on \a d1 is earlier than the deadline in \a
|
||||||
d2, false otherwise. The timer type used to create the two deadlines is
|
d2, false otherwise. The timer type used to create the two deadlines is
|
||||||
@ -723,7 +709,7 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2)
|
\fn bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns true if the deadline on \a d1 is earlier than or the same as the
|
Returns true if the deadline on \a d1 is earlier than or the same as the
|
||||||
deadline in \a d2, false otherwise. The timer type used to create the two
|
deadline in \a d2, false otherwise. The timer type used to create the two
|
||||||
@ -739,7 +725,7 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool operator>(QDeadlineTimer d1, QDeadlineTimer d2)
|
\fn bool operator>(QDeadlineTimer d1, QDeadlineTimer d2)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns true if the deadline on \a d1 is later than the deadline in \a
|
Returns true if the deadline on \a d1 is later than the deadline in \a
|
||||||
d2, false otherwise. The timer type used to create the two deadlines is
|
d2, false otherwise. The timer type used to create the two deadlines is
|
||||||
@ -755,7 +741,7 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2)
|
\fn bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns true if the deadline on \a d1 is later than or the same as the
|
Returns true if the deadline on \a d1 is later than or the same as the
|
||||||
deadline in \a d2, false otherwise. The timer type used to create the two
|
deadline in \a d2, false otherwise. The timer type used to create the two
|
||||||
@ -771,7 +757,7 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs)
|
\fn QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns a QDeadlineTimer object whose deadline is \a msecs later than the
|
Returns a QDeadlineTimer object whose deadline is \a msecs later than the
|
||||||
deadline stored in \a dt. If \a dt is set to never expire, this function
|
deadline stored in \a dt. If \a dt is set to never expire, this function
|
||||||
@ -782,7 +768,7 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QDeadlineTimer operator+(qint64 msecs, QDeadlineTimer dt)
|
\fn QDeadlineTimer operator+(qint64 msecs, QDeadlineTimer dt)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns a QDeadlineTimer object whose deadline is \a msecs later than the
|
Returns a QDeadlineTimer object whose deadline is \a msecs later than the
|
||||||
deadline stored in \a dt. If \a dt is set to never expire, this function
|
deadline stored in \a dt. If \a dt is set to never expire, this function
|
||||||
@ -793,7 +779,7 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn QDeadlineTimer operator-(QDeadlineTimer dt, qint64 msecs)
|
\fn QDeadlineTimer operator-(QDeadlineTimer dt, qint64 msecs)
|
||||||
\related QDeadlineTimer
|
\relates QDeadlineTimer
|
||||||
|
|
||||||
Returns a QDeadlineTimer object whose deadline is \a msecs before the
|
Returns a QDeadlineTimer object whose deadline is \a msecs before the
|
||||||
deadline stored in \a dt. If \a dt is set to never expire, this function
|
deadline stored in \a dt. If \a dt is set to never expire, this function
|
||||||
|
@ -536,11 +536,11 @@ void QMimeBinaryProvider::loadMimeTypeList()
|
|||||||
for (const QString &typeFilename : typesFilenames) {
|
for (const QString &typeFilename : typesFilenames) {
|
||||||
QFile file(typeFilename);
|
QFile file(typeFilename);
|
||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
while (!file.atEnd()) {
|
QTextStream stream(&file);
|
||||||
QByteArray line = file.readLine();
|
stream.setCodec("ISO 8859-1");
|
||||||
line.chop(1);
|
QString line;
|
||||||
m_mimetypeNames.insert(QString::fromLatin1(line.constData(), line.size()));
|
while (stream.readLineInto(&line))
|
||||||
}
|
m_mimetypeNames.insert(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,15 +48,12 @@
|
|||||||
|
|
||||||
#ifndef QT_NO_DBUS
|
#ifndef QT_NO_DBUS
|
||||||
|
|
||||||
//#define QDBUS_PARSER_DEBUG
|
|
||||||
#ifdef QDBUS_PARSER_DEBUG
|
|
||||||
# define qDBusParserError qDebug
|
|
||||||
#else
|
|
||||||
# define qDBusParserError if (true) {} else qDebug
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(dbusParser, "dbus.parser", QtWarningMsg)
|
||||||
|
|
||||||
|
#define qDBusParserError(...) qCDebug(dbusParser, ##__VA_ARGS__)
|
||||||
|
|
||||||
static bool parseArg(const QXmlStreamAttributes &attributes, QDBusIntrospection::Argument &argData,
|
static bool parseArg(const QXmlStreamAttributes &attributes, QDBusIntrospection::Argument &argData,
|
||||||
QDBusIntrospection::Interface *ifaceData)
|
QDBusIntrospection::Interface *ifaceData)
|
||||||
{
|
{
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <QtDBus/private/qtdbusglobal_p.h>
|
#include <QtDBus/private/qtdbusglobal_p.h>
|
||||||
|
#include <QtCore/qloggingcategory.h>
|
||||||
#include <QtCore/qmap.h>
|
#include <QtCore/qmap.h>
|
||||||
#include "qdbusintrospection_p.h"
|
#include "qdbusintrospection_p.h"
|
||||||
|
|
||||||
@ -59,6 +60,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(dbusParser)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
|
@ -438,6 +438,10 @@ void QClipboard::setPixmap(const QPixmap &pixmap, Mode mode)
|
|||||||
The text(), image(), and pixmap() functions are simpler
|
The text(), image(), and pixmap() functions are simpler
|
||||||
wrappers for retrieving text, image, and pixmap data.
|
wrappers for retrieving text, image, and pixmap data.
|
||||||
|
|
||||||
|
\note The pointer returned might become invalidated when the contents
|
||||||
|
of the clipboard changes; either by calling one of the setter functions
|
||||||
|
or externally by the system clipboard changing.
|
||||||
|
|
||||||
\sa setMimeData()
|
\sa setMimeData()
|
||||||
*/
|
*/
|
||||||
const QMimeData* QClipboard::mimeData(Mode mode) const
|
const QMimeData* QClipboard::mimeData(Mode mode) const
|
||||||
|
@ -1203,12 +1203,6 @@ static void init_plugins(const QList<QByteArray> &pluginList)
|
|||||||
|
|
||||||
void QGuiApplicationPrivate::createPlatformIntegration()
|
void QGuiApplicationPrivate::createPlatformIntegration()
|
||||||
{
|
{
|
||||||
// Use the Qt menus by default. Platform plugins that
|
|
||||||
// want to enable a native menu implementation can clear
|
|
||||||
// this flag.
|
|
||||||
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
|
|
||||||
|
|
||||||
|
|
||||||
QHighDpiScaling::initHighDpiScaling();
|
QHighDpiScaling::initHighDpiScaling();
|
||||||
|
|
||||||
// Load the platform integration
|
// Load the platform integration
|
||||||
|
@ -2395,7 +2395,7 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
|
|||||||
bool lastWindowClosed = true;
|
bool lastWindowClosed = true;
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
QWindow *w = list.at(i);
|
QWindow *w = list.at(i);
|
||||||
if (!w->isVisible() || w->transientParent())
|
if (!w->isVisible() || w->transientParent() || w->type() == Qt::ToolTip)
|
||||||
continue;
|
continue;
|
||||||
lastWindowClosed = false;
|
lastWindowClosed = false;
|
||||||
break;
|
break;
|
||||||
|
@ -584,16 +584,26 @@ bool QOpenGLShader::compileSourceCode(const char *source)
|
|||||||
|
|
||||||
QVarLengthArray<const char *, 5> sourceChunks;
|
QVarLengthArray<const char *, 5> sourceChunks;
|
||||||
QVarLengthArray<GLint, 5> sourceChunkLengths;
|
QVarLengthArray<GLint, 5> sourceChunkLengths;
|
||||||
|
QOpenGLContext *ctx = QOpenGLContext::currentContext();
|
||||||
|
|
||||||
if (versionDirectivePosition.hasPosition()) {
|
if (versionDirectivePosition.hasPosition()) {
|
||||||
// Append source up to #version directive
|
// Append source up to and including the #version directive
|
||||||
sourceChunks.append(source);
|
sourceChunks.append(source);
|
||||||
sourceChunkLengths.append(GLint(versionDirectivePosition.position));
|
sourceChunkLengths.append(GLint(versionDirectivePosition.position));
|
||||||
|
} else {
|
||||||
|
// QTBUG-55733: Intel on Windows with Compatibility profile requires a #version always
|
||||||
|
if (ctx->format().profile() == QSurfaceFormat::CompatibilityProfile) {
|
||||||
|
const char *vendor = reinterpret_cast<const char *>(ctx->functions()->glGetString(GL_VENDOR));
|
||||||
|
if (vendor && !strcmp(vendor, "Intel")) {
|
||||||
|
static const char version110[] = "#version 110\n";
|
||||||
|
sourceChunks.append(version110);
|
||||||
|
sourceChunkLengths.append(GLint(sizeof(version110)) - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The precision qualifiers are useful on OpenGL/ES systems,
|
// The precision qualifiers are useful on OpenGL/ES systems,
|
||||||
// but usually not present on desktop systems.
|
// but usually not present on desktop systems.
|
||||||
QOpenGLContext *ctx = QOpenGLContext::currentContext();
|
|
||||||
const QSurfaceFormat currentSurfaceFormat = ctx->format();
|
const QSurfaceFormat currentSurfaceFormat = ctx->format();
|
||||||
QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(QOpenGLContext::currentContext());
|
QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(QOpenGLContext::currentContext());
|
||||||
if (currentSurfaceFormat.renderableType() == QSurfaceFormat::OpenGL
|
if (currentSurfaceFormat.renderableType() == QSurfaceFormat::OpenGL
|
||||||
|
@ -138,6 +138,7 @@ QBackingStore::QBackingStore(QWindow *window)
|
|||||||
: d_ptr(new QBackingStorePrivate(window))
|
: d_ptr(new QBackingStorePrivate(window))
|
||||||
{
|
{
|
||||||
d_ptr->platformBackingStore = QGuiApplicationPrivate::platformIntegration()->createPlatformBackingStore(window);
|
d_ptr->platformBackingStore = QGuiApplicationPrivate::platformIntegration()->createPlatformBackingStore(window);
|
||||||
|
d_ptr->platformBackingStore->setBackingStore(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -5331,15 +5331,16 @@ static void qt_gradient_quint16(int count, const QSpan *spans, void *userData)
|
|||||||
int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE);
|
int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE);
|
||||||
int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE));
|
int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE));
|
||||||
|
|
||||||
QRgba64 oldColor = data->solid.color;
|
// Save the fillData since we overwrite it when setting solid.color.
|
||||||
|
QGradientData gradient = data->gradient;
|
||||||
while (count--) {
|
while (count--) {
|
||||||
int y = spans->y;
|
int y = spans->y;
|
||||||
|
|
||||||
data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&data->gradient, yinc * y + off));
|
data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&gradient, yinc * y + off));
|
||||||
blend_color_rgb16(1, spans, userData);
|
blend_color_rgb16(1, spans, userData);
|
||||||
++spans;
|
++spans;
|
||||||
}
|
}
|
||||||
data->solid.color = oldColor;
|
data->gradient = gradient;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
blend_src_generic(count, spans, userData);
|
blend_src_generic(count, spans, userData);
|
||||||
|
@ -77,6 +77,7 @@ class QPlatformBackingStorePrivate
|
|||||||
public:
|
public:
|
||||||
QPlatformBackingStorePrivate(QWindow *w)
|
QPlatformBackingStorePrivate(QWindow *w)
|
||||||
: window(w)
|
: window(w)
|
||||||
|
, backingStore(0)
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
, textureId(0)
|
, textureId(0)
|
||||||
, blitter(0)
|
, blitter(0)
|
||||||
@ -100,6 +101,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
QWindow *window;
|
QWindow *window;
|
||||||
|
QBackingStore *backingStore;
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
mutable GLuint textureId;
|
mutable GLuint textureId;
|
||||||
mutable QSize textureSize;
|
mutable QSize textureSize;
|
||||||
@ -622,6 +624,23 @@ QWindow* QPlatformBackingStore::window() const
|
|||||||
return d_ptr->window;
|
return d_ptr->window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Sets the backing store associated with this surface.
|
||||||
|
*/
|
||||||
|
void QPlatformBackingStore::setBackingStore(QBackingStore *backingStore)
|
||||||
|
{
|
||||||
|
d_ptr->backingStore = backingStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns a pointer to the backing store associated with this
|
||||||
|
surface.
|
||||||
|
*/
|
||||||
|
QBackingStore *QPlatformBackingStore::backingStore() const
|
||||||
|
{
|
||||||
|
return d_ptr->backingStore;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
This function is called before painting onto the surface begins,
|
This function is called before painting onto the surface begins,
|
||||||
with the \a region in which the painting will occur.
|
with the \a region in which the painting will occur.
|
||||||
|
@ -112,6 +112,7 @@ public:
|
|||||||
virtual ~QPlatformBackingStore();
|
virtual ~QPlatformBackingStore();
|
||||||
|
|
||||||
QWindow *window() const;
|
QWindow *window() const;
|
||||||
|
QBackingStore *backingStore() const;
|
||||||
|
|
||||||
virtual QPaintDevice *paintDevice() = 0;
|
virtual QPaintDevice *paintDevice() = 0;
|
||||||
|
|
||||||
@ -145,6 +146,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QPlatformBackingStorePrivate *d_ptr;
|
QPlatformBackingStorePrivate *d_ptr;
|
||||||
|
|
||||||
|
void setBackingStore(QBackingStore *);
|
||||||
|
friend class QBackingStore;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
|
@ -324,6 +324,13 @@ bool QRawFont::operator==(const QRawFont &other) const
|
|||||||
/*!
|
/*!
|
||||||
Returns the ascent of this QRawFont in pixel units.
|
Returns the ascent of this QRawFont in pixel units.
|
||||||
|
|
||||||
|
The ascent of a font is the distance from the baseline to the
|
||||||
|
highest position characters extend to. In practice, some font
|
||||||
|
designers break this rule, e.g. when they put more than one accent
|
||||||
|
on top of a character, or to accommodate an unusual character in
|
||||||
|
an exotic language, so it is possible (though rare) that this
|
||||||
|
value will be too small.
|
||||||
|
|
||||||
\sa QFontMetricsF::ascent()
|
\sa QFontMetricsF::ascent()
|
||||||
*/
|
*/
|
||||||
qreal QRawFont::ascent() const
|
qreal QRawFont::ascent() const
|
||||||
@ -351,6 +358,11 @@ qreal QRawFont::capHeight() const
|
|||||||
/*!
|
/*!
|
||||||
Returns the descent of this QRawFont in pixel units.
|
Returns the descent of this QRawFont in pixel units.
|
||||||
|
|
||||||
|
The descent is the distance from the base line to the lowest point
|
||||||
|
characters extend to. In practice, some font designers break this rule,
|
||||||
|
e.g. to accommodate an unusual character in an exotic language, so
|
||||||
|
it is possible (though rare) that this value will be too small.
|
||||||
|
|
||||||
\sa QFontMetricsF::descent()
|
\sa QFontMetricsF::descent()
|
||||||
*/
|
*/
|
||||||
qreal QRawFont::descent() const
|
qreal QRawFont::descent() const
|
||||||
@ -361,6 +373,8 @@ qreal QRawFont::descent() const
|
|||||||
/*!
|
/*!
|
||||||
Returns the xHeight of this QRawFont in pixel units.
|
Returns the xHeight of this QRawFont in pixel units.
|
||||||
|
|
||||||
|
This is often but not always the same as the height of the character 'x'.
|
||||||
|
|
||||||
\sa QFontMetricsF::xHeight()
|
\sa QFontMetricsF::xHeight()
|
||||||
*/
|
*/
|
||||||
qreal QRawFont::xHeight() const
|
qreal QRawFont::xHeight() const
|
||||||
@ -371,6 +385,8 @@ qreal QRawFont::xHeight() const
|
|||||||
/*!
|
/*!
|
||||||
Returns the leading of this QRawFont in pixel units.
|
Returns the leading of this QRawFont in pixel units.
|
||||||
|
|
||||||
|
This is the natural inter-line spacing.
|
||||||
|
|
||||||
\sa QFontMetricsF::leading()
|
\sa QFontMetricsF::leading()
|
||||||
*/
|
*/
|
||||||
qreal QRawFont::leading() const
|
qreal QRawFont::leading() const
|
||||||
|
@ -36,10 +36,12 @@
|
|||||||
the Secure Sockets Layer (SSL) protocol, using the OpenSSL Toolkit (\l{http://www.openssl.org/})
|
the Secure Sockets Layer (SSL) protocol, using the OpenSSL Toolkit (\l{http://www.openssl.org/})
|
||||||
to perform encryption and protocol handling.
|
to perform encryption and protocol handling.
|
||||||
|
|
||||||
|
From Qt version 5.2 onwards, the officially supported version for OpenSSL
|
||||||
|
is 1.0.0 or later. Versions >= 0.9.7 and < 1.0.0 might work, but are not
|
||||||
|
guaranteed to work.
|
||||||
|
|
||||||
\annotatedlist ssl
|
\annotatedlist ssl
|
||||||
|
|
||||||
See the \l {openssl-v1later}{OpenSSL Compatibility} page for information about the
|
|
||||||
versions of OpenSSL that are known to work with Qt.
|
|
||||||
|
|
||||||
\section1 Enabling and Disabling SSL Support
|
\section1 Enabling and Disabling SSL Support
|
||||||
|
|
||||||
|
@ -404,6 +404,9 @@ static QList<QNetworkInterfacePrivate *> createInterfaces(ifaddrs *rawList)
|
|||||||
if (seenIndexes.contains(ifindex))
|
if (seenIndexes.contains(ifindex))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
seenInterfaces.insert(name);
|
||||||
|
seenIndexes.append(ifindex);
|
||||||
|
|
||||||
QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate;
|
QNetworkInterfacePrivate *iface = new QNetworkInterfacePrivate;
|
||||||
interfaces << iface;
|
interfaces << iface;
|
||||||
iface->name = name;
|
iface->name = name;
|
||||||
|
@ -505,7 +505,7 @@ void QSslSocketBackendPrivate::transmit()
|
|||||||
|
|
||||||
if (connectionEncrypted) {
|
if (connectionEncrypted) {
|
||||||
QVarLengthArray<char, 4096> data;
|
QVarLengthArray<char, 4096> data;
|
||||||
while (context) {
|
while (context && (!readBufferMaxSize || buffer.size() < readBufferMaxSize)) {
|
||||||
size_t readBytes = 0;
|
size_t readBytes = 0;
|
||||||
data.resize(4096);
|
data.resize(4096);
|
||||||
const OSStatus err = SSLRead(context, data.data(), data.size(), &readBytes);
|
const OSStatus err = SSLRead(context, data.data(), data.size(), &readBytes);
|
||||||
|
@ -140,6 +140,10 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay
|
|||||||
#define EGL_DRM_PLANE_EXT 0x3235
|
#define EGL_DRM_PLANE_EXT 0x3235
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef EGL_PLATFORM_X11_KHR
|
||||||
|
#define EGL_PLATFORM_X11_KHR 0x31D5
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QEGLStreamConvenience
|
class QEGLStreamConvenience
|
||||||
|
@ -362,6 +362,12 @@ static const char *getFcFamilyForStyleHint(const QFont::StyleHint style)
|
|||||||
return stylehint;
|
return stylehint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool requiresOpenType(int writingSystem)
|
||||||
|
{
|
||||||
|
return ((writingSystem >= QFontDatabase::Syriac && writingSystem <= QFontDatabase::Sinhala)
|
||||||
|
|| writingSystem == QFontDatabase::Khmer || writingSystem == QFontDatabase::Nko);
|
||||||
|
}
|
||||||
|
|
||||||
static void populateFromPattern(FcPattern *pattern)
|
static void populateFromPattern(FcPattern *pattern)
|
||||||
{
|
{
|
||||||
QString familyName;
|
QString familyName;
|
||||||
@ -430,7 +436,7 @@ static void populateFromPattern(FcPattern *pattern)
|
|||||||
FcLangResult langRes = FcLangSetHasLang(langset, lang);
|
FcLangResult langRes = FcLangSetHasLang(langset, lang);
|
||||||
if (langRes != FcLangDifferentLang) {
|
if (langRes != FcLangDifferentLang) {
|
||||||
#if FC_VERSION >= 20297
|
#if FC_VERSION >= 20297
|
||||||
if (capabilityForWritingSystem[j] != Q_NULLPTR) {
|
if (capabilityForWritingSystem[j] != Q_NULLPTR && requiresOpenType(j)) {
|
||||||
if (cap == Q_NULLPTR)
|
if (cap == Q_NULLPTR)
|
||||||
capRes = FcPatternGetString(pattern, FC_CAPABILITY, 0, &cap);
|
capRes = FcPatternGetString(pattern, FC_CAPABILITY, 0, &cap);
|
||||||
if (capRes == FcResultMatch && strstr(reinterpret_cast<const char *>(cap), capabilityForWritingSystem[j]) == 0)
|
if (capRes == FcResultMatch && strstr(reinterpret_cast<const char *>(cap), capabilityForWritingSystem[j]) == 0)
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include "qrasterbackingstore_p.h"
|
#include "qrasterbackingstore_p.h"
|
||||||
|
|
||||||
|
#include <QtGui/qbackingstore.h>
|
||||||
#include <QtGui/qpainter.h>
|
#include <QtGui/qpainter.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -104,6 +105,10 @@ bool QRasterBackingStore::scroll(const QRegion ®ion, int dx, int dy)
|
|||||||
|
|
||||||
void QRasterBackingStore::beginPaint(const QRegion ®ion)
|
void QRasterBackingStore::beginPaint(const QRegion ®ion)
|
||||||
{
|
{
|
||||||
|
// Keep backing store device pixel ratio in sync with window
|
||||||
|
if (m_image.devicePixelRatio() != window()->devicePixelRatio())
|
||||||
|
resize(backingStore()->size(), backingStore()->staticContents());
|
||||||
|
|
||||||
if (!m_image.hasAlphaChannel())
|
if (!m_image.hasAlphaChannel())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -368,9 +368,6 @@ QAndroidPlatformTheme::QAndroidPlatformTheme(QAndroidPlatformNativeInterface *an
|
|||||||
|
|
||||||
// default in case the style has not set a font
|
// default in case the style has not set a font
|
||||||
m_systemFont = QFont(QLatin1String("Roboto"), 14.0 * 100 / 72); // keep default size the same after changing from 100 dpi to 72 dpi
|
m_systemFont = QFont(QLatin1String("Roboto"), 14.0 * 100 / 72); // keep default size the same after changing from 100 dpi to 72 dpi
|
||||||
|
|
||||||
// by default use native menu bar
|
|
||||||
QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPlatformMenuBar *QAndroidPlatformTheme::createPlatformMenuBar() const
|
QPlatformMenuBar *QAndroidPlatformTheme::createPlatformMenuBar() const
|
||||||
|
@ -301,8 +301,6 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList)
|
|||||||
initResources();
|
initResources();
|
||||||
QMacAutoReleasePool pool;
|
QMacAutoReleasePool pool;
|
||||||
|
|
||||||
qApp->setAttribute(Qt::AA_DontUseNativeMenuBar, false);
|
|
||||||
|
|
||||||
NSApplication *cocoaApplication = [QNSApplication sharedApplication];
|
NSApplication *cocoaApplication = [QNSApplication sharedApplication];
|
||||||
qt_redirectNSApplicationSendEvent();
|
qt_redirectNSApplicationSendEvent();
|
||||||
|
|
||||||
|
@ -1114,7 +1114,7 @@ static bool _q_dontOverrideCtrlLMB = false;
|
|||||||
|
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
[self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
||||||
m_platformWindow->m_enterLeaveTargetWindow = m_platformWindow->childWindowAt(windowPoint.toPoint());
|
m_platformWindow->m_enterLeaveTargetWindow = m_platformWindow->childWindowAt(windowPoint.toPoint());
|
||||||
QWindowSystemInterface::handleEnterEvent(m_platformWindow->m_enterLeaveTargetWindow, windowPoint, screenPoint);
|
QWindowSystemInterface::handleEnterEvent(m_platformWindow->m_enterLeaveTargetWindow, windowPoint, screenPoint);
|
||||||
}
|
}
|
||||||
@ -1156,7 +1156,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
|
|||||||
|
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint: &windowPoint andScreenPoint: &screenPoint];
|
[self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint: &windowPoint andScreenPoint: &screenPoint];
|
||||||
|
|
||||||
uint deviceId = [theEvent deviceID];
|
uint deviceId = [theEvent deviceID];
|
||||||
if (!tabletDeviceDataHash->contains(deviceId)) {
|
if (!tabletDeviceDataHash->contains(deviceId)) {
|
||||||
@ -1371,7 +1371,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
|||||||
const NSTimeInterval timestamp = [event timestamp];
|
const NSTimeInterval timestamp = [event timestamp];
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
[self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
||||||
QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::ZoomNativeGesture,
|
QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::ZoomNativeGesture,
|
||||||
[event magnification], windowPoint, screenPoint);
|
[event magnification], windowPoint, screenPoint);
|
||||||
}
|
}
|
||||||
@ -1383,7 +1383,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
|||||||
const NSTimeInterval timestamp = [event timestamp];
|
const NSTimeInterval timestamp = [event timestamp];
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
[self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
||||||
QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::SmartZoomNativeGesture,
|
QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::SmartZoomNativeGesture,
|
||||||
zoomIn ? 1.0f : 0.0f, windowPoint, screenPoint);
|
zoomIn ? 1.0f : 0.0f, windowPoint, screenPoint);
|
||||||
zoomIn = !zoomIn;
|
zoomIn = !zoomIn;
|
||||||
@ -1397,7 +1397,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
|||||||
const NSTimeInterval timestamp = [event timestamp];
|
const NSTimeInterval timestamp = [event timestamp];
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
[self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
||||||
QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::RotateNativeGesture,
|
QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::RotateNativeGesture,
|
||||||
-[event rotation], windowPoint, screenPoint);
|
-[event rotation], windowPoint, screenPoint);
|
||||||
}
|
}
|
||||||
@ -1408,7 +1408,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
|||||||
const NSTimeInterval timestamp = [event timestamp];
|
const NSTimeInterval timestamp = [event timestamp];
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
[self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
||||||
|
|
||||||
qreal angle = 0.0f;
|
qreal angle = 0.0f;
|
||||||
if ([event deltaX] == 1)
|
if ([event deltaX] == 1)
|
||||||
@ -1429,7 +1429,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
|||||||
const NSTimeInterval timestamp = [event timestamp];
|
const NSTimeInterval timestamp = [event timestamp];
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
[self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
||||||
qCDebug(lcQpaGestures) << "beginGestureWithEvent @" << windowPoint;
|
qCDebug(lcQpaGestures) << "beginGestureWithEvent @" << windowPoint;
|
||||||
QWindowSystemInterface::handleGestureEvent(m_window, timestamp, Qt::BeginNativeGesture,
|
QWindowSystemInterface::handleGestureEvent(m_window, timestamp, Qt::BeginNativeGesture,
|
||||||
windowPoint, screenPoint);
|
windowPoint, screenPoint);
|
||||||
@ -1441,7 +1441,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
|||||||
const NSTimeInterval timestamp = [event timestamp];
|
const NSTimeInterval timestamp = [event timestamp];
|
||||||
QPointF windowPoint;
|
QPointF windowPoint;
|
||||||
QPointF screenPoint;
|
QPointF screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
[self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
|
||||||
QWindowSystemInterface::handleGestureEvent(m_window, timestamp, Qt::EndNativeGesture,
|
QWindowSystemInterface::handleGestureEvent(m_window, timestamp, Qt::EndNativeGesture,
|
||||||
windowPoint, screenPoint);
|
windowPoint, screenPoint);
|
||||||
}
|
}
|
||||||
@ -1485,7 +1485,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
|||||||
|
|
||||||
QPointF qt_windowPoint;
|
QPointF qt_windowPoint;
|
||||||
QPointF qt_screenPoint;
|
QPointF qt_screenPoint;
|
||||||
[self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&qt_windowPoint andScreenPoint:&qt_screenPoint];
|
[self convertFromScreen:[self screenMousePoint:theEvent] toWindowPoint:&qt_windowPoint andScreenPoint:&qt_screenPoint];
|
||||||
NSTimeInterval timestamp = [theEvent timestamp];
|
NSTimeInterval timestamp = [theEvent timestamp];
|
||||||
ulong qt_timestamp = timestamp * 1000;
|
ulong qt_timestamp = timestamp * 1000;
|
||||||
|
|
||||||
|
@ -66,6 +66,33 @@ void QIOSPaintDevice::ensureActiveTarget()
|
|||||||
m_backingStore->makeCurrent();
|
m_backingStore->makeCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\class QIOSBackingStore
|
||||||
|
|
||||||
|
\brief The QPlatformBackingStore on iOS.
|
||||||
|
|
||||||
|
QBackingStore enables the use of QPainter to paint on a QWindow, as opposed
|
||||||
|
to rendering to a QWindow through the use of OpenGL with QOpenGLContext.
|
||||||
|
|
||||||
|
Historically, the iOS port initially implemented the backing store by using
|
||||||
|
an QOpenGLPaintDevice as its paint device, triggering the use of the OpenGL
|
||||||
|
paint engine for QPainter based drawing. This was due to raster drawing
|
||||||
|
operations being too slow when not being NEON-optimized, and got the port
|
||||||
|
up and running quickly.
|
||||||
|
|
||||||
|
As of 3e892e4a97, released in Qt 5.7, the backing store now uses a QImage,
|
||||||
|
for its paint device, giving normal raster-based QPainter operations, and
|
||||||
|
enabling features such as antialiased drawing.
|
||||||
|
|
||||||
|
To account for regressions in performance, the old code path is still
|
||||||
|
available by setting the surface type of the QWindow to OpenGLSurface.
|
||||||
|
This surface type is normally used when rendering though QOpenGLContext,
|
||||||
|
but will in the case of QIOSBackingStore trigger the old OpenGL based
|
||||||
|
painter.
|
||||||
|
|
||||||
|
This fallback path is not too intrusive, as the QImage based path still
|
||||||
|
uses OpenGL to composite the image at flush() time using composeAndFlush.
|
||||||
|
*/
|
||||||
QIOSBackingStore::QIOSBackingStore(QWindow *window)
|
QIOSBackingStore::QIOSBackingStore(QWindow *window)
|
||||||
: QRasterBackingStore(window)
|
: QRasterBackingStore(window)
|
||||||
, m_context(new QOpenGLContext)
|
, m_context(new QOpenGLContext)
|
||||||
|
@ -1274,8 +1274,23 @@ QT_WARNING_POP
|
|||||||
Q_ASSERT(fontEngine->ref.load() == 0);
|
Q_ASSERT(fontEngine->ref.load() == 0);
|
||||||
|
|
||||||
// Override the generated font name
|
// Override the generated font name
|
||||||
|
switch (fontEngine->type()) {
|
||||||
|
case QFontEngine::Win:
|
||||||
static_cast<QWindowsFontEngine *>(fontEngine)->setUniqueFamilyName(uniqueFamilyName);
|
static_cast<QWindowsFontEngine *>(fontEngine)->setUniqueFamilyName(uniqueFamilyName);
|
||||||
fontEngine->fontDef.family = actualFontName;
|
fontEngine->fontDef.family = actualFontName;
|
||||||
|
break;
|
||||||
|
|
||||||
|
#if !defined(QT_NO_DIRECTWRITE)
|
||||||
|
case QFontEngine::DirectWrite:
|
||||||
|
static_cast<QWindowsFontEngineDirectWrite *>(fontEngine)->setUniqueFamilyName(uniqueFamilyName);
|
||||||
|
fontEngine->fontDef.family = actualFontName;
|
||||||
|
break;
|
||||||
|
#endif // !QT_NO_DIRECTWRITE
|
||||||
|
|
||||||
|
default:
|
||||||
|
Q_ASSERT_X(false, Q_FUNC_INFO, "Unhandled font engine.");
|
||||||
|
}
|
||||||
|
|
||||||
UniqueFontData uniqueData;
|
UniqueFontData uniqueData;
|
||||||
uniqueData.handle = fontHandle;
|
uniqueData.handle = fontHandle;
|
||||||
uniqueData.refCount.ref();
|
uniqueData.refCount.ref();
|
||||||
|
@ -49,6 +49,8 @@
|
|||||||
#include <QtCore/QFile>
|
#include <QtCore/QFile>
|
||||||
#include <private/qstringiterator_p.h>
|
#include <private/qstringiterator_p.h>
|
||||||
#include <QtCore/private/qsystemlibrary_p.h>
|
#include <QtCore/private/qsystemlibrary_p.h>
|
||||||
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
|
#include <qpa/qplatformintegration.h>
|
||||||
|
|
||||||
#if defined(QT_USE_DIRECTWRITE2)
|
#if defined(QT_USE_DIRECTWRITE2)
|
||||||
# include <dwrite_2.h>
|
# include <dwrite_2.h>
|
||||||
@ -235,6 +237,11 @@ QWindowsFontEngineDirectWrite::~QWindowsFontEngineDirectWrite()
|
|||||||
|
|
||||||
if (m_directWriteBitmapRenderTarget != 0)
|
if (m_directWriteBitmapRenderTarget != 0)
|
||||||
m_directWriteBitmapRenderTarget->Release();
|
m_directWriteBitmapRenderTarget->Release();
|
||||||
|
|
||||||
|
if (!m_uniqueFamilyName.isEmpty()) {
|
||||||
|
QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase();
|
||||||
|
static_cast<QWindowsFontDatabase *>(pfdb)->derefUniqueFont(m_uniqueFamilyName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_CC_MINGW
|
#ifndef Q_CC_MINGW
|
||||||
@ -866,12 +873,17 @@ QImage QWindowsFontEngineDirectWrite::alphaRGBMapForGlyph(glyph_t t,
|
|||||||
|
|
||||||
QFontEngine *QWindowsFontEngineDirectWrite::cloneWithSize(qreal pixelSize) const
|
QFontEngine *QWindowsFontEngineDirectWrite::cloneWithSize(qreal pixelSize) const
|
||||||
{
|
{
|
||||||
QFontEngine *fontEngine = new QWindowsFontEngineDirectWrite(m_directWriteFontFace,
|
QWindowsFontEngineDirectWrite *fontEngine = new QWindowsFontEngineDirectWrite(m_directWriteFontFace,
|
||||||
pixelSize,
|
pixelSize,
|
||||||
m_fontEngineData);
|
m_fontEngineData);
|
||||||
|
|
||||||
fontEngine->fontDef = fontDef;
|
fontEngine->fontDef = fontDef;
|
||||||
fontEngine->fontDef.pixelSize = pixelSize;
|
fontEngine->fontDef.pixelSize = pixelSize;
|
||||||
|
if (!m_uniqueFamilyName.isEmpty()) {
|
||||||
|
fontEngine->setUniqueFamilyName(m_uniqueFamilyName);
|
||||||
|
QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase();
|
||||||
|
static_cast<QWindowsFontDatabase *>(pfdb)->refUniqueFont(m_uniqueFamilyName);
|
||||||
|
}
|
||||||
|
|
||||||
return fontEngine;
|
return fontEngine;
|
||||||
}
|
}
|
||||||
|
@ -111,6 +111,8 @@ public:
|
|||||||
|
|
||||||
IDWriteFontFace *directWriteFontFace() const { return m_directWriteFontFace; }
|
IDWriteFontFace *directWriteFontFace() const { return m_directWriteFontFace; }
|
||||||
|
|
||||||
|
void setUniqueFamilyName(const QString &newName) { m_uniqueFamilyName = newName; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QImage imageForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform);
|
QImage imageForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform);
|
||||||
void collectMetrics();
|
void collectMetrics();
|
||||||
@ -131,6 +133,7 @@ private:
|
|||||||
QFixed m_xHeight;
|
QFixed m_xHeight;
|
||||||
QFixed m_lineGap;
|
QFixed m_lineGap;
|
||||||
FaceId m_faceId;
|
FaceId m_faceId;
|
||||||
|
QString m_uniqueFamilyName;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include "qxcbeglcontext.h"
|
#include "qxcbeglcontext.h"
|
||||||
|
|
||||||
#include <QtGui/QOffscreenSurface>
|
#include <QtGui/QOffscreenSurface>
|
||||||
|
#include <QtPlatformSupport/private/qeglstreamconvenience_p.h>
|
||||||
|
|
||||||
#include "qxcbeglnativeinterfacehandler.h"
|
#include "qxcbeglnativeinterfacehandler.h"
|
||||||
|
|
||||||
@ -63,6 +64,17 @@ QXcbEglIntegration::~QXcbEglIntegration()
|
|||||||
bool QXcbEglIntegration::initialize(QXcbConnection *connection)
|
bool QXcbEglIntegration::initialize(QXcbConnection *connection)
|
||||||
{
|
{
|
||||||
m_connection = connection;
|
m_connection = connection;
|
||||||
|
|
||||||
|
const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|
||||||
|
|
||||||
|
if (extensions && strstr(extensions, "EGL_EXT_platform_x11")) {
|
||||||
|
QEGLStreamConvenience streamFuncs;
|
||||||
|
m_egl_display = streamFuncs.get_platform_display(EGL_PLATFORM_X11_KHR,
|
||||||
|
xlib_display(),
|
||||||
|
nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_egl_display)
|
||||||
m_egl_display = eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(xlib_display()));
|
m_egl_display = eglGetDisplay(reinterpret_cast<EGLNativeDisplayType>(xlib_display()));
|
||||||
|
|
||||||
EGLint major, minor;
|
EGLint major, minor;
|
||||||
|
@ -69,6 +69,7 @@
|
|||||||
"label": "PostgreSQL",
|
"label": "PostgreSQL",
|
||||||
"test": "unix/psql",
|
"test": "unix/psql",
|
||||||
"sources": [
|
"sources": [
|
||||||
|
{ "type": "pkgConfig", "args": "libpq" },
|
||||||
{ "type": "psqlConfig" },
|
{ "type": "psqlConfig" },
|
||||||
{ "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" },
|
{ "type": "psqlEnv", "libs": "-llibpq -lws2_32 -ladvapi32", "condition": "config.win32" },
|
||||||
{ "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" }
|
{ "type": "psqlEnv", "libs": "-lpq", "condition": "!config.win32" }
|
||||||
|
@ -538,7 +538,6 @@ bool Moc::parseMaybeFunction(const ClassDef *cdef, FunctionDef *def)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Moc::parse()
|
void Moc::parse()
|
||||||
{
|
{
|
||||||
QVector<NamespaceDef> namespaceList;
|
QVector<NamespaceDef> namespaceList;
|
||||||
@ -560,9 +559,27 @@ void Moc::parse()
|
|||||||
until(RBRACE);
|
until(RBRACE);
|
||||||
def.end = index;
|
def.end = index;
|
||||||
index = def.begin + 1;
|
index = def.begin + 1;
|
||||||
|
|
||||||
const bool parseNamespace = currentFilenames.size() <= 1;
|
const bool parseNamespace = currentFilenames.size() <= 1;
|
||||||
|
if (parseNamespace) {
|
||||||
|
for (int i = namespaceList.size() - 1; i >= 0; --i) {
|
||||||
|
if (inNamespace(&namespaceList.at(i))) {
|
||||||
|
def.qualified.prepend(namespaceList.at(i).classname + "::");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
while (parseNamespace && inNamespace(&def) && hasNext()) {
|
while (parseNamespace && inNamespace(&def) && hasNext()) {
|
||||||
switch (next()) {
|
switch (next()) {
|
||||||
|
case NAMESPACE:
|
||||||
|
if (test(IDENTIFIER)) {
|
||||||
|
if (test(EQ)) {
|
||||||
|
// namespace Foo = Bar::Baz;
|
||||||
|
until(SEMIC);
|
||||||
|
} else if (!test(SEMIC)) {
|
||||||
|
until(RBRACE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case Q_NAMESPACE_TOKEN:
|
case Q_NAMESPACE_TOKEN:
|
||||||
def.hasQNamespace = true;
|
def.hasQNamespace = true;
|
||||||
break;
|
break;
|
||||||
@ -857,13 +874,22 @@ void Moc::parse()
|
|||||||
continue;
|
continue;
|
||||||
ClassDef def;
|
ClassDef def;
|
||||||
static_cast<BaseDef &>(def) = static_cast<BaseDef>(n);
|
static_cast<BaseDef &>(def) = static_cast<BaseDef>(n);
|
||||||
if (!def.qualified.isEmpty())
|
|
||||||
def.qualified += "::";
|
|
||||||
def.qualified += def.classname;
|
def.qualified += def.classname;
|
||||||
def.hasQGadget = true;
|
def.hasQGadget = true;
|
||||||
classList += def;
|
auto it = std::find_if(classList.begin(), classList.end(), [&def](const ClassDef &val) {
|
||||||
|
return def.classname == val.classname && def.qualified == val.qualified;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (it != classList.end()) {
|
||||||
|
it->classInfoList += def.classInfoList;
|
||||||
|
it->enumDeclarations.unite(def.enumDeclarations);
|
||||||
|
it->enumList += def.enumList;
|
||||||
|
it->flagAliases.unite(def.flagAliases);
|
||||||
|
} else {
|
||||||
knownGadgets.insert(def.classname, def.qualified);
|
knownGadgets.insert(def.classname, def.qualified);
|
||||||
knownGadgets.insert(def.qualified, def.qualified);
|
knownGadgets.insert(def.qualified, def.qualified);
|
||||||
|
classList += def;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
#include <qfile.h>
|
#include <qfile.h>
|
||||||
#include <qfileinfo.h>
|
#include <qfileinfo.h>
|
||||||
|
#include <qloggingcategory.h>
|
||||||
#include <qstring.h>
|
#include <qstring.h>
|
||||||
#include <qstringlist.h>
|
#include <qstringlist.h>
|
||||||
#include <qtextstream.h>
|
#include <qtextstream.h>
|
||||||
@ -1092,6 +1093,9 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (verbose)
|
||||||
|
QLoggingCategory::setFilterRules(QStringLiteral("dbus.parser.debug=true"));
|
||||||
|
|
||||||
QDBusIntrospection::Interfaces interfaces = readInput();
|
QDBusIntrospection::Interfaces interfaces = readInput();
|
||||||
cleanInterfaces(interfaces);
|
cleanInterfaces(interfaces);
|
||||||
|
|
||||||
|
@ -1862,12 +1862,14 @@ void QColorDialogPrivate::retranslateStrings()
|
|||||||
|
|
||||||
bool QColorDialogPrivate::canBeNativeDialog() const
|
bool QColorDialogPrivate::canBeNativeDialog() const
|
||||||
{
|
{
|
||||||
Q_Q(const QColorDialog);
|
// Don't use Q_Q here! This function is called from ~QDialog,
|
||||||
|
// so Q_Q calling q_func() invokes undefined behavior (invalid cast in q_func()).
|
||||||
|
const QDialog * const q = static_cast<const QDialog*>(q_ptr);
|
||||||
if (nativeDialogInUse)
|
if (nativeDialogInUse)
|
||||||
return true;
|
return true;
|
||||||
if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
|
if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
|
||||||
|| q->testAttribute(Qt::WA_DontShowOnScreen)
|
|| q->testAttribute(Qt::WA_DontShowOnScreen)
|
||||||
|| (q->options() & QColorDialog::DontUseNativeDialog)) {
|
|| (options->options() & QColorDialog::DontUseNativeDialog)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -692,12 +692,14 @@ void QFileDialogPrivate::emitFilesSelected(const QStringList &files)
|
|||||||
|
|
||||||
bool QFileDialogPrivate::canBeNativeDialog() const
|
bool QFileDialogPrivate::canBeNativeDialog() const
|
||||||
{
|
{
|
||||||
Q_Q(const QFileDialog);
|
// Don't use Q_Q here! This function is called from ~QDialog,
|
||||||
|
// so Q_Q calling q_func() invokes undefined behavior (invalid cast in q_func()).
|
||||||
|
const QDialog * const q = static_cast<const QDialog*>(q_ptr);
|
||||||
if (nativeDialogInUse)
|
if (nativeDialogInUse)
|
||||||
return true;
|
return true;
|
||||||
if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
|
if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
|
||||||
|| q->testAttribute(Qt::WA_DontShowOnScreen)
|
|| q->testAttribute(Qt::WA_DontShowOnScreen)
|
||||||
|| (q->options() & QFileDialog::DontUseNativeDialog)) {
|
|| (options->options() & QFileDialog::DontUseNativeDialog)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1030,7 +1030,9 @@ void QFontDialog::done(int result)
|
|||||||
|
|
||||||
bool QFontDialogPrivate::canBeNativeDialog() const
|
bool QFontDialogPrivate::canBeNativeDialog() const
|
||||||
{
|
{
|
||||||
Q_Q(const QFontDialog);
|
// Don't use Q_Q here! This function is called from ~QDialog,
|
||||||
|
// so Q_Q calling q_func() invokes undefined behavior (invalid cast in q_func()).
|
||||||
|
const QDialog * const q = static_cast<const QDialog*>(q_ptr);
|
||||||
if (nativeDialogInUse)
|
if (nativeDialogInUse)
|
||||||
return true;
|
return true;
|
||||||
if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
|
if (QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
|
||||||
|
@ -2096,7 +2096,7 @@ QList<AnchorData *> getVariables(const QList<QSimplexConstraint *> &constraints)
|
|||||||
void QGraphicsAnchorLayoutPrivate::calculateGraphs(
|
void QGraphicsAnchorLayoutPrivate::calculateGraphs(
|
||||||
QGraphicsAnchorLayoutPrivate::Orientation orientation)
|
QGraphicsAnchorLayoutPrivate::Orientation orientation)
|
||||||
{
|
{
|
||||||
#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT)
|
#if defined(QT_DEBUG) || defined(QT_BUILD_INTERNAL)
|
||||||
lastCalculationUsedSimplex[orientation] = false;
|
lastCalculationUsedSimplex[orientation] = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2249,7 +2249,7 @@ bool QGraphicsAnchorLayoutPrivate::calculateTrunk(Orientation orientation, const
|
|||||||
sizeHints[orientation][Qt::MaximumSize] = ad->sizeAtMaximum;
|
sizeHints[orientation][Qt::MaximumSize] = ad->sizeAtMaximum;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT)
|
#if defined(QT_DEBUG) || defined(QT_BUILD_INTERNAL)
|
||||||
lastCalculationUsedSimplex[orientation] = needsSimplex;
|
lastCalculationUsedSimplex[orientation] = needsSimplex;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ public:
|
|||||||
bool graphHasConflicts[2];
|
bool graphHasConflicts[2];
|
||||||
QSet<QGraphicsLayoutItem *> m_floatItems[2];
|
QSet<QGraphicsLayoutItem *> m_floatItems[2];
|
||||||
|
|
||||||
#if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT)
|
#if defined(QT_DEBUG) || defined(QT_BUILD_INTERNAL)
|
||||||
bool lastCalculationUsedSimplex[2];
|
bool lastCalculationUsedSimplex[2];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -717,10 +717,11 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
|
|||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsObject *dummy = static_cast<QGraphicsObject *>(item);
|
if (QGraphicsObject *dummy = item->toGraphicsObject()) {
|
||||||
cachedTargetItems.removeOne(dummy);
|
cachedTargetItems.removeOne(dummy);
|
||||||
cachedItemGestures.remove(dummy);
|
cachedItemGestures.remove(dummy);
|
||||||
cachedAlreadyDeliveredGestures.remove(dummy);
|
cachedAlreadyDeliveredGestures.remove(dummy);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (Qt::GestureType gesture, item->d_ptr->gestureContext.keys())
|
foreach (Qt::GestureType gesture, item->d_ptr->gestureContext.keys())
|
||||||
ungrabGesture(item, gesture);
|
ungrabGesture(item, gesture);
|
||||||
@ -996,7 +997,7 @@ void QGraphicsScenePrivate::ungrabMouse(QGraphicsItem *item, bool itemIsDying)
|
|||||||
// If the item is a popup, go via removePopup to ensure state
|
// If the item is a popup, go via removePopup to ensure state
|
||||||
// consistency and that it gets hidden correctly - beware that
|
// consistency and that it gets hidden correctly - beware that
|
||||||
// removePopup() reenters this function to continue removing the grab.
|
// removePopup() reenters this function to continue removing the grab.
|
||||||
removePopup((QGraphicsWidget *)item, itemIsDying);
|
removePopup(popupWidgets.constLast(), itemIsDying);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1068,15 +1068,17 @@ QStyle *QApplication::style()
|
|||||||
if (!QApplicationPrivate::app_style) {
|
if (!QApplicationPrivate::app_style) {
|
||||||
// Compile-time search for default style
|
// Compile-time search for default style
|
||||||
//
|
//
|
||||||
QString style;
|
|
||||||
if (!QApplicationPrivate::styleOverride.isEmpty()) {
|
|
||||||
style = QApplicationPrivate::styleOverride.toLower();
|
|
||||||
} else {
|
|
||||||
style = QApplicationPrivate::desktopStyleKey();
|
|
||||||
}
|
|
||||||
|
|
||||||
QStyle *&app_style = QApplicationPrivate::app_style;
|
QStyle *&app_style = QApplicationPrivate::app_style;
|
||||||
|
|
||||||
|
if (!QApplicationPrivate::styleOverride.isEmpty()) {
|
||||||
|
const QString style = QApplicationPrivate::styleOverride.toLower();
|
||||||
app_style = QStyleFactory::create(style);
|
app_style = QStyleFactory::create(style);
|
||||||
|
if (!app_style)
|
||||||
|
qWarning("QApplication: invalid style override passed, ignoring it.");
|
||||||
|
}
|
||||||
|
if (!app_style)
|
||||||
|
app_style = QStyleFactory::create(QApplicationPrivate::desktopStyleKey());
|
||||||
|
|
||||||
if (!app_style) {
|
if (!app_style) {
|
||||||
const QStringList styles = QStyleFactory::keys();
|
const QStringList styles = QStyleFactory::keys();
|
||||||
for (const auto &style : styles) {
|
for (const auto &style : styles) {
|
||||||
@ -3116,11 +3118,11 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
|||||||
key->accept();
|
key->accept();
|
||||||
else
|
else
|
||||||
key->ignore();
|
key->ignore();
|
||||||
res = d->notify_helper(receiver, e);
|
|
||||||
QWidget *w = isWidget ? static_cast<QWidget *>(receiver) : 0;
|
QWidget *w = isWidget ? static_cast<QWidget *>(receiver) : 0;
|
||||||
#ifndef QT_NO_GRAPHICSVIEW
|
#ifndef QT_NO_GRAPHICSVIEW
|
||||||
QGraphicsWidget *gw = isGraphicsWidget ? static_cast<QGraphicsWidget *>(receiver) : 0;
|
QGraphicsWidget *gw = isGraphicsWidget ? static_cast<QGraphicsWidget *>(receiver) : 0;
|
||||||
#endif
|
#endif
|
||||||
|
res = d->notify_helper(receiver, e);
|
||||||
|
|
||||||
if ((res && key->isAccepted())
|
if ((res && key->isAccepted())
|
||||||
/*
|
/*
|
||||||
|
@ -546,7 +546,7 @@ void QLayout::invalidate()
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool removeWidgetRecursively(QLayoutItem *li, QWidget *w)
|
static bool removeWidgetRecursively(QLayoutItem *li, QObject *w)
|
||||||
{
|
{
|
||||||
QLayout *lay = li->layout();
|
QLayout *lay = li->layout();
|
||||||
if (!lay)
|
if (!lay)
|
||||||
@ -609,12 +609,11 @@ void QLayout::widgetEvent(QEvent *e)
|
|||||||
{
|
{
|
||||||
QChildEvent *c = (QChildEvent *)e;
|
QChildEvent *c = (QChildEvent *)e;
|
||||||
if (c->child()->isWidgetType()) {
|
if (c->child()->isWidgetType()) {
|
||||||
QWidget *w = (QWidget *)c->child();
|
|
||||||
#ifndef QT_NO_MENUBAR
|
#ifndef QT_NO_MENUBAR
|
||||||
if (w == d->menubar)
|
if (c->child() == d->menubar)
|
||||||
d->menubar = 0;
|
d->menubar = 0;
|
||||||
#endif
|
#endif
|
||||||
removeWidgetRecursively(this, w);
|
removeWidgetRecursively(this, c->child());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
#include "qlayout_p.h"
|
#include "qlayout_p.h"
|
||||||
|
|
||||||
#include <qlist.h>
|
#include <qlist.h>
|
||||||
#include <qwidget.h>
|
#include "private/qwidget_p.h"
|
||||||
#include "private/qlayoutengine_p.h"
|
#include "private/qlayoutengine_p.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -251,14 +251,10 @@ QLayoutItem *QStackedLayout::itemAt(int index) const
|
|||||||
// Code that enables proper handling of the case that takeAt() is
|
// Code that enables proper handling of the case that takeAt() is
|
||||||
// called somewhere inside QObject destructor (can't call hide()
|
// called somewhere inside QObject destructor (can't call hide()
|
||||||
// on the object then)
|
// on the object then)
|
||||||
|
static bool qt_wasDeleted(const QWidget *w)
|
||||||
class QtFriendlyLayoutWidget : public QWidget
|
|
||||||
{
|
{
|
||||||
public:
|
return QWidgetPrivate::get(w)->wasDeleted;
|
||||||
inline bool wasDeleted() const { return d_ptr->wasDeleted; }
|
}
|
||||||
};
|
|
||||||
|
|
||||||
static bool qt_wasDeleted(const QWidget *w) { return static_cast<const QtFriendlyLayoutWidget*>(w)->wasDeleted(); }
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -508,45 +508,46 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
|
|||||||
return QGestureRecognizer::FinishGesture | QGestureRecognizer::ConsumeEventHint;
|
return QGestureRecognizer::FinishGesture | QGestureRecognizer::ConsumeEventHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QTouchEvent *ev = static_cast<const QTouchEvent *>(event);
|
|
||||||
const QMouseEvent *me = static_cast<const QMouseEvent *>(event);
|
|
||||||
#ifndef QT_NO_GRAPHICSVIEW
|
|
||||||
const QGraphicsSceneMouseEvent *gsme = static_cast<const QGraphicsSceneMouseEvent *>(event);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum { TapRadius = 40 };
|
enum { TapRadius = 40 };
|
||||||
|
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
#ifndef QT_NO_GRAPHICSVIEW
|
#ifndef QT_NO_GRAPHICSVIEW
|
||||||
case QEvent::GraphicsSceneMousePress:
|
case QEvent::GraphicsSceneMousePress: {
|
||||||
|
const QGraphicsSceneMouseEvent *gsme = static_cast<const QGraphicsSceneMouseEvent *>(event);
|
||||||
d->position = gsme->screenPos();
|
d->position = gsme->screenPos();
|
||||||
q->setHotSpot(d->position);
|
q->setHotSpot(d->position);
|
||||||
if (d->timerId)
|
if (d->timerId)
|
||||||
q->killTimer(d->timerId);
|
q->killTimer(d->timerId);
|
||||||
d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
|
d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
|
||||||
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
|
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
case QEvent::MouseButtonPress:
|
case QEvent::MouseButtonPress: {
|
||||||
|
const QMouseEvent *me = static_cast<const QMouseEvent *>(event);
|
||||||
d->position = me->globalPos();
|
d->position = me->globalPos();
|
||||||
q->setHotSpot(d->position);
|
q->setHotSpot(d->position);
|
||||||
if (d->timerId)
|
if (d->timerId)
|
||||||
q->killTimer(d->timerId);
|
q->killTimer(d->timerId);
|
||||||
d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
|
d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
|
||||||
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
|
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
|
||||||
case QEvent::TouchBegin:
|
}
|
||||||
|
case QEvent::TouchBegin: {
|
||||||
|
const QTouchEvent *ev = static_cast<const QTouchEvent *>(event);
|
||||||
d->position = ev->touchPoints().at(0).startScreenPos();
|
d->position = ev->touchPoints().at(0).startScreenPos();
|
||||||
q->setHotSpot(d->position);
|
q->setHotSpot(d->position);
|
||||||
if (d->timerId)
|
if (d->timerId)
|
||||||
q->killTimer(d->timerId);
|
q->killTimer(d->timerId);
|
||||||
d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
|
d->timerId = q->startTimer(QTapAndHoldGesturePrivate::Timeout);
|
||||||
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
|
return QGestureRecognizer::MayBeGesture; // we don't show a sign of life until the timeout
|
||||||
|
}
|
||||||
#ifndef QT_NO_GRAPHICSVIEW
|
#ifndef QT_NO_GRAPHICSVIEW
|
||||||
case QEvent::GraphicsSceneMouseRelease:
|
case QEvent::GraphicsSceneMouseRelease:
|
||||||
#endif
|
#endif
|
||||||
case QEvent::MouseButtonRelease:
|
case QEvent::MouseButtonRelease:
|
||||||
case QEvent::TouchEnd:
|
case QEvent::TouchEnd:
|
||||||
return QGestureRecognizer::CancelGesture; // get out of the MayBeGesture state
|
return QGestureRecognizer::CancelGesture; // get out of the MayBeGesture state
|
||||||
case QEvent::TouchUpdate:
|
case QEvent::TouchUpdate: {
|
||||||
|
const QTouchEvent *ev = static_cast<const QTouchEvent *>(event);
|
||||||
if (d->timerId && ev->touchPoints().size() == 1) {
|
if (d->timerId && ev->touchPoints().size() == 1) {
|
||||||
QTouchEvent::TouchPoint p = ev->touchPoints().at(0);
|
QTouchEvent::TouchPoint p = ev->touchPoints().at(0);
|
||||||
QPoint delta = p.pos().toPoint() - p.startPos().toPoint();
|
QPoint delta = p.pos().toPoint() - p.startPos().toPoint();
|
||||||
@ -554,7 +555,9 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
|
|||||||
return QGestureRecognizer::MayBeGesture;
|
return QGestureRecognizer::MayBeGesture;
|
||||||
}
|
}
|
||||||
return QGestureRecognizer::CancelGesture;
|
return QGestureRecognizer::CancelGesture;
|
||||||
|
}
|
||||||
case QEvent::MouseMove: {
|
case QEvent::MouseMove: {
|
||||||
|
const QMouseEvent *me = static_cast<const QMouseEvent *>(event);
|
||||||
QPoint delta = me->globalPos() - d->position.toPoint();
|
QPoint delta = me->globalPos() - d->position.toPoint();
|
||||||
if (d->timerId && delta.manhattanLength() <= TapRadius)
|
if (d->timerId && delta.manhattanLength() <= TapRadius)
|
||||||
return QGestureRecognizer::MayBeGesture;
|
return QGestureRecognizer::MayBeGesture;
|
||||||
@ -562,6 +565,7 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
|
|||||||
}
|
}
|
||||||
#ifndef QT_NO_GRAPHICSVIEW
|
#ifndef QT_NO_GRAPHICSVIEW
|
||||||
case QEvent::GraphicsSceneMouseMove: {
|
case QEvent::GraphicsSceneMouseMove: {
|
||||||
|
const QGraphicsSceneMouseEvent *gsme = static_cast<const QGraphicsSceneMouseEvent *>(event);
|
||||||
QPoint delta = gsme->screenPos() - d->position.toPoint();
|
QPoint delta = gsme->screenPos() - d->position.toPoint();
|
||||||
if (d->timerId && delta.manhattanLength() <= TapRadius)
|
if (d->timerId && delta.manhattanLength() <= TapRadius)
|
||||||
return QGestureRecognizer::MayBeGesture;
|
return QGestureRecognizer::MayBeGesture;
|
||||||
|
@ -342,6 +342,7 @@ bool QTipLabel::eventFilter(QObject *o, QEvent *e)
|
|||||||
case QEvent::FocusIn:
|
case QEvent::FocusIn:
|
||||||
case QEvent::FocusOut:
|
case QEvent::FocusOut:
|
||||||
#endif
|
#endif
|
||||||
|
case QEvent::Close: // For QTBUG-55523 (QQC) specifically: Hide tooltip when windows are closed
|
||||||
case QEvent::MouseButtonPress:
|
case QEvent::MouseButtonPress:
|
||||||
case QEvent::MouseButtonRelease:
|
case QEvent::MouseButtonRelease:
|
||||||
case QEvent::MouseButtonDblClick:
|
case QEvent::MouseButtonDblClick:
|
||||||
|
@ -5226,8 +5226,10 @@ static void sendResizeEvents(QWidget *target)
|
|||||||
|
|
||||||
const QObjectList children = target->children();
|
const QObjectList children = target->children();
|
||||||
for (int i = 0; i < children.size(); ++i) {
|
for (int i = 0; i < children.size(); ++i) {
|
||||||
|
if (!children.at(i)->isWidgetType())
|
||||||
|
continue;
|
||||||
QWidget *child = static_cast<QWidget*>(children.at(i));
|
QWidget *child = static_cast<QWidget*>(children.at(i));
|
||||||
if (child->isWidgetType() && !child->isWindow() && child->testAttribute(Qt::WA_PendingResizeEvent))
|
if (!child->isWindow() && child->testAttribute(Qt::WA_PendingResizeEvent))
|
||||||
sendResizeEvents(child);
|
sendResizeEvents(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -330,6 +330,7 @@ public:
|
|||||||
~QWidgetPrivate();
|
~QWidgetPrivate();
|
||||||
|
|
||||||
static QWidgetPrivate *get(QWidget *w) { return w->d_func(); }
|
static QWidgetPrivate *get(QWidget *w) { return w->d_func(); }
|
||||||
|
static const QWidgetPrivate *get(const QWidget *w) { return w->d_func(); }
|
||||||
|
|
||||||
QWExtra *extraData() const;
|
QWExtra *extraData() const;
|
||||||
QTLWExtra *topData() const;
|
QTLWExtra *topData() const;
|
||||||
|
@ -2394,18 +2394,21 @@ void QDateTimeEditPrivate::init(const QVariant &var)
|
|||||||
switch (var.type()) {
|
switch (var.type()) {
|
||||||
case QVariant::Date:
|
case QVariant::Date:
|
||||||
value = QDateTime(var.toDate(), QDATETIMEEDIT_TIME_MIN);
|
value = QDateTime(var.toDate(), QDATETIMEEDIT_TIME_MIN);
|
||||||
|
updateTimeSpec();
|
||||||
q->setDisplayFormat(defaultDateFormat);
|
q->setDisplayFormat(defaultDateFormat);
|
||||||
if (sectionNodes.isEmpty()) // ### safeguard for broken locale
|
if (sectionNodes.isEmpty()) // ### safeguard for broken locale
|
||||||
q->setDisplayFormat(QLatin1String("dd/MM/yyyy"));
|
q->setDisplayFormat(QLatin1String("dd/MM/yyyy"));
|
||||||
break;
|
break;
|
||||||
case QVariant::DateTime:
|
case QVariant::DateTime:
|
||||||
value = var;
|
value = var;
|
||||||
|
updateTimeSpec();
|
||||||
q->setDisplayFormat(defaultDateTimeFormat);
|
q->setDisplayFormat(defaultDateTimeFormat);
|
||||||
if (sectionNodes.isEmpty()) // ### safeguard for broken locale
|
if (sectionNodes.isEmpty()) // ### safeguard for broken locale
|
||||||
q->setDisplayFormat(QLatin1String("dd/MM/yyyy hh:mm:ss"));
|
q->setDisplayFormat(QLatin1String("dd/MM/yyyy hh:mm:ss"));
|
||||||
break;
|
break;
|
||||||
case QVariant::Time:
|
case QVariant::Time:
|
||||||
value = QDateTime(QDATETIMEEDIT_DATE_INITIAL, var.toTime());
|
value = QDateTime(QDATETIMEEDIT_DATE_INITIAL, var.toTime());
|
||||||
|
updateTimeSpec();
|
||||||
q->setDisplayFormat(defaultTimeFormat);
|
q->setDisplayFormat(defaultTimeFormat);
|
||||||
if (sectionNodes.isEmpty()) // ### safeguard for broken locale
|
if (sectionNodes.isEmpty()) // ### safeguard for broken locale
|
||||||
q->setDisplayFormat(QLatin1String("hh:mm:ss"));
|
q->setDisplayFormat(QLatin1String("hh:mm:ss"));
|
||||||
@ -2418,7 +2421,6 @@ void QDateTimeEditPrivate::init(const QVariant &var)
|
|||||||
if (QApplication::keypadNavigationEnabled())
|
if (QApplication::keypadNavigationEnabled())
|
||||||
q->setCalendarPopup(true);
|
q->setCalendarPopup(true);
|
||||||
#endif
|
#endif
|
||||||
updateTimeSpec();
|
|
||||||
q->setInputMethodHints(Qt::ImhPreferNumbers);
|
q->setInputMethodHints(Qt::ImhPreferNumbers);
|
||||||
setLayoutItemMargins(QStyle::SE_DateTimeEditLayoutItem);
|
setLayoutItemMargins(QStyle::SE_DateTimeEditLayoutItem);
|
||||||
}
|
}
|
||||||
|
@ -6546,6 +6546,29 @@ signals:
|
|||||||
CountedStruct mySignal(const CountedStruct &s1, CountedStruct s2);
|
CountedStruct mySignal(const CountedStruct &s1, CountedStruct s2);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CountedExceptionThrower : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit CountedExceptionThrower(bool throwException, QObject *parent = Q_NULLPTR)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
if (throwException)
|
||||||
|
throw ObjectException();
|
||||||
|
++counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
~CountedExceptionThrower()
|
||||||
|
{
|
||||||
|
--counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int counter;
|
||||||
|
};
|
||||||
|
|
||||||
|
int CountedExceptionThrower::counter = 0;
|
||||||
|
|
||||||
void tst_QObject::exceptions()
|
void tst_QObject::exceptions()
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_EXCEPTIONS
|
#ifndef QT_NO_EXCEPTIONS
|
||||||
@ -6607,6 +6630,59 @@ void tst_QObject::exceptions()
|
|||||||
}
|
}
|
||||||
QCOMPARE(countedStructObjectsCount, 0);
|
QCOMPARE(countedStructObjectsCount, 0);
|
||||||
|
|
||||||
|
// Child object reaping in case of exceptions thrown by constructors
|
||||||
|
{
|
||||||
|
QCOMPARE(CountedExceptionThrower::counter, 0);
|
||||||
|
|
||||||
|
try {
|
||||||
|
class ParentObject : public QObject {
|
||||||
|
public:
|
||||||
|
explicit ParentObject(QObject *parent = Q_NULLPTR)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
new CountedExceptionThrower(false, this);
|
||||||
|
new CountedExceptionThrower(false, this);
|
||||||
|
new CountedExceptionThrower(true, this); // throws
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
ParentObject p;
|
||||||
|
QFAIL("Exception not thrown");
|
||||||
|
} catch (const ObjectException &) {
|
||||||
|
} catch (...) {
|
||||||
|
QFAIL("Wrong exception thrown");
|
||||||
|
}
|
||||||
|
|
||||||
|
QCOMPARE(CountedExceptionThrower::counter, 0);
|
||||||
|
|
||||||
|
try {
|
||||||
|
QObject o;
|
||||||
|
new CountedExceptionThrower(false, &o);
|
||||||
|
new CountedExceptionThrower(false, &o);
|
||||||
|
new CountedExceptionThrower(true, &o); // throws
|
||||||
|
|
||||||
|
QFAIL("Exception not thrown");
|
||||||
|
} catch (const ObjectException &) {
|
||||||
|
} catch (...) {
|
||||||
|
QFAIL("Wrong exception thrown");
|
||||||
|
}
|
||||||
|
|
||||||
|
QCOMPARE(CountedExceptionThrower::counter, 0);
|
||||||
|
|
||||||
|
try {
|
||||||
|
QObject o;
|
||||||
|
CountedExceptionThrower c1(false, &o);
|
||||||
|
CountedExceptionThrower c2(false, &o);
|
||||||
|
CountedExceptionThrower c3(true, &o); // throws
|
||||||
|
|
||||||
|
QFAIL("Exception not thrown");
|
||||||
|
} catch (const ObjectException &) {
|
||||||
|
} catch (...) {
|
||||||
|
QFAIL("Wrong exception thrown");
|
||||||
|
}
|
||||||
|
|
||||||
|
QCOMPARE(CountedExceptionThrower::counter, 0);
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
QSKIP("Needs exceptions");
|
QSKIP("Needs exceptions");
|
||||||
|
@ -227,6 +227,7 @@ private slots:
|
|||||||
void ecdhServer();
|
void ecdhServer();
|
||||||
void verifyClientCertificate_data();
|
void verifyClientCertificate_data();
|
||||||
void verifyClientCertificate();
|
void verifyClientCertificate();
|
||||||
|
void readBufferMaxSize();
|
||||||
|
|
||||||
#ifndef QT_NO_OPENSSL
|
#ifndef QT_NO_OPENSSL
|
||||||
void simplePskConnect_data();
|
void simplePskConnect_data();
|
||||||
@ -3136,6 +3137,68 @@ void tst_QSslSocket::verifyClientCertificate()
|
|||||||
QCOMPARE(client.isEncrypted(), works);
|
QCOMPARE(client.isEncrypted(), works);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QSslSocket::readBufferMaxSize()
|
||||||
|
{
|
||||||
|
#ifdef QT_SECURETRANSPORT
|
||||||
|
// QTBUG-55170:
|
||||||
|
// SecureTransport back-end was ignoring read-buffer
|
||||||
|
// size limit, resulting (potentially) in a constantly
|
||||||
|
// growing internal buffer.
|
||||||
|
// The test's logic is: we set a small read buffer size on a client
|
||||||
|
// socket (to some ridiculously small value), server sends us
|
||||||
|
// a bunch of bytes , we ignore readReady signal so
|
||||||
|
// that socket's internal buffer size stays
|
||||||
|
// >= readBufferMaxSize, we wait for a quite long time
|
||||||
|
// (which previously would be enough to read completely)
|
||||||
|
// and we check socket's bytesAvaiable to be less than sent.
|
||||||
|
QFETCH_GLOBAL(bool, setProxy);
|
||||||
|
if (setProxy)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SslServer server;
|
||||||
|
QVERIFY(server.listen());
|
||||||
|
|
||||||
|
QEventLoop loop;
|
||||||
|
|
||||||
|
QSslSocketPtr client(new QSslSocket);
|
||||||
|
socket = client.data();
|
||||||
|
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
|
||||||
|
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
|
||||||
|
connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
|
||||||
|
|
||||||
|
client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(),
|
||||||
|
server.serverPort());
|
||||||
|
|
||||||
|
// Wait for 'encrypted' first:
|
||||||
|
QTimer::singleShot(5000, &loop, SLOT(quit()));
|
||||||
|
loop.exec();
|
||||||
|
|
||||||
|
QCOMPARE(client->state(), QAbstractSocket::ConnectedState);
|
||||||
|
QCOMPARE(client->mode(), QSslSocket::SslClientMode);
|
||||||
|
|
||||||
|
client->setReadBufferSize(10);
|
||||||
|
const QByteArray message(int(0xffff), 'a');
|
||||||
|
server.socket->write(message);
|
||||||
|
|
||||||
|
QTimer::singleShot(5000, &loop, SLOT(quit()));
|
||||||
|
loop.exec();
|
||||||
|
|
||||||
|
int readSoFar = client->bytesAvailable();
|
||||||
|
QVERIFY(readSoFar > 0 && readSoFar < message.size());
|
||||||
|
// Now, let's check that we still can read the rest of it:
|
||||||
|
QCOMPARE(client->readAll().size(), readSoFar);
|
||||||
|
|
||||||
|
client->setReadBufferSize(0);
|
||||||
|
|
||||||
|
QTimer::singleShot(1500, &loop, SLOT(quit()));
|
||||||
|
loop.exec();
|
||||||
|
|
||||||
|
QCOMPARE(client->bytesAvailable() + readSoFar, message.size());
|
||||||
|
#else
|
||||||
|
// Not needed, QSslSocket works correctly with other back-ends.
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last, as it has some side effects
|
void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last, as it has some side effects
|
||||||
{
|
{
|
||||||
// used to produce a crash in QSslConfigurationPrivate::deepCopyDefaultConfiguration, QTBUG-13265
|
// used to produce a crash in QSslConfigurationPrivate::deepCopyDefaultConfiguration, QTBUG-13265
|
||||||
|
@ -75,6 +75,10 @@ private slots:
|
|||||||
void testRasterA2RGB30PM();
|
void testRasterA2RGB30PM();
|
||||||
void testRasterBGR30_data();
|
void testRasterBGR30_data();
|
||||||
void testRasterBGR30();
|
void testRasterBGR30();
|
||||||
|
void testRasterARGB8565PM_data();
|
||||||
|
void testRasterARGB8565PM();
|
||||||
|
void testRasterGrayscale8_data();
|
||||||
|
void testRasterGrayscale8();
|
||||||
|
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
void testOpenGL_data();
|
void testOpenGL_data();
|
||||||
@ -178,6 +182,28 @@ void tst_Lancelot::testRasterBGR30()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void tst_Lancelot::testRasterARGB8565PM_data()
|
||||||
|
{
|
||||||
|
setupTestSuite();
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_Lancelot::testRasterARGB8565PM()
|
||||||
|
{
|
||||||
|
runTestSuite(Raster, QImage::Format_ARGB8565_Premultiplied);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void tst_Lancelot::testRasterGrayscale8_data()
|
||||||
|
{
|
||||||
|
setupTestSuite();
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_Lancelot::testRasterGrayscale8()
|
||||||
|
{
|
||||||
|
runTestSuite(Raster, QImage::Format_Grayscale8);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef QT_NO_OPENGL
|
#ifndef QT_NO_OPENGL
|
||||||
bool tst_Lancelot::checkSystemGLSupport()
|
bool tst_Lancelot::checkSystemGLSupport()
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,77 @@
|
|||||||
#pragma once
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 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$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef NAMESPACE_H
|
||||||
|
#define NAMESPACE_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
#include "namespace_no_merge.h"
|
||||||
|
// moc should not merge namespace_no_merge.h content with this one !
|
||||||
|
|
||||||
namespace FooNamespace {
|
namespace FooNamespace {
|
||||||
Q_NAMESPACE
|
Q_NAMESPACE
|
||||||
|
enum class Enum1 {
|
||||||
|
Key1,
|
||||||
|
Key2
|
||||||
|
};
|
||||||
|
Q_ENUM_NS(Enum1)
|
||||||
|
|
||||||
|
namespace FooNestedNamespace {
|
||||||
|
Q_NAMESPACE
|
||||||
|
enum class Enum2 {
|
||||||
|
Key3,
|
||||||
|
Key4
|
||||||
|
};
|
||||||
|
Q_ENUM_NS(Enum2)
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace FooNamespace;
|
||||||
|
namespace Bar = FooNamespace;
|
||||||
|
|
||||||
|
// Moc should merge this namespace with the previous one
|
||||||
|
namespace FooNestedNamespace {
|
||||||
|
Q_NAMESPACE
|
||||||
|
enum class Enum3 {
|
||||||
|
Key5,
|
||||||
|
Key6
|
||||||
|
};
|
||||||
|
Q_ENUM_NS(Enum3)
|
||||||
|
|
||||||
|
namespace FooMoreNestedNamespace {
|
||||||
|
Q_NAMESPACE
|
||||||
|
enum class Enum4 {
|
||||||
|
Key7,
|
||||||
|
Key8
|
||||||
|
};
|
||||||
|
Q_ENUM_NS(Enum4)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // NAMESPACE_H
|
||||||
|
74
tests/auto/tools/moc/namespace_no_merge.h
Normal file
74
tests/auto/tools/moc/namespace_no_merge.h
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 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$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef NAMESPACE_NO_MERGE_H
|
||||||
|
#define NAMESPACE_NO_MERGE_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
namespace FooNamespace {
|
||||||
|
Q_NAMESPACE
|
||||||
|
enum class MEnum1 {
|
||||||
|
Key1,
|
||||||
|
Key2
|
||||||
|
};
|
||||||
|
Q_ENUM_NS(MEnum1)
|
||||||
|
|
||||||
|
namespace FooNestedNamespace {
|
||||||
|
Q_NAMESPACE
|
||||||
|
enum class MEnum2 {
|
||||||
|
Key3,
|
||||||
|
Key4
|
||||||
|
};
|
||||||
|
Q_ENUM_NS(MEnum2)
|
||||||
|
}
|
||||||
|
|
||||||
|
using namespace FooNamespace;
|
||||||
|
namespace Bar = FooNamespace;
|
||||||
|
|
||||||
|
// Moc should merge this namespace with the previous one
|
||||||
|
namespace FooNestedNamespace {
|
||||||
|
Q_NAMESPACE
|
||||||
|
enum class MEnum3 {
|
||||||
|
Key5,
|
||||||
|
Key6
|
||||||
|
};
|
||||||
|
Q_ENUM_NS(MEnum3)
|
||||||
|
|
||||||
|
namespace FooMoreNestedNamespace {
|
||||||
|
Q_NAMESPACE
|
||||||
|
enum class MEnum4 {
|
||||||
|
Key7,
|
||||||
|
Key8
|
||||||
|
};
|
||||||
|
Q_ENUM_NS(MEnum4)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // NAMESPACE_NO_MERGE_H
|
@ -3777,6 +3777,10 @@ void tst_Moc::testQNamespace()
|
|||||||
QCOMPARE(meta.name(), "TestEnum1");
|
QCOMPARE(meta.name(), "TestEnum1");
|
||||||
QCOMPARE(meta.enclosingMetaObject(), &TestQNamespace::staticMetaObject);
|
QCOMPARE(meta.enclosingMetaObject(), &TestQNamespace::staticMetaObject);
|
||||||
QCOMPARE(meta.keyCount(), 2);
|
QCOMPARE(meta.keyCount(), 2);
|
||||||
|
|
||||||
|
QCOMPARE(FooNamespace::staticMetaObject.enumeratorCount(), 1);
|
||||||
|
QCOMPARE(FooNamespace::FooNestedNamespace::staticMetaObject.enumeratorCount(), 2);
|
||||||
|
QCOMPARE(FooNamespace::FooNestedNamespace::FooMoreNestedNamespace::staticMetaObject.enumeratorCount(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
QTEST_MAIN(tst_Moc)
|
QTEST_MAIN(tst_Moc)
|
||||||
|
@ -5050,9 +5050,10 @@ void tst_QGraphicsItem::sceneEventFilter()
|
|||||||
delete ti;
|
delete ti;
|
||||||
}
|
}
|
||||||
|
|
||||||
class GeometryChanger : public QGraphicsItem
|
class GeometryChanger : public QGraphicsRectItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
explicit GeometryChanger(QRectF r) : QGraphicsRectItem(r) {}
|
||||||
void changeGeometry()
|
void changeGeometry()
|
||||||
{ prepareGeometryChange(); }
|
{ prepareGeometryChange(); }
|
||||||
};
|
};
|
||||||
@ -5061,10 +5062,12 @@ void tst_QGraphicsItem::prepareGeometryChange()
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
QGraphicsScene scene;
|
QGraphicsScene scene;
|
||||||
QGraphicsItem *item = scene.addRect(QRectF(0, 0, 100, 100));
|
const QRectF rect(0, 0, 100, 100);
|
||||||
QVERIFY(scene.items(QRectF(0, 0, 100, 100)).contains(item));
|
GeometryChanger item(rect);
|
||||||
((GeometryChanger *)item)->changeGeometry();
|
scene.addItem(&item);
|
||||||
QVERIFY(scene.items(QRectF(0, 0, 100, 100)).contains(item));
|
QVERIFY(scene.items(rect).contains(&item));
|
||||||
|
item.changeGeometry();
|
||||||
|
QVERIFY(scene.items(rect).contains(&item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1715,25 +1715,6 @@ void tst_QApplication::focusOut()
|
|||||||
QTest::qWait(2000);
|
QTest::qWait(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
class SpontaneousEvent
|
|
||||||
{
|
|
||||||
Q_GADGET
|
|
||||||
QDOC_PROPERTY(bool accepted READ isAccepted WRITE setAccepted)
|
|
||||||
Q_ENUMS(Type)
|
|
||||||
public:
|
|
||||||
enum Type {
|
|
||||||
Void
|
|
||||||
};
|
|
||||||
|
|
||||||
virtual ~SpontaneousEvent() {}
|
|
||||||
|
|
||||||
QEventPrivate *d;
|
|
||||||
ushort t;
|
|
||||||
|
|
||||||
ushort posted : 1;
|
|
||||||
ushort spont : 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
void tst_QApplication::focusMouseClick()
|
void tst_QApplication::focusMouseClick()
|
||||||
{
|
{
|
||||||
int argc = 1;
|
int argc = 1;
|
||||||
@ -1751,14 +1732,14 @@ void tst_QApplication::focusMouseClick()
|
|||||||
// now send a mouse button press event and check what happens with the focus
|
// now send a mouse button press event and check what happens with the focus
|
||||||
// it should be given to the parent widget
|
// it should be given to the parent widget
|
||||||
QMouseEvent ev(QEvent::MouseButtonPress, QPointF(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
QMouseEvent ev(QEvent::MouseButtonPress, QPointF(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
|
||||||
reinterpret_cast<SpontaneousEvent *>(&ev)->spont = 1;
|
QSpontaneKeyEvent::setSpontaneous(&ev);
|
||||||
QVERIFY(ev.spontaneous());
|
QVERIFY(ev.spontaneous());
|
||||||
qApp->notify(&w2, &ev);
|
qApp->notify(&w2, &ev);
|
||||||
QCOMPARE(QApplication::focusWidget(), &w);
|
QCOMPARE(QApplication::focusWidget(), &w);
|
||||||
|
|
||||||
// then we give the inner widget strong focus -> it should get focus
|
// then we give the inner widget strong focus -> it should get focus
|
||||||
w2.setFocusPolicy(Qt::StrongFocus);
|
w2.setFocusPolicy(Qt::StrongFocus);
|
||||||
reinterpret_cast<SpontaneousEvent *>(&ev)->spont = 1;
|
QSpontaneKeyEvent::setSpontaneous(&ev);
|
||||||
QVERIFY(ev.spontaneous());
|
QVERIFY(ev.spontaneous());
|
||||||
qApp->notify(&w2, &ev);
|
qApp->notify(&w2, &ev);
|
||||||
QTRY_COMPARE(QApplication::focusWidget(), &w2);
|
QTRY_COMPARE(QApplication::focusWidget(), &w2);
|
||||||
@ -1766,7 +1747,7 @@ void tst_QApplication::focusMouseClick()
|
|||||||
// now back to tab focus and click again (it already had focus) -> focus should stay
|
// now back to tab focus and click again (it already had focus) -> focus should stay
|
||||||
// (focus was revoked as of QTBUG-34042)
|
// (focus was revoked as of QTBUG-34042)
|
||||||
w2.setFocusPolicy(Qt::TabFocus);
|
w2.setFocusPolicy(Qt::TabFocus);
|
||||||
reinterpret_cast<SpontaneousEvent *>(&ev)->spont = 1;
|
QSpontaneKeyEvent::setSpontaneous(&ev);
|
||||||
QVERIFY(ev.spontaneous());
|
QVERIFY(ev.spontaneous());
|
||||||
qApp->notify(&w2, &ev);
|
qApp->notify(&w2, &ev);
|
||||||
QCOMPARE(QApplication::focusWidget(), &w2);
|
QCOMPARE(QApplication::focusWidget(), &w2);
|
||||||
|
@ -183,7 +183,7 @@ void tst_QBoxLayout::sizeConstraints()
|
|||||||
window.show();
|
window.show();
|
||||||
QTest::qWaitForWindowExposed(&window);
|
QTest::qWaitForWindowExposed(&window);
|
||||||
QSize sh = window.sizeHint();
|
QSize sh = window.sizeHint();
|
||||||
lay->takeAt(1);
|
delete lay->takeAt(1);
|
||||||
QVERIFY(sh.width() >= window.sizeHint().width() &&
|
QVERIFY(sh.width() >= window.sizeHint().width() &&
|
||||||
sh.height() >= window.sizeHint().height());
|
sh.height() >= window.sizeHint().height());
|
||||||
|
|
||||||
@ -512,7 +512,7 @@ void tst_QBoxLayout::replaceWidget()
|
|||||||
|
|
||||||
QCOMPARE(boxLayout->indexOf(replaceFrom), 1);
|
QCOMPARE(boxLayout->indexOf(replaceFrom), 1);
|
||||||
QCOMPARE(boxLayout->indexOf(replaceTo), -1);
|
QCOMPARE(boxLayout->indexOf(replaceTo), -1);
|
||||||
boxLayout->replaceWidget(replaceFrom, replaceTo);
|
delete boxLayout->replaceWidget(replaceFrom, replaceTo);
|
||||||
|
|
||||||
QCOMPARE(boxLayout->indexOf(replaceFrom), -1);
|
QCOMPARE(boxLayout->indexOf(replaceFrom), -1);
|
||||||
QCOMPARE(boxLayout->indexOf(replaceTo), 1);
|
QCOMPARE(boxLayout->indexOf(replaceTo), 1);
|
||||||
|
@ -341,6 +341,8 @@ void tst_QGridLayout::setMinAndMaxSize()
|
|||||||
|
|
||||||
|
|
||||||
layout.removeItem(spacer);
|
layout.removeItem(spacer);
|
||||||
|
delete spacer;
|
||||||
|
spacer = Q_NULLPTR;
|
||||||
|
|
||||||
rightChild.hide();
|
rightChild.hide();
|
||||||
QApplication::sendPostedEvents(0, 0);
|
QApplication::sendPostedEvents(0, 0);
|
||||||
@ -1577,10 +1579,10 @@ void tst_QGridLayout::contentsRect()
|
|||||||
void tst_QGridLayout::distributeMultiCell()
|
void tst_QGridLayout::distributeMultiCell()
|
||||||
{
|
{
|
||||||
QWidget w;
|
QWidget w;
|
||||||
Qt42Style *style = new Qt42Style();
|
Qt42Style style;
|
||||||
style->spacing = 9;
|
style.spacing = 9;
|
||||||
|
|
||||||
w.setStyle(style);
|
w.setStyle(&style);
|
||||||
QGridLayout grid;
|
QGridLayout grid;
|
||||||
w.setLayout(&grid);
|
w.setLayout(&grid);
|
||||||
|
|
||||||
|
@ -4997,7 +4997,8 @@ void tst_QWidget::moveChild()
|
|||||||
|
|
||||||
ColorWidget parent(0, Qt::Window | Qt::WindowStaysOnTopHint);
|
ColorWidget parent(0, Qt::Window | Qt::WindowStaysOnTopHint);
|
||||||
// prevent custom styles
|
// prevent custom styles
|
||||||
parent.setStyle(QStyleFactory::create(QLatin1String("Windows")));
|
const QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("Windows")));
|
||||||
|
parent.setStyle(style.data());
|
||||||
ColorWidget child(&parent, Qt::Widget, Qt::blue);
|
ColorWidget child(&parent, Qt::Widget, Qt::blue);
|
||||||
|
|
||||||
parent.setGeometry(QRect(QPoint(QApplication::desktop()->availableGeometry(&parent).topLeft()) + QPoint(50, 50),
|
parent.setGeometry(QRect(QPoint(QApplication::desktop()->availableGeometry(&parent).topLeft()) + QPoint(50, 50),
|
||||||
@ -5042,7 +5043,8 @@ void tst_QWidget::showAndMoveChild()
|
|||||||
QSKIP("Wayland: This fails. Figure out why.");
|
QSKIP("Wayland: This fails. Figure out why.");
|
||||||
QWidget parent(0, Qt::Window | Qt::WindowStaysOnTopHint);
|
QWidget parent(0, Qt::Window | Qt::WindowStaysOnTopHint);
|
||||||
// prevent custom styles
|
// prevent custom styles
|
||||||
parent.setStyle(QStyleFactory::create(QLatin1String("Windows")));
|
const QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("Windows")));
|
||||||
|
parent.setStyle(style.data());
|
||||||
|
|
||||||
QDesktopWidget desktop;
|
QDesktopWidget desktop;
|
||||||
QRect desktopDimensions = desktop.availableGeometry(&parent);
|
QRect desktopDimensions = desktop.availableGeometry(&parent);
|
||||||
@ -6542,7 +6544,9 @@ void tst_QWidget::renderWithPainter()
|
|||||||
{
|
{
|
||||||
QWidget widget(0, Qt::Tool);
|
QWidget widget(0, Qt::Tool);
|
||||||
// prevent custom styles
|
// prevent custom styles
|
||||||
widget.setStyle(QStyleFactory::create(QLatin1String("Windows")));
|
|
||||||
|
const QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("Windows")));
|
||||||
|
widget.setStyle(style.data());
|
||||||
widget.show();
|
widget.show();
|
||||||
widget.resize(70, 50);
|
widget.resize(70, 50);
|
||||||
widget.setAutoFillBackground(true);
|
widget.setAutoFillBackground(true);
|
||||||
|
@ -221,6 +221,7 @@ private slots:
|
|||||||
void timeSpec_data();
|
void timeSpec_data();
|
||||||
void timeSpec();
|
void timeSpec();
|
||||||
void timeSpecBug();
|
void timeSpecBug();
|
||||||
|
void timeSpecInit();
|
||||||
|
|
||||||
void monthEdgeCase();
|
void monthEdgeCase();
|
||||||
void setLocale();
|
void setLocale();
|
||||||
@ -3176,6 +3177,13 @@ void tst_QDateTimeEdit::timeSpecBug()
|
|||||||
QCOMPARE(oldText, testWidget->text());
|
QCOMPARE(oldText, testWidget->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_QDateTimeEdit::timeSpecInit()
|
||||||
|
{
|
||||||
|
QDateTime utc(QDate(2000, 1, 1), QTime(12, 0, 0), Qt::UTC);
|
||||||
|
QDateTimeEdit widget(utc);
|
||||||
|
QCOMPARE(widget.dateTime(), utc);
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QDateTimeEdit::cachedDayTest()
|
void tst_QDateTimeEdit::cachedDayTest()
|
||||||
{
|
{
|
||||||
testWidget->setDisplayFormat("MM/dd");
|
testWidget->setDisplayFormat("MM/dd");
|
||||||
|
@ -357,10 +357,11 @@ void tst_QMdiSubWindow::mainWindowSupport()
|
|||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
mainWindow.menuBar()->setVisible(true);
|
mainWindow.menuBar()->setVisible(true);
|
||||||
qApp->setActiveWindow(&mainWindow);
|
qApp->setActiveWindow(&mainWindow);
|
||||||
|
bool nativeMenuBar = mainWindow.menuBar()->isNativeMenuBar();
|
||||||
|
|
||||||
// QMainWindow's window title is empty
|
// QMainWindow's window title is empty, so on a platform which does NOT have a native menubar,
|
||||||
#if !defined(Q_OS_DARWIN)
|
// the maximized subwindow's title is imposed onto the main window's titlebar.
|
||||||
{
|
if (!nativeMenuBar) {
|
||||||
QCOMPARE(mainWindow.windowTitle(), QString());
|
QCOMPARE(mainWindow.windowTitle(), QString());
|
||||||
QMdiSubWindow *window = workspace->addSubWindow(new QPushButton(QLatin1String("Test")));
|
QMdiSubWindow *window = workspace->addSubWindow(new QPushButton(QLatin1String("Test")));
|
||||||
QString expectedTitle = QLatin1String("MainWindow's title is empty");
|
QString expectedTitle = QLatin1String("MainWindow's title is empty");
|
||||||
@ -375,7 +376,6 @@ void tst_QMdiSubWindow::mainWindowSupport()
|
|||||||
QCOMPARE(mainWindow.windowTitle(), QString());
|
QCOMPARE(mainWindow.windowTitle(), QString());
|
||||||
window->close();
|
window->close();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
QString originalWindowTitle = QString::fromLatin1("MainWindow");
|
QString originalWindowTitle = QString::fromLatin1("MainWindow");
|
||||||
mainWindow.setWindowTitle(originalWindowTitle);
|
mainWindow.setWindowTitle(originalWindowTitle);
|
||||||
@ -411,16 +411,16 @@ void tst_QMdiSubWindow::mainWindowSupport()
|
|||||||
window->showMaximized();
|
window->showMaximized();
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
QVERIFY(window->isMaximized());
|
QVERIFY(window->isMaximized());
|
||||||
#if !defined(Q_OS_DARWIN)
|
if (!nativeMenuBar) {
|
||||||
QVERIFY(window->maximizedButtonsWidget());
|
QVERIFY(window->maximizedButtonsWidget());
|
||||||
QCOMPARE(window->maximizedButtonsWidget(), mainWindow.menuBar()->cornerWidget(Qt::TopRightCorner));
|
QCOMPARE(window->maximizedButtonsWidget(), mainWindow.menuBar()->cornerWidget(Qt::TopRightCorner));
|
||||||
QVERIFY(window->maximizedSystemMenuIconWidget());
|
QVERIFY(window->maximizedSystemMenuIconWidget());
|
||||||
QCOMPARE(window->maximizedSystemMenuIconWidget(), qobject_cast<QWidget *>(mainWindow.menuBar()
|
QCOMPARE(window->maximizedSystemMenuIconWidget(),
|
||||||
->cornerWidget(Qt::TopLeftCorner)));
|
qobject_cast<QWidget *>(mainWindow.menuBar()->cornerWidget(Qt::TopLeftCorner)));
|
||||||
const QString expectedTitle = originalWindowTitle + QLatin1String(" - [")
|
const QString expectedTitle = originalWindowTitle + QLatin1String(" - [")
|
||||||
+ window->widget()->windowTitle() + QLatin1Char(']');
|
+ window->widget()->windowTitle() + QLatin1Char(']');
|
||||||
QCOMPARE(mainWindow.windowTitle(), expectedTitle);
|
QCOMPARE(mainWindow.windowTitle(), expectedTitle);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Check that nested child windows don't set window title
|
// Check that nested child windows don't set window title
|
||||||
nestedWorkspace->show();
|
nestedWorkspace->show();
|
||||||
@ -434,15 +434,14 @@ void tst_QMdiSubWindow::mainWindowSupport()
|
|||||||
QVERIFY(!nestedWindow->maximizedButtonsWidget());
|
QVERIFY(!nestedWindow->maximizedButtonsWidget());
|
||||||
QVERIFY(!nestedWindow->maximizedSystemMenuIconWidget());
|
QVERIFY(!nestedWindow->maximizedSystemMenuIconWidget());
|
||||||
|
|
||||||
#if !defined(Q_OS_DARWIN) && !defined(Q_OS_QNX)
|
if (!nativeMenuBar) {
|
||||||
QCOMPARE(mainWindow.windowTitle(), QString::fromLatin1("%1 - [%2]")
|
QCOMPARE(mainWindow.windowTitle(), QString::fromLatin1("%1 - [%2]")
|
||||||
.arg(originalWindowTitle, window->widget()->windowTitle()));
|
.arg(originalWindowTitle, window->widget()->windowTitle()));
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_DARWIN)
|
if (nativeMenuBar)
|
||||||
return;
|
return;
|
||||||
#endif
|
|
||||||
|
|
||||||
workspace->activateNextSubWindow();
|
workspace->activateNextSubWindow();
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
@ -1905,14 +1904,14 @@ void tst_QMdiSubWindow::mdiArea()
|
|||||||
|
|
||||||
void tst_QMdiSubWindow::task_182852()
|
void tst_QMdiSubWindow::task_182852()
|
||||||
{
|
{
|
||||||
#if !defined(Q_OS_DARWIN)
|
|
||||||
|
|
||||||
QMdiArea *workspace = new QMdiArea;
|
QMdiArea *workspace = new QMdiArea;
|
||||||
QMainWindow mainWindow;
|
QMainWindow mainWindow;
|
||||||
mainWindow.setCentralWidget(workspace);
|
mainWindow.setCentralWidget(workspace);
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
mainWindow.menuBar()->setVisible(true);
|
mainWindow.menuBar()->setVisible(true);
|
||||||
qApp->setActiveWindow(&mainWindow);
|
qApp->setActiveWindow(&mainWindow);
|
||||||
|
if (mainWindow.menuBar()->isNativeMenuBar())
|
||||||
|
return; // The main window's title is not overwritten if we have a native menubar (macOS, Unity etc.)
|
||||||
|
|
||||||
QString originalWindowTitle = QString::fromLatin1("MainWindow - [foo]");
|
QString originalWindowTitle = QString::fromLatin1("MainWindow - [foo]");
|
||||||
mainWindow.setWindowTitle(originalWindowTitle);
|
mainWindow.setWindowTitle(originalWindowTitle);
|
||||||
@ -1948,9 +1947,6 @@ void tst_QMdiSubWindow::task_182852()
|
|||||||
|
|
||||||
QCOMPARE(mainWindow.windowTitle(), QString::fromLatin1("%1 - [%2]")
|
QCOMPARE(mainWindow.windowTitle(), QString::fromLatin1("%1 - [%2]")
|
||||||
.arg(originalWindowTitle, window->widget()->windowTitle()));
|
.arg(originalWindowTitle, window->widget()->windowTitle()));
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QMdiSubWindow::task_233197()
|
void tst_QMdiSubWindow::task_233197()
|
||||||
|
@ -93,7 +93,6 @@ private slots:
|
|||||||
#if !defined(Q_OS_DARWIN)
|
#if !defined(Q_OS_DARWIN)
|
||||||
void accel();
|
void accel();
|
||||||
void activatedCount();
|
void activatedCount();
|
||||||
void allowActiveAndDisabled();
|
|
||||||
|
|
||||||
void check_accelKeys();
|
void check_accelKeys();
|
||||||
void check_cursorKeys1();
|
void check_cursorKeys1();
|
||||||
@ -102,6 +101,9 @@ private slots:
|
|||||||
|
|
||||||
void check_escKey();
|
void check_escKey();
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef Q_OS_WINCE
|
||||||
|
void allowActiveAndDisabled();
|
||||||
|
#endif
|
||||||
|
|
||||||
void check_endKey();
|
void check_endKey();
|
||||||
void check_homeKey();
|
void check_homeKey();
|
||||||
@ -918,10 +920,10 @@ void tst_QMenuBar::check_escKey()
|
|||||||
// QCOMPARE(m_complexActionTriggerCount['h'], (uint)itemH_count);
|
// QCOMPARE(m_complexActionTriggerCount['h'], (uint)itemH_count);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
#if !defined(Q_OS_DARWIN)
|
|
||||||
void tst_QMenuBar::allowActiveAndDisabled()
|
void tst_QMenuBar::allowActiveAndDisabled()
|
||||||
{
|
{
|
||||||
QMenuBar menuBar;
|
QMenuBar menuBar;
|
||||||
|
menuBar.setNativeMenuBar(false);
|
||||||
|
|
||||||
// Task 241043 : check that second menu is activated if only
|
// Task 241043 : check that second menu is activated if only
|
||||||
// disabled menu items are added
|
// disabled menu items are added
|
||||||
@ -957,7 +959,6 @@ void tst_QMenuBar::allowActiveAndDisabled()
|
|||||||
else
|
else
|
||||||
QCOMPARE(menuBar.activeAction()->text(), fileMenu.title());
|
QCOMPARE(menuBar.activeAction()->text(), fileMenu.title());
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void tst_QMenuBar::check_altPress()
|
void tst_QMenuBar::check_altPress()
|
||||||
{
|
{
|
||||||
|
@ -1718,14 +1718,14 @@ void tst_QDom::germanUmlautToFile() const
|
|||||||
|
|
||||||
QDomDocument d("test");
|
QDomDocument d("test");
|
||||||
d.appendChild(d.createElement(name));
|
d.appendChild(d.createElement(name));
|
||||||
QFile file("germanUmlautToFile.xml");
|
QTemporaryFile file;
|
||||||
QVERIFY(file.open(QIODevice::WriteOnly));
|
QVERIFY(file.open());
|
||||||
QTextStream ts(&file);
|
QTextStream ts(&file);
|
||||||
ts.setCodec("UTF-8");
|
ts.setCodec("UTF-8");
|
||||||
ts << d.toString();
|
ts << d.toString();
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
QFile inFile("germanUmlautToFile.xml");
|
QFile inFile(file.fileName());
|
||||||
QVERIFY(inFile.open(QIODevice::ReadOnly));
|
QVERIFY(inFile.open(QIODevice::ReadOnly));
|
||||||
|
|
||||||
QString baseline(QLatin1String("<!DOCTYPE test>\n<german"));
|
QString baseline(QLatin1String("<!DOCTYPE test>\n<german"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user