Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into wip/qt6
Browse files Browse the repository at this point in the history
Change-Id: I54741635460bb2d8f3fd0be535ee1968d6c442bb
  • Loading branch information
alcroito committed Sep 4, 2019
2 parents 7e8705f + bf8fcab commit f255b1e
Show file tree
Hide file tree
Showing 768 changed files with 130,250 additions and 82,421 deletions.
1 change: 0 additions & 1 deletion .qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ load(qt_build_config)
CONFIG += warning_clean

DEFINES += QT_NO_JAVA_STYLE_ITERATORS
DEFINES += QT_NO_LINKED_LIST

QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)
Expand Down
18 changes: 9 additions & 9 deletions bin/syncqt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ sub normalizePath {
our $build_basedir;
our $basedir;

# Make sure we use Windows line endings for chomp and friends on Windows.
$INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys");

# will be defined based on the modules sync.profile
our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %deprecatedheaders);
our (@qpa_headers, @private_headers);
Expand Down Expand Up @@ -182,10 +179,10 @@ sub shouldMasterInclude {
my ($iheader) = @_;
return 0 if (basename($iheader) =~ /_/);
return 0 if (basename($iheader) =~ /qconfig/);
local $/ = "\x0a";
if (open(F, "<$iheader")) {
while (<F>) {
chomp;
chop if /\r$/;
s/\x0d?\x0a//;
return 0 if (/^\#pragma qt_no_master_include$/);
}
close(F);
Expand Down Expand Up @@ -215,11 +212,11 @@ sub classNames {
my $ihdrbase = basename($iheader);

my $parsable = "";
local $/ = "\x0a";
if(open(F, "<$iheader")) {
while(<F>) {
s/\x0d?\x0a//;
my $line = $_;
chomp $line;
chop $line if ($line =~ /\r$/);
if($line =~ /^\#/) {
$$clean = 0 if ($line =~ m/^#pragma qt_sync_skip_header_check/);
return @ret if($line =~ m/^#pragma qt_sync_stop_processing/);
Expand All @@ -231,6 +228,7 @@ sub classNames {
$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)_NAMESPACE(_[A-Z]+)*[\r\n]*$/); #qt macro
$line .= ";" if($line =~ m/^QT_DEPRECATED_X\(.*\)[\r\n]*$/); #qt macro
$line .= ";" if($line =~ m/^QT_MODULE\(.*\)[\r\n]*$/); # QT_MODULE macro
$line .= ";" if($line =~ m/^QT_WARNING_(PUSH|POP|DISABLE_\w+\(.*\))[\r\n]*$/); # qt macros
$$requires = $1 if ($line =~ m/^QT_REQUIRE_CONFIG\((.*)\);[\r\n]*$/);
Expand Down Expand Up @@ -336,6 +334,7 @@ sub check_header {
$header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header});
}

local $/ = "\x0a";
open(F, "<$iheader") or return;
my $qt_begin_namespace_found = 0;
my $qt_end_namespace_found = 0;
Expand All @@ -344,7 +343,7 @@ sub check_header {
my $stop_processing = 0;
my $we_mean_it = 0;
while ($line = <F>) {
chomp $line;
$line =~ s/\x0d?\x0a//;
my $output_line = 1;
if ($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) {
$stop_processing = 1;
Expand Down Expand Up @@ -965,9 +964,10 @@ ($$)
#push @files, "$out_basedir/include/Qt/$t" if(-e "$out_basedir/include/Qt/$t");
foreach my $file (@files) {
my $remove_file = 0;
local $/ = "\x0a";
if(open(F, "<$file")) {
while(my $line = <F>) {
chomp $line;
$line =~ s/\x0d?\x0a//;
if($line =~ /^\#include \"([^\"]*)\"$/) {
my $include = $1;
$include = $subdir . "/" . $include unless(substr($include, 0, 1) eq "/");
Expand Down
1 change: 1 addition & 0 deletions config.tests/arch/arch.pro
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
SOURCES = arch.cpp
include(write_info.pri)
1 change: 1 addition & 0 deletions config.tests/arch/arch_host.pro
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
option(host_build)
SOURCES = arch.cpp
include(write_info.pri)
14 changes: 14 additions & 0 deletions config.tests/arch/write_info.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
targetinfofile = $$basename(_PRO_FILE_)
targetinfofile ~= s/pro$/target.txt/

win32 {
ext = .exe
} else:wasm {
equals(WASM_OBJECT_FILES, 1): \
ext = .o
else: \
ext = .wasm
}

content = $${file_prefix}$${TARGET}$${ext}
write_file($$OUT_PWD/$$targetinfofile, content)
10 changes: 4 additions & 6 deletions config_help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,8 @@ Build environment:
-android-ndk-platform Set Android platform
-android-ndk-host .... Set Android NDK host (linux-x86, linux-x86_64, etc.)
[$ANDROID_NDK_HOST]
-android-arch ........ Set Android architecture (armeabi, armeabi-v7a,
arm64-v8a, x86, x86_64)
-android-toolchain-version ... Set Android toolchain version
-android-abis ....... Comma separated Android abis, default is:
armeabi-v7a,arm64-v8a,x86,x86_64
-android-style-assets Automatically extract style assets from the device at
run time. This option makes the Android style behave
correctly, but also makes the Android platform plugin
Expand Down Expand Up @@ -297,8 +296,7 @@ Gui, printing, widget options:
-gbm ............... Enable backends for GBM [auto] (Linux only)
-kms ............... Enable backends for KMS [auto] (Linux only)
-linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
-xcb ............... Enable X11 support. Select used xcb-* libraries [system/qt/no]
(-qt-xcb still uses system version of libxcb itself)
-xcb ............... Enable X11 support [auto] (Linux only)

Input backends:
-libudev............ Enable udev support [auto]
Expand All @@ -307,7 +305,7 @@ Gui, printing, widget options:
-libinput .......... Enable libinput support [auto]
-mtdev ............. Enable mtdev support [auto]
-tslib ............. Enable tslib support [auto]
-xcb-xinput ........ Enable XInput2 support [auto]
-bundled-xcb-xinput Use bundled XInput2 support [auto]
-xkbcommon ......... Enable key mapping support [auto]

Image formats:
Expand Down
2 changes: 1 addition & 1 deletion configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
"translationdir": "string",

"android-arch": "string",
"android-abis": "string",
"android-ndk": "string",
"android-ndk-host": "string",
"android-ndk-platform": "string",
"android-sdk": "string",
"android-toolchain-version": "string",

"android-style-assets": "boolean",
"appstore-compliant": "boolean",
Expand Down
53 changes: 11 additions & 42 deletions configure.pri
Original file line number Diff line number Diff line change
Expand Up @@ -286,37 +286,13 @@ defineTest(qtConfTest_architecture) {
!qtConfTest_compile($${1}): \
error("Could not determine $$eval($${1}.label). See config.log for details.")

host = $$eval($${1}.host)
isEmpty(host): host = false
file_prefix =
exts = -
$$host {
equals(QMAKE_HOST.os, Windows): \
exts = .exe
} else {
win32 {
exts = .exe
} else:android {
file_prefix = lib
exts = .so
} else:wasm {
exts = .wasm .o
}
}

test = $$eval($${1}.test)
output = $$eval($${1}.output)
test_out_dir = $$OUT_PWD/$$basename(QMAKE_CONFIG_TESTS_DIR)/$$test
test_out_file =
for(ext, exts) {
equals(ext, -): ext =
f = $$test_out_dir/$$file_prefix$$output$$ext
exists($$f) {
test_out_file = $$f
break()
}
}
isEmpty(test_out_file): \
test_out_file = $$test_out_dir/$$cat($$test_out_dir/$${output}.target.txt)
exists($$test_out_file): \
content = $$cat($$test_out_file, blob)
else: \
error("$$eval($${1}.label) detection binary not found.")
content = $$cat($$test_out_file, blob)

Expand Down Expand Up @@ -597,14 +573,7 @@ defineTest(qtConfOutput_prepareOptions) {
qtConfFatalError("Cannot find Android NDK." \
"Please use -android-ndk option to specify one.")

ndk_tc_ver = $$eval(config.input.android-toolchain-version)
isEmpty(ndk_tc_ver): \
ndk_tc_ver = 4.9
!exists($$ndk_root/toolchains/arm-linux-androideabi-$$ndk_tc_ver/prebuilt/*): \
qtConfFatalError("Cannot detect Android NDK toolchain." \
"Please use -android-toolchain-version to specify it.")

ndk_tc_pfx = $$ndk_root/toolchains/arm-linux-androideabi-$$ndk_tc_ver/prebuilt
ndk_tc_pfx = $$ndk_root/toolchains/llvm/prebuilt
ndk_host = $$eval(config.input.android-ndk-host)
isEmpty(ndk_host): \
ndk_host = $$getenv(ANDROID_NDK_HOST)
Expand Down Expand Up @@ -642,10 +611,11 @@ defineTest(qtConfOutput_prepareOptions) {
qtConfFatalError("Specified Android NDK host is invalid.")
}

target_arch = $$eval(config.input.android-arch)
isEmpty(target_arch): \
target_arch = armeabi-v7a

android_abis = $$eval(config.input.android-abis)
isEmpty(android_abis): \
android_abis = $$eval(config.input.android-arch)
isEmpty(android_abis): \
android_abis = armeabi-v7a,arm64-v8a,x86,x86_64
platform = $$eval(config.input.android-ndk-platform)
isEmpty(platform): \
platform = android-21
Expand All @@ -655,8 +625,7 @@ defineTest(qtConfOutput_prepareOptions) {
"DEFAULT_ANDROID_NDK_ROOT = $$val_escape(ndk_root)" \
"DEFAULT_ANDROID_PLATFORM = $$platform" \
"DEFAULT_ANDROID_NDK_HOST = $$ndk_host" \
"DEFAULT_ANDROID_TARGET_ARCH = $$target_arch" \
"DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION = $$ndk_tc_ver"
"DEFAULT_ANDROID_ABIS = $$split(android_abis, ',')"
}

export($${currentConfig}.output.devicePro)
Expand Down
Binary file removed doc/src/images/macmainwindow.png
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/corelib/threads/doc/src/mandelbrot.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@
\snippet threads/mandelbrot/mandelbrotwidget.cpp 12

The wheel event handler is reimplemented to make the mouse wheel
control the zoom level. QWheelEvent::delta() returns the angle of
the wheel mouse movement, in eights of a degree. For most mice,
control the zoom level. QWheelEvent::angleDelta() returns the angle
of the wheel mouse movement, in eighths of a degree. For most mice,
one wheel step corresponds to 15 degrees. We find out how many
mouse steps we have and determine the resulting zoom factor.
For example, if we have two wheel steps in the positive direction
Expand Down
2 changes: 1 addition & 1 deletion examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void MandelbrotWidget::keyPressEvent(QKeyEvent *event)
//! [12]
void MandelbrotWidget::wheelEvent(QWheelEvent *event)
{
int numDegrees = event->delta() / 8;
int numDegrees = event->angleDelta().y() / 8;
double numSteps = numDegrees / 15.0f;
zoom(pow(ZoomInFactor, numSteps));
}
Expand Down
7 changes: 3 additions & 4 deletions examples/widgets/animation/easing/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ Window::Window(QWidget *parent)
m_iconSize(64, 64)
{
m_ui.setupUi(this);
QButtonGroup *buttonGroup = findChild<QButtonGroup *>(); // ### workaround for uic in 4.4
m_ui.easingCurvePicker->setIconSize(m_iconSize);
m_ui.easingCurvePicker->setMinimumHeight(m_iconSize.height() + 50);
buttonGroup->setId(m_ui.lineRadio, 0);
buttonGroup->setId(m_ui.circleRadio, 1);
m_ui.buttonGroup->setId(m_ui.lineRadio, 0);
m_ui.buttonGroup->setId(m_ui.circleRadio, 1);

QEasingCurve dummy;
m_ui.periodSpinBox->setValue(dummy.period());
Expand All @@ -68,7 +67,7 @@ Window::Window(QWidget *parent)

connect(m_ui.easingCurvePicker, &QListWidget::currentRowChanged,
this, &Window::curveChanged);
connect(buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked),
connect(m_ui.buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked),
this, &Window::pathChanged);
connect(m_ui.periodSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &Window::periodChanged);
Expand Down
18 changes: 7 additions & 11 deletions examples/widgets/animation/stickman/animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,13 @@

#include "animation.h"

#include <QPointF>
#include <QVector>
#include <QIODevice>
#include <QDataStream>

class Frame
{
public:
Frame() {
}
Frame() = default;

int nodeCount() const
{
Expand All @@ -85,9 +82,8 @@ class Frame
QVector<QPointF> m_nodePositions;
};

Animation::Animation()
Animation::Animation() : m_currentFrame(0)
{
m_currentFrame = 0;
m_frames.append(new Frame);
}

Expand All @@ -103,6 +99,8 @@ void Animation::setTotalFrames(int totalFrames)

while (totalFrames < m_frames.size())
delete m_frames.takeLast();

setCurrentFrame(m_currentFrame);
}

int Animation::totalFrames() const
Expand All @@ -112,7 +110,7 @@ int Animation::totalFrames() const

void Animation::setCurrentFrame(int currentFrame)
{
m_currentFrame = qMax(qMin(currentFrame, totalFrames()-1), 0);
m_currentFrame = qBound(0, currentFrame, totalFrames() - 1);
}

int Animation::currentFrame() const
Expand Down Expand Up @@ -177,18 +175,16 @@ void Animation::load(QIODevice *device)
int frameCount;
stream >> frameCount;

for (int i=0; i<frameCount; ++i) {

for (int i = 0; i < frameCount; ++i) {
int nodeCount;
stream >> nodeCount;

Frame *frame = new Frame;
frame->setNodeCount(nodeCount);

for (int j=0; j<nodeCount; ++j) {
for (int j = 0; j < nodeCount; ++j) {
QPointF pos;
stream >> pos;

frame->setNodePos(j, pos);
}

Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/animation/stickman/animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
#define ANIMATION_H

#include <QPointF>
#include <QList>
#include <QString>
#include <QVector>

class Frame;
QT_BEGIN_NAMESPACE
Expand Down Expand Up @@ -85,7 +85,7 @@ class Animation

private:
QString m_name;
QList<Frame *> m_frames;
QVector<Frame *> m_frames;
int m_currentFrame;
};

Expand Down
12 changes: 4 additions & 8 deletions examples/widgets/animation/stickman/graphicsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,8 @@
#include "graphicsview.h"
#include "stickman.h"

#include <QtGui/QKeyEvent>
#include <QtWidgets/QGraphicsScene>
#include <QtWidgets/QGraphicsView>

GraphicsView::GraphicsView(QWidget *parent)
: QGraphicsView(parent), m_editor(nullptr)
{}
#include <QKeyEvent>
#include <QGraphicsScene>

void GraphicsView::keyPressEvent(QKeyEvent *e)
{
Expand All @@ -66,7 +61,8 @@ void GraphicsView::keyPressEvent(QKeyEvent *e)
emit keyPressed(Qt::Key(e->key()));
}

void GraphicsView::resizeEvent(QResizeEvent *)
void GraphicsView::resizeEvent(QResizeEvent *e)
{
fitInView(scene()->sceneRect());
QGraphicsView::resizeEvent(e);
}
Loading

0 comments on commit f255b1e

Please sign in to comment.