Feature #271

Feature #189: GUI: implement prototype(s), decide about architecture

Implement PyQt4 prototype

Added by pospelov over 7 years ago. Updated about 7 years ago.

Status:RejectedStart date:26 Apr 2013
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Write PyQt GUI prototype which fully reproduces the functionality of our existing C++ GUI


#1 Updated by pospelov over 7 years ago

  • Status changed from Backlog to Sprint

#2 Updated by pospelov over 7 years ago

  • Target version set to Sprint 13

#3 Updated by herck over 7 years ago

  • Description updated (diff)

#4 Updated by pospelov over 7 years ago

  • % Done changed from 0 to 10

The development of py-qt prototype has been started in ./BornAgain/GUI/pytgui. The initial ideas was to reproduce the functionality of existing BornAgain C++ prototype using python. Since our C++ GUI uses complicated custom Qt widgets, it was decided not to port them on pure Python (too much work), but compile them into separate library and use this library from python. Given approach is used in Avogadro and Orange frameworks, so we were not reinventing the wheel.

This goal has been partly achieved. C++ Qt widgets were compiled with boost-python into the library which can be imported in Python in such way, that PyQt widgets communicate via boost-python with C++ Qt widgets.
Unfortunately, some bugs are still there and our first PyQt application still crashes.

The technical problem here, as usual, the ownership of objects. Qt originally was not created for python. Qt widgets often owns other Qt widgets and take care about they deletion. Python also owns all objects and takes care about they deletion. PyQt is the guy, who resolve this problem and takes care about passing ownership from PyQt to Qt and back.
See http://stackoverflow.com/questions/11945183/what-are-good-practices-for-avoiding-crashes-hangs-in-pyqt

When we tried to extend PyQt with our custom C++ widgets, we had to deal with the same problem of correct passing of ownership. So far there is a bug somewhere.

Possible continuation:
0) try to find the bug and continue as before (C++ Qt <-> boost/python <-> PyQt gui)
1) Not to use custom C++ Qt widgets at all. Always write bare python PyQt code.
2) Try to expose C++ Qt widgets in python, as we already tried, but using another approach (SIP).
3) Continue with C++ gui development.

I'm taking a pause with this issue. It's free now.

#5 Updated by pospelov over 7 years ago

  • Target version deleted (Sprint 13)

#6 Updated by pospelov over 7 years ago

  • Status changed from Sprint to Backlog

#7 Updated by pospelov over 7 years ago

  • Assignee deleted (pospelov)

#8 Updated by pospelov about 7 years ago

  • Status changed from Backlog to Rejected

Also available in: Atom PDF