Commit Graph

21 Commits

Author SHA1 Message Date
Matthias Koefferlein ed20ced941 Using data holder approach also for Qt4 QImage 2023-03-27 21:59:41 +02:00
Matthias Koefferlein 80987a6408 Provide more lifetime management in Qt bindings also for Qt4 2023-03-26 22:51:06 +02:00
Matthias Koefferlein 4966601bd1 Updated Qt4 bindings 2021-12-11 14:05:09 +01:00
Matthias Koefferlein 96650cb65d WIP: Qt4 compatibility, cleanup, version bumped 2021-12-05 17:03:16 +01:00
Matthias Koefferlein 8ad943ebc6 WIP: compatibility of C++ API generation with Qt4 2021-11-27 01:16:03 +01:00
Matthias Koefferlein 6496a71b5b Removed is_of_type() of gsi::Class which is not needed and appears to cause problems on M1 ARM 2021-05-19 22:40:14 +02:00
Matthias Köfferlein b968f2b47f
#730: providing a new Qt module named QtUiTools for QUiLoader class s… (#735)
* #730: providing a new Qt module named QtUiTools for QUiLoader class support.

* Fixed a compile error on Mac

* Added QtUiTools to some more places

* Fixed a linker issue in the QtUiTools Python lib

* On occasion fixed a infinite recursion problem in the debugger

The recursion happened because by mistake I instantiated a
QApplication inside an in-application Python script. This
crashed the debugger due to infinite recursion. This is not
a real use case but to prevent similar issues, a recursion
sentinel was added.

* Removed QCoreApplication#notify from script bindings

Reasoning: "notify" made standalone scripts using QApplication and
QUiLoader virtually impossible.

Problem description:
- When a QApplication object is instantiated, e.g. in Python, the Qt binding
  will install reimplementation hooks as the object may be dynamically
  extended.
- A notify is virtual this means the *every* "notify" call in the application
  is routed through the interpreter.
- For one thing this will slow down the application
- But as "notify" is called a zillion times this has more than this side effect.
- Specifically "notify" is called from within the QWidget constructor to
  indicate a new widget. Then, if a QDialog for example is instatiated, it's
  base class constructor will call "notify" when the object isn't ready yet.
- This has another severe side effect: as the object isn't ready yet, it gets
  registered in the Python space with the wrong class and QDialog is not visible
  as such.

To mitigate these problems, the most efficient solution is to disable "notify"
in general. There is hardly any use case in a script environment (in C++,
apart from hacking the only reasonable use case is exception handling, but
this does not apply to scripts). For providing the call functionality of
"notify" you should better use "postEvent" or "sendEvent" anyway.

So farewell QCoreApplication.notify ...

* Fixed python test for QtUiTools module

* Fixed UiTools test on Qt4 - QUiLoader needs an application object

Co-authored-by: Kazunari Sekigawa <kazunari.sekigawa@gmail.com>
2021-02-25 21:29:21 +01:00
Matthias Koefferlein d31f87f053 Some issues with the byte array binding fixed, less ambiguitites with Qt bindings, tests added. 2021-01-24 23:44:40 +01:00
Matthias Köfferlein 59ee6b6a83
Fixed #629 (timeout event of QTimer not present on Qt5) (#631)
In addition, the "destroyed" and "objectNameChanged" signals
were added (specifically to QObject).

The API binding for Qt5 was updated which adds some events.
2020-09-14 18:34:28 +02:00
Matthias Köfferlein 69e7704430
Issue 501 (#505)
* Fixed #501 (more Qt ownership management) - this commit contains some more changes because I had to regenerate the Qt binding sources.

* Fixed #501 (Qt object ownership transfer) - repairs, added tests

* Updated Jenkinsfile to not publish a PR build

* Update Jenkinsfile - exclude PR's from build
2020-02-21 18:25:22 +01:00
Matthias Koefferlein a20c3259bf WIP: refactored mkqtdecl configuration (common part factored out), fixed .pro file dependencies 2018-06-05 23:21:15 +02:00
Matthias Koefferlein 4fda7b2a50 WIP: added gui argument to QApplication, fixed documentation of virtual methods. 2018-06-05 22:29:34 +02:00
Matthias Koefferlein 40b2e9a1a5 WIP: usable constructors for QApplication and related. 2018-06-02 22:21:59 +02:00
Matthias Koefferlein ea31e5bcde WIP: removed old Qt5 binding code, fixed a segfault (static argc), enabled pya without interpreter 2018-06-02 02:03:14 +02:00
Matthias Koefferlein 6468bb7ab9 WIP: refactoring of GSI structure for separated modules. 2018-05-30 00:39:58 +02:00
Matthias Koefferlein 53328d1767 Merge branch 'macos-build' from kazzz 2018-01-14 17:29:59 +01:00
Matthias Koefferlein d11e2ed8a6 Fixed #62 (QXmlSimpleReader#parse cannot be called) 2018-01-10 20:21:56 +01:00
Matthias Koefferlein 8003d1bb47 Merge branch 'master' into macos-build-on-master 2018-01-02 23:37:45 +01:00
Matthias Koefferlein 28ff493de7 Replaced patch by generated code
The Qt4/5 bindings are generated automatically. Hence any manual
patches are bound to become lost on the next generation run.

This commit removes symbols which are not available on MacOS
by a code-generation solution.

These symbols are only required for WindowsCE so their
unavailability on other systems is not a big loss.
2017-12-17 15:30:37 +01:00
Matthias Koefferlein ad741d0eb7 Fixed #36: harding against destruction of object inside event handler
Plus: declare the form builder to return a new
widget object (the way it is).
2017-12-16 01:45:35 +01:00
Matthias Koefferlein 1f60e7729e Qt signals can be bound to functions with less args in Python
With this change it is possible to bind signals to functions
accepting less arguments. For example:

    def triggered():
      ...

    b = pya.QPushButton()
    b.clicked(triggered)
    b.emit_clicked(True)

wasn't working before since triggered() gets one parameter
(checked) and the call fails. Now, additional parameters are
ignored.
2017-02-24 23:48:47 +01:00