Skip to content

Python qt3 upgrade #36

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

Closed
wants to merge 28 commits into from
Closed

Conversation

ericheim
Copy link

Added default build configuration for Qt versions greater 5.4. If the version is greater than the actual supported 5.4 , the 5.4 wrappers will be used as default like it is done in build/common.prf configuration file for non CMake triggered builds.

@jcfr
Copy link
Member

jcfr commented Feb 10, 2016

Hi @eric-h

Thanks for the updated PR 👍

To facilitate integration and contribution to upstream project, would it be possible to base your topic on top of the current patched-5 branch ?

The idea would be to remove commit like Added CMake build system.

jcfr and others added 22 commits February 17, 2016 15:24
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.
made name->objectName alias optional (off by default, add PYTHONQT_SUPPORT_NAME_PROPERTY to DEFINES if you need it)
added py_delete() slot support for built-in delete() method

git-svn-id: http://svn.code.sf.net/p/pythonqt/code/trunk@396 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
…king

added removeSignalHandlers()

git-svn-id: http://svn.code.sf.net/p/pythonqt/code/trunk@398 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
git-svn-id: http://svn.code.sf.net/p/pythonqt/code/trunk@399 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
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 <[email protected]>
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 <[email protected]>
Co-authored-by: Pat Marion <[email protected]>
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.
@ericheim
Copy link
Author

Rebased branch on patched-5. This branch is a fork of the new PythonQt version 3.0 from sourceforge with updated CMake build system to work with Qt 5 & 4.

jcfr added a commit to jcfr/PythonQt that referenced this pull request Feb 18, 2016
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 Feb 18, 2016

Closing this PR. Superseded by #39

@jcfr jcfr closed this Feb 18, 2016
mwoehlke-kitware pushed a commit to mwoehlke-kitware/PythonQt that referenced this pull request May 23, 2016
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 added a commit that referenced this pull request Jan 17, 2017
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 #38)
 * Arnaud Barre (@Alzathar):See #15
 * Eric Heim (@eric-h):See #36
jcfr added a commit that referenced this pull request Jun 11, 2017
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 #38)
 * Arnaud Barre (@Alzathar):See #15
 * Eric Heim (@eric-h):See #36
jcfr added a commit that referenced this pull request Jun 11, 2017
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 #38)
 * Arnaud Barre (@Alzathar):See #15
 * Eric Heim (@eric-h):See #36
jcfr added a commit that referenced this pull request Aug 8, 2017
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 #38)
 * Arnaud Barre (@Alzathar):See #15
 * Eric Heim (@eric-h):See #36
jcfr added a commit that referenced this pull request Apr 1, 2019
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 #38)
 * Arnaud Barre (@Alzathar):See #15
 * Eric Heim (@eric-h):See #36
jcfr added a commit that referenced this pull request Sep 5, 2019
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 #38)
 * Arnaud Barre (@Alzathar):See #15
 * Eric Heim (@eric-h):See #36
jcfr added a commit that referenced this pull request Aug 2, 2022
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 #38)
 * Arnaud Barre (@Alzathar):See #15
 * Eric Heim (@eric-h):See #36
jamesobutler pushed a commit to jamesobutler/PythonQt that referenced this pull request Dec 12, 2023
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
jamesobutler pushed a commit to jamesobutler/PythonQt that referenced this pull request Dec 13, 2023
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
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.

3 participants