Skip to content

Commit

Permalink
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
Browse files Browse the repository at this point in the history
  • Loading branch information
tronical committed Jan 28, 2020
2 parents 1bd6074 + a4ea0d9 commit 4cbadf6
Show file tree
Hide file tree
Showing 119 changed files with 9,757 additions and 341 deletions.
7 changes: 4 additions & 3 deletions examples/widgets/animation/easing/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Window::Window(QWidget *parent)

connect(m_ui.easingCurvePicker, &QListWidget::currentRowChanged,
this, &Window::curveChanged);
connect(m_ui.buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked),
connect(m_ui.buttonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
this, &Window::pathChanged);
connect(m_ui.periodSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &Window::periodChanged);
Expand Down Expand Up @@ -180,9 +180,10 @@ void Window::curveChanged(int row)
m_ui.overshootSpinBox->setEnabled(curveType >= QEasingCurve::InBack && curveType <= QEasingCurve::OutInBack);
}

void Window::pathChanged(int index)
void Window::pathChanged(QAbstractButton *button)
{
m_anim->setPathType((Animation::PathType)index);
const int index = m_ui.buttonGroup->id(button);
m_anim->setPathType(Animation::PathType(index));
}

void Window::periodChanged(double value)
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/animation/easing/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Window : public QWidget {
Window(QWidget *parent = nullptr);
private slots:
void curveChanged(int row);
void pathChanged(int index);
void pathChanged(QAbstractButton *button);
void periodChanged(double);
void amplitudeChanged(double);
void overshootChanged(double);
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/graphicsview/chip/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ void View::setupMatrix()
{
qreal scale = qPow(qreal(2), (zoomSlider->value() - 250) / qreal(50));

QMatrix matrix;
QTransform matrix;
matrix.scale(scale, scale);
matrix.rotate(rotateSlider->value());

graphicsView->setMatrix(matrix);
graphicsView->setTransform(matrix);
setResetButtonEnabled();
}

Expand Down
17 changes: 9 additions & 8 deletions examples/widgets/graphicsview/diagramscene/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ void MainWindow::backgroundButtonGroupClicked(QAbstractButton *button)
//! [1]

//! [2]
void MainWindow::buttonGroupClicked(int id)
void MainWindow::buttonGroupClicked(QAbstractButton *button)
{
const QList<QAbstractButton *> buttons = buttonGroup->buttons();
for (QAbstractButton *button : buttons) {
if (buttonGroup->button(id) != button)
for (QAbstractButton *myButton : buttons) {
if (myButton != button)
button->setChecked(false);
}
const int id = buttonGroup->id(button);
if (id == InsertTextButton) {
scene->setMode(DiagramScene::InsertText);
} else {
Expand Down Expand Up @@ -154,7 +155,7 @@ void MainWindow::deleteItem()
//! [3]

//! [4]
void MainWindow::pointerGroupClicked(int)
void MainWindow::pointerGroupClicked()
{
scene->setMode(DiagramScene::Mode(pointerTypeGroup->checkedId()));
}
Expand Down Expand Up @@ -231,8 +232,8 @@ void MainWindow::fontSizeChanged(const QString &)
void MainWindow::sceneScaleChanged(const QString &scale)
{
double newScale = scale.left(scale.indexOf(tr("%"))).toDouble() / 100.0;
QMatrix oldMatrix = view->matrix();
view->resetMatrix();
QTransform oldMatrix = view->transform();
view->resetTransform();
view->translate(oldMatrix.dx(), oldMatrix.dy());
view->scale(newScale, newScale);
}
Expand Down Expand Up @@ -334,7 +335,7 @@ void MainWindow::createToolBox()
{
buttonGroup = new QButtonGroup(this);
buttonGroup->setExclusive(false);
connect(buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked),
connect(buttonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
this, &MainWindow::buttonGroupClicked);
QGridLayout *layout = new QGridLayout;
layout->addWidget(createCellWidget(tr("Conditional"), DiagramItem::Conditional), 0, 0);
Expand Down Expand Up @@ -528,7 +529,7 @@ void MainWindow::createToolbars()
pointerTypeGroup = new QButtonGroup(this);
pointerTypeGroup->addButton(pointerButton, int(DiagramScene::MoveItem));
pointerTypeGroup->addButton(linePointerButton, int(DiagramScene::InsertLine));
connect(pointerTypeGroup, QOverload<int>::of(&QButtonGroup::buttonClicked),
connect(pointerTypeGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
this, &MainWindow::pointerGroupClicked);

sceneScaleCombo = new QComboBox;
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/graphicsview/diagramscene/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class MainWindow : public QMainWindow

private slots:
void backgroundButtonGroupClicked(QAbstractButton *button);
void buttonGroupClicked(int id);
void buttonGroupClicked(QAbstractButton *button);
void deleteItem();
void pointerGroupClicked(int id);
void pointerGroupClicked();
void bringToFront();
void sendToBack();
void itemInserted(DiagramItem *item);
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/painting/affine/xform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void XFormView::setRotation(qreal r)
m_rotation = r;

QPointF center(pts->points().at(0));
QMatrix m;
QTransform m;
m.translate(center.x(), center.y());
m.rotate(m_rotation - old_rot);
m.translate(-center.x(), -center.y());
Expand All @@ -236,7 +236,7 @@ void XFormView::timerEvent(QTimerEvent *e)
{
if (e->timerId() == timer.timerId()) {
QPointF center(pts->points().at(0));
QMatrix m;
QTransform m;
m.translate(center.x(), center.y());
m.rotate(0.2);
m.translate(-center.x(), -center.y());
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/painting/deform/pathdeform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void PathDeformRenderer::setText(const QString &text)
}

for (int i=0; i<m_paths.size(); ++i)
m_paths[i] = m_paths[i] * QMatrix(1, 0, 0, 1, -m_pathBounds.x(), -m_pathBounds.y());
m_paths[i] = m_paths[i] * QTransform(1, 0, 0, 1, -m_pathBounds.x(), -m_pathBounds.y());

update();
}
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/painting/pathstroke/pathstroke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,10 @@ void PathStrokeRenderer::initializePoints()
m_points.clear();
m_vectors.clear();

QMatrix m;
QTransform m;
qreal rot = 360.0 / count;
QPointF center(width() / 2, height() / 2);
QMatrix vm;
QTransform vm;
vm.shear(2, -1);
vm.scale(3, 3);

Expand Down
41 changes: 13 additions & 28 deletions mkspecs/features/create_cmake.prf
Original file line number Diff line number Diff line change
Expand Up @@ -212,21 +212,17 @@ contains(CONFIG, plugin) {
CMAKE_PLUGIN_TYPE_ESCAPED = $$replace(PLUGIN_TYPE, [-/], _)

win32 {
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl
isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.dll
CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.dll
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl
} else:mingw {
CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.a
CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}d.a
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}d.prl
} else { # MSVC static
CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.lib
CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.lib
CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl
CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl
}
} else {
mac {
Expand Down Expand Up @@ -320,36 +316,25 @@ mac {
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.dll
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.dll

!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_STATIC_WINDOWS_BUILD = "true"

CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
}

mingw {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a

!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_STATIC_WINDOWS_BUILD = "true"
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a

CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.prl
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
} else {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
}
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}d.a
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
} else {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib

!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_STATIC_WINDOWS_BUILD = "true"
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib

CMAKE_PRL_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.prl
CMAKE_PRL_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.prl
} else {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
}
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}d.lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.lib
}
} else {
!isEmpty(CMAKE_STATIC_TYPE) {
Expand Down
2 changes: 2 additions & 0 deletions mkspecs/features/default_post.prf
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ debug {
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_DEBUG
QMAKE_LFLAGS += $$QMAKE_LFLAGS_DEBUG
QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_DEBUG
DEFINES += $$DEFINES_DEBUG
} else {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_RELEASE
QMAKE_LFLAGS += $$QMAKE_LFLAGS_RELEASE
QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_RELEASE
DEFINES += $$DEFINES_RELEASE
}

stack_protector_strong {
Expand Down
6 changes: 0 additions & 6 deletions mkspecs/features/default_pre.prf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,4 @@ CONFIG = \
unset(today)
}

CONFIG(debug, debug|release) {
DEFINES += $$DEFINES_DEBUG
} else {
DEFINES += $$DEFINES_RELEASE
}

load(toolchain)
4 changes: 3 additions & 1 deletion mkspecs/features/qt_common.prf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ qtConfig(c11): CONFIG += c11
qtConfig(stack-protector-strong): CONFIG += stack_protector_strong
contains(TEMPLATE, .*lib) {
# module and plugins
if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols
unix:qtConfig(reduce_relocations): CONFIG += bsymbolic_functions
qtConfig(separate_debug_info): CONFIG += separate_debug_info

Expand Down Expand Up @@ -58,6 +57,9 @@ contains(TEMPLATE, .*lib) {
QMAKE_PRL_INSTALL_REPLACE += qtlibdir_replace
}
}
contains(TEMPLATE, .*lib)|darwin {
if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols
}

# The remainder of this file must not apply to host tools/libraries,
# as the host compiler's version and capabilities are not checked.
Expand Down
1 change: 1 addition & 0 deletions mkspecs/wasm-emscripten/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ EMCC_COMMON_LFLAGS += \
-s USE_WEBGL2=1 \
-s NO_EXIT_RUNTIME=0 \
-s ERROR_ON_UNDEFINED_SYMBOLS=1 \
-s EXTRA_EXPORTED_RUNTIME_METHODS=[\"UTF16ToString\",\"stringToUTF16\"] \
--bind

# The -s arguments can also be used with release builds,
Expand Down
7 changes: 5 additions & 2 deletions qmake/doc/src/qmake-manual.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@
\section1 DEFINES_DEBUG

Specifies preprocessor defines for the debug configuration. The values of
this variable get added to \l{DEFINES} before the project is loaded. This
this variable get added to \l{DEFINES} after the project is loaded. This
variable is typically set in \l{#QMAKESPEC}{qmake.conf} and rarely needs
to be modified.

Expand All @@ -1178,10 +1178,13 @@
\section1 DEFINES_RELEASE

Specifies preprocessor defines for the release configuration. The values of
this variable get added to \l{DEFINES} before the project is loaded. This
this variable get added to \l{DEFINES} after the project is loaded. This
variable is typically set in \l{#QMAKESPEC}{qmake.conf} and rarely needs
to be modified.

\note For MSVC mkspecs, this variable contains the value \c NDEBUG by
default.

This variable was introduced in Qt 5.13.2.

\target DEF_FILE
Expand Down
21 changes: 19 additions & 2 deletions src/corelib/global/qlibraryinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,25 @@ static QString getRelocatablePrefix()
#if defined(QT_STATIC)
prefixPath = prefixFromAppDirHelper();
#elif defined(Q_OS_DARWIN) && QT_CONFIG(framework)
CFBundleRef qtCoreBundle = CFBundleGetBundleWithIdentifier(
CFSTR("org.qt-project.QtCore"));
auto qtCoreBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.qt-project.QtCore"));
if (!qtCoreBundle) {
// When running Qt apps over Samba shares, CoreFoundation will fail to find
// the Resources directory inside the bundle, This directory is a symlink,
// and CF relies on readdir() and dtent.dt_type to detect symlinks, which
// does not work reliably for Samba shares. We work around it by manually
// looking for the QtCore bundle.
auto allBundles = CFBundleGetAllBundles();
auto bundleCount = CFArrayGetCount(allBundles);
for (int i = 0; i < bundleCount; ++i) {
auto bundle = CFBundleRef(CFArrayGetValueAtIndex(allBundles, i));
auto url = QCFType<CFURLRef>(CFBundleCopyBundleURL(bundle));
auto path = QCFType<CFStringRef>(CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle));
if (CFStringHasSuffix(path, CFSTR("/QtCore.framework"))) {
qtCoreBundle = bundle;
break;
}
}
}
Q_ASSERT(qtCoreBundle);

QCFType<CFURLRef> qtCorePath = CFBundleCopyBundleURL(qtCoreBundle);
Expand Down
2 changes: 1 addition & 1 deletion src/corelib/global/qnamespace.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@

\value WA_MacNoClickThrough This value is obsolete and has no effect.

\value WA_MacOpaqueSizeGrip Indicates that the native Carbon size grip
\value WA_MacOpaqueSizeGrip Indicates that the native size grip
should be opaque instead of transparent (the default). This attribute
is only applicable to \macos and is set by the widget's author.

Expand Down
Loading

0 comments on commit 4cbadf6

Please sign in to comment.