Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore inclusion of Qt5Core_PRIVATE_INCLUDE_DIRS #53

Closed
wants to merge 37 commits into from

Conversation

cwilling
Copy link

Signed-off-by: Christoph Willing chris.willing@linux.com

jcfr and others added 30 commits June 11, 2017 12:05
Update list of features associated with patched-2
and patched-3 branches
By ensuring that "undef" of _DEBUG macro is not done before system
includes, it fixes the issue.

This commit is based on what has been within VTK.
See Kitware/VTK@81d4a72

See commontk#9

Thanks @Neosettler for testing the patch.

Reported-by: Neosettler
Disabled by default to keep behavior consistent with previous
CMake'ified version.
By checking if an enum member has already been cached it is not required
anymore to skip it if is a QFlags.

Additionally, the wrapping of QFlags can now be done by using
only Q_FLAGS without having a corresponding Q_ENUMS.
Remove unmatched '${' in error message. CMake itself might not have
minded, but it confuses the heck out of both katepart and vim syntax
highlighting.
Add variables to allow users to override the default install
directories, and also respect LIB_SUFFIX by default.
Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
The file "PythonQtUtils.h" has been added in r251 (started qt5 port)
PyObject_GetAttrString returns a new reference. PyDict_SetItemString
does not steal a reference, so Py_DECREF should be called after
PyDict_SetItemString.
This commit increments the refcount of the built-in PyInt_Type instance
when creating an enum wrapper. This is necessary because
PyTuple_SET_ITEM steals a reference to that instance.

Fixing the refcount prevents a crash when calling Py_Finalize().
…anup()

In certain situations the dealloc callback
PythonQtInstanceWrapper_dealloc is called after PythonQt::cleanup() has
been run. This can happen when Python destroys objects during
Py_Finalize(). This commit adds a check that PythonQt is still
initialized in the dealloc callback.
Prior to commit commontk@9c2e489, the "name" property was offered as an alias for the "objectName" property. Now, the alias is a compile-time option that is disabled by default.

This commit enables the "name" property alias to maintain backwards compatibility with earlier versions.
This commit prevents crashes by handling scenarios such as:
(a) object destruction after the Python interpreter has been finalized
(b) object destruction after cleanup, i.e. the singleton no longer exists

Any usage of a Qt enum demonstrates (a).

One example that demonstrates (b) is a QTimer object which is created with a
QApplication parent. PythonQt::cleanup() is called before the QApplication is
completely destroyed, so the code that handles wrapping the QTimer object must
handle the case when the PythonQt singleton no longer exists.

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
This commit fixes a link error building PythonQtCppTests on Windows:

    1>PythonQtCppTests.obj : error LNK2001: unresolved external symbol "int __cdecl tests_PythonQtTestMain(int,char * * const)" (?tests_PythonQtTestMain@@YAHHQEAPEAD@Z)
    1>C:\temp\PythonQt-build\Debug\PythonQtCppTests.exe : fatal error LNK1120: 1 unresolved externals
A sequence of calls like the following would crash in Python when reinitializing
the interpreter the second time:

    PythonQt::init(0);
    ...
    Py_Finalize();

    PythonQt::init(0);
    ...
    Py_Finalize();
This commit changes initialization of the global storage containers to be
explicit instead of happening during static initialization. This makes the
containers properly initialized if PythonQt is initialized and cleaned up more
than once.

The motivation for this change is to support testing cleanup and finalization.
Add tests that check for clean cleanup and finalization in different scenarios.

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Co-authored-by: Pat Marion <james.patrick.marion@gmail.com>
This commit fixes a crash during PythonQt::cleanup(). While destroying the
PythonQtPrivate instance, any remaining PythonQtSignalReceivers that are kept
alive only by their parent object will be destroyed. The crash occurs when
PythonQtSignalReceiver's destructor calls back into
PythonQtPrivate::removeSignalEmitter() when the PythonQtPrivate instance is
mostly destroyed.

Includes test case that crashes without the fix.
This commit fixes the following link error:

PythonQtTestMain.cpp:(.text+0x1637): undefined reference to `PythonQtTestCleanup::~PythonQtTestCleanup()'
This will allow to easily add new exceptions when adding support
for Qt5..
Based on work from the following individual:
 * Melven Röhrig-Zöllner (https://sourceforge.net/p/pythonqt/discussion/631392/thread/5f20c176/)
 * Julien Finet (@finetjul): See commontk#38)
 * Arnaud Barre (@Alzathar):See commontk#15
 * Eric Heim (@eric-h):See commontk#36
@jcfr
Copy link
Member

jcfr commented Jun 15, 2017

Thanks for the update @cwilling

Just to let you that I will be travelling for the next week and I am not sure if I will have time to follow up until I am back.

@jcfr
Copy link
Member

jcfr commented Aug 8, 2017

Thanks for the contributions.

Closing since associated changes have been integrated into patched-8 branch as 0401ec7

@jcfr jcfr closed this Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants