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: Ib719a6249069e6bd6c9311bbec7f364855ab82ff
  • Loading branch information
laknoll committed Aug 6, 2019
2 parents 7301e44 + 3183e42 commit 6f357f5
Show file tree
Hide file tree
Showing 718 changed files with 8,645 additions and 4,397 deletions.
1 change: 1 addition & 0 deletions .qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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
2 changes: 1 addition & 1 deletion bin/syncqt.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ ($$)
# }
my $class_header = "$class ";
$pri_install_gfiles .= $class_header
unless ($shadow || $pri_install_gfiles =~ $class_header);
unless ($shadow || $pri_install_gfiles =~ m/\b$class_header/);
$injection .= ":$class";
}

Expand Down
1 change: 0 additions & 1 deletion config.tests/arch/arch.pro
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
TARGET = arch
SOURCES = arch.cpp
2 changes: 1 addition & 1 deletion config.tests/arch/arch_host.pro
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
option(host_build)
include(arch.pro)
SOURCES = arch.cpp
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ if [ -z "$QT_MAJOR_VERSION" ]; then
fi

#-------------------------------------------------------------------------------
# initalize variables
# initialize variables
#-------------------------------------------------------------------------------

# QTDIR may be set and point to an old or system-wide Qt installation
Expand Down
4 changes: 3 additions & 1 deletion configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,14 @@
"label": "target architecture",
"type": "architecture",
"test": "arch",
"output": "arch",
"log": "arch"
},
"host_architecture": {
"label": "host architecture",
"type": "architecture",
"test": "arch",
"output": "arch_host",
"host": true,
"pro": "arch_host.pro",
"log": "arch"
Expand Down Expand Up @@ -1323,7 +1325,7 @@
"ccache": {
"label": "Using ccache",
"autoDetect": false,
"condition": "config.unix && tests.ccache",
"condition": "tests.ccache",
"output": [ "privateConfig" ]
},
"msvc_mp": {
Expand Down
41 changes: 30 additions & 11 deletions configure.pri
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,39 @@ 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
unix:exists($$test_out_dir/arch): \
content = $$cat($$test_out_dir/arch, blob)
else: win32:exists($$test_out_dir/arch.exe): \
content = $$cat($$test_out_dir/arch.exe, blob)
else: android:exists($$test_out_dir/libarch.so): \
content = $$cat($$test_out_dir/libarch.so, blob)
else: wasm:exists($$test_out_dir/arch.wasm): \
content = $$cat($$test_out_dir/arch.wasm, blob)
else: wasm:exists($$test_out_dir/arch.o): \
content = $$cat($$test_out_dir/arch.o, blob)
else: \
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): \
error("$$eval($${1}.label) detection binary not found.")
content = $$cat($$test_out_file, blob)

arch_magic = ".*==Qt=magic=Qt== Architecture:([^\\0]*).*"
subarch_magic = ".*==Qt=magic=Qt== Sub-architecture:([^\\0]*).*"
Expand Down
4 changes: 2 additions & 2 deletions examples/opengl/legacy/hellogl/glwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ void GLWidget::initializeGL()
{
initializeOpenGLFunctions();

qglClearColor(qtPurple.dark());
qglClearColor(qtPurple.darker());

logo = new QtLogo(this, 64);
logo->setColor(qtGreen.dark());
logo->setColor(qtGreen.darker());

glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
Expand Down
4 changes: 2 additions & 2 deletions examples/opengl/legacy/overpainting/glwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void GLWidget::initializeGL()
glEnable(GL_MULTISAMPLE);

logo = new QtLogo(this);
logo->setColor(qtGreen.dark());
logo->setColor(qtGreen.darker());
}
//! [2]

Expand Down Expand Up @@ -163,7 +163,7 @@ void GLWidget::paintEvent(QPaintEvent *event)
//! [4]

//! [6]
qglClearColor(qtPurple.dark());
qglClearColor(qtPurple.darker());
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
Expand Down
11 changes: 7 additions & 4 deletions examples/opengl/qopenglwindow/background_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ FragmentToy::FragmentToy(const QString &fragmentSource, QObject *parent)
}
}

FragmentToy::~FragmentToy()
= default;

void FragmentToy::draw(const QSize &windowSize)
{
if (!m_program)
Expand Down Expand Up @@ -120,7 +123,7 @@ void FragmentToy::draw(const QSize &windowSize)
if (!m_vertex_shader->compileSourceCode(vertex_shader)) {
qWarning() << "Failed to compile the vertex shader:" << m_vertex_shader->log();
}
if (!m_program->addShader(m_vertex_shader.data())) {
if (!m_program->addShader(m_vertex_shader.get())) {
qWarning() << "Failed to add vertex shader to program:" << m_program->log();
}
}
Expand Down Expand Up @@ -153,7 +156,7 @@ void FragmentToy::draw(const QSize &windowSize)
}

if (m_fragment_shader) {
if (!m_program->addShader(m_fragment_shader.data())) {
if (!m_program->addShader(m_fragment_shader.get())) {
qWarning() << "Failed to add fragment shader to program:" << m_program->log();
}
}
Expand Down Expand Up @@ -197,14 +200,14 @@ void FragmentToy::fileChanged(const QString &path)
m_fragment_file_last_modified = fragment_source.lastModified();
m_recompile_shaders = true;
if (m_program) {
m_program->removeShader(m_fragment_shader.data());
m_program->removeShader(m_fragment_shader.get());
m_fragment_shader.reset(nullptr);
}
}
} else {
m_recompile_shaders = true;
if (m_program) {
m_program->removeShader(m_fragment_shader.data());
m_program->removeShader(m_fragment_shader.get());
m_fragment_shader.reset(nullptr);
}
}
Expand Down
11 changes: 7 additions & 4 deletions examples/opengl/qopenglwindow/background_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,14 @@
#include <QOpenGLShaderProgram>
#include <QOpenGLFunctions>

#include <memory>

class FragmentToy : public QObject, protected QOpenGLFunctions
{
Q_OBJECT
public:
FragmentToy(const QString &fragmentSource, QObject *parent = 0);
explicit FragmentToy(const QString &fragmentSource, QObject *parent = nullptr);
~FragmentToy();

void draw(const QSize &windowSize);

Expand All @@ -79,9 +82,9 @@ class FragmentToy : public QObject, protected QOpenGLFunctions
QString m_fragment_file;
QDateTime m_fragment_file_last_modified;

QScopedPointer<QOpenGLShaderProgram> m_program;
QScopedPointer<QOpenGLShader> m_vertex_shader;
QScopedPointer<QOpenGLShader> m_fragment_shader;
std::unique_ptr<QOpenGLShaderProgram> m_program;
std::unique_ptr<QOpenGLShader> m_vertex_shader;
std::unique_ptr<QOpenGLShader> m_fragment_shader;
QOpenGLVertexArrayObject m_vao;
QOpenGLBuffer m_vertex_buffer;
GLuint m_vertex_coord_pos;
Expand Down
9 changes: 5 additions & 4 deletions examples/widgets/desktop/systray/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ void Window::iconActivated(QSystemTrayIcon::ActivationReason reason)
void Window::showMessage()
{
showIconCheckBox->setChecked(true);
QSystemTrayIcon::MessageIcon msgIcon = QSystemTrayIcon::MessageIcon(
typeComboBox->itemData(typeComboBox->currentIndex()).toInt());
if (msgIcon == QSystemTrayIcon::NoIcon) {
int selectedIcon = typeComboBox->itemData(typeComboBox->currentIndex()).toInt();
QSystemTrayIcon::MessageIcon msgIcon = QSystemTrayIcon::MessageIcon(selectedIcon);

if (selectedIcon == -1) { // custom icon
QIcon icon(iconComboBox->itemIcon(iconComboBox->currentIndex()));
trayIcon->showMessage(titleEdit->text(), bodyEdit->toPlainText(), icon,
durationSpinBox->value() * 1000);
Expand Down Expand Up @@ -222,7 +223,7 @@ void Window::createMessageGroupBox()
QStyle::SP_MessageBoxCritical), tr("Critical"),
QSystemTrayIcon::Critical);
typeComboBox->addItem(QIcon(), tr("Custom icon"),
QSystemTrayIcon::NoIcon);
-1);
typeComboBox->setCurrentIndex(1);

durationLabel = new QLabel(tr("Duration:"));
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/dialogs/standarddialogs/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void Dialog::setInteger()
{
//! [0]
bool ok;
int i = QInputDialog::getInt(this, tr("QInputDialog::getInteger()"),
int i = QInputDialog::getInt(this, tr("QInputDialog::getInt()"),
tr("Percentage:"), 25, 0, 100, 1, &ok);
if (ok)
integerLabel->setText(tr("%1%").arg(i));
Expand Down
4 changes: 2 additions & 2 deletions examples/widgets/painting/shared/arthurstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void ArthurStyle::polish(QWidget *widget)

QPalette pal = widget->palette();
if (widget->isWindow()) {
pal.setColor(QPalette::Background, QColor(241, 241, 241));
pal.setColor(QPalette::Window, QColor(241, 241, 241));
widget->setPalette(pal);
}

Expand All @@ -474,7 +474,7 @@ void ArthurStyle::unpolish(QWidget *widget)

void ArthurStyle::polish(QPalette &palette)
{
palette.setColor(QPalette::Background, QColor(241, 241, 241));
palette.setColor(QPalette::Window, QColor(241, 241, 241));
}

QRect ArthurStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/painting/shared/arthurwidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void ArthurFrame::paintEvent(QPaintEvent *e)

int o = 10;

QBrush bg = palette().brush(QPalette::Background);
QBrush bg = palette().brush(QPalette::Window);
painter.fillRect(0, 0, o, o, bg);
painter.fillRect(width() - o, 0, o, o, bg);
painter.fillRect(0, height() - o, o, o, bg);
Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/statemachine/trafficlight/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class TrafficLightWidget : public QWidget
m_green = new LightWidget(Qt::green);
vbox->addWidget(m_green);
QPalette pal = palette();
pal.setColor(QPalette::Background, Qt::black);
pal.setColor(QPalette::Window, Qt::black);
setPalette(pal);
setAutoFillBackground(true);
}
Expand Down
28 changes: 27 additions & 1 deletion mkspecs/features/create_cmake.prf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND

CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake

internal_module {
MODULE = "$${MODULE}_private"
}

# Core, Network, an external module named Foo
CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE})

Expand Down Expand Up @@ -112,6 +116,10 @@ win32:!static:!staticlib {

static|staticlib:CMAKE_STATIC_TYPE = true

internal_module {
CMAKE_INTERNAL_MODULE = true
}

CMAKE_DEBUG_TYPE =
CMAKE_RELEASE_TYPE =

Expand All @@ -133,6 +141,24 @@ equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
if(build_all|CONFIG(debug, debug|release)): CMAKE_DEBUG_TYPE = debug
if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release

# CMAKE_DEBUG_AND_RELEASE is used to tell the _populate_$${CMAKE_MODULE_NAME}_target_properties
# functions whether a Configuration specific generator expression needs to be added to the values
# of INTERFACE_LINK_LIBRARIES and INTERFACE_LINK_OPTIONS. For debug_and_release builds, we do need
# configuration specific values. For singular builds (only release or only debug), we want the
# values to be applied regardless of the configuration.
# This would allow on Linux and macOS (and with a recent enough version of CMake on Windows) to
# build a Debug configuration of an application, even if Qt was built in a Release configuration.
#
# All IMPORTED_LOCATION_<CONFIG> paths are automatically considered by CMake if there is no
# <CONFIG> equivalent to the value specified by CMAKE_BUILD_TYPE.
# This means that when Qt was built in a Release configuration, and the application in a Debug
# configuration, IMPORTED_LOCATION_RELEASE will be used for the Qt libraries.
debug_and_release {
CMAKE_DEBUG_AND_RELEASE = TRUE
} else {
CMAKE_DEBUG_AND_RELEASE = FALSE
}

contains(CONFIG, plugin) {
!isEmpty(PLUGIN_EXTENDS):!equals(PLUGIN_EXTENDS, -) {
count(PLUGIN_EXTENDS, 1, greaterThan): \
Expand Down Expand Up @@ -341,7 +367,7 @@ cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
# Other modules should either create proper tests in tests/auto/cmake or, as
# a temporary measure, disable the generation of cmake files
# with 'CONFIG -= create_cmake'
!equals(CMAKE_MODULE_TESTS, -) {
!internal_module:!equals(CMAKE_MODULE_TESTS, -) {
isEmpty(CMAKE_MODULE_TESTS): CMAKE_MODULE_TESTS = $$MODULE_BASE_INDIR/tests/auto/cmake
!exists($$CMAKE_MODULE_TESTS): \
error("Missing CMake tests. Either create tests in tests/auto/cmake," \
Expand Down
Loading

0 comments on commit 6f357f5

Please sign in to comment.