aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove branch from .gitmoduleSimo Fält2019-02-061-1/+0
| | | | | | | | | In some cases CI can't find submodule commits, causing integration to fail due to not being able to create source packages. Change-Id: Iebce92db3d73aab5ff5cf7d8113341fb81410dee Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Build scripts: Make location of 7z a bit smarter on WindowsFriedemann Kleint2019-02-061-2/+12
| | | | | | | | Check for the default install location in case it was not added to the path. Change-Id: I6f21353147552ed6f556f79878e6ba89dc40cb43 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* coin_build/test_instructions.py: Add more packagesFriedemann Kleint2019-02-062-2/+2
| | | | | | | | Add numpy for testing arrays, sphinx for the documentation and PyOpenGL for testing. Change-Id: I62662de47fb89f8277faed74ad9cedd20efec556 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix environment check regarding msvc redist librariesAlexandru Croitor2019-02-061-2/+1
| | | | | | | | Empty string is not the same as None. This caused the redist libraries to always be downloaded. Change-Id: Ib4951ba0e56c87749aa85cb3b815ce222ecb95cd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Avoid __pycache__ directoriesCristian Maureira-Fredes2019-02-063-2/+13
| | | | | | | | We are currently shipping the __pycache__ directory of the examples, so this filter will remove them. Change-Id: Ia387108d8867cf08f8bfc2677f166fb33b521ad5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* typesystem_gui_common.xml: CleanupFriedemann Kleint2019-02-065-66/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove duplicate modifications of QOpenGLExtraFunctions::SamplerParameteri/fv() that are covered by the below regular expression - Remove QMatrix4x2::copyDataTo() as is done for the other QMatrix<N>x<M> classes, fixing: There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type 'float *' of argument 1 in function 'QMatrix4x2::copyDataTo(float * values) const'. - Remove the array modifications of the QMatrix<N>x<M> constructors (specializations of QGenericMatrix). They don't work since the handling is not implemented in shiboken's AbstractMetaBuilderPrivate::inheritTemplate(). This can be fixed, but has no effect here since the manually added constructor from a PySequence always takes preference. This fixes: There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type 'const float *' of argument 1 in function 'QMatrix2x2::QMatrix2x2(const float * values)'. 'const float *' of argument 1 in function 'QMatrix2x3::QMatrix2x3(const float * values)'. 'const float *' of argument 1 in function 'QMatrix2x4::QMatrix2x4(const float * values)'. 'const float *' of argument 1 in function 'QMatrix3x2::QMatrix3x2(const float * values)'. 'const float *' of argument 1 in function 'QMatrix3x3::QMatrix3x3(const float * values)'. 'const float *' of argument 1 in function 'QMatrix3x4::QMatrix3x4(const float * values)'. 'const float *' of argument 1 in function 'QMatrix4x2::QMatrix4x2(const float * values)'. 'const float *' of argument 1 in function 'QMatrix4x3::QMatrix4x3(const float * values)'. Change-Id: Iea9ced35158b31fb006d038cd5c307d5feec839e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace QString::null/isNull() by QString()/isEmpty()Friedemann Kleint2019-02-066-13/+13
| | | | | | | | | | | | | | Fix warnings appearing in Qt 5.13: sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:873:25: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:873:25: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:880:25: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/shibokengenerator.cpp:880:25: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:5060:34: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:5060:34: warning: ‘QString::null’ is deprecated: use QString() [-Wdeprecated-declarations] Change-Id: I7c938df64babf824b58bf5c785b281a88d5111db Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace the deprecated Qt algorithms by their std:: equivalentsFriedemann Kleint2019-02-054-8/+17
| | | | | | | | | | | | | | Fix warnings occurring in 5.13: sources/shiboken2/ApiExtractor/abstractmetalang.cpp:1431:66: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = AbstractMetaFunction**; LessThan = bool (*)(AbstractMetaFunction*, AbstractMetaFunction*)]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:358:43: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator) [with RandomAccessIterator = Include*]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:1683:55: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator) [with RandomAccessIterator = QList<QString>::iterator]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/shiboken2/cppgenerator.cpp:5500:53: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator) [with RandomAccessIterator = Include*]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp:1585:65: warning: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = AbstractMetaFunction**; LessThan = bool (*)(const AbstractMetaFunction*, const AbstractMetaFunction*)]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp:1681:24: warning: ‘void qSort(Container&) [with Container = QStringList]’ is deprecated: Use std::sort [-Wdeprecated-declarations] sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp:2054:25: warning: ‘void qSort(Container&) [with Container = QStringList]’ is deprecated: Use std::sort [-Wdeprecated-declarations] Change-Id: If6940941ac31327597ce362a31b27773f4d5b94c Reviewed-by: Christian Tismer <tismer@stackless.com>
* Type Hints: Handle Container Types CorrectlyChristian Tismer2019-02-055-31/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An error was reported that we had a bug in this .pyi line: def parseErrors(self) -> PySide2.QtScxml.QScxmlError: ... which actually had to be a list like def parseErrors(self) -> typing.List[PySide2.QtScxml.QScxmlError]: ... A deeper look revealed that we had very many other examples, also in the argument lists, were we did not handle containers properly. (For example, 90 times in QtCore!) This is a leftover from the type error messages which were generated in C++, and never really understood. This is now a clean rewrite of the C++ part to expose all information and an extension of the Python parser that systematically uses the container types from the typing module. The implementation became a bit more complex because of Python 2: We need to provide our own copy of the public typing module, because it is not safe to assume that this module can be loaded. Importing it from support.signature gave a problem because we now need to find the names of instances to produce List[...], which needed to be implemented in the loader. Implemented the "Pair" type now as a native generic type. This is more correct than the former implementation and shorter in the .pyi files. Additionally, an own definition of "Char" was provided for brevity. This was not important to implement and could also be done with "int", but it is helpful for the future to know how to implement own types (and it was fun). Task-number: PYSIDE-921 Task-number: PYSIDE-795 Change-Id: I0e565b38d7b4fff39dd606950f9f8d97c45acbf5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide2/QtSxcml: Support bool *ok in some of the models' evaluateTo() functionsFriedemann Kleint2019-02-042-0/+17
| | | | | | | | | | | | | | | | | Add yet another version of the fix_args,arg,bool template, fixing: There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type 'bool *' of argument 2 in function 'QScxmlDataModel::evaluateToBool(int id, bool * ok)'. 'QScxmlDataModel::evaluateToString(int id, bool * ok)'. 'QScxmlDataModel::evaluateToVariant(int id, bool * ok)'. 'QScxmlEcmaScriptDataModel::evaluateToBool(int id, bool * ok)'. 'QScxmlEcmaScriptDataModel::evaluateToString(int id, bool * ok)'. 'QScxmlEcmaScriptDataModel::evaluateToVariant(int id, bool * ok)'. 'QScxmlEcmaScriptDataModel::evaluateToVoid(int id, bool * ok)'. 'QScxmlNullDataModel::evaluateToString(int id, bool * ok)'. 'QScxmlNullDataModel::evaluateToVariant(int id, bool * ok)'. Change-Id: Idfda2adc0875a4626797a92240fa5267016d04bb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* libshiboken: Fix unused function warning (PepRun_GetResult)Friedemann Kleint2019-02-041-0/+2
| | | | | | | | | Add #ifdefs, fixing: sources/shiboken2/libshiboken/pep384impl.cpp:413:1: warning: ‘PyObject* PepRun_GetResult(const char*, const char*)’ defined but not used [-Wunused-function] PepRun_GetResult(const char *command, const char *resvar) Change-Id: I5e469d6a24e95a602b882adbaad334a4ecf9af23 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Unify The Function Formatting In Generated CodeChristian Tismer2019-02-031-1/+1
| | | | | | | | | | | | | | | | | | | PySide functions are quite uniquely formatted: - There comes some header - Then an opening brace to the very left - Then body text - Then a closing brace. This structure is very quickly parsable with a single regular expression, except: There is a single case where the structure is different. We remove that to save complexity in evaluation tools. Task-number: PYSIDE-803 Change-Id: If868eb4b6a6e0d62ed2f944aeb9227a3bc459458 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide2/QtGui: Add more array modifications for const (unsigned) int * ↵Friedemann Kleint2019-02-011-1/+13
| | | | | | | | | | | | | | | | | parameters Fix warnings: There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type 'const unsigned int *' of argument 5 in function 'QOpenGLExtraFunctions::glDebugMessageControl(unsigned int source, unsigned int type, unsigned int severity, int count, const unsigned int * ids, unsigned char enabled)'. 'const int *' of argument 3 in function 'QOpenGLExtraFunctions::glSamplerParameterIiv(unsigned int sampler, unsigned int pname, const int * param)'. 'const unsigned int *' of argument 3 in function 'QOpenGLExtraFunctions::glSamplerParameterIuiv(unsigned int sampler, unsigned int pname, const unsigned int * param)'. 'const int *' of argument 3 in function 'QOpenGLExtraFunctions::glTexParameterIiv(unsigned int target, unsigned int pname, const int * params)'. 'const unsigned int *' of argument 3 in function 'QOpenGLExtraFunctions::glTexParameterIuiv(unsigned int target, unsigned int pname, const unsigned int * params)'. 'const unsigned int *' of argument 2 in function 'QOpenGLFunctions::glShaderBinary(int n, const unsigned int * shaders, unsigned int binaryformat, const void * binary, int length)'. Change-Id: I764823352fc4360d167acb07e8502a1dc8c060dc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix shiboken description issueCristian Maureira-Fredes2019-02-011-2/+2
| | | | | | | | | | The comma at the end of the string generate an ugly tuple-like string on pypi. Change-Id: I3fb9b1d23fad939dc46c3e323dd95210eab8da2c Reviewed-by: Simo Fält <simo.falt@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* PySide2: Remove enumeration AbstractPhysicalDevice::DeviceStatusFriedemann Kleint2019-02-011-3/+1
| | | | | | | | Fix warning: enum 'Qt3DInput::QAbstractPhysicalDevice::DeviceStatus' is specified in typesystem, but not declared Change-Id: I2d241e6c524cce84fc090fec3eca4595beb998d0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QtGui: Fix warning about <array> modificationFriedemann Kleint2019-02-011-1/+1
| | | | | | | | | | Extend the regexp for the <array> modification of glClearBufferXX() to actually check for '*' so that only the overloads with arrays match, fixing warning: glClearBufferfi(uint,int,float,int): Cannot use parameter 3 as an array: Type does not have indirections. Change-Id: Ic1cd24ca3d66ea7eac593b4a2d3b1a759ab1af18 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide2/Widgets: Add overload of QInputDialog::getDouble()Friedemann Kleint2019-01-312-0/+18
| | | | | | | | | | | | | Add modification and new variant of the fix_arg template, fixing warning: There's no user provided way (conversion rule, argument removal, custom code, etc) to handle the primitive type 'bool *' of argument 8 in function 'QInputDialog::getDouble(QWidget * parent, const QString & title, const QString & label, double value, double minValue, double maxValue, int decimals, bool * ok, QFlags<Qt::WindowType> flags, double step)'. Change-Id: I02ee5c477d74698bd5dda23bbec01f39775d5c6d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Tabbed browser example: Add history listFriedemann Kleint2019-01-314-2/+139
| | | | | Change-Id: I4b668b7d14a872a5d140a53f22249d7778750679 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Suppress warnings about missing types for dropped entriesFriedemann Kleint2019-01-311-0/+1
| | | | | | | | | Fix warnings in case Qt is not built with SCTP: qt.shiboken: (network) type 'QSctpServer' is specified in typesystem, but not defined. This could potentially lead to compilation errors. qt.shiboken: (network) type 'QSctpSocket' is specified in typesystem, but not defined. This could potentially lead to compilation errors. Change-Id: I0352e34011f2123e08fe3330a53dcdadc468d6a9 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide2: Remove non-existent or moved Qt3D classesFriedemann Kleint2019-01-312-9/+0
| | | | | | | | | | | | Fix warnings: (3dcore) type 'Qt3DCore::QAbstractEngine' is specified in typesystem, but not defined. This could potentially lead to compilation errors. (3dcore) type 'Qt3DCore::Quick::QQmlAspectEngine' is specified in typesystem, but not defined. This could potentially lead to compilation errors. (3drender) type 'Qt3DRender::AssimpImporter' is specified in typesystem, but not defined. This could potentially lead to compilation errors. (3drender) type 'Qt3DRender::GLTFExporter' is specified in typesystem, but not defined. This could potentially lead to compilation errors. (3drender) type 'Qt3DRender::GLTFImporter' is specified in typesystem, but not defined. This could potentially lead to compilation errors. Change-Id: Iee873d69214e8195bfbd72bb664b691dd01d6877 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide2: Fix some build warningsFriedemann Kleint2019-01-313-1/+3
| | | | | | | | | - Add enum QJSValue::ErrorType - Add enum QWebEngineDownloadItem::DownloadType - Adapt suppressed warnings in XML class Change-Id: I0d598b256cf8f83253cdb7684dc4f8c3050a76e2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Bump version strings to 5.12.2Simo Fält2019-01-312-2/+2
| | | | | | | Next release out 5.12 branch will be 5.12.2 Change-Id: Ib2d6d2dcf60d5568699b06a299f3261d23cd6ebd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Include MSVC dlls in the shiboken module packageAlexandru Croitor2019-01-311-22/+41
| | | | | | | | | | | | | The libshiboken library uses C++ code, therefore we have to ship the MSVC redistributable DLLs along with it. They were distributed before for the shiboken2-generator package, but not for the module package. Amends 43fe3494a9d902034896e3afa7b5158c77163be0 Fixes: PYSIDE-914 Change-Id: I5981bfbcf3316e7742a0854051ddbd3b4bf4a938 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Add option to skip deprecated functionsFriedemann Kleint2019-01-319-2/+56
| | | | | | | | | | | | | Pass the "deprecated" annotation from Clang into the meta language and reject functions based on it when the the command line option --skip-deprecated is set. By default, have Python output a deprecation warning when a deprecated function is called (which is visible when passing -Wd). Task-number: PYSIDE-487 Change-Id: Ic28d82963fde11f258b2559b562d3f24017fe98d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add classes QWebEngineHistory, WebEngineHistoryItemFriedemann Kleint2019-01-302-5/+3
| | | | | | | Fixes: PYSIDE-906 Change-Id: I612a8881d530bb098d9e2991fd47a15bc454b2d6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Make constructor checks more fine-grainedFriedemann Kleint2019-01-306-31/+78
| | | | | | | | | | | | | | | | ShibokenGenerator::isValueTypeWithCopyConstructorOnly() returned false for QWebEngineHistoryItem since the check for AbstractMetaAttributes::HasRejectedConstructor triggered on WebEngineHistoryItem(QWebEngineHistoryItemPrivate *priv), causing the function to bail out. To prevent this, add a new AbstractMetaAttributes::HasRejectedDefaultConstructor attribute and use that in isValueTypeWithCopyConstructorOnly(). Task-number: PYSIDE-906 Change-Id: I4fee83b89f0a4c44e7e8d69e118ed7f2b03ceee1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* shiboken: Generate unused variable cast for variable numArgsFriedemann Kleint2019-01-301-0/+1
| | | | | | | | | Fix warning: qsignalblocker_wrapper.cpp:110:9: warning: unused variable ‘numArgs’ [-Wunused-variable] int numArgs = PyTuple_GET_SIZE(args); Change-Id: Iad56d7b5218851df2ddf5cd68bfbddc8efcf83e0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add QtRemoteObjects classesFriedemann Kleint2019-01-306-1/+323
| | | | | | | | | | | For starters, add the classes so that ready-made classes like QAbstractItemModelReplica can be used. Actually implementing repc requires another step. Task-number: PYSIDE-862 Change-Id: I28adb1d45c262f298f0ad1926198ec6a3013542f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtCore snippets: Fix warning about printf() format in generated codeFriedemann Kleint2019-01-301-1/+2
| | | | | | | | | | Add a cast to int for value_length and slicelength, fixing: qbytearray_wrapper.cpp:5288:158: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘Py_ssize_t {aka long int}’ [-Wformat=] PyErr_Format(PyExc_ValueError, "attempt to assign %s of size %d to extended slice of size %d",Py_TYPE(_value)->tp_name, value_length, slicelength); Change-Id: I4bd2e5d43a26c73c21a6121b469f5ec1c76994b2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Run generate_pyi After Generation of All BinariesChristian Tismer2019-01-221-1/+15
| | | | | | | | | | | | | | | | | | | | In COIN, there is a racing condition under Windows: Python opens as many modules as it can, while the build process is not yet done. This can lead to the situation that a module is loaded by Python before the Windows Manifest Tool has been run, and that creates a crash. We therefore wait when COIN is run, until all binaries have been created. That means that we are the last process, and the tool must have been already run. In non-COIN builds it is more convenient when in case of errors the generator crashes early. Task-number: PYSIDE-735 Change-Id: I060dbd54432778f14f74830596f28b4db83a0692 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add debug_windows.py scriptAlexandru Croitor2019-01-221-0/+357
| | | | | | | | | | | | | | | | | | | | | | | | | | This script can be used to find out why PySide2 modules fail to load with various DLL errors like: - Missing DLL - Missing symbol in DLL You can think of it as a Windows version of ldd / LD_DEBUG. Underneath it uses the cdb.exe command line debugger, and the gflags.exe tool, both installed with the latest Windows Kit. The aim is to ask users to run this script when they encounter PySide2 imports not working on Windows. The user should then provide the generated log file. Incindentally it can also be used for any Windows executables, not just Python. Consider adapting it to work on Linux and macOS as well (using LD_DEBUG and something similar on macOS). Change-Id: Ic7ef37ffd0565495e0774e4db3fc509090607af2 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Disable WebAssembly config from CISimo Fält2019-01-221-1/+1
| | | | | | | Qt for Python is not supporting that configuration. Change-Id: I4821ca84c1706cc60d3d43d5f20efbbda10e9c07 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* coin_build/test_instructions.py: Remove environment variables impacting cmakeFriedemann Kleint2019-01-222-0/+10
| | | | | | | Remove CC,CXX which might be set by some COIN setup scripts. Change-Id: I33d56dfeb54476edf591fc765a4a4c3c8fe746a6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup.py: Fix running under non-UTF8 localeFriedemann Kleint2019-01-163-20/+2
| | | | | | | | | | Redirecting stderr to stdout causes an error when running under non-UTF8 locales. For the build scripts, it is also not desired to mix the output channels, so, remove the redirection. Change-Id: I6e3d05ede00537c3cc4c022780e8d0ed27bb0cad Fixes: PYSIDE-880 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Support help() using the Signature ModuleChristian Tismer2019-01-155-22/+148
| | | | | | | | | | | | | | | | | | | | The signature module will be used to generate automated documentation by using the function signatures as docstrings. This functionality should be low-hanging fruit. Actually, it was a bit tricky to get this working. The crucial point was to use PyType_Modified(). The function works fine on methods. Supporting types needs some more effort. It is not clear why the __signature__ attribute can be added, but the change to __doc__ is not recognized. May be related to the absence of Py_TPFLAGS_HAVE_VERSION_TAG ? This will be addressed another time. Task-number: PYSIDE-908 Change-Id: If8faa87927899f4c072d42b91eafd8f7658c6abc Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Fix security warning in formatting error messageFriedemann Kleint2019-01-151-2/+2
| | | | | | | cppgenerator.cpp:2698:107: warning: format not a string literal and no format arguments [-Wformat-security] Change-Id: I41d976749023bda142b680930f2d54d00687eb47 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix a crash when overriding ↵Friedemann Kleint2019-01-141-2/+4
| | | | | | | | | | | | | | QAbstractNativeEventFilter.QAbstractNativeEventFilter() long * result is nullptr for the custom message WM_USER + 1 internally used by Qt (cf QEventDispatcherWin32::processEvents()). Add a check for that. Amends 899b3cfed8e1c3513f8d3001c53b0bb0cc1af548. Task-number: PYSIDE-790 Change-Id: I4c55cfb17aa95d79f728f43a9030d1f1cbb1d024 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Reduce C-style casts in generated codeFriedemann Kleint2019-01-141-47/+70
| | | | | Change-Id: I9539c1a4e24e915d5b356afafbd902266d493b5a Reviewed-by: Christian Tismer <tismer@stackless.com>
* shiboken: Refactor formatting of the PyType_Slot array in writeClassDefinition()Friedemann Kleint2019-01-132-31/+55
| | | | | | | | | | Change the tp_func handling such that "" means nullptr and introduce a formatter class for the entries to use nullptr and change the C-style casts to reinterpret_cast. Change-Id: I36a1a218d003035f23ab9f8d31c7a993379e23c2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Improve check when a QFlag<Enum> is foundCristian Maureira-Fredes2019-01-111-2/+11
| | | | | | | | | | | | | | | | | | | | | | For the case of the method `addAxis` in the QPolarChart class, the generated code evaluates first the inherited method: QChart::addAxis(QtCharts::QAbstractAxis*,QFlags<Qt::AlignmentFlag>) instead of the same class method: QPolarChart::addAxis(QtCharts::QAbstractAxis*,QtCharts::QPolarChart::PolarOrientation) The condition to check if an argument was a `QFlags<Qt::AlignmentFlag>`, was just `PyNumber_Check(...)`, which was too broad, and then any Enum would pass that condition. The change was to include an additional condition to check the type of the EnumType that was passed as argument. Change-Id: I2eebb6f05c097d170a6d61633698444f03f20b02 Fixes: PYSIDE-898 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* shiboken: Use more nullptr or {} in generated codeFriedemann Kleint2019-01-111-27/+32
| | | | | Change-Id: I96e3bff8a48f0bd5ea98c33a22ff12c31b01357d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* shiboken: Replace C-style NULL by nullptrFriedemann Kleint2019-01-115-22/+25
| | | | | | | | | | | | | | Replace in comments, code and generated code. Rename variable NULL_VALUE to NULL_PTR and make extern for follow-up changes. Rewrite code using NULL in QString::arg() (resulting apparently from some misunderstanding that it requires a terminating nullptr) to use printf-formatting to fix a warning: format not a string literal and no format arguments [-Wformat-security]). Change-Id: I97c111cadc09192132308924136eb6ede7a6bf44 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Update READMEsCristian Maureira-Fredes2019-01-113-10/+10
| | | | | | | | | | | A couple of details were fixed: * the --jobs option that is now --parallel, * don't mention shiboken on the PySide2 wheel, * add a shiboken wiki page link, * among others Change-Id: I6e1ae7375bd425c2e0357a03e976ea70c7b05e1d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix snippet typoCristian Maureira-Fredes2019-01-111-1/+1
| | | | | Change-Id: Ic38aa8ba9a2470c97eb5cbd83b7d227322207db9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix wrong METADATA for generated wheelsCristian Maureira-Fredes2019-01-111-3/+2
| | | | | | | | | | | | | | | | | | | | | For the 5.12.0 release, we noticed that a couple of strings in the wheel METADATA were not properly formed. The first case was the type of the description content: 'text/markdown', got interpreted as a tuple ('text/markdown',), which was not recognize as a valid format. The second issue was the summary. It was a two-line string: ('Python bindings ... ', '....') which got wrongly parsed, and we ended up missing some title information, and even getting the parenthesis on the description. Change-Id: I2f3e8b23e3d9a39355e6eb30ab79f581bde33d30 Fixes: PYSIDE-874 Task-number: QTQAINFRA-2455 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Documentation: Add \nullptr macro definitionFriedemann Kleint2019-01-101-0/+2
| | | | | | | Task-number: PYSIDE-903 Change-Id: I727b861b048c48bbeea51272e607c06dfb58c1df Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: Update and fix the Slot documentationCristian Maureira-Fredes2019-01-101-15/+15
| | | | | | Task-number: PYSIDE-691 Change-Id: I5a6691554b64b808591e3ed000f01ca0211167ab Reviewed-by: Christian Tismer <tismer@stackless.com>
* Documentation: Replace nullptr by None in signaturesFriedemann Kleint2019-01-101-3/+7
| | | | | | Task-number: PYSIDE-903 Change-Id: I4dc2cce4741c87e08b8b3d0dc911c62d044ee054 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Produce TypeError Messages Using the Signature ModuleChristian Tismer2019-01-1012-128/+174
| | | | | | | | | | | | | | | The TypeError messages can now be produced, based upon the signature module. As a feature under test, we produce ValueErrors instead in certain cases. This will probably improve, later. We are currently investigating how much can be determined, automatically. Task-number: PYSIDE-795 Change-Id: Ie8a648beaf8a3bed388e3c01ba501bb36859722e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Avoid creation of empty build directories in install treeStefan Brüns2019-01-081-3/+3
| | | | | | | | Initial-patch-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Change-Id: Ia1f86a8c8926dda2072a10757928497067580dca Fixes: PYSIDE-882 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>