Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.15' into dev
Browse files Browse the repository at this point in the history
 Conflicts:
	src/network/access/qnetworkaccessmanager.cpp
	src/network/access/qnetworkreplyhttpimpl.cpp

Change-Id: I059be651604623616fd31e8616be8ae61b4f8883
  • Loading branch information
liangqi committed Oct 4, 2019
2 parents 3598ffc + a379068 commit 96a2044
Show file tree
Hide file tree
Showing 53 changed files with 846 additions and 973 deletions.
20 changes: 13 additions & 7 deletions configure.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,13 @@
"qmake": "CONFIG += c++11 c++14"
}
},
"c++1z": {
"c++17": {
"label": "C++17 support",
"type": "compile",
"test": {
"head": [
"#if __cplusplus > 201402L",
"// Compiler claims to support experimental C++1z, trust it",
"// Compiler claims to support C++17, trust it",
"#else",
"# error __cplusplus must be > 201402L (the value for C++14)",
"#endif",
Expand All @@ -354,7 +354,7 @@
"int i = std::get<int>(v);",
"std::visit([](const auto &) { return 1; }, v);"
],
"qmake": "CONFIG += c++11 c++14 c++1z"
"qmake": "CONFIG += c++11 c++14 c++17"
}
},
"c++2a": {
Expand All @@ -368,7 +368,7 @@
"# error __cplusplus must be > 201703L (the value for C++17)",
"#endif"
],
"qmake": "CONFIG += c++11 c++14 c++1z c++2a"
"qmake": "CONFIG += c++11 c++14 c++17 c++2a"
}
},
"precompile_header": {
Expand Down Expand Up @@ -818,6 +818,7 @@
"rpath": {
"label": "Build with RPATH",
"autoDetect": "var.QMAKE_LFLAGS_RPATH != '' && features.shared",
"condition": "!config.android",
"output": [ "publicFeature", "publicQtConfig" ]
},
"rpath_dir": {
Expand Down Expand Up @@ -950,15 +951,20 @@
"condition": "features.c++11 && tests.c++14",
"output": [ "publicFeature", "publicQtConfig" ]
},
"c++17": {
"label": "C++17",
"condition": "features.c++14 && tests.c++17",
"output": [ "publicFeature", "publicQtConfig" ]
},
"c++1z": {
"label": "C++17",
"condition": "features.c++14 && tests.c++1z",
"condition": "features.c++17",
"output": [ "publicFeature", "publicQtConfig" ]
},
"c++2a": {
"label": "C++2a",
"autoDetect": false,
"condition": "features.c++1z && tests.c++2a",
"condition": "features.c++17 && tests.c++2a",
"output": [ "publicFeature", "publicQtConfig" ]
},
"c89": {
Expand Down Expand Up @@ -1485,7 +1491,7 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
{
"message": "Using C++ standard",
"type": "firstAvailableFeature",
"args": "c++2a c++1z c++14 c++11"
"args": "c++2a c++17 c++14 c++11"
},
{
"type": "feature",
Expand Down
25 changes: 14 additions & 11 deletions examples/gui/openglwindow/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class TriangleWindow : public OpenGLWindow
void render() override;

private:
GLuint m_posAttr = 0;
GLuint m_colAttr = 0;
GLuint m_matrixUniform = 0;
GLint m_posAttr = 0;
GLint m_colAttr = 0;
GLint m_matrixUniform = 0;

QOpenGLShaderProgram *m_program = nullptr;
int m_frame = 0;
Expand Down Expand Up @@ -122,8 +122,11 @@ void TriangleWindow::initialize()
m_program->addShaderFromSourceCode(QOpenGLShader::Fragment, fragmentShaderSource);
m_program->link();
m_posAttr = m_program->attributeLocation("posAttr");
Q_ASSERT(m_posAttr != -1);
m_colAttr = m_program->attributeLocation("colAttr");
Q_ASSERT(m_colAttr != -1);
m_matrixUniform = m_program->uniformLocation("matrix");
Q_ASSERT(m_matrixUniform != -1);
}
//! [4]

Expand All @@ -144,13 +147,13 @@ void TriangleWindow::render()

m_program->setUniformValue(m_matrixUniform, matrix);

GLfloat vertices[] = {
0.0f, 0.707f,
static const GLfloat vertices[] = {
0.0f, 0.707f,
-0.5f, -0.5f,
0.5f, -0.5f
0.5f, -0.5f
};

GLfloat colors[] = {
static const GLfloat colors[] = {
1.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 1.0f
Expand All @@ -159,13 +162,13 @@ void TriangleWindow::render()
glVertexAttribPointer(m_posAttr, 2, GL_FLOAT, GL_FALSE, 0, vertices);
glVertexAttribPointer(m_colAttr, 3, GL_FLOAT, GL_FALSE, 0, colors);

glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glEnableVertexAttribArray(m_posAttr);
glEnableVertexAttribArray(m_colAttr);

glDrawArrays(GL_TRIANGLES, 0, 3);

glDisableVertexAttribArray(1);
glDisableVertexAttribArray(0);
glDisableVertexAttribArray(m_colAttr);
glDisableVertexAttribArray(m_posAttr);

m_program->release();

Expand Down
2 changes: 1 addition & 1 deletion examples/widgets/graphicsview/flowlayout/flowlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ FlowLayout::FlowLayout(QGraphicsLayoutItem *parent) : QGraphicsLayout(parent)
void FlowLayout::insertItem(int index, QGraphicsLayoutItem *item)
{
item->setParentLayoutItem(this);
if (index > m_items.count())
if (index > m_items.count() || index < 0)
index = m_items.count();
m_items.insert(index, item);
invalidate();
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/qml_plugin.prf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ INSTALLS += target

# Some final setup

TARGET = $$qt5LibraryTarget($$TARGET)
TARGET = $$qt5LibraryTarget($$TARGET, "qml/$$TARGETPATH/")

load(qt_targets)
load(qt_common)
Expand Down
8 changes: 7 additions & 1 deletion mkspecs/features/qt_functions.prf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ defineReplace(qtLibraryTarget) {
}

defineReplace(qt5LibraryTarget) {
LIBRARY_NAME = $$qtLibraryTarget($$1)
android {
LIBRARY_NAME_PREFIX = $$2
LIBRARY_NAME_PREFIX = $$replace(LIBRARY_NAME_PREFIX, "//", "/")
LIBRARY_NAME_PREFIX = $$replace(LIBRARY_NAME_PREFIX, "/", "_")
LIBRARY_NAME = $$LIBRARY_NAME_PREFIX$$qtLibraryTarget($$1)
unset(LIBRARY_NAME_PREFIX)
} else: LIBRARY_NAME = $$qtLibraryTarget($$1)
isEmpty(QMAKE_FRAMEWORK_BUNDLE_NAME) {
# Insert the major version of Qt in the library name
# unless it's a framework build.
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/qt_plugin.prf
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
INSTALLS += target

qt_libinfix_plugins: TARGET = $$TARGET$$QT_LIBINFIX
TARGET = $$qt5LibraryTarget($$TARGET)
TARGET = $$qt5LibraryTarget($$TARGET, "plugins/$$PLUGIN_TYPE/")

CONFIG += create_cmake

Expand Down
20 changes: 13 additions & 7 deletions qmake/generators/unix/unixmake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,21 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
opt.remove(suffixMarker); // Apply suffix by removing marker
}
for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) {
auto processPrlIfFound = [&](QString directory) {
QString suffixedPrl = directory + opt;
if (processPrlFile(suffixedPrl, true))
return true;
if (hasSuffix) {
QString unsuffixedPrl = directory + frameworkName;
if (processPrlFile(unsuffixedPrl, true))
return true;
}
return false;
};
QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/";
QString suffixedPrl = frameworkDirectory + opt;
if (processPrlFile(suffixedPrl, true))
if (processPrlIfFound(frameworkDirectory + "Resources/")
|| processPrlIfFound(frameworkDirectory))
break;
if (hasSuffix) {
QString unsuffixedPrl = frameworkDirectory + frameworkName;
if (processPrlFile(unsuffixedPrl, true))
break;
}
}
} else {
if (opt.length() == 10)
Expand Down
5 changes: 3 additions & 2 deletions qmake/generators/unix/unixmake2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,9 @@ void UnixMakefileGenerator::init2()
else
ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)");
if (!project->isEmpty("QMAKE_BUNDLE")) {
project->values("PRL_TARGET").prepend(
project->first("QMAKE_BUNDLE") + Option::dir_sep + project->first("TARGET"));
project->values("PRL_TARGET").prepend(project->first("QMAKE_BUNDLE") +
"/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") +
"/Resources/" + project->first("TARGET"));
ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
Expand Down
19 changes: 19 additions & 0 deletions src/android/jar/src/org/qtproject/qt5/android/QtNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,25 @@ public void run() {
});
}

private static String[] listAssetContent(android.content.res.AssetManager asset, String path) {
String [] list;
ArrayList<String> res = new ArrayList<String>();
try {
list = asset.list(path);
if (list.length > 0) {
for (String file : list) {
try {
String[] isDir = asset.list(path.length() > 0 ? path + "/" + file : file);
if (isDir != null && isDir.length > 0)
file += "/";
res.add(file);
} catch (Exception e) {}
}
}
} catch (Exception e) {}
return res.toArray(new String[res.size()]);
}

// screen methods
public static native void setDisplayMetrics(int screenWidthPixels,
int screenHeightPixels,
Expand Down
Loading

0 comments on commit 96a2044

Please sign in to comment.