From frank at ohufx.com Mon Jul 2 05:43:54 2018 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Mon, 2 Jul 2018 15:43:54 +1200 Subject: [PySide] adding buttons to table view in an efficient manner Message-ID: <91268ac8-51ae-2a65-3d8d-f24d2868d144@ohufx.com> Hi all, this seems to come up a lot but I still don't have a routine for the solution so I wanted to see what other thinks: Task: write a table view for an unknown amount of rows, and each row needs to have a progressbar and two buttons. The progressbar is covered by a super simple custom paint method that just fills the option rectangle (I found using /QtGui.QApplication.style().drawControl /was too slow for a large amount of rows and causes jerky resizing behaviour). As for the buttons I am having the view's viewportEvent (event type=QtCore.QEvent.Type.Paint) loop over the model's rows, checking each row's visualRect() against the viewport. If the row is currently visible I open a persistent editor for it, otherwise I close the persistent editor. The delegate's createEditor() method takes care of the required signal/slot connections. This seems to work ok, but still seems a bit jerky when resizing a large window with lots o rows. The other approach I am contemplating is to draw rendered buttons as pixmaps into the cells and only swap them out for actual buttons on mouse over. I'm sure the latter will make things a lot snappier, so should be worth the re-write?! Does anybody have any input on this? Cheers, frank -- ohufxLogo 50x50 *vfx compositing | *workflow customisation and consulting * * ** Your gateway to over 1,000 free tools... right inside of Nuke -------------- next part -------------- An HTML attachment was scrubbed... URL: From Cristian.Maureira-Fredes at qt.io Fri Jul 6 10:55:38 2018 From: Cristian.Maureira-Fredes at qt.io (=?UTF-8?Q?Cristi=c3=a1n_Maureira-Fredes?=) Date: Fri, 6 Jul 2018 10:55:38 +0200 Subject: [PySide] Weekly update 05.06.2018 Message-ID: <13723200-2f86-0323-370a-dd3d75b7e7a9@qt.io> Hello, As you maybe noticed, we were a bit away during the last weeks regarding development notes, and that was due to the summer break. In any case, we have been still working on many things, and you can always check: https://wiki.qt.io/Qt_for_Python_Development_Notes The main goal during the last weeks after the release have been fixing most of the issues that our community reported. Besides the bug fixing, we have been focusing on polishing the binding generation process. More importantly, besides defining internally what are the next steps of the project, we would like to know what do you think. We want you to share your ideas, and then shape the future Qt for Python together. We currently have three main categories in: https://wiki.qt.io/Qt_for_Python/Suggestions if you feel like creating a new one, go for it. Many users have been asking for more examples/tutorials so feel free to tell us which topics you would like to see in our official documentation. Cheers! -- Cristian Maureira-Fredes Software Engineer The Qt Company GmbH Rudower Chaussee 13 D-12489 Berlin Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B -- From redstone-cold at 163.com Mon Jul 9 02:54:31 2018 From: redstone-cold at 163.com (Zhao Lee) Date: Mon, 9 Jul 2018 08:54:31 +0800 (CST) Subject: [PySide] Weekly update 05.06.2018 In-Reply-To: <13723200-2f86-0323-370a-dd3d75b7e7a9@qt.io> References: <13723200-2f86-0323-370a-dd3d75b7e7a9@qt.io> Message-ID: <47954707.20.1647c886685.Coremail.redstone-cold@163.com> I would suggest Qt for Python on Android and iOS APPs development support with examples/tutorials, this is what I am dreaming for . Mobile APPs development support would also make Qt for Python more competitive than PyQt. 在2018年07月06 16时55分, "Cristián Maureira-Fredes"写道: Hello, As you maybe noticed, we were a bit away during the last weeks regarding development notes, and that was due to the summer break. In any case, we have been still working on many things, and you can always check: https://wiki.qt.io/Qt_for_Python_Development_Notes The main goal during the last weeks after the release have been fixing most of the issues that our community reported. Besides the bug fixing, we have been focusing on polishing the binding generation process. More importantly, besides defining internally what are the next steps of the project, we would like to know what do you think. We want you to share your ideas, and then shape the future Qt for Python together. We currently have three main categories in: https://wiki.qt.io/Qt_for_Python/Suggestions if you feel like creating a new one, go for it. Many users have been asking for more examples/tutorials so feel free to tell us which topics you would like to see in our official documentation. Cheers! -- Cristian Maureira-Fredes Software Engineer The Qt Company GmbH Rudower Chaussee 13 D-12489 Berlin Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B -- _______________________________________________ PySide mailing list PySide at qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at pythonlibrary.org Mon Jul 9 14:56:02 2018 From: mike at pythonlibrary.org (Mike Driscoll) Date: Mon, 9 Jul 2018 07:56:02 -0500 Subject: [PySide] Weekly update 05.06.2018 In-Reply-To: <47954707.20.1647c886685.Coremail.redstone-cold@163.com> References: <13723200-2f86-0323-370a-dd3d75b7e7a9@qt.io> <47954707.20.1647c886685.Coremail.redstone-cold@163.com> Message-ID: On Sun, Jul 8, 2018 at 7:54 PM, Zhao Lee wrote: > I would suggest Qt for Python on Android and iOS APPs development support > with examples/tutorials, this is what I am dreaming for . > Mobile APPs development support would also make Qt for Python more > competitive than PyQt. > > Adding mobile support to Qt for Python would bring it into parity with PyQt, which already has that support - http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html But I would like that as well. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at mycontent.gr Thu Jul 19 02:10:35 2018 From: info at mycontent.gr (info at mycontent.gr) Date: Thu, 19 Jul 2018 10:10:35 +1000 Subject: [PySide] Python bindings for Qt/C++ library (advice needed on best practices) Message-ID: <18208178-0294-3e66-d009-976ce9f66e0c@mycontent.gr> Dear all, first of all congratulations and thanks to the PySide2 team for a great project. After going through the blog post at http://blog.qt.io/blog/2018/05/31/write-python-bindings/ on creating Python bindings for a C++ library with Shiboken, a few questions arise when thinking about a bigger/real-life project. I suspect these questions will come up frequently as people try to build Python bindings for their projects, so I would like to volunteer to collect the answers that I hope to get from this mailing list into a tutorial-style document (if the team is interested in this!) Suppose that we have a Qt-based C++ library, for which we would like to create Python bindings. Many library classes are subclasses of QObject. There are several methods accepting QString arguments and returning QLists, QHashes, QMaps, as well as pointers to the library’s objects. Suppose that the library uses QtSql and QtXml (and many elements of QtCore) internally, but these objects need not be exposed to the user. In most use cases, the users of the bindings will not need the Qt user interface classes, as they will be writing automation scripts. The library itself does not depend on QtGui, QtWidgets etc. What would be the best course of action: 1. Write a thin interface layer to the library using only C++ primitives and STL types, like std::string, std::list, so that all interfaces that will be exposed to Python accept and return standard library constructs? 2. Create Python bindings with Qt objects as arguments? In the first case, how can we keep the dependencies for library users to a minimum? QtCore, QtSql and QtXml are necessary for the functioning of the library, but the Python bindings of these Qt libraries, normally should not be necessary (is this correct?). In the second case, how can we package the library in such a way that the required PySide2 dependencies are installed automatically (preferably using pip)? How can we keep the dependencies to a minimum? Thank you very much for your time! Kind regards, George Christodoulides From alexandru.croitor at qt.io Thu Jul 19 09:56:12 2018 From: alexandru.croitor at qt.io (Alexandru Croitor) Date: Thu, 19 Jul 2018 07:56:12 +0000 Subject: [PySide] Python bindings for Qt/C++ library (advice needed on best practices) In-Reply-To: <18208178-0294-3e66-d009-976ce9f66e0c@mycontent.gr> References: <18208178-0294-3e66-d009-976ce9f66e0c@mycontent.gr> Message-ID: Hi, For 1) if the bindings for your library don't expose any Qt classes to Python, then yes, you don't need to ship the QtCore python module, etc. You do need QtCore and QtXmlPatterns for building and running shiboken though. But deployment wise, you will only need Qt libraries and libshiboken, and the generated module for your library. You won't need PySide2 libraries. For 2) it's more of a deployment question, which for now users have to figure out for themselves based on their use cases. PyInstaller helps in this respect. And if you plan to publish your bindings to PyPi, I suspect there is some way (requirements.txt or similar) to specify that the PySide2 package needs to be installed as well. > On 19. Jul 2018, at 02:10, info at mycontent.gr wrote: > > Dear all, > > first of all congratulations and thanks to the PySide2 team for a great project. > > After going through the blog post at http://blog.qt.io/blog/2018/05/31/write-python-bindings/ on creating Python bindings for a C++ library with Shiboken, a few questions arise when thinking about a bigger/real-life project. I suspect these questions will come up frequently as people try to build Python bindings for their projects, so I would like to volunteer to collect the answers that I hope to get from this mailing list into a tutorial-style document (if the team is interested in this!) > > Suppose that we have a Qt-based C++ library, for which we would like to create Python bindings. > Many library classes are subclasses of QObject. There are several methods accepting QString arguments and returning QLists, QHashes, QMaps, as well as pointers to the library’s objects. > Suppose that the library uses QtSql and QtXml (and many elements of QtCore) internally, but these objects need not be exposed to the user. > In most use cases, the users of the bindings will not need the Qt user interface classes, as they will be writing automation scripts. The library itself does not depend on QtGui, QtWidgets etc. > > What would be the best course of action: > 1. Write a thin interface layer to the library using only C++ primitives and STL types, like std::string, std::list, so that all interfaces that will be exposed to Python accept and return standard library constructs? > 2. Create Python bindings with Qt objects as arguments? > > In the first case, how can we keep the dependencies for library users to a minimum? QtCore, QtSql and QtXml are necessary for the functioning of the library, but the Python bindings of these Qt libraries, normally should not be necessary (is this correct?). > In the second case, how can we package the library in such a way that the required PySide2 dependencies are installed automatically (preferably using pip)? How can we keep the dependencies to a minimum? > > Thank you very much for your time! > > Kind regards, > > George Christodoulides > > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From info at mycontent.gr Fri Jul 20 01:49:02 2018 From: info at mycontent.gr (info at mycontent.gr) Date: Fri, 20 Jul 2018 01:49:02 +0200 Subject: [PySide] Python bindings for Qt/C++ library (advice needed on best practices) In-Reply-To: References: <18208178-0294-3e66-d009-976ce9f66e0c@mycontent.gr> Message-ID: <35f8eec2-3f0b-6ac0-0cb8-a2592c290758@mycontent.gr> Hello Alexandru, thank you for your reply, that clarifies things. In the first scenario (abstraction layer using the STL): - There is the added advantage that one could use SWIG to create bindings to multiple languages (e.g. R). This is the approach taken for example in a library like SuperElastix (https://github.com/SuperElastix/SimpleElastix), but this means that the entire library would essentially be rewritten to use STL containers and basic types. - An obvious disadvantage is that one needs to constantly convert between QString and std::string, QList and std::vector, QMap and std::map... Apart from the fact that all this code will need to be maintained, have there been any benchmarks on the performance degradation incurred when doing these conversion? In fact, does anybody know of a library that has taken this approach ("Qt inside, STL to the outside world") ? In the second scenario (Qt types used as arguments to the Python bindings) - Creating bindings for another language such as R is no longer straightforward. - It is indeed a deployment question, that can be solved with requirements.txt for PIP. For this reason, actually, it may be helpful to modularize the PySide2 bindings along the lines of Qt's modules. If all that's needed for a library are the Py bindings to basic QtCore objects, then it would be preferable to be able to include a dependency only these bindings (something like pip install PySide2QtCore). I saw on the blog that you are considering such a possibility, that's good to hear! This scenario is the approach taken by the QGIS team, for example. Quoting from their website: "PyQGIS bindings depend on SIP and PyQt4. The reason for using SIP instead of more widely used SWIG is that the whole QGIS code depends on Qt libraries. Python bindings for Qt (PyQt) are done also using SIP and this allows seamless integration of PyQGIS with PyQt." (replace SIP with shiboken2 and PyQt with PySide2 and you have our scenario). Any other pointers to real-life libraries that had to deal with these issues will be greatly appreciated. thank you for your time George On 19/07/2018 09:56 πμ, Alexandru Croitor wrote: > Hi, > > For 1) if the bindings for your library don't expose any Qt classes to Python, then yes, you don't need to ship the QtCore python module, etc. You do need QtCore and QtXmlPatterns for building and running shiboken though. But deployment wise, you will only need Qt libraries and libshiboken, and the generated module for your library. You won't need PySide2 libraries. > > For 2) it's more of a deployment question, which for now users have to figure out for themselves based on their use cases. PyInstaller helps in this respect. And if you plan to publish your bindings to PyPi, I suspect there is some way (requirements.txt or similar) to specify that the PySide2 package needs to be installed as well. >> On 19. Jul 2018, at 02:10, info at mycontent.gr wrote: >> >> Dear all, >> >> first of all congratulations and thanks to the PySide2 team for a great project. >> >> After going through the blog post at http://blog.qt.io/blog/2018/05/31/write-python-bindings/ on creating Python bindings for a C++ library with Shiboken, a few questions arise when thinking about a bigger/real-life project. I suspect these questions will come up frequently as people try to build Python bindings for their projects, so I would like to volunteer to collect the answers that I hope to get from this mailing list into a tutorial-style document (if the team is interested in this!) >> >> Suppose that we have a Qt-based C++ library, for which we would like to create Python bindings. >> Many library classes are subclasses of QObject. There are several methods accepting QString arguments and returning QLists, QHashes, QMaps, as well as pointers to the library’s objects. >> Suppose that the library uses QtSql and QtXml (and many elements of QtCore) internally, but these objects need not be exposed to the user. >> In most use cases, the users of the bindings will not need the Qt user interface classes, as they will be writing automation scripts. The library itself does not depend on QtGui, QtWidgets etc. >> >> What would be the best course of action: >> 1. Write a thin interface layer to the library using only C++ primitives and STL types, like std::string, std::list, so that all interfaces that will be exposed to Python accept and return standard library constructs? >> 2. Create Python bindings with Qt objects as arguments? >> >> In the first case, how can we keep the dependencies for library users to a minimum? QtCore, QtSql and QtXml are necessary for the functioning of the library, but the Python bindings of these Qt libraries, normally should not be necessary (is this correct?). >> In the second case, how can we package the library in such a way that the required PySide2 dependencies are installed automatically (preferably using pip)? How can we keep the dependencies to a minimum? >> >> --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus From alexandru.croitor at qt.io Fri Jul 20 11:08:20 2018 From: alexandru.croitor at qt.io (Alexandru Croitor) Date: Fri, 20 Jul 2018 09:08:20 +0000 Subject: [PySide] Python bindings for Qt/C++ library (advice needed on best practices) In-Reply-To: <35f8eec2-3f0b-6ac0-0cb8-a2592c290758@mycontent.gr> References: <18208178-0294-3e66-d009-976ce9f66e0c@mycontent.gr> <35f8eec2-3f0b-6ac0-0cb8-a2592c290758@mycontent.gr> Message-ID: <0C02FDDD-B334-47B2-A5ED-7BD224824F50@qt.io> Personally I am unaware of such libraries. Consumers usually use Qt For Python, and only come around to interact when something is wrong, or when they don't know how to do something. IMO success stories are less frequently reported back, not due to not being successful, but rather if it works, nobody says anything. More success feedback is obviously welcome. On 20. Jul 2018, at 01:49, info at mycontent.gr wrote: Hello Alexandru, thank you for your reply, that clarifies things. In the first scenario (abstraction layer using the STL): - There is the added advantage that one could use SWIG to create bindings to multiple languages (e.g. R). This is the approach taken for example in a library like SuperElastix (https://github.com/SuperElastix/SimpleElastix), but this means that the entire library would essentially be rewritten to use STL containers and basic types. - An obvious disadvantage is that one needs to constantly convert between QString and std::string, QList and std::vector, QMap and std::map... Apart from the fact that all this code will need to be maintained, have there been any benchmarks on the performance degradation incurred when doing these conversion? In fact, does anybody know of a library that has taken this approach ("Qt inside, STL to the outside world") ? In the second scenario (Qt types used as arguments to the Python bindings) - Creating bindings for another language such as R is no longer straightforward. - It is indeed a deployment question, that can be solved with requirements.txt for PIP. For this reason, actually, it may be helpful to modularize the PySide2 bindings along the lines of Qt's modules. If all that's needed for a library are the Py bindings to basic QtCore objects, then it would be preferable to be able to include a dependency only these bindings (something like pip install PySide2QtCore). I saw on the blog that you are considering such a possibility, that's good to hear! This scenario is the approach taken by the QGIS team, for example. Quoting from their website: "PyQGIS bindings depend on SIP and PyQt4. The reason for using SIP instead of more widely used SWIG is that the whole QGIS code depends on Qt libraries. Python bindings for Qt (PyQt) are done also using SIP and this allows seamless integration of PyQGIS with PyQt." (replace SIP with shiboken2 and PyQt with PySide2 and you have our scenario). Any other pointers to real-life libraries that had to deal with these issues will be greatly appreciated. thank you for your time George On 19/07/2018 09:56 πμ, Alexandru Croitor wrote: Hi, For 1) if the bindings for your library don't expose any Qt classes to Python, then yes, you don't need to ship the QtCore python module, etc. You do need QtCore and QtXmlPatterns for building and running shiboken though. But deployment wise, you will only need Qt libraries and libshiboken, and the generated module for your library. You won't need PySide2 libraries. For 2) it's more of a deployment question, which for now users have to figure out for themselves based on their use cases. PyInstaller helps in this respect. And if you plan to publish your bindings to PyPi, I suspect there is some way (requirements.txt or similar) to specify that the PySide2 package needs to be installed as well. On 19. Jul 2018, at 02:10, info at mycontent.gr wrote: Dear all, first of all congratulations and thanks to the PySide2 team for a great project. After going through the blog post at http://blog.qt.io/blog/2018/05/31/write-python-bindings/ on creating Python bindings for a C++ library with Shiboken, a few questions arise when thinking about a bigger/real-life project. I suspect these questions will come up frequently as people try to build Python bindings for their projects, so I would like to volunteer to collect the answers that I hope to get from this mailing list into a tutorial-style document (if the team is interested in this!) Suppose that we have a Qt-based C++ library, for which we would like to create Python bindings. Many library classes are subclasses of QObject. There are several methods accepting QString arguments and returning QLists, QHashes, QMaps, as well as pointers to the library’s objects. Suppose that the library uses QtSql and QtXml (and many elements of QtCore) internally, but these objects need not be exposed to the user. In most use cases, the users of the bindings will not need the Qt user interface classes, as they will be writing automation scripts. The library itself does not depend on QtGui, QtWidgets etc. What would be the best course of action: 1. Write a thin interface layer to the library using only C++ primitives and STL types, like std::string, std::list, so that all interfaces that will be exposed to Python accept and return standard library constructs? 2. Create Python bindings with Qt objects as arguments? In the first case, how can we keep the dependencies for library users to a minimum? QtCore, QtSql and QtXml are necessary for the functioning of the library, but the Python bindings of these Qt libraries, normally should not be necessary (is this correct?). In the second case, how can we package the library in such a way that the required PySide2 dependencies are installed automatically (preferably using pip)? How can we keep the dependencies to a minimum? --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus _______________________________________________ PySide mailing list PySide at qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Sat Jul 21 07:09:54 2018 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Sat, 21 Jul 2018 17:09:54 +1200 Subject: [PySide] checking for installedent event filters Message-ID: <1ad42b04-8f11-5b3e-acb2-ff1e0e1b907b@ohufx.com> Hi, I have an interesting scenario where I need to install an event filter on the fly from inside another event filter. This is because the widget I install the first event filter on changes it's window() inside the main application under certain circumstances (out of my control), and I need to know about the widget.window()'s move event in order for the main event filter to work properly. Anyway, to avoid installing the same filter multiple times I currently do this inside the first event filter:     def eventFilter(self, obj, event):         if event.type() == QtCore.QEvent.UpdateRequest:             # obj.window() may or may not have change at this stage             obj.window().removeEventFilter(self.window_ef)             obj.window().installEventFilter(self.window_ef) Is there a better way? I.e. is there a way to check which event filters are already installed? Cheers, frank From david.anes at gmail.com Sat Jul 21 16:59:39 2018 From: david.anes at gmail.com (David Anes) Date: Sat, 21 Jul 2018 16:59:39 +0200 Subject: [PySide] checking for installedent event filters In-Reply-To: <1ad42b04-8f11-5b3e-acb2-ff1e0e1b907b@ohufx.com> References: <1ad42b04-8f11-5b3e-acb2-ff1e0e1b907b@ohufx.com> Message-ID: Hi Frank, I would track the window object on my own on every call to the event filter, and if it's different, then do the removeEventFilter from the old one, installEvent on the new one and update the tracked object. Cheers, David. 2018-07-21 7:09 GMT+02:00 Frank Rueter | OHUfx : > Hi, > > I have an interesting scenario where I need to install an event filter on > the fly from inside another event filter. > > This is because the widget I install the first event filter on changes > it's window() inside the main application under certain circumstances (out > of my control), and I need to know about the widget.window()'s move event > in order for the main event filter to work properly. > > Anyway, to avoid installing the same filter multiple times I currently do > this inside the first event filter: > def eventFilter(self, obj, event): > if event.type() == QtCore.QEvent.UpdateRequest: > # obj.window() may or may not have change at this stage > obj.window().removeEventFilter(self.window_ef) > obj.window().installEventFilter(self.window_ef) > > Is there a better way? I.e. is there a way to check which event filters > are already installed? > > Cheers, > frank > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -- David "kraptor" Anes Alcolea * @kraptor * linkedin.com/in/davidanes -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Mon Jul 23 02:57:20 2018 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Mon, 23 Jul 2018 12:57:20 +1200 Subject: [PySide] checking for installedent event filters In-Reply-To: References: <1ad42b04-8f11-5b3e-acb2-ff1e0e1b907b@ohufx.com> Message-ID: Ah yes, good point. That sounds much cleaner, thanks! Cheers, frank On 22/07/18 2:59 AM, David Anes wrote: > Hi Frank, > > I would track the window object on my own on every call to the event > filter, and if it's different, then do the removeEventFilter from the > old one, installEvent on the new one and update the tracked object. > > Cheers, > David. > > 2018-07-21 7:09 GMT+02:00 Frank Rueter | OHUfx >: > > Hi, > > I have an interesting scenario where I need to install an event > filter on the fly from inside another event filter. > > This is because the widget I install the first event filter on > changes it's window() inside the main application under certain > circumstances (out of my control), and I need to know about the > widget.window()'s move event in order for the main event filter to > work properly. > > Anyway, to avoid installing the same filter multiple times I > currently do this inside the first event filter: >     def eventFilter(self, obj, event): >         if event.type() == QtCore.QEvent.UpdateRequest: >             # obj.window() may or may not have change at this stage >             obj.window().removeEventFilter(self.window_ef) >             obj.window().installEventFilter(self.window_ef) > > Is there a better way? I.e. is there a way to check which event > filters are already installed? > > Cheers, > frank > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > -- > David "kraptor" Anes Alcolea > * @kraptor > * linkedin.com/in/davidanes -------------- next part -------------- An HTML attachment was scrubbed... URL: From hindy.ilan at gmail.com Thu Jul 26 07:55:08 2018 From: hindy.ilan at gmail.com (=?UTF-8?B?15DXmdec158g15TXmdeg15PXmQ==?=) Date: Thu, 26 Jul 2018 08:55:08 +0300 Subject: [PySide] Start work with PySide2 Message-ID: Dear members I am moving from PyQt to PySide. I managed to install and operate My questions are: Do you have intentions to be part of anaconda? Do you have something like the pyuic5 (That allows using the qt designer)? More critical: Do you have/can recommend for a tool to migrate code from Qt C++ to PySide2 python? (My aim is to be able to use the examples Qt has, for learning) Is there a forum or other organized way to ask technical questions about PySide2 (Lacking this opportunity is one the main reasons I quitted PyQt)? Thanks, Ilan Ilan Hindy e-mail : Hindy.Ilan at gmail.com celular : +972-54-4292112 home : +972-9-9570521 -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Thu Jul 26 08:35:07 2018 From: me at the-compiler.org (Florian Bruhin) Date: Thu, 26 Jul 2018 08:35:07 +0200 Subject: [PySide] Start work with PySide2 In-Reply-To: References: Message-ID: <20180726063507.trt5oyrsf5o6pdl3@hooch.localdomain> Hey, On Thu, Jul 26, 2018 at 08:55:08AM +0300, אילן הינדי wrote: > Do you have/can recommend for a tool to migrate code from Qt C++ to PySide2 > python? > > (My aim is to be able to use the examples Qt has, for learning) There's http://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples and PyQt also comes with many examples which are probably easier to get to work with PySide than the C++ code. Other than that: Probably just whatever text editor you're comfortable with, most of this kind of porting probably can't be automated meaningfully. > Is there a forum or other organized way to ask technical questions about > PySide2 (Lacking this opportunity is one the main reasons I quitted PyQt)? Probably about the same as with PyQt: - A mailinglist - An IRC channel (#pyside/#pyqt on Freenode) - Stackoverflow Florian -- https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc I love long mails! | https://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From Cristian.Maureira-Fredes at qt.io Thu Jul 26 10:33:25 2018 From: Cristian.Maureira-Fredes at qt.io (=?utf-8?B?Q3Jpc3Rpw6FuIE1hdXJlaXJhLUZyZWRlcw==?=) Date: Thu, 26 Jul 2018 08:33:25 +0000 Subject: [PySide] Start work with PySide2 In-Reply-To: References: Message-ID: Hello Ilan, I think the community will be in charge of packaging PySide2 to anaconda, but it seems they have an old version of Qt, so at the moment it would be quite difficult. When you install PySide2 there is a submodule called "pyside2-tools" when you can find "pyside2-uic" to generate a Python class from a UI file. I personally migrate Qt/C++ by hand, you can write the same classes in Python using the private variables from the header files as 'self' python variables, then just adapting the code. The good thing is that of course we also keep Qt API, so most of the steps will be removing data types and removing semi colons. Most of the PySide2 examples are manually written from Qt/C++ so you can probably do it too. For technical questions I recommend you to go to the IRC channel on Freenode #qt-pyside If you don't like IRC, there is a gitter channel that links to IRC, and as Florian stated, there are many other places for you to ask questions: https://wiki.qt.io/Qt_for_Python#Community Cheers ________________________________________ From: PySide on behalf of אילן הינדי Sent: 26 July 2018 07:55:08 To: pyside at qt-project.org Subject: [PySide] Start work with PySide2 Dear members I am moving from PyQt to PySide. I managed to install and operate My questions are: Do you have intentions to be part of anaconda? Do you have something like the pyuic5 (That allows using the qt designer)? More critical: Do you have/can recommend for a tool to migrate code from Qt C++ to PySide2 python? (My aim is to be able to use the examples Qt has, for learning) Is there a forum or other organized way to ask technical questions about PySide2 (Lacking this opportunity is one the main reasons I quitted PyQt)? Thanks, Ilan Ilan Hindy e-mail : Hindy.Ilan at gmail.com celular : +972-54-4292112 home : +972-9-9570521 From Cristian.Maureira-Fredes at qt.io Thu Jul 26 16:37:46 2018 From: Cristian.Maureira-Fredes at qt.io (=?UTF-8?Q?Cristi=c3=a1n_Maureira-Fredes?=) Date: Thu, 26 Jul 2018 16:37:46 +0200 Subject: [PySide] Weekly update 26.07.2018 Message-ID: <3a4442d2-7aaf-0dec-fd5a-26bb6ed6e617@qt.io> Hello, I would like to share with you a summary for the last three meetings we had: 12.07.2018 * There has been a lot of work on Shiboken, improving their functionality and also fixing bugs. * The compatibility development with the future Qt 5.12 already started, since we need to make sure the binding generation process is not being affected. * A couple of patches were included into our code base to be compatible with Python 3.7 * There is effort on providing .pyi files to be compatible with many IDEs to have type hints. 19.07.2018 * We are preparing everything for 5.11.1 release. * Qt for Python is available in PyPi: * http://blog.qt.io/blog/2018/07/17/qt-python-available-pypi/ * We have a few considerations for the release of 5.12 * PySide2 * Mainly focusing on bug fixing. * Mitigate all the issues regarding QVariant. * Improve secondary modules (QML, QtCharts, Qt3D) * Better NumPy integration. * Shiboken2 * Template support for custom binding generation. * Splitting PySide2, Shiboken2 (Module) and Shiboken2 (Generator) * This will happen just at the level of wheel packages, not the repository. * Having a separate shiboken2 package will simplify the generation of custom bindings for 3rd party libraries. * Additionally, we can go deeper and provide separate the PySide2 wheels into Qt-modules subsets (e.g.: Having a wheel with only QtCore, QtGui and QtWidgets) * The mobile integration (Androd, iOS) is not a priority at the moment, but it is part of our future nice-to-have features. 26.07.2018 * 5.11.1 will be released soon. * We had some performance issues with QTableWidget and after a lot of discussion and research we managed to improve our bindings performance: https://bugreports.qt.io/browse/PYSIDE-727 * There has been a lot of development regarding the proper functionality of Shiboken2 attributes: https://bugreports.qt.io/browse/PYSIDE-743 * You can see a detailed explanation on how the modularization of PySide2/Shiboken2 is being done: https://bugreports.qt.io/browse/PYSIDE-749 * A new research topic has been started: * Allow users to write QtCreator plugins with PySide2 * First steps are generating a few bindings for QtCreator * Additionally, we have been able to run 3rdparty scripts interacting directly with QtCreator. If you have questions or comments, we encourage you to follow the discussion in our mailing list or in our IRC channel. Cheers -- Cristian Maureira-Fredes Software Engineer The Qt Company GmbH Rudower Chaussee 13 D-12489 Berlin Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B -- From sivan at omniqueue.com Fri Jul 27 11:13:53 2018 From: sivan at omniqueue.com (Sivan Greenberg) Date: Fri, 27 Jul 2018 12:13:53 +0300 Subject: [PySide] Start work with PySide2 In-Reply-To: References: Message-ID: Hey there, I have quite some experience with porting PyQt to PySide and in general the C++ process Cristian described works the same in Python code, making sure in particular signals and slots follow the PySide scheme and that difference in operating the app Singleton are catered for. I used to use at some point even a script that would replace class names and arguments, and the run the file collecting tracebacks then iterating over them manually to fix the ‘debris’. The fact the project follows closely the Qt interface makes this kind of s no brainer and relatively quick process. Sivan On Thu, 26 Jul 2018 at 11:33 Cristián Maureira-Fredes < Cristian.Maureira-Fredes at qt.io> wrote: > Hello Ilan, > > I think the community will be in charge of packaging PySide2 > to anaconda, but it seems they have an old version of Qt, > so at the moment it would be quite difficult. > > When you install PySide2 there is a submodule called "pyside2-tools" > when you can find "pyside2-uic" to generate a Python class from a UI file. > > I personally migrate Qt/C++ by hand, > you can write the same classes in Python using the private variables > from the header files as 'self' python variables, > then just adapting the code. The good thing is that of course we also > keep Qt API, so most of the steps will be removing data types > and removing semi colons. > Most of the PySide2 examples are manually written from Qt/C++ > so you can probably do it too. > > For technical questions I recommend you to go to the IRC > channel on Freenode #qt-pyside > If you don't like IRC, there is a gitter channel that links > to IRC, and as Florian stated, there are many other > places for you to ask questions: > https://wiki.qt.io/Qt_for_Python#Community > > Cheers > > > > ________________________________________ > From: PySide > on behalf of אילן הינדי > Sent: 26 July 2018 07:55:08 > To: pyside at qt-project.org > Subject: [PySide] Start work with PySide2 > > Dear members > I am moving from PyQt to PySide. > I managed to install and operate > My questions are: > Do you have intentions to be part of anaconda? > Do you have something like the pyuic5 (That allows using the qt designer)? > More critical: > Do you have/can recommend for a tool to migrate code from Qt C++ to > PySide2 python? > (My aim is to be able to use the examples Qt has, for learning) > Is there a forum or other organized way to ask technical questions about > PySide2 (Lacking this opportunity is one the main reasons I quitted PyQt)? > Thanks, > Ilan > > > Ilan Hindy > e-mail : Hindy.Ilan at gmail.com > celular : +972-54-4292112 > home : +972-9-9570521 > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -- -Sivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From hindy.ilan at gmail.com Sat Jul 28 08:56:08 2018 From: hindy.ilan at gmail.com (=?UTF-8?B?15DXmdec158g15TXmdeg15PXmQ==?=) Date: Sat, 28 Jul 2018 09:56:08 +0300 Subject: [PySide] Access methods in the QMath library Message-ID: Hi, Can you tell how to access methods in the QMath module like qATang etc.. What to import How to access the methods Ilan Hindy e-mail : Hindy.Ilan at gmail.com celular : +972-54-4292112 home : +972-9-9570521 -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Sat Jul 28 09:32:21 2018 From: me at the-compiler.org (Florian Bruhin) Date: Sat, 28 Jul 2018 09:32:21 +0200 Subject: [PySide] Access methods in the QMath library In-Reply-To: References: Message-ID: <20180728073221.vdtj73xeydoehwkd@hooch.localdomain> On Sat, Jul 28, 2018 at 09:56:08AM +0300, אילן הינדי wrote: > Can you tell how to access methods in the QMath module like qATang etc.. From what I can see, QtMath is a header-file with some functions only, and not exposed by PySide. Why not just use Python's math.atan? https://docs.python.org/3/library/math.html#math.atan Florian -- https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc I love long mails! | https://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From Cristian.Maureira-Fredes at qt.io Sat Jul 28 12:40:48 2018 From: Cristian.Maureira-Fredes at qt.io (=?utf-8?B?Q3Jpc3Rpw6FuIE1hdXJlaXJhLUZyZWRlcw==?=) Date: Sat, 28 Jul 2018 10:40:48 +0000 Subject: [PySide] Access methods in the QMath library In-Reply-To: References: Message-ID: Hello, It does not make sense to expose things that are almost in the core of Python, like math operations. I recommend you to use the math module as Florian stated, or any other math-related module. Cheers ________________________________________ From: PySide on behalf of אילן הינדי Sent: 28 July 2018 08:56:08 To: pyside at qt-project.org Subject: [PySide] Access methods in the QMath library Hi, Can you tell how to access methods in the QMath module like qATang etc.. What to import How to access the methods Ilan Hindy e-mail : Hindy.Ilan at gmail.com celular : +972-54-4292112 home : +972-9-9570521 From frank at ohufx.com Sun Jul 29 10:25:25 2018 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Sun, 29 Jul 2018 20:25:25 +1200 Subject: [PySide] QListView with delegate: support drag outside of QApplication Message-ID: Hi all, I have an app that uses two QListViews with delegates. The user can drag ad drop items from one view into the other to create something like a shopping list. So far so good. Now I need to enable the user to also drag an item out of the application entirely. Is it possible to access the drag event data that the list view produces by default, so I don’t have to re-invent the wheel for the already functioning internal drag&drop? Here is a simplified example that just needs support for dragging an item outside of the QApplication. Any tips would be much appreciated. Cheers, frank |import sys from PySide import QtGui, QtCore app = QtGui.QApplication(sys.argv) class MyList(QtGui.QListView): def __init__(self, parent=None): super(MyList, self).__init__(parent) self.setDragEnabled(True) self.setAcceptDrops(True) list1 = MyList() list2 = MyList() model1 = QtGui.QStandardItemModel(list1) model2 = QtGui.QStandardItemModel(list1) model2.setItemPrototype(QtGui.QStandardItem()) foods = [ 'Cookie dough', 'Hummus', 'Spaghetti', 'Dal makhani', 'Chocolate whipped cream' ] for food in foods: item = QtGui.QStandardItem(food) model1.appendRow(item) list1.setModel(model1) list2.setModel(model2) w = QtGui.QSplitter() w.addWidget(list1) w.addWidget(list2) w.show() w.raise_() app.exec_() | ​ -- ohufxLogo 50x50 *vfx compositing | *workflow customisation and consulting * * ** Your gateway to over 1,000 free tools... right inside of Nuke -------------- next part -------------- An HTML attachment was scrubbed... URL: