From akabaila at pcug.org.au Mon Apr 1 14:35:37 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Mon, 01 Apr 2013 23:35:37 +1100 Subject: [PySide] Resurrecting PySide In-Reply-To: References: Message-ID: <1372411.tToMQLs6Gt@supremo> Hi David, Starting this thread Long Duong has asked for authority to re-organise the wiki and for help to do it. I am willing to help and I offer to do so. I have trimmed this email as it was getting rather long. I was tempted to start a new thread as this thread is getting old, but I will resist the temptation, at least for now. I think you, David, have raised a vital point - the need to help the newbies with their questions. The objective is noble and useful, but it is difficult. It is much easier to prepare good tutorial material for the beginners and it may well be equally or even more attractive to new users. Few years ago I wrote a few tutorials, under the name "PySide- simplicissimus". As an experienced educator I thought I could make best contribution to PySide by addressing my tutorials to real beginners. "PySide-Simplicissimus" is made up of several real newbie tutorial examples with solutions. Most were translated to French and to Japanese by "person or persons unknown". Here is a little table, indicating which modules of PySideSimplicissimus were translated in to language or languages other than original English: "Prerequisites" module French "Close" module French and Japanese "About" module French and Japanese "ShowLicence" module French and Japanese "Combine" module French and Japanese "Alternative Combine" module French and Japanese "Combine All in one" module Japanese "Engineering application" module -- no known translations All the modules are simple newbie exercises, but the last one had a small injection of tiny bit of theory. Is this evidence that really simple, newbie examples are preferred by the newbies as an introduction to PySide? Probably yes. Do we need more simple tutorials for the beginners? I think yes. Some years ago I wrote a simple tutorial program of a reasonably complete simple text editor in PyQt. It is at http://www.diotavelli.net/PyQtWiki/simple and http://www.diotavelli.net/PyQtWiki/simplefinis I am in the process of porting the tutorial to PySide and Python 3.x. If there are no objections, I would like to post it in the PySide newbie tutorial section in a similar style to PySideSimplicissimus: >From wiki/PySideTutorials link to new page PySideSimple from PySideSimple links to probably 4 separate stage pages with return to PySideSimple, which in turn returns to PySideTutorials. I know this wiki (like most wikis) uses a flat file system. That's why a structure or a pseudo structure is so important IMHO. To summarise - as the lists ability to promptly answer newbie questions may be limited, a good set of newbie tutorials is essential. Cheers, Al (aka OldAl) On Wednesday 20 March 2013 11:46:24 David Brandse wrote: One of the things I've noticed about people posting the "PySide is dead" threads seems to be that they will ask a question either here or in IRC and wait a few days for an answer, in the event that they don't get an answer the immediate response seems to be that the project is dead. Perhaps one of the areas that should be focused on is helping out users on the mailing list with problems. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: From lndndev at gmail.com Tue Apr 2 23:23:29 2013 From: lndndev at gmail.com (lndn) Date: Tue, 2 Apr 2013 14:23:29 -0700 Subject: [PySide] PySide Newbie Tutorials Message-ID: On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: > ** > > I am in the process of porting the tutorial to PySide and Python 3.x. If > there are no objections, I would like to post it in the PySide newbie > tutorial section in a similar style to PySideSimplicissimus: > > > > From wiki/PySideTutorials link to new page PySideSimple > > from PySideSimple links to probably 4 separate stage pages with return to > PySideSimple, which in turn returns to PySideTutorials. > > > > Al (aka OldAl) > Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus series were well-written and easy to follow. What modules do you plan on covering in these new tutorials? The tutorials we currently have are great but it's not comprehensive in covering more Qt modules. Here's hoping to see more modules covered in newer tutorials. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc at marchankin.com Tue Apr 2 23:41:34 2013 From: marc at marchankin.com (Marc Hankin) Date: Tue, 2 Apr 2013 14:41:34 -0700 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: Message-ID: Hi. I'm a python newbie and a pyside newbie. I've gone through the zetcode tutorial and the simplicitimus (or whatever it is called), and I still feel crippled in using pyside. I used to teach law at a law school and I like to think about pedagogical issues. So, if you folks want to try out some of your tutorials on me and get my questionable feedback about how to improve your tutorials, I'd be very pleased with the opportunity to give you feedback ... and I confess, I also would like to learn from you. It's really wonderful to follow your emails. The open source python/pyside community is so giving/altruistic that it is fun to follow your emails. I wish I could occupy myself with this stuff full time and never see the nasty interior of a courtroom again. Anyway, thanks again, Marc ******************************************************************** Marc B. Hankin The Law Offices of Marc B. Hankin, Inc. Post Office Box 3668, Beverly Hills, California 90212 (Not for mail:509S.BeverlyDr.) Tel: (310) 552-3005 Fax: (310) 382-2416 Email: marc at marchankin.com Website: www.marchankin.com This e-mail message is generated from the law firm of the Law Offices of Marc B. Hankin, Inc., and may contain information that is confidential and may be privileged as an attorney/client communication or as attorney work product. The information is intended to be disclosed solely to the addressee(s). If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this e-mail information is prohibited. If you have received this e-mail in error, please notify the sender by return e-mail and delete it from your computer system. ******************************************************************** On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: > On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: > >> ** >> >> I am in the process of porting the tutorial to PySide and Python 3.x. If >> there are no objections, I would like to post it in the PySide newbie >> tutorial section in a similar style to PySideSimplicissimus: >> >> >> >> From wiki/PySideTutorials link to new page PySideSimple >> >> from PySideSimple links to probably 4 separate stage pages with return to >> PySideSimple, which in turn returns to PySideTutorials. >> >> >> >> Al (aka OldAl) >> > > Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus > series were well-written and easy to follow. > > What modules do you plan on covering in these new tutorials? The > tutorials we currently have are great but it's not comprehensive in > covering more Qt modules. Here's hoping to see more modules covered in > newer tutorials. > > Thanks! > > _______________________________________________ > 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 akabaila at pcug.org.au Wed Apr 3 00:12:59 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 03 Apr 2013 09:12:59 +1100 Subject: [PySide] spyder not finding pyqt4.6 except with python2.6 (vs. python3.3, 3.1, 2.7) , spyder 2.1.14 and 2.2.0beta4 In-Reply-To: <52363.70.57.247.63.1364924066.squirrel@mail.tigertech.net> References: <52363.70.57.247.63.1364924066.squirrel@mail.tigertech.net> Message-ID: <9682593.h86yu4x8h8@supremo> Hi and thanks for kind words re my posting on pyside at qt-project.org. It seems to me that there is some confusion on qt, pyqt and pyside. PyQt is a Python library of programs that enable python programs to make use of qt libraries. PySide has very similar (the same?) objectives as PyQt. In a commercial environment one could say that PyQt and PySide are competitors. Each is independent of the other and go about similar objectives in a different way. In my limited experience, operating from a kubuntu (ubuntu with KDE desktop environment) with Python 2.x both PySide and PyQt4 run "out of the box" with both downloadable from standard repositories. To my pleasant surprise, PySide also runs seamlessly with Python3. In the days past, PyQt4 had to be compiled from source to run with Python3. It seems that that is still the case today. If I am wrong, please tell me! I quite unfamiliar with spyder-ide. If these ramblings of mine are useful - great. If not, I ask just bear with me. Al. (Algis) On Tuesday 02 April 2013 11:34:26 drc at cognizor.com wrote: > Greetings. > > My goal here is getting python3.3 working the spyder python IDE. (Spyder > 2.1.14 from the git repo is said to work with python3 by Pierre > Raybaut, its major developer, at http://spyder-ide.blogspot.com/ in > the Jan. 24 posting.(The 2.2 series beta4 release of March 12 will not, > he says. And he's right!) > > Neither any other spyder nor pyside are installed in this pure debian OS > (AVlinux 6.0). This seems to be a bug relevant to pyqt4 naming. Can't > tell if pyside would provide a workarounpyside at qt-project.orgd. > > Theoretically qt4 ( "qt4.4+" is specified in the spyder code) should > work since debian package qt 4.7.3-1+b1 is installed. > > python2.6 finds it and starts up spyder with it, thus: > ---------pyside at qt-project.org > python2.6 bootstrap.py > Executing Spyder from source checkout > Revision 2114:b2b019b3abb3, Branch: default > 01. Patched sys.path with > /home/py/tidings/pyacqs/ide/spyder2.1.14/spyderlib.v21 > and > /home/py/tidings/pyacqs/ide/spyder2.1.14/spyderlib.v21/external-py2 > 02. No PySide detected, using PyQt4 if available > 03. Imported Spyder 2.1.14dev3 (Qt 4.6.3 via PyQt4 (API v1) 4.7.3) > 0x. Enforcing parent console (Windows only) > 04. Executing spyder.main() > > ----------- > > But no, the pyqt4 is not found with python3.3, python3.1, and python2.7 > . The same error as produced by the beta arises, namely this: > > ------------ > ide/spyder2.1.14/spyderlib.v21$ python3.3 bootstrap.py > Executing Spyder from source checkout > Revision 2114:b2b019b3abb3, Branch: default > 01. Patched sys.path with /home/.../ide/spyder2.1.14/spyderlib.v21 > and > /home/.../ide/spyder2.1.14/spyderlib.v21/external-py3 > 02. No PySide detected, using PyQt4 if available > Traceback (most recent call last): > File > "/home/py/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/qt/__init__.py", > line 46, in > from PySide import __version__ # analysis:ignore > ImportError: No module named 'PySide' > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File > "/home/py/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > line 39, in check_qt > from spyderlib import qt > File > "/home/py/.../spyder2.1.14/spyderlib.v21/spyderlib/qt/__init__.py", > line 48, in > raise ImportError("Spyder requires PySide or PyQt to be installed") > ImportError: Spyder requires PySide or PyQt to be installed > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "bootstrap.py", line 89, in > from spyderlib import spyder > File "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/spyder.py", > line 50, in > requirements.check_qt() > File > "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > line 49, in check_qt > % (qt_infos['pyqt']+qt_infos['pyside'])) > File > "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > line 24, in show_warning > raise RuntimeError(message) > RuntimeError: Please check Spyder installation requirements: > PyQt4 4.4+ (or PySide 1.0+) is required. > [64234 refs] > py at t9012av6:~/.../ide/spyder2.1.14/spyderlib.v21$ > > ----------- > > Thanks for your help! > > @ Algis: > thanks for your notes posted today on tutorials for pyside, at > http://lists.qt-project.org/pipermail/pyside/2013-April/001209.html > Does pyside work with python3.3 on unix (debian linux, AVlinux6.0)? > >From the elaborate pyside install instructions at pypi.python.org I > >can't > tell. There is definitely need for a clear Tutorial posted > conspicuously! > > @ Pierre: > Many congratulations on your new child. (Read about in the iep > forum.) And Thanks for spyder! > > SC > Dr. S. Candelaria de Ram > drc at cognizor.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From chigga101 at gmail.com Wed Apr 3 00:17:17 2013 From: chigga101 at gmail.com (Matthew Ngaha) Date: Tue, 2 Apr 2013 23:17:17 +0100 Subject: [PySide] WebKit problem Message-ID: i was doing some pyside tutorials, some made use of Qt webkit and gave clear instructions that i should download "libqtwebkit4-declarative." I thought weird Pyside asking me to installl this as it should already come built in. from PySide import QtGui, QtDeclarative, QtWebKit on a .qml file i have type import QtWebKit 1.0 On Windows Vista, Python 3.3 i run the script and this is my error message: http://bpaste.net/show/E5ZRqp92JS2FuWkrGsde/ the path is valid, that dll file it cant find is on the path it looked in. i asked in #qt's irc channel and was told to try installing pyside for Python 2.7 as it might have something to do with issues on Python 3.3. Sure enough it worked fine on 2.7, the folder QtWebKit is exactly the same on both versions, so why is 3.3 returning an error? i don;t use Python 2.7 so this would really be a hassle if i had to use pyside on it. Any solutions to making this work? Do i try reinstalling pyside for 3.3? And also why would a Pyside tutorial instruct us to download this package: "libqtwebkit4-declarative."? doesnt everything we need already come built in? Thanks From a.richi at bluewin.ch Wed Apr 3 00:34:29 2013 From: a.richi at bluewin.ch (Aaron Richiger) Date: Wed, 03 Apr 2013 00:34:29 +0200 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: Message-ID: <515B5CF5.7080102@bluewin.ch> Hello Al and Marc! Many thanks for your offer, good tutorials are always essential for a popular project. I just wanted to have a look at your tuts, but the top five results of a google search after "pyside simplicissimus tutorial" directed me to dead links. So, this would be a good starting point:) We also do not have to reinvent the wheel, there are many examples coming with pyside already, have a look at them, you could probably use some of them, but enrich them with comments and explanations in your HTML. Marcs offer sounds great! It's always great to have "customers" helping designing the "products", because we sometimes can't imagine what's needed or missing for beginners. Having some newbies to test the tutorials would be great I think! Just one note, I think, your tutorials should not cover general python stuff but just PySide related stuff. There are plenty of good python tuts out there, we only need more PySide tuts. I know, that many of the PySide newbies are also python newbies (as Marc), but you could place some links to good python tuts at the beginning or start page of the tutorial and if you use some non-obvious python magic give another link to the specific explanation of this python feature (e.g. when you first use list comprehension). Our tutorials should focus on the important (=PySide) stuff! Happy coding! Aaron Am 02.04.2013 23:41, schrieb Marc Hankin: > Hi. I'm a python newbie and a pyside newbie. > I've gone through the zetcode tutorial and the simplicitimus (or > whatever it is called), and I still feel crippled in using pyside. > I used to teach law at a law school and I like to think about > pedagogical issues. > So, if you folks want to try out some of your tutorials on me and get > my questionable feedback about how to improve your tutorials, I'd be > very pleased with the opportunity to give you feedback ... and I > confess, I also would like to learn from you. > > It's really wonderful to follow your emails. The open source > python/pyside community is so giving/altruistic that it is fun to > follow your emails. I wish I could occupy myself with this stuff full > time and never see the nasty interior of a courtroom again. > > Anyway, thanks again, > > Marc > > > > ******************************************************************** > > Marc B. Hankin > > The Law Offices of Marc B. Hankin, Inc. > > Post Office Box 3668, Beverly Hills, California 90212 (Not for > mail:509S.BeverlyDr.) > > Tel: (310) 552-3005 Fax: (310) 382-2416 > > Email: marc at marchankin.com Website: > www.marchankin.com > > This e-mail message is generated from the law firm of the Law Offices > of Marc B. Hankin, Inc., and may contain information that is > confidential and may be privileged as an attorney/client communication > or as attorney work product. The information is intended to be > disclosed solely to the addressee(s). > > If you are not the intended recipient, any disclosure, copying, > distribution or use of the contents of this e-mail information is > prohibited. If you have received this e-mail in error, please notify > the sender by return e-mail and delete it from your computer system. > > ******************************************************************** > > > > On Tue, Apr 2, 2013 at 2:23 PM, lndn > wrote: > > On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila > > wrote: > > I am in the process of porting the tutorial to PySide and > Python 3.x. If there are no objections, I would like to post > it in the PySide newbie tutorial section in a similar style to > PySideSimplicissimus: > > From wiki/PySideTutorials link to new page PySideSimple > > from PySideSimple links to probably 4 separate stage pages > with return to PySideSimple, which in turn returns to > PySideTutorials. > > Al (aka OldAl) > > > Hi Al, the newbie tutorials are a great idea. The > PySideSimplicissimus series were well-written and easy to follow. > > What modules do you plan on covering in these new tutorials? The > tutorials we currently have are great but it's not comprehensive > in covering more Qt modules. Here's hoping to see more modules > covered in newer tutorials. > > Thanks! > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > _______________________________________________ > 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 thoromyr at mac.com Wed Apr 3 00:49:25 2013 From: thoromyr at mac.com (Tim Doty) Date: Tue, 02 Apr 2013 17:49:25 -0500 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: <515B5CF5.7080102@bluewin.ch> References: <515B5CF5.7080102@bluewin.ch> Message-ID: <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> To a point I agree about focusing on PySide, but it doesn't hurt to cover (at least cursorily) some elementary Python as well. Mark Summerfield's excellent book "Rapid GUI Programming with Python and Qt" (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it does cover things. In fact, one of the best things IMO would be if he adapted that book to PySide. Regrettably, I doubt he has the time to do so (http://www.qtrac.eu/pyqtbook.html#pyside). I'm coming from PyQt so I'm not a *complete* newbie, but there is a real advantage to having the content in one place rather than being directed to other tutorials (not to mention the problem with links going stale). Tim Doty On Apr 2, 2013, at 5:34 PM, Aaron Richiger wrote: > Hello Al and Marc! > > Many thanks for your offer, good tutorials are always essential for a popular project. I just wanted to have a look at your tuts, but the top five results of a google search after > "pyside simplicissimus tutorial" > directed me to dead links. So, this would be a good starting point:) > > We also do not have to reinvent the wheel, there are many examples coming with pyside already, have a look at them, you could probably use some of them, but enrich them with comments and explanations in your HTML. > > Marcs offer sounds great! It's always great to have "customers" helping designing the "products", because we sometimes can't imagine what's needed or missing for beginners. Having some newbies to test the tutorials would be great I think! > > Just one note, I think, your tutorials should not cover general python stuff but just PySide related stuff. There are plenty of good python tuts out there, we only need more PySide tuts. I know, that many of the PySide newbies are also python newbies (as Marc), but you could place some links to good python tuts at the beginning or start page of the tutorial and if you use some non-obvious python magic give another link to the specific explanation of this python feature (e.g. when you first use list comprehension). Our tutorials should focus on the important (=PySide) stuff! > > Happy coding! > Aaron > > Am 02.04.2013 23:41, schrieb Marc Hankin: >> Hi. I'm a python newbie and a pyside newbie. >> I've gone through the zetcode tutorial and the simplicitimus (or whatever it is called), and I still feel crippled in using pyside. >> I used to teach law at a law school and I like to think about pedagogical issues. >> So, if you folks want to try out some of your tutorials on me and get my questionable feedback about how to improve your tutorials, I'd be very pleased with the opportunity to give you feedback ... and I confess, I also would like to learn from you. >> >> It's really wonderful to follow your emails. The open source python/pyside community is so giving/altruistic that it is fun to follow your emails. I wish I could occupy myself with this stuff full time and never see the nasty interior of a courtroom again. >> >> Anyway, thanks again, >> >> Marc >> >> >> >> ******************************************************************** >> Marc B. Hankin >> The Law Offices of Marc B. Hankin, Inc. >> Post Office Box 3668, Beverly Hills, California 90212 (Not for mail:509S.BeverlyDr.) >> Tel: (310) 552-3005 Fax: (310) 382-2416 >> Email: marc at marchankin.com Website: www.marchankin.com >> This e-mail message is generated from the law firm of the Law Offices of Marc B. Hankin, Inc., and may contain information that is confidential and may be privileged as an attorney/client communication or as attorney work product. The information is intended to be disclosed solely to the addressee(s). >> If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this e-mail information is prohibited. If you have received this e-mail in error, please notify the sender by return e-mail and delete it from your computer system. >> ******************************************************************** >> >> >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: >> I am in the process of porting the tutorial to PySide and Python 3.x. If there are no objections, I would like to post it in the PySide newbie tutorial section in a similar style to PySideSimplicissimus: >> >> From wiki/PySideTutorials link to new page PySideSimple >> from PySideSimple links to probably 4 separate stage pages with return to PySideSimple, which in turn returns to PySideTutorials. >> >> Al (aka OldAl) >> >> Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus series were well-written and easy to follow. >> >> What modules do you plan on covering in these new tutorials? The tutorials we currently have are great but it's not comprehensive in covering more Qt modules. Here's hoping to see more modules covered in newer tutorials. >> >> Thanks! >> >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside >> >> >> >> >> _______________________________________________ >> PySide mailing list >> >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From vasure at gmail.com Wed Apr 3 01:11:58 2013 From: vasure at gmail.com (Srini Kommoori) Date: Tue, 2 Apr 2013 16:11:58 -0700 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> References: <515B5CF5.7080102@bluewin.ch> <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> Message-ID: Once you get some level of python understanding, I would start with pyside examples. http://qt.gitorious.org/pyside/pyside-examples - Srini On Tue, Apr 2, 2013 at 3:49 PM, Tim Doty wrote: > To a point I agree about focusing on PySide, but it doesn't hurt to cover > (at least cursorily) some elementary Python as well. Mark Summerfield's > excellent book "Rapid GUI Programming with Python and Qt" ( > http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it does > cover things. > > In fact, one of the best things IMO would be if he adapted that book to > PySide. Regrettably, I doubt he has the time to do so ( > http://www.qtrac.eu/pyqtbook.html#pyside). > > I'm coming from PyQt so I'm not a *complete* newbie, but there is a real > advantage to having the content in one place rather than being directed to > other tutorials (not to mention the problem with links going stale). > > Tim Doty > > On Apr 2, 2013, at 5:34 PM, Aaron Richiger wrote: > > > Hello Al and Marc! > > > > Many thanks for your offer, good tutorials are always essential for a > popular project. I just wanted to have a look at your tuts, but the top > five results of a google search after > > "pyside simplicissimus tutorial" > > directed me to dead links. So, this would be a good starting point:) > > > > We also do not have to reinvent the wheel, there are many examples > coming with pyside already, have a look at them, you could probably use > some of them, but enrich them with comments and explanations in your HTML. > > > > Marcs offer sounds great! It's always great to have "customers" helping > designing the "products", because we sometimes can't imagine what's needed > or missing for beginners. Having some newbies to test the tutorials would > be great I think! > > > > Just one note, I think, your tutorials should not cover general python > stuff but just PySide related stuff. There are plenty of good python tuts > out there, we only need more PySide tuts. I know, that many of the PySide > newbies are also python newbies (as Marc), but you could place some links > to good python tuts at the beginning or start page of the tutorial and if > you use some non-obvious python magic give another link to the specific > explanation of this python feature (e.g. when you first use list > comprehension). Our tutorials should focus on the important (=PySide) stuff! > > > > Happy coding! > > Aaron > > > > Am 02.04.2013 23:41, schrieb Marc Hankin: > >> Hi. I'm a python newbie and a pyside newbie. > >> I've gone through the zetcode tutorial and the simplicitimus (or > whatever it is called), and I still feel crippled in using pyside. > >> I used to teach law at a law school and I like to think about > pedagogical issues. > >> So, if you folks want to try out some of your tutorials on me and get > my questionable feedback about how to improve your tutorials, I'd be very > pleased with the opportunity to give you feedback ... and I confess, I also > would like to learn from you. > >> > >> It's really wonderful to follow your emails. The open source > python/pyside community is so giving/altruistic that it is fun to follow > your emails. I wish I could occupy myself with this stuff full time and > never see the nasty interior of a courtroom again. > >> > >> Anyway, thanks again, > >> > >> Marc > >> > >> > >> > >> ******************************************************************** > >> Marc B. Hankin > >> The Law Offices of Marc B. Hankin, Inc. > >> Post Office Box 3668, Beverly Hills, California 90212 (Not for > mail:509S.BeverlyDr.) > >> Tel: (310) 552-3005 Fax: (310) 382-2416 > >> Email: marc at marchankin.com Website: www.marchankin.com > >> This e-mail message is generated from the law firm of the Law > Offices of Marc B. Hankin, Inc., and may contain information that is > confidential and may be privileged as an attorney/client communication or > as attorney work product. The information is intended to be disclosed > solely to the addressee(s). > >> If you are not the intended recipient, any disclosure, copying, > distribution or use of the contents of this e-mail information is > prohibited. If you have received this e-mail in error, please notify the > sender by return e-mail and delete it from your computer system. > >> ******************************************************************** > >> > >> > >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: > >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila > wrote: > >> I am in the process of porting the tutorial to PySide and Python 3.x. > If there are no objections, I would like to post it in the PySide newbie > tutorial section in a similar style to PySideSimplicissimus: > >> > >> From wiki/PySideTutorials link to new page PySideSimple > >> from PySideSimple links to probably 4 separate stage pages with return > to PySideSimple, which in turn returns to PySideTutorials. > >> > >> Al (aka OldAl) > >> > >> Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus > series were well-written and easy to follow. > >> > >> What modules do you plan on covering in these new tutorials? The > tutorials we currently have are great but it's not comprehensive in > covering more Qt modules. Here's hoping to see more modules covered in > newer tutorials. > >> > >> Thanks! > >> > >> _______________________________________________ > >> PySide mailing list > >> PySide at qt-project.org > >> http://lists.qt-project.org/mailman/listinfo/pyside > >> > >> > >> > >> > >> _______________________________________________ > >> PySide mailing list > >> > >> PySide at qt-project.org > >> http://lists.qt-project.org/mailman/listinfo/pyside > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > _______________________________________________ > 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 akabaila at pcug.org.au Wed Apr 3 01:52:16 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 03 Apr 2013 10:52:16 +1100 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: Message-ID: <10421602.4MVUQNxazL@supremo> Hi Long, Is it OK for me to call you Long? I find lndn confusing. I think that rather than using lower case LNDN, i used lower case INDN. Sorry about that! My given LIthuanian name is much longer, but true to the Australian tradition, I have trimmed it down to Al. Confusing, as Al is a common abbreviation for lots of other names, but "life was not meant to be easy". I thought I gave the link to the PyQt4 tutorial that I am in process to bring it to PySide: http://www.diotavelli.net/PyQtWiki/simple It does not cover many modules - it uses QtextEdit or QplainTextEdit, QMainWindow, QApplication, QFileDialog, QKeySequence, QAction, QIcon, QMessageBox, a few QpuxhButtons. None are "covered" - they are merely used. I think what we really lack is a good tutorial on how to use with PySide Qt 4 Assistant, Qt 4 Designer. Perhaps for Qt4 Assistant a brief mention of the vast topic of c++ would be helpful as a facilitator to read Qt 4 Assistant information. A deeper discussion of QFileDialog would be welcome, as practically all GUI programs need it. Any recommendations for a good text editor to edit Python and Pyside programs? Anybody porting a good editor to PySide in view of Python-IDLE not being real friendly with PySide? Al. On Tuesday 02 April 2013 14:23:29 lndn wrote: On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: I am in the process of porting the tutorial to PySide and Python 3.x. If there are no objections, I would like to post it in the PySide newbie tutorial section in a similar style to PySideSimplicissimus: >From wiki/PySideTutorials link to new page PySideSimple from PySideSimple links to probably 4 separate stage pages with return to PySideSimple, which in turn returns to PySideTutorials. Al (aka OldAl) Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus series were well-written and easy to follow. What modules do you plan on covering in these new tutorials? The tutorials we currently have are great but it's not comprehensive in covering more Qt modules. Here's hoping to see more modules covered in newer tutorials. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Wed Apr 3 01:57:28 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 03 Apr 2013 10:57:28 +1100 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: <515B5CF5.7080102@bluewin.ch> References: <515B5CF5.7080102@bluewin.ch> Message-ID: <2710390.FOyps6r3xa@supremo> Hi Aaron, http://qt-project.org/wiki/PySide-Newbie-Tutorials http://qt-project.org/wiki/PySideSimplicissimus_Module_2_CloseButton Cheers, Al. On Wednesday 03 April 2013 00:34:29 Aaron Richiger wrote: Hello Al and Marc! Many thanks for your offer, good tutorials are always essential for a popular project. I just wanted to have a look at your tuts, but the top five results of a google search after "pyside simplicissimus tutorial" directed me to dead links. So, this would be a good starting point:) We also do not have to reinvent the wheel, there are many examples coming with pyside already, have a look at them, you could probably use some of them, but enrich them with comments and explanations in your HTML. Marcs offer sounds great! It's always great to have "customers" helping designing the "products", because we sometimes can't imagine what's needed or missing for beginners. Having some newbies to test the tutorials would be great I think! Just one note, I think, your tutorials should not cover general python stuff but just PySide related stuff. There are plenty of good python tuts out there, we only need more PySide tuts. I know, that many of the PySide newbies are also python newbies (as Marc), but you could place some links to good python tuts at the beginning or start page of the tutorial and if you use some non-obvious python magic give another link to the specific explanation of this python feature (e.g. when you first use list comprehension). Our tutorials should focus on the important (=PySide) stuff! Happy coding! Aaron Am 02.04.2013 23:41, schrieb Marc Hankin: Hi. I'm a python newbie and a pyside newbie. I've gone through the zetcode tutorial and the simplicitimus (or whatever it is called), and I still feel crippled in using pyside. I used to teach law at a law school and I like to think about pedagogical issues. So, if you folks want to try out some of your tutorials on me and get my questionable feedback about how to improve your tutorials, I'd be very pleased with the opportunity to give you feedback ... and I confess, I also would like to learn from you. It's really wonderful to follow your emails. The open source python/pyside community is so giving/altruistic that it is fun to follow your emails. I wish I could occupy myself with this stuff full time and never see the nasty interior of a courtroom again. Anyway, thanks again, Marc ******************************************************************** Marc B. Hankin The Law Offices of Marc B. Hankin, Inc. Post Office Box 3668, Beverly Hills, California 90212 (Not for mail:509S.BeverlyDr.) Tel: (310) 552-3005 Fax: (310) 382-2416 Email: marc at marchankin.com Website: www.marchankin.com This e-mail message is generated from the law firm of the Law Offices of Marc B. Hankin, Inc., and may contain information that is confidential and may be privileged as an attorney/client communication or as attorney work product. The information is intended to be disclosed solely to the addressee(s). If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this e-mail information is prohibited. If you have received this e-mail in error, please notify the sender by return e-mail and delete it from your computer system. ******************************************************************** On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: I am in the process of porting the tutorial to PySide and Python 3.x. If there are no objections, I would like to post it in the PySide newbie tutorial section in a similar style to PySideSimplicissimus: >From wiki/PySideTutorials link to new page PySideSimple from PySideSimple links to probably 4 separate stage pages with return to PySideSimple, which in turn returns to PySideTutorials. Al (aka OldAl) Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus series were well-written and easy to follow. What modules do you plan on covering in these new tutorials? The tutorials we currently have are great but it's not comprehensive in covering more Qt modules. Here's hoping to see more modules covered in newer tutorials. Thanks! _______________________________________________ PySide mailing list PySide at qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside _______________________________________________ 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 serpulga at gmail.com Wed Apr 3 02:11:44 2013 From: serpulga at gmail.com (=?ISO-8859-1?Q?Sergio_Pulgar=EDn?=) Date: Tue, 2 Apr 2013 19:11:44 -0500 Subject: [PySide] PySide tutorials Message-ID: On 2 Apr 2013 17:13, wrote: > > Send PySide mailing list submissions to > pyside at qt-project.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.qt-project.org/mailman/listinfo/pyside > or, via email, send a message with subject or body 'help' to > pyside-request at qt-project.org > > You can reach the person managing the list at > pyside-owner at qt-project.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of PySide digest..." > > > Today's Topics: > > 1. PySide Newbie Tutorials (lndn) > 2. Re: PySide Newbie Tutorials (Marc Hankin) > 3. Re: spyder not finding pyqt4.6 except with python2.6 (vs. > python3.3, 3.1, 2.7) , spyder 2.1.14 and 2.2.0beta4 (Algis Kabaila) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 2 Apr 2013 14:23:29 -0700 > From: lndn > Subject: [PySide] PySide Newbie Tutorials > To: Algis Kabaila > Cc: pyside at qt-project.org > Message-ID: > < CAJ6WS8s64oNYM0KRqwrMqbfS+5kx0NWkB7nXO3PNvQBnmZe9OA at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: > > > ** > > > > I am in the process of porting the tutorial to PySide and Python 3.x. If > > there are no objections, I would like to post it in the PySide newbie > > tutorial section in a similar style to PySideSimplicissimus: > > > > > > > > From wiki/PySideTutorials link to new page PySideSimple > > > > from PySideSimple links to probably 4 separate stage pages with return to > > PySideSimple, which in turn returns to PySideTutorials. > > > > > > > > Al (aka OldAl) > > > > Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus > series were well-written and easy to follow. > > What modules do you plan on covering in these new tutorials? The tutorials > we currently have are great but it's not comprehensive in covering more Qt > modules. Here's hoping to see more modules covered in newer tutorials. > I guess I could write a couple of tutorials. I've been using Qt for a couple of years and have touched several modules. What topic do you feel like is evidently missing? > Thanks! > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.qt-project.org/pipermail/pyside/attachments/20130402/ec8aa57b/attachment-0001.html > > ------------------------------ > > Message: 2 > Date: Tue, 2 Apr 2013 14:41:34 -0700 > From: Marc Hankin > Subject: Re: [PySide] PySide Newbie Tutorials > To: lndn > Cc: pyside at qt-project.org > Message-ID: > < CACGromFOn-f+GpOXaNPUA+pHgy4rOf2zr_5raf5Rk3RC1woMOw at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi. I'm a python newbie and a pyside newbie. > I've gone through the zetcode tutorial and the simplicitimus (or whatever > it is called), and I still feel crippled in using pyside. > I used to teach law at a law school and I like to think about pedagogical > issues. > So, if you folks want to try out some of your tutorials on me and get my > questionable feedback about how to improve your tutorials, I'd be very > pleased with the opportunity to give you feedback ... and I confess, I also > would like to learn from you. > > It's really wonderful to follow your emails. The open source python/pyside > community is so giving/altruistic that it is fun to follow your emails. I > wish I could occupy myself with this stuff full time and never see the > nasty interior of a courtroom again. > > Anyway, thanks again, > > Marc > > > > ******************************************************************** > > Marc B. Hankin > > The Law Offices of Marc B. Hankin, Inc. > > Post Office Box 3668, Beverly Hills, California 90212 (Not for > mail:509S.BeverlyDr.) > > Tel: (310) 552-3005 Fax: (310) 382-2416 > > Email: marc at marchankin.com Website: www.marchankin.com > > This e-mail message is generated from the law firm of the Law Offices > of Marc B. Hankin, Inc., and may contain information that is confidential > and may be privileged as an attorney/client communication or as attorney > work product. The information is intended to be disclosed solely to the > addressee(s). > > If you are not the intended recipient, any disclosure, copying, > distribution or use of the contents of this e-mail information is > prohibited. If you have received this e-mail in error, please notify the > sender by return e-mail and delete it from your computer system. > > ******************************************************************** > > > On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: > > > On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: > > > >> ** > >> > >> I am in the process of porting the tutorial to PySide and Python 3.x. If > >> there are no objections, I would like to post it in the PySide newbie > >> tutorial section in a similar style to PySideSimplicissimus: > >> > >> > >> > >> From wiki/PySideTutorials link to new page PySideSimple > >> > >> from PySideSimple links to probably 4 separate stage pages with return to > >> PySideSimple, which in turn returns to PySideTutorials. > >> > >> > >> > >> Al (aka OldAl) > >> > > > > Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus > > series were well-written and easy to follow. > > > > What modules do you plan on covering in these new tutorials? The > > tutorials we currently have are great but it's not comprehensive in > > covering more Qt modules. Here's hoping to see more modules covered in > > newer tutorials. > > > > Thanks! > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.qt-project.org/pipermail/pyside/attachments/20130402/0d6044a3/attachment-0001.html > > ------------------------------ > > Message: 3 > Date: Wed, 03 Apr 2013 09:12:59 +1100 > From: Algis Kabaila > Subject: Re: [PySide] spyder not finding pyqt4.6 except with python2.6 > (vs. python3.3, 3.1, 2.7) , spyder 2.1.14 and 2.2.0beta4 > To: drc at cognizor.com > Cc: Pierre Raybaut , pyside at qt-project.org, > Carlos Co'rdoba > Message-ID: <9682593.h86yu4x8h8 at supremo> > Content-Type: text/plain; charset="us-ascii" > > Hi and thanks for kind words re my posting on pyside at qt-project.org. > > It seems to me that there is some confusion on qt, pyqt and pyside. PyQt > is a Python library of programs that enable python programs to make use of > qt libraries. PySide has very similar (the same?) objectives as PyQt. > > In a commercial environment one could say that PyQt and PySide are > competitors. Each is independent of the other and go about similar > objectives in a different way. > > In my limited experience, operating from a kubuntu (ubuntu with KDE > desktop environment) with Python 2.x both PySide and PyQt4 run "out of the > box" with both downloadable from standard repositories. To my pleasant > surprise, PySide also runs seamlessly with Python3. > > In the days past, PyQt4 had to be compiled from source to run with > Python3. It seems that that is still the case today. If I am wrong, > please tell me! > > I quite unfamiliar with spyder-ide. > > If these ramblings of mine are useful - great. If not, I ask just bear > with me. > > Al. (Algis) > > > > On Tuesday 02 April 2013 11:34:26 drc at cognizor.com wrote: > > Greetings. > > > > My goal here is getting python3.3 working the spyder python IDE. (Spyder > > 2.1.14 from the git repo is said to work with python3 by Pierre > > Raybaut, its major developer, at http://spyder-ide.blogspot.com/ in > > the Jan. 24 posting.(The 2.2 series beta4 release of March 12 will not, > > he says. And he's right!) > > > > Neither any other spyder nor pyside are installed in this pure debian OS > > (AVlinux 6.0). This seems to be a bug relevant to pyqt4 naming. Can't > > tell if pyside would provide a workarounpyside at qt-project.orgd. > > > > Theoretically qt4 ( "qt4.4+" is specified in the spyder code) should > > work since debian package qt 4.7.3-1+b1 is installed. > > > > python2.6 finds it and starts up spyder with it, thus: > > ---------pyside at qt-project.org > > python2.6 bootstrap.py > > Executing Spyder from source checkout > > Revision 2114:b2b019b3abb3, Branch: default > > 01. Patched sys.path with > > /home/py/tidings/pyacqs/ide/spyder2.1.14/spyderlib.v21 > > and > > /home/py/tidings/pyacqs/ide/spyder2.1.14/spyderlib.v21/external-py2 > > 02. No PySide detected, using PyQt4 if available > > 03. Imported Spyder 2.1.14dev3 (Qt 4.6.3 via PyQt4 (API v1) 4.7.3) > > 0x. Enforcing parent console (Windows only) > > 04. Executing spyder.main() > > > > ----------- > > > > But no, the pyqt4 is not found with python3.3, python3.1, and python2.7 > > . The same error as produced by the beta arises, namely this: > > > > ------------ > > ide/spyder2.1.14/spyderlib.v21$ python3.3 bootstrap.py > > Executing Spyder from source checkout > > Revision 2114:b2b019b3abb3, Branch: default > > 01. Patched sys.path with /home/.../ide/spyder2.1.14/spyderlib.v21 > > and > > /home/.../ide/spyder2.1.14/spyderlib.v21/external-py3 > > 02. No PySide detected, using PyQt4 if available > > Traceback (most recent call last): > > File > > "/home/py/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/qt/__init__.py", > > line 46, in > > from PySide import __version__ # analysis:ignore > > ImportError: No module named 'PySide' > > > > During handling of the above exception, another exception occurred: > > > > Traceback (most recent call last): > > File > > "/home/py/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > > line 39, in check_qt > > from spyderlib import qt > > File > > "/home/py/.../spyder2.1.14/spyderlib.v21/spyderlib/qt/__init__.py", > > line 48, in > > raise ImportError("Spyder requires PySide or PyQt to be installed") > > ImportError: Spyder requires PySide or PyQt to be installed > > > > During handling of the above exception, another exception occurred: > > > > Traceback (most recent call last): > > File "bootstrap.py", line 89, in > > from spyderlib import spyder > > File "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/spyder.py", > > line 50, in > > requirements.check_qt() > > File > > "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > > line 49, in check_qt > > % (qt_infos['pyqt']+qt_infos['pyside'])) > > File > > "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > > line 24, in show_warning > > raise RuntimeError(message) > > RuntimeError: Please check Spyder installation requirements: > > PyQt4 4.4+ (or PySide 1.0+) is required. > > [64234 refs] > > py at t9012av6:~/.../ide/spyder2.1.14/spyderlib.v21$ > > > > ----------- > > > > Thanks for your help! > > > > @ Algis: > > thanks for your notes posted today on tutorials for pyside, at > > http://lists.qt-project.org/pipermail/pyside/2013-April/001209.html > > Does pyside work with python3.3 on unix (debian linux, AVlinux6.0)? > > >From the elaborate pyside install instructions at pypi.python.org I > > >can't > > tell. There is definitely need for a clear Tutorial posted > > conspicuously! > > > > @ Pierre: > > Many congratulations on your new child. (Read about in the iep > > forum.) And Thanks for spyder! > > > > SC > > Dr. S. Candelaria de Ram > > drc at cognizor.com > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.qt-project.org/pipermail/pyside/attachments/20130403/53367203/attachment.html > > ------------------------------ > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > End of PySide Digest, Vol 15, Issue 3 > ************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From backup.rlacko at gmail.com Wed Apr 3 09:01:01 2013 From: backup.rlacko at gmail.com (Roman Lacko) Date: Wed, 3 Apr 2013 09:01:01 +0200 Subject: [PySide] WebKit problem In-Reply-To: References: Message-ID: Hi, 2013/4/3 Matthew Ngaha > i was doing some pyside tutorials, some made use of Qt webkit and gave > clear instructions that i should download "libqtwebkit4-declarative." > I thought weird Pyside asking me to installl this as it should > already come built in. > > from PySide import QtGui, QtDeclarative, QtWebKit > > on a .qml file i have type import QtWebKit 1.0 > > On Windows Vista, Python 3.3 i run the script and this is my error message: > > http://bpaste.net/show/E5ZRqp92JS2FuWkrGsde/ > > the path is valid, that dll file it cant find is on the path it looked > in. i asked in #qt's irc channel and was told to try installing pyside > for Python 2.7 as it might have something to do with issues on Python > 3.3. Sure enough it worked fine on 2.7, the folder QtWebKit is exactly > the same on both versions, so why is 3.3 returning an error? i don;t > use Python 2.7 so this would really be a hassle if i had to use pyside > on it. Any solutions to making this work? Do i try reinstalling pyside > for 3.3? And also why would a Pyside tutorial instruct us to download > this package: "libqtwebkit4-declarative."? doesnt everything we need > already come built in? > Yes, everything should be built in, You should download one of the packages from http://qt-project.org/wiki/PySide_Binaries_Windows.All packages contains also required Qt libraries, designer, linguist, translator, examples, headers and shiboken related files. Regards R. > > Thanks > _______________________________________________ > 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 akabaila at pcug.org.au Wed Apr 3 09:44:42 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 03 Apr 2013 18:44:42 +1100 Subject: [PySide] PySide tutorials In-Reply-To: References: Message-ID: <1647993.1TEWbTIKC7@supremo> Sergio, I would like to acknowledge the effort at coordination to lndn - let us "appoint" him as a coordinator and follow his directions. So I will wait for his suggestions. In my opinion the newbie tutorials are best written by newbies, albeit with critical appraisal by more experienced persons. Of course, anybody could and everybody should contribute! I would suggest that for newbie tutorials, the tutorials should be readable by people who know python and have heard of PySide and would like to try it. If we succed to enable them to solve one problem, no matter how simple, we, IMHO, may have attracted another user to PySide. Al. On Tuesday 02 April 2013 19:11:44 Sergio Pulgarín wrote: On 2 Apr 2013 17:13, wrote: > > Send PySide mailing list submissions to > pyside at qt-project.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.qt-project.org/mailman/listinfo/pyside > or, via email, send a message with subject or body 'help' to > pyside-request at qt-project.org > > You can reach the person managing the list at > pyside-owner at qt-project.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of PySide digest..." > > > Today's Topics: > > 1. PySide Newbie Tutorials (lndn) > 2. Re: PySide Newbie Tutorials (Marc Hankin) > 3. Re: spyder not finding pyqt4.6 except with python2.6 (vs. > python3.3, 3.1, 2.7) , spyder 2.1.14 and 2.2.0beta4 (Algis Kabaila) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 2 Apr 2013 14:23:29 -0700 > From: lndn > Subject: [PySide] PySide Newbie Tutorials > To: Algis Kabaila > Cc: pyside at qt-project.org > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: > > > ** > > > > I am in the process of porting the tutorial to PySide and Python 3.x. If > > there are no objections, I would like to post it in the PySide newbie > > tutorial section in a similar style to PySideSimplicissimus: > > > > > > > > From wiki/PySideTutorials link to new page PySideSimple > > > > from PySideSimple links to probably 4 separate stage pages with return to > > PySideSimple, which in turn returns to PySideTutorials. > > > > > > > > Al (aka OldAl) > > > > Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus > series were well-written and easy to follow. > > What modules do you plan on covering in these new tutorials? The tutorials > we currently have are great but it's not comprehensive in covering more Qt > modules. Here's hoping to see more modules covered in newer tutorials. > I guess I could write a couple of tutorials. I've been using Qt for a couple of years and have touched several modules. What topic do you feel like is evidently missing? > Thanks! > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.qt- project.org/pipermail/pyside/attachments/20130402/ec8aa57b/attachment-0001.html > > ------------------------------ > > Message: 2 > Date: Tue, 2 Apr 2013 14:41:34 -0700 > From: Marc Hankin > Subject: Re: [PySide] PySide Newbie Tutorials > To: lndn > Cc: pyside at qt-project.org > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hi. I'm a python newbie and a pyside newbie. > I've gone through the zetcode tutorial and the simplicitimus (or whatever > it is called), and I still feel crippled in using pyside. > I used to teach law at a law school and I like to think about pedagogical > issues. > So, if you folks want to try out some of your tutorials on me and get my > questionable feedback about how to improve your tutorials, I'd be very > pleased with the opportunity to give you feedback ... and I confess, I also > would like to learn from you. > > It's really wonderful to follow your emails. The open source python/pyside > community is so giving/altruistic that it is fun to follow your emails. I > wish I could occupy myself with this stuff full time and never see the > nasty interior of a courtroom again. > > Anyway, thanks again, > > Marc > > > > ******************************************************************** > > Marc B. Hankin > > The Law Offices of Marc B. Hankin, Inc. > > Post Office Box 3668, Beverly Hills, California 90212 (Not for > mail:509S.BeverlyDr.) > > Tel: (310) 552-3005 Fax: (310) 382-2416 > > Email: marc at marchankin.com Website: www.marchankin.com > > This e-mail message is generated from the law firm of the Law Offices > of Marc B. Hankin, Inc., and may contain information that is confidential > and may be privileged as an attorney/client communication or as attorney > work product. The information is intended to be disclosed solely to the > addressee(s). > > If you are not the intended recipient, any disclosure, copying, > distribution or use of the contents of this e-mail information is > prohibited. If you have received this e-mail in error, please notify the > sender by return e-mail and delete it from your computer system. > > ******************************************************************** > > > On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: > > > On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: > > > >> ** > >> > >> I am in the process of porting the tutorial to PySide and Python 3.x. If > >> there are no objections, I would like to post it in the PySide newbie > >> tutorial section in a similar style to PySideSimplicissimus: > >> > >> > >> > >> From wiki/PySideTutorials link to new page PySideSimple > >> > >> from PySideSimple links to probably 4 separate stage pages with return to > >> PySideSimple, which in turn returns to PySideTutorials. > >> > >> > >> > >> Al (aka OldAl) > >> > > > > Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus > > series were well-written and easy to follow. > > > > What modules do you plan on covering in these new tutorials? The > > tutorials we currently have are great but it's not comprehensive in > > covering more Qt modules. Here's hoping to see more modules covered in > > newer tutorials. > > > > Thanks! > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.qt- project.org/pipermail/pyside/attachments/20130402/0d6044a3/attachment-0001.html > > ------------------------------ > > Message: 3 > Date: Wed, 03 Apr 2013 09:12:59 +1100 > From: Algis Kabaila > Subject: Re: [PySide] spyder not finding pyqt4.6 except with python2.6 > (vs. python3.3, 3.1, 2.7) , spyder 2.1.14 and 2.2.0beta4 > To: drc at cognizor.com > Cc: Pierre Raybaut , pyside at qt-project.org, > Carlos Co'rdoba > Message-ID: <9682593.h86yu4x8h8 at supremo> > Content-Type: text/plain; charset="us-ascii" > > Hi and thanks for kind words re my posting on pyside at qt-project.org. > > It seems to me that there is some confusion on qt, pyqt and pyside. PyQt > is a Python library of programs that enable python programs to make use of > qt libraries. PySide has very similar (the same?) objectives as PyQt. > > In a commercial environment one could say that PyQt and PySide are > competitors. Each is independent of the other and go about similar > objectives in a different way. > > In my limited experience, operating from a kubuntu (ubuntu with KDE > desktop environment) with Python 2.x both PySide and PyQt4 run "out of the > box" with both downloadable from standard repositories. To my pleasant > surprise, PySide also runs seamlessly with Python3. > > In the days past, PyQt4 had to be compiled from source to run with > Python3. It seems that that is still the case today. If I am wrong, > please tell me! > > I quite unfamiliar with spyder-ide. > > If these ramblings of mine are useful - great. If not, I ask just bear > with me. > > Al. (Algis) > > > > On Tuesday 02 April 2013 11:34:26 drc at cognizor.com wrote: > > Greetings. > > > > My goal here is getting python3.3 working the spyder python IDE. (Spyder > > 2.1.14 from the git repo is said to work with python3 by Pierre > > Raybaut, its major developer, at http://spyder-ide.blogspot.com/ in > > the Jan. 24 posting.(The 2.2 series beta4 release of March 12 will not, > > he says. And he's right!) > > > > Neither any other spyder nor pyside are installed in this pure debian OS > > (AVlinux 6.0). This seems to be a bug relevant to pyqt4 naming. Can't > > tell if pyside would provide a workarounpyside at qt-project.orgd. > > > > Theoretically qt4 ( "qt4.4+" is specified in the spyder code) should > > work since debian package qt 4.7.3-1+b1 is installed. > > > > python2.6 finds it and starts up spyder with it, thus: > > ---------pyside at qt-project.org > > python2.6 bootstrap.py > > Executing Spyder from source checkout > > Revision 2114:b2b019b3abb3, Branch: default > > 01. Patched sys.path with > > /home/py/tidings/pyacqs/ide/spyder2.1.14/spyderlib.v21 > > and > > /home/py/tidings/pyacqs/ide/spyder2.1.14/spyderlib.v21/external-py2 > > 02. No PySide detected, using PyQt4 if available > > 03. Imported Spyder 2.1.14dev3 (Qt 4.6.3 via PyQt4 (API v1) 4.7.3) > > 0x. Enforcing parent console (Windows only) > > 04. Executing spyder.main() > > > > ----------- > > > > But no, the pyqt4 is not found with python3.3, python3.1, and python2.7 > > . The same error as produced by the beta arises, namely this: > > > > ------------ > > ide/spyder2.1.14/spyderlib.v21$ python3.3 bootstrap.py > > Executing Spyder from source checkout > > Revision 2114:b2b019b3abb3, Branch: default > > 01. Patched sys.path with /home/.../ide/spyder2.1.14/spyderlib.v21 > > and > > /home/.../ide/spyder2.1.14/spyderlib.v21/external-py3 > > 02. No PySide detected, using PyQt4 if available > > Traceback (most recent call last): > > File > > "/home/py/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/qt/__init__.py", > > line 46, in > > from PySide import __version__ # analysis:ignore > > ImportError: No module named 'PySide' > > > > During handling of the above exception, another exception occurred: > > > > Traceback (most recent call last): > > File > > "/home/py/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > > line 39, in check_qt > > from spyderlib import qt > > File > > "/home/py/.../spyder2.1.14/spyderlib.v21/spyderlib/qt/__init__.py", > > line 48, in > > raise ImportError("Spyder requires PySide or PyQt to be installed") > > ImportError: Spyder requires PySide or PyQt to be installed > > > > During handling of the above exception, another exception occurred: > > > > Traceback (most recent call last): > > File "bootstrap.py", line 89, in > > from spyderlib import spyder > > File "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/spyder.py", > > line 50, in > > requirements.check_qt() > > File > > "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > > line 49, in check_qt > > % (qt_infos['pyqt']+qt_infos['pyside'])) > > File > > "/home/.../ide/spyder2.1.14/spyderlib.v21/spyderlib/requirements.py", > > line 24, in show_warning > > raise RuntimeError(message) > > RuntimeError: Please check Spyder installation requirements: > > PyQt4 4.4+ (or PySide 1.0+) is required. > > [64234 refs] > > py at t9012av6:~/.../ide/spyder2.1.14/spyderlib.v21$ > > > > ----------- > > > > Thanks for your help! > > > > @ Algis: > > thanks for your notes posted today on tutorials for pyside, at > > http://lists.qt-project.org/pipermail/pyside/2013-April/001209.html > > Does pyside work with python3.3 on unix (debian linux, AVlinux6.0)? > > >From the elaborate pyside install instructions at pypi.python.org I > > >can't > > tell. There is definitely need for a clear Tutorial posted > > conspicuously! > > > > @ Pierre: > > Many congratulations on your new child. (Read about in the iep > > forum.) And Thanks for spyder! > > > > SC > > Dr. S. Candelaria de Ram > > drc at cognizor.com > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.qt- project.org/pipermail/pyside/attachments/20130403/53367203/attachment.html > > ------------------------------ > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > End of PySide Digest, Vol 15, Issue 3 > ************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Wed Apr 3 09:47:11 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 03 Apr 2013 18:47:11 +1100 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> Message-ID: <1964616.UMW0oDfclN@supremo> Srini, Good idea! How about posting a detailed way of getting your chosen example? Al. On Tuesday 02 April 2013 16:11:58 Srini Kommoori wrote: Once you get some level of python understanding, I would start with pyside examples. http://qt.gitorious.org/pyside/pyside-examples - Srini On Tue, Apr 2, 2013 at 3:49 PM, Tim Doty wrote: To a point I agree about focusing on PySide, but it doesn't hurt to cover (at least cursorily) some elementary Python as well. Mark Summerfield's excellent book "Rapid GUI Programming with Python and Qt" (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it does cover things. In fact, one of the best things IMO would be if he adapted that book to PySide. Regrettably, I doubt he has the time to do so (http://www.qtrac.eu/pyqtbook.html#pyside). I'm coming from PyQt so I'm not a *complete* newbie, but there is a real advantage to having the content in one place rather than being directed to other tutorials (not to mention the problem with links going stale). Tim Doty On Apr 2, 2013, at 5:34 PM, Aaron Richiger wrote: > Hello Al and Marc! > > Many thanks for your offer, good tutorials are always essential for a popular project. I just wanted to have a look at your tuts, but the top five results of a google search after > "pyside simplicissimus tutorial" > directed me to dead links. So, this would be a good starting point:) > > We also do not have to reinvent the wheel, there are many examples coming with pyside already, have a look at them, you could probably use some of them, but enrich them with comments and explanations in your HTML. > > Marcs offer sounds great! It's always great to have "customers" helping designing the "products", because we sometimes can't imagine what's needed or missing for beginners. Having some newbies to test the tutorials would be great I think! > > Just one note, I think, your tutorials should not cover general python stuff but just PySide related stuff. There are plenty of good python tuts out there, we only need more PySide tuts. I know, that many of the PySide newbies are also python newbies (as Marc), but you could place some links to good python tuts at the beginning or start page of the tutorial and if you use some non-obvious python magic give another link to the specific explanation of this python feature (e.g. when you first use list comprehension). Our tutorials should focus on the important (=PySide) stuff! > > Happy coding! > Aaron > > Am 02.04.2013 23:41, schrieb Marc Hankin: >> Hi. I'm a python newbie and a pyside newbie. >> I've gone through the zetcode tutorial and the simplicitimus (or whatever it is called), and I still feel crippled in using pyside. >> I used to teach law at a law school and I like to think about pedagogical issues. >> So, if you folks want to try out some of your tutorials on me and get my questionable feedback about how to improve your tutorials, I'd be very pleased with the opportunity to give you feedback ... and I confess, I also would like to learn from you. >> >> It's really wonderful to follow your emails. The open source python/pyside community is so giving/altruistic that it is fun to follow your emails. I wish I could occupy myself with this stuff full time and never see the nasty interior of a courtroom again. >> >> Anyway, thanks again, >> >> Marc >> >> >> >> ******************************************************************** >> Marc B. Hankin >> The Law Offices of Marc B. Hankin, Inc. >> Post Office Box 3668, Beverly Hills, California 90212 (Not for mail:509S.BeverlyDr.) >> Tel: (310) 552-3005 Fax: (310) 382-2416 >> Email: marc at marchankin.com Website: www.marchankin.com >> This e-mail message is generated from the law firm of the Law Offices of Marc B. Hankin, Inc., and may contain information that is confidential and may be privileged as an attorney/client communication or as attorney work product. The information is intended to be disclosed solely to the addressee(s). >> If you are not the intended recipient, any disclosure, copying, distribution or use of the contents of this e-mail information is prohibited. If you have received this e-mail in error, please notify the sender by return e-mail and delete it from your computer system. >> ******************************************************************** >> >> >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila wrote: >> I am in the process of porting the tutorial to PySide and Python 3.x. If there are no objections, I would like to post it in the PySide newbie tutorial section in a similar style to PySideSimplicissimus: >> >> From wiki/PySideTutorials link to new page PySideSimple >> from PySideSimple links to probably 4 separate stage pages with return to PySideSimple, which in turn returns to PySideTutorials. >> >> Al (aka OldAl) >> >> Hi Al, the newbie tutorials are a great idea. The PySideSimplicissimus series were well-written and easy to follow. >> >> What modules do you plan on covering in these new tutorials? The tutorials we currently have are great but it's not comprehensive in covering more Qt modules. Here's hoping to see more modules covered in newer tutorials. >> >> Thanks! >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Wed Apr 3 09:56:41 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Wed, 03 Apr 2013 18:56:41 +1100 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> References: <515B5CF5.7080102@bluewin.ch> <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> Message-ID: <1880990.7qVRghPlsz@supremo> Tim, You wrote: > Mark Summerfield's excellent book "Rapid GUI Programming with Python and > Qt" (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it > does cover things. I want to second that. An extract from the "simple editor" tutorial of PyQt that I wrote some years ago has this statement: """Have I mentioned that all that I know about PyQt I have learned from an excellent text "Rapid GUI Programming with Python and Qt" by Mark Summerfield? Well, I mention it now - it is a great text book. This tutorial is meant to be a "gentle" introduction to the PyQt world and it would be a disservice to the reader not to point out the direction to a more thorough treatment of the subject.""" Your point is really appreciated. @Aaron Richiger - Mark Summerfield does a great job of revision of python in the introduction. Good read, indeed. Al. On Tuesday 02 April 2013 17:49:25 Tim Doty wrote: > To a point I agree about focusing on PySide, but it doesn't hurt to > cover (at least cursorily) some elementary Python as well. Mark > Summerfield's excellent book "Rapid GUI Programming with Python and Qt" > (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it > does cover things. > > In fact, one of the best things IMO would be if he adapted that book to > PySide. Regrettably, I doubt he has the time to do so > (http://www.qtrac.eu/pyqtbook.html#pyside). > > I'm coming from PyQt so I'm not a *complete* newbie, but there is a real > advantage to having the content in one place rather than being directed > to other tutorials (not to mention the problem with links going stale). > > Tim Doty > > On Apr 2, 2013, at 5:34 PM, Aaron Richiger wrote: > > Hello Al and Marc! > > > > Many thanks for your offer, good tutorials are always essential for a > > popular project. I just wanted to have a look at your tuts, but the > > top five results of a google search after "pyside simplicissimus > > tutorial" > > directed me to dead links. So, this would be a good starting point:) > > > > We also do not have to reinvent the wheel, there are many examples > > coming with pyside already, have a look at them, you could probably > > use some of them, but enrich them with comments and explanations in > > your HTML. > > > > Marcs offer sounds great! It's always great to have "customers" > > helping designing the "products", because we sometimes can't imagine > > what's needed or missing for beginners. Having some newbies to test > > the tutorials would be great I think! > > > > Just one note, I think, your tutorials should not cover general python > > stuff but just PySide related stuff. There are plenty of good python > > tuts out there, we only need more PySide tuts. I know, that many of > > the PySide newbies are also python newbies (as Marc), but you could > > place some links to good python tuts at the beginning or start page > > of the tutorial and if you use some non-obvious python magic give > > another link to the specific explanation of this python feature (e.g. > > when you first use list comprehension). Our tutorials should focus on > > the important (=PySide) stuff! > > > > Happy coding! > > Aaron > > > > Am 02.04.2013 23:41, schrieb Marc Hankin: > >> Hi. I'm a python newbie and a pyside newbie. > >> I've gone through the zetcode tutorial and the simplicitimus (or > >> whatever it is called), and I still feel crippled in using pyside. I > >> used to teach law at a law school and I like to think about > >> pedagogical issues. So, if you folks want to try out some of your > >> tutorials on me and get my questionable feedback about how to > >> improve your tutorials, I'd be very pleased with the opportunity to > >> give you feedback ... and I confess, I also would like to learn from > >> you. > >> > >> It's really wonderful to follow your emails. The open source > >> python/pyside community is so giving/altruistic that it is fun to > >> follow your emails. I wish I could occupy myself with this stuff > >> full time and never see the nasty interior of a courtroom again. > >> > >> Anyway, thanks again, > >> > >> Marc > >> > >> ******************************************************************** > >> > >> Marc B. Hankin > >> The Law Offices of Marc B. Hankin, Inc. > >> Post Office Box 3668, Beverly Hills, California 90212 (Not for > >> mail:509S.BeverlyDr.) Tel: (310) 552-3005 Fax: (310) 382-2416 > >> Email: marc at marchankin.com Website: www.marchankin.com > >> > >> This e-mail message is generated from the law firm of the Law > >> Offices of Marc B. Hankin, Inc., and may contain information > >> that is confidential and may be privileged as an > >> attorney/client communication or as attorney work product. The > >> information is intended to be disclosed solely to the > >> addressee(s). If you are not the intended recipient, any > >> disclosure, copying, distribution or use of the contents of > >> this e-mail information is prohibited. If you have received > >> this e-mail in error, please notify the sender by return e-mail > >> and delete it from your computer system.>> > >> ******************************************************************** > >> > >> > >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: > >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila > >> wrote: I am in the process of porting the tutorial to PySide and > >> Python 3.x. If there are no objections, I would like to post it in > >> the PySide newbie tutorial section in a similar style to > >> PySideSimplicissimus: > >> > >> From wiki/PySideTutorials link to new page PySideSimple > >> from PySideSimple links to probably 4 separate stage pages with > >> return to PySideSimple, which in turn returns to PySideTutorials. > >> > >> Al (aka OldAl) > >> > >> Hi Al, the newbie tutorials are a great idea. The > >> PySideSimplicissimus series were well-written and easy to follow. > >> > >> What modules do you plan on covering in these new tutorials? The > >> tutorials we currently have are great but it's not comprehensive in > >> covering more Qt modules. Here's hoping to see more modules covered > >> in newer tutorials. > >> > >> Thanks! > >> > >> _______________________________________________ > >> PySide mailing list > >> PySide at qt-project.org > >> http://lists.qt-project.org/mailman/listinfo/pyside > >> > >> > >> > >> > >> _______________________________________________ > >> PySide mailing list > >> > >> PySide at qt-project.org > >> http://lists.qt-project.org/mailman/listinfo/pyside > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > _______________________________________________ > 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 lndndev at gmail.com Wed Apr 3 10:25:53 2013 From: lndndev at gmail.com (lndn) Date: Wed, 3 Apr 2013 01:25:53 -0700 Subject: [PySide] PySide tutorials In-Reply-To: <1647993.1TEWbTIKC7@supremo> References: <1647993.1TEWbTIKC7@supremo> Message-ID: On Wed, Apr 3, 2013 at 12:44 AM, Algis Kabaila wrote: > ** > > I would like to acknowledge the effort at coordination to lndn < > lndndev at gmail.com> - let us "appoint" him as a coordinator and follow his > directions. So I will wait for his suggestions. > > Al. > I'm new to the PySide project so I'm just going with the flow and seeing what's currently out there now and contributing wherever I can. I probably want what most people want: an abundance of well-written tutorials, clear documentation and good examples to follow. I look forward to seeing new tutorials (Al, Sergo...). I'm currently writing a short "Getting Started with PySide Development" guide [1]. I'm learning at the same time as writing and it's far from complete, so any feedback is welcome. There's not enough tutorials and documentation on the development aspect of PySide and that's a weakness I'm trying to change. [1] http://qt-project.org/wiki/PySide_Development_Getting_Started -------------- next part -------------- An HTML attachment was scrubbed... URL: From niceguysan at gmail.com Wed Apr 3 11:02:38 2013 From: niceguysan at gmail.com (=?UTF-8?B?xaHDo8Ox?=) Date: Wed, 3 Apr 2013 14:32:38 +0530 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: <1880990.7qVRghPlsz@supremo> References: <515B5CF5.7080102@bluewin.ch> <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> <1880990.7qVRghPlsz@supremo> Message-ID: well, I have found Yasin's tutorial on Model View programming a lot better than the ones refer in Mark Summerfield's book. Also the book is older edition , and many new things were introduced later like QFileSystemModel etc... Last time I talked to Mark a month back, he had no plans for a new edition. however it could have been nice if he or someone contribute in going over different areas giving focus to PySide. On Wed, Apr 3, 2013 at 1:26 PM, Algis Kabaila wrote: > ** > > Tim, > > > > You wrote: > > > Mark Summerfield's excellent book "Rapid GUI Programming with Python and > > Qt" (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it > > > does cover things. > > > > I want to second that. An extract from the "simple editor" tutorial of > PyQt that I wrote some years ago has this statement: > > > > """Have I mentioned that all that I know about PyQt I have learned from an > excellent text "Rapid GUI Programming with Python and Qt" by Mark > Summerfield? Well, I mention it now - it is a great text book. This > tutorial is meant to be a "gentle" introduction to the PyQt world and it > would be a disservice to the reader not to point out the direction to a > more thorough treatment of the subject.""" > > > > Your point is really appreciated. > > > > @Aaron Richiger - Mark Summerfield does a great job of revision of python > in the introduction. Good read, indeed. > > > > Al. > > > > On Tuesday 02 April 2013 17:49:25 Tim Doty wrote: > > > To a point I agree about focusing on PySide, but it doesn't hurt to > > > cover (at least cursorily) some elementary Python as well. Mark > > > Summerfield's excellent book "Rapid GUI Programming with Python and Qt" > > > (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it > > > does cover things. > > > > > > In fact, one of the best things IMO would be if he adapted that book to > > > PySide. Regrettably, I doubt he has the time to do so > > > (http://www.qtrac.eu/pyqtbook.html#pyside). > > > > > > I'm coming from PyQt so I'm not a *complete* newbie, but there is a real > > > advantage to having the content in one place rather than being directed > > > to other tutorials (not to mention the problem with links going stale). > > > > > > Tim Doty > > > > > > On Apr 2, 2013, at 5:34 PM, Aaron Richiger wrote: > > > > Hello Al and Marc! > > > > > > > > Many thanks for your offer, good tutorials are always essential for a > > > > popular project. I just wanted to have a look at your tuts, but the > > > > top five results of a google search after "pyside simplicissimus > > > > tutorial" > > > > directed me to dead links. So, this would be a good starting point:) > > > > > > > > We also do not have to reinvent the wheel, there are many examples > > > > coming with pyside already, have a look at them, you could probably > > > > use some of them, but enrich them with comments and explanations in > > > > your HTML. > > > > > > > > Marcs offer sounds great! It's always great to have "customers" > > > > helping designing the "products", because we sometimes can't imagine > > > > what's needed or missing for beginners. Having some newbies to test > > > > the tutorials would be great I think! > > > > > > > > Just one note, I think, your tutorials should not cover general python > > > > stuff but just PySide related stuff. There are plenty of good python > > > > tuts out there, we only need more PySide tuts. I know, that many of > > > > the PySide newbies are also python newbies (as Marc), but you could > > > > place some links to good python tuts at the beginning or start page > > > > of the tutorial and if you use some non-obvious python magic give > > > > another link to the specific explanation of this python feature (e.g. > > > > when you first use list comprehension). Our tutorials should focus on > > > > the important (=PySide) stuff! > > > > > > > > Happy coding! > > > > Aaron > > > > > > > > Am 02.04.2013 23:41, schrieb Marc Hankin: > > > >> Hi. I'm a python newbie and a pyside newbie. > > > >> I've gone through the zetcode tutorial and the simplicitimus (or > > > >> whatever it is called), and I still feel crippled in using pyside. I > > > >> used to teach law at a law school and I like to think about > > > >> pedagogical issues. So, if you folks want to try out some of your > > > >> tutorials on me and get my questionable feedback about how to > > > >> improve your tutorials, I'd be very pleased with the opportunity to > > > >> give you feedback ... and I confess, I also would like to learn from > > > >> you. > > > >> > > > >> It's really wonderful to follow your emails. The open source > > > >> python/pyside community is so giving/altruistic that it is fun to > > > >> follow your emails. I wish I could occupy myself with this stuff > > > >> full time and never see the nasty interior of a courtroom again. > > > >> > > > >> Anyway, thanks again, > > > >> > > > >> Marc > > > >> > > > >> ******************************************************************** > > > >> > > > >> Marc B. Hankin > > > >> The Law Offices of Marc B. Hankin, Inc. > > > >> Post Office Box 3668, Beverly Hills, California 90212 (Not for > > > >> mail:509S.BeverlyDr.) Tel: (310) 552-3005 Fax: (310) 382-2416 > > > >> Email: marc at marchankin.com Website: www.marchankin.com > > > >> > > > >> This e-mail message is generated from the law firm of the Law > > > >> Offices of Marc B. Hankin, Inc., and may contain information > > > >> that is confidential and may be privileged as an > > > >> attorney/client communication or as attorney work product. The > > > >> information is intended to be disclosed solely to the > > > >> addressee(s). If you are not the intended recipient, any > > > >> disclosure, copying, distribution or use of the contents of > > > >> this e-mail information is prohibited. If you have received > > > >> this e-mail in error, please notify the sender by return e-mail > > > >> and delete it from your computer system.>> > > > >> ******************************************************************** > > > >> > > > >> > > > >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: > > > >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila > > > >> wrote: I am in the process of porting the tutorial to PySide and > > > >> Python 3.x. If there are no objections, I would like to post it in > > > >> the PySide newbie tutorial section in a similar style to > > > >> PySideSimplicissimus: > > > >> > > > >> From wiki/PySideTutorials link to new page PySideSimple > > > >> from PySideSimple links to probably 4 separate stage pages with > > > >> return to PySideSimple, which in turn returns to PySideTutorials. > > > >> > > > >> Al (aka OldAl) > > > >> > > > >> Hi Al, the newbie tutorials are a great idea. The > > > >> PySideSimplicissimus series were well-written and easy to follow. > > > >> > > > >> What modules do you plan on covering in these new tutorials? The > > > >> tutorials we currently have are great but it's not comprehensive in > > > >> covering more Qt modules. Here's hoping to see more modules covered > > > >> in newer tutorials. > > > >> > > > >> Thanks! > > > >> > > > >> _______________________________________________ > > > >> PySide mailing list > > > >> PySide at qt-project.org > > > >> http://lists.qt-project.org/mailman/listinfo/pyside > > > >> > > > >> > > > >> > > > >> > > > >> _______________________________________________ > > > >> PySide mailing list > > > >> > > > >> PySide at qt-project.org > > > >> http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > > > _______________________________________________ > > > > PySide mailing list > > > > PySide at qt-project.org > > > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > _______________________________________________ > > > PySide mailing list > > > PySide at qt-project.org > > > http://lists.qt-project.org/mailman/listinfo/pyside > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > -- ** [image: San's personal blog] * * -------------- next part -------------- An HTML attachment was scrubbed... URL: From thoromyr at mac.com Wed Apr 3 13:52:59 2013 From: thoromyr at mac.com (Tim Doty) Date: Wed, 03 Apr 2013 06:52:59 -0500 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: <515B5CF5.7080102@bluewin.ch> <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> <1880990.7qVRghPlsz@supremo> Message-ID: <9DAD15F5-F2DD-4E52-8835-D7066E6ED07E@mac.com> oh, its out of date true enough. It still remains the best text I know of. My main point was the approach where he did cover basics of Python so while you would be better off having other sources the book did stand on its own. IMO a newbie tutorial set is better at being self contained in this fashion than either assuming a knowledge of Python or sending the user elsewhere. I understand the desire to not duplicate effort, and it wouldn't be to teach Python per se, just to provide sufficient basis for the tutorial. Again, IMO, this important for something seen as a newbie tutorial. I didn't see it directly referenced on the page I linked, but I remember reading a statement by him about doing it for PySide and roughly his response was that PyQt and PySide were similar enough you could get by with the present book and he lacked the time (other commitments) to address it. Perhaps if he was persuaded to do a Python and Qt5 book it would be enough different to be seen as worth his while. Tim Doty On Apr 3, 2013, at 4:02 AM, šãñ wrote: > well, I have found Yasin's tutorial on Model View programming a lot better than the ones refer in Mark Summerfield's book. Also the book is older edition , and many new things were introduced later like QFileSystemModel etc... > > Last time I talked to Mark a month back, he had no plans for a new edition. however it could have been nice if he or someone contribute in going over different areas giving focus to PySide. > > > On Wed, Apr 3, 2013 at 1:26 PM, Algis Kabaila wrote: > Tim, > > You wrote: > > Mark Summerfield's excellent book "Rapid GUI Programming with Python and > Qt" (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it > > does cover things. > > I want to second that. An extract from the "simple editor" tutorial of PyQt that I wrote some years ago has this statement: > > """Have I mentioned that all that I know about PyQt I have learned from an excellent text "Rapid GUI Programming with Python and Qt" by Mark Summerfield? Well, I mention it now - it is a great text book. This tutorial is meant to be a "gentle" introduction to the PyQt world and it would be a disservice to the reader not to point out the direction to a more thorough treatment of the subject.""" > > Your point is really appreciated. > > @Aaron Richiger - Mark Summerfield does a great job of revision of python in the introduction. Good read, indeed. > > Al. > > On Tuesday 02 April 2013 17:49:25 Tim Doty wrote: > > To a point I agree about focusing on PySide, but it doesn't hurt to > > cover (at least cursorily) some elementary Python as well. Mark > > Summerfield's excellent book "Rapid GUI Programming with Python and Qt" > > (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it > > does cover things. > > > > In fact, one of the best things IMO would be if he adapted that book to > > PySide. Regrettably, I doubt he has the time to do so > > (http://www.qtrac.eu/pyqtbook.html#pyside). > > > > I'm coming from PyQt so I'm not a *complete* newbie, but there is a real > > advantage to having the content in one place rather than being directed > > to other tutorials (not to mention the problem with links going stale). > > > > Tim Doty > > > > On Apr 2, 2013, at 5:34 PM, Aaron Richiger wrote: > > > Hello Al and Marc! > > > > > > Many thanks for your offer, good tutorials are always essential for a > > > popular project. I just wanted to have a look at your tuts, but the > > > top five results of a google search after "pyside simplicissimus > > > tutorial" > > > directed me to dead links. So, this would be a good starting point:) > > > > > > We also do not have to reinvent the wheel, there are many examples > > > coming with pyside already, have a look at them, you could probably > > > use some of them, but enrich them with comments and explanations in > > > your HTML. > > > > > > Marcs offer sounds great! It's always great to have "customers" > > > helping designing the "products", because we sometimes can't imagine > > > what's needed or missing for beginners. Having some newbies to test > > > the tutorials would be great I think! > > > > > > Just one note, I think, your tutorials should not cover general python > > > stuff but just PySide related stuff. There are plenty of good python > > > tuts out there, we only need more PySide tuts. I know, that many of > > > the PySide newbies are also python newbies (as Marc), but you could > > > place some links to good python tuts at the beginning or start page > > > of the tutorial and if you use some non-obvious python magic give > > > another link to the specific explanation of this python feature (e.g. > > > when you first use list comprehension). Our tutorials should focus on > > > the important (=PySide) stuff! > > > > > > Happy coding! > > > Aaron > > > > > > Am 02.04.2013 23:41, schrieb Marc Hankin: > > >> Hi. I'm a python newbie and a pyside newbie. > > >> I've gone through the zetcode tutorial and the simplicitimus (or > > >> whatever it is called), and I still feel crippled in using pyside. I > > >> used to teach law at a law school and I like to think about > > >> pedagogical issues. So, if you folks want to try out some of your > > >> tutorials on me and get my questionable feedback about how to > > >> improve your tutorials, I'd be very pleased with the opportunity to > > >> give you feedback ... and I confess, I also would like to learn from > > >> you. > > >> > > >> It's really wonderful to follow your emails. The open source > > >> python/pyside community is so giving/altruistic that it is fun to > > >> follow your emails. I wish I could occupy myself with this stuff > > >> full time and never see the nasty interior of a courtroom again. > > >> > > >> Anyway, thanks again, > > >> > > >> Marc > > >> > > >> ******************************************************************** > > >> > > >> Marc B. Hankin > > >> The Law Offices of Marc B. Hankin, Inc. > > >> Post Office Box 3668, Beverly Hills, California 90212 (Not for > > >> mail:509S.BeverlyDr.) Tel: (310) 552-3005 Fax: (310) 382-2416 > > >> Email: marc at marchankin.com Website: www.marchankin.com > > >> > > >> This e-mail message is generated from the law firm of the Law > > >> Offices of Marc B. Hankin, Inc., and may contain information > > >> that is confidential and may be privileged as an > > >> attorney/client communication or as attorney work product. The > > >> information is intended to be disclosed solely to the > > >> addressee(s). If you are not the intended recipient, any > > >> disclosure, copying, distribution or use of the contents of > > >> this e-mail information is prohibited. If you have received > > >> this e-mail in error, please notify the sender by return e-mail > > >> and delete it from your computer system.>> > > >> ******************************************************************** > > >> > > >> > > >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: > > >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila > > >> wrote: I am in the process of porting the tutorial to PySide and > > >> Python 3.x. If there are no objections, I would like to post it in > > >> the PySide newbie tutorial section in a similar style to > > >> PySideSimplicissimus: > > >> > > >> From wiki/PySideTutorials link to new page PySideSimple > > >> from PySideSimple links to probably 4 separate stage pages with > > >> return to PySideSimple, which in turn returns to PySideTutorials. > > >> > > >> Al (aka OldAl) > > >> > > >> Hi Al, the newbie tutorials are a great idea. The > > >> PySideSimplicissimus series were well-written and easy to follow. > > >> > > >> What modules do you plan on covering in these new tutorials? The > > >> tutorials we currently have are great but it's not comprehensive in > > >> covering more Qt modules. Here's hoping to see more modules covered > > >> in newer tutorials. > > >> > > >> Thanks! > > >> > > >> _______________________________________________ > > >> PySide mailing list > > >> PySide at qt-project.org > > >> http://lists.qt-project.org/mailman/listinfo/pyside > > >> > > >> > > >> > > >> > > >> _______________________________________________ > > >> PySide mailing list > > >> > > >> PySide at qt-project.org > > >> http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > _______________________________________________ > > > PySide mailing list > > > PySide at qt-project.org > > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > -- > > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From serpulga at gmail.com Wed Apr 3 15:32:37 2013 From: serpulga at gmail.com (=?ISO-8859-1?Q?Sergio_Pulgar=EDn?=) Date: Wed, 3 Apr 2013 08:32:37 -0500 Subject: [PySide] PySide tutorials In-Reply-To: References: <1647993.1TEWbTIKC7@supremo> Message-ID: On 3 April 2013 03:25, lndn wrote: > On Wed, Apr 3, 2013 at 12:44 AM, Algis Kabaila wrote: > >> ** >> >> I would like to acknowledge the effort at coordination to lndn < >> lndndev at gmail.com> - let us "appoint" him as a coordinator and follow >> his directions. So I will wait for his suggestions. >> >> Al. >> > > I'm new to the PySide project so I'm just going with the flow and seeing > what's currently out there now and contributing wherever I can. I probably > want what most people want: an abundance of well-written tutorials, clear > documentation and good examples to follow. I look forward to seeing new > tutorials (Al, Sergo...). > > I'm currently writing a short "Getting Started with PySide Development" > guide [1]. I'm learning at the same time as writing and it's far from > complete, so any feedback is welcome. There's not enough tutorials and > documentation on the development aspect of PySide and that's a weakness I'm > trying to change. > > > > [1] http://qt-project.org/wiki/PyS > > It's decided, LNDN will coordinate these efforts. > > ide_Development_Getting_Started > > > I agree it is good to have one coordinator for this effort. -------------- next part -------------- An HTML attachment was scrubbed... URL: From heng at cantab.net Wed Apr 3 15:46:35 2013 From: heng at cantab.net (Henry Gomersall) Date: Wed, 03 Apr 2013 14:46:35 +0100 Subject: [PySide] PySide tutorials In-Reply-To: References: <1647993.1TEWbTIKC7@supremo> Message-ID: <1364996795.5955.47.camel@farnsworth> On Wed, 2013-04-03 at 08:32 -0500, Sergio Pulgarín wrote: > I'm new to the PySide project so I'm just going with the flow and > seeing what's currently out there now and contributing wherever I > can. I probably want what most people want: an abundance of > well-written tutorials, clear documentation and good examples to > follow. I look forward to seeing new tutorials (Al, Sergo...). > Just to contribute to the discussion: I wrote a few blog posts (including code) when playing with PySide + QML + OpenGL. They may be of interest as working test cases showing some interesting capabilities. https://hgomersall.wordpress.com/2011/03/31/qml_with_opengl_using_python/ https://hgomersall.wordpress.com/2011/03/31/rendering-textures-in-glsl-using-python/ https://hgomersall.wordpress.com/2011/06/09/almost-pretty-drawers-with-qml/ Do with them what you will. Cheers, Henry From metaperl at gmail.com Wed Apr 3 16:46:14 2013 From: metaperl at gmail.com (Terrence Brannon) Date: Wed, 3 Apr 2013 14:46:14 +0000 (UTC) Subject: [PySide] issues building PySide on RHEL 6.4 Message-ID: Hello, I attempted to install PySide on a RHEL 6.3 system. I built a virtual environment containing Python 2.7. The system Qt libraries were only 4.6.2. When I activate my virtual environment and type `pip install PySide` I get the error: CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: QT_PHONON_INCLUDE_DIR (ADVANCED) used as include directory in directory /home/tbrannon/prg/webbot/build/PySide/sources/pyside/PySide/phonon The entire build log is here: http://static.livingcosmos.org/scpaste/pip.log As an aside, I'd like to mention that I got no headway in bringing up this issue in this thread: https://github.com/PySide/BuildScripts/issues/6 From jpe at wingware.com Wed Apr 3 17:38:46 2013 From: jpe at wingware.com (John Ehresman) Date: Wed, 03 Apr 2013 11:38:46 -0400 Subject: [PySide] issues building PySide on RHEL 6.4 In-Reply-To: References: Message-ID: <515C4D06.3030203@wingware.com> On 4/3/13 10:46 AM, Terrence Brannon wrote: > When I activate my virtual environment and type `pip install PySide` I > get the error: > > CMake Error: The following variables are used in this project, but > they are set to NOTFOUND. Please set them or make sure they are set > and tested correctly in the CMake files: QT_PHONON_INCLUDE_DIR > (ADVANCED) used as include directory in directory > /home/tbrannon/prg/webbot/build/PySide/sources/pyside/PySide/phonon > > The entire build log is here: > http://static.livingcosmos.org/scpaste/pip.log Are the phonon development files installed on the system? I believe that the error indicates that the phonon headers were not found. It may be a bug that PySide can't be built without phonon support but even if it is, just installing them is probably easier than fixing the bug. Thanks, John From niceguysan at gmail.com Wed Apr 3 17:55:11 2013 From: niceguysan at gmail.com (=?UTF-8?B?xaHDo8Ox?=) Date: Wed, 3 Apr 2013 21:25:11 +0530 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: <9DAD15F5-F2DD-4E52-8835-D7066E6ED07E@mac.com> References: <515B5CF5.7080102@bluewin.ch> <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> <1880990.7qVRghPlsz@supremo> <9DAD15F5-F2DD-4E52-8835-D7066E6ED07E@mac.com> Message-ID: oh here is one of my contribution to PySide newbie tutorial with very less explanation though http://www.devilsan.com/1/post/2013/01/pyside-version-of-rename-selected-node.html Its a tool to rename selected node in Autodesk maya.. i hope this is of any useful, it was more of fun doing it. On Wed, Apr 3, 2013 at 5:22 PM, Tim Doty wrote: > oh, its out of date true enough. It still remains the best text I know of. > > My main point was the approach where he did cover basics of Python so > while you would be better off having other sources the book did stand on > its own. IMO a newbie tutorial set is better at being self contained in > this fashion than either assuming a knowledge of Python or sending the user > elsewhere. I understand the desire to not duplicate effort, and it wouldn't > be to teach Python per se, just to provide sufficient basis for the > tutorial. Again, IMO, this important for something seen as a newbie > tutorial. > > I didn't see it directly referenced on the page I linked, but I remember > reading a statement by him about doing it for PySide and roughly his > response was that PyQt and PySide were similar enough you could get by with > the present book and he lacked the time (other commitments) to address it. > Perhaps if he was persuaded to do a Python and Qt5 book it would be enough > different to be seen as worth his while. > > Tim Doty > On Apr 3, 2013, at 4:02 AM, šãñ wrote: > > > well, I have found Yasin's tutorial on Model View programming a lot > better than the ones refer in Mark Summerfield's book. Also the book is > older edition , and many new things were introduced later like > QFileSystemModel etc... > > > > Last time I talked to Mark a month back, he had no plans for a new > edition. however it could have been nice if he or someone contribute in > going over different areas giving focus to PySide. > > > > > > On Wed, Apr 3, 2013 at 1:26 PM, Algis Kabaila > wrote: > > Tim, > > > > You wrote: > > > Mark Summerfield's excellent book "Rapid GUI Programming with Python > and > Qt" (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, > but it > > > does cover things. > > > > I want to second that. An extract from the "simple editor" tutorial of > PyQt that I wrote some years ago has this statement: > > > > """Have I mentioned that all that I know about PyQt I have learned from > an excellent text "Rapid GUI Programming with Python and Qt" by Mark > Summerfield? Well, I mention it now - it is a great text book. This > tutorial is meant to be a "gentle" introduction to the PyQt world and it > would be a disservice to the reader not to point out the direction to a > more thorough treatment of the subject.""" > > > > Your point is really appreciated. > > > > @Aaron Richiger - Mark Summerfield does a great job of revision of > python in the introduction. Good read, indeed. > > > > Al. > > > > On Tuesday 02 April 2013 17:49:25 Tim Doty wrote: > > > To a point I agree about focusing on PySide, but it doesn't hurt to > > > cover (at least cursorily) some elementary Python as well. Mark > > > Summerfield's excellent book "Rapid GUI Programming with Python and Qt" > > > (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it > > > does cover things. > > > > > > In fact, one of the best things IMO would be if he adapted that book to > > > PySide. Regrettably, I doubt he has the time to do so > > > (http://www.qtrac.eu/pyqtbook.html#pyside). > > > > > > I'm coming from PyQt so I'm not a *complete* newbie, but there is a > real > > > advantage to having the content in one place rather than being directed > > > to other tutorials (not to mention the problem with links going stale). > > > > > > Tim Doty > > > > > > On Apr 2, 2013, at 5:34 PM, Aaron Richiger wrote: > > > > Hello Al and Marc! > > > > > > > > Many thanks for your offer, good tutorials are always essential for a > > > > popular project. I just wanted to have a look at your tuts, but the > > > > top five results of a google search after "pyside simplicissimus > > > > tutorial" > > > > directed me to dead links. So, this would be a good starting point:) > > > > > > > > We also do not have to reinvent the wheel, there are many examples > > > > coming with pyside already, have a look at them, you could probably > > > > use some of them, but enrich them with comments and explanations in > > > > your HTML. > > > > > > > > Marcs offer sounds great! It's always great to have "customers" > > > > helping designing the "products", because we sometimes can't imagine > > > > what's needed or missing for beginners. Having some newbies to test > > > > the tutorials would be great I think! > > > > > > > > Just one note, I think, your tutorials should not cover general > python > > > > stuff but just PySide related stuff. There are plenty of good python > > > > tuts out there, we only need more PySide tuts. I know, that many of > > > > the PySide newbies are also python newbies (as Marc), but you could > > > > place some links to good python tuts at the beginning or start page > > > > of the tutorial and if you use some non-obvious python magic give > > > > another link to the specific explanation of this python feature (e.g. > > > > when you first use list comprehension). Our tutorials should focus on > > > > the important (=PySide) stuff! > > > > > > > > Happy coding! > > > > Aaron > > > > > > > > Am 02.04.2013 23:41, schrieb Marc Hankin: > > > >> Hi. I'm a python newbie and a pyside newbie. > > > >> I've gone through the zetcode tutorial and the simplicitimus (or > > > >> whatever it is called), and I still feel crippled in using pyside. I > > > >> used to teach law at a law school and I like to think about > > > >> pedagogical issues. So, if you folks want to try out some of your > > > >> tutorials on me and get my questionable feedback about how to > > > >> improve your tutorials, I'd be very pleased with the opportunity to > > > >> give you feedback ... and I confess, I also would like to learn from > > > >> you. > > > >> > > > >> It's really wonderful to follow your emails. The open source > > > >> python/pyside community is so giving/altruistic that it is fun to > > > >> follow your emails. I wish I could occupy myself with this stuff > > > >> full time and never see the nasty interior of a courtroom again. > > > >> > > > >> Anyway, thanks again, > > > >> > > > >> Marc > > > >> > > > >> ******************************************************************** > > > >> > > > >> Marc B. Hankin > > > >> The Law Offices of Marc B. Hankin, Inc. > > > >> Post Office Box 3668, Beverly Hills, California 90212 (Not for > > > >> mail:509S.BeverlyDr.) Tel: (310) 552-3005 Fax: (310) 382-2416 > > > >> Email: marc at marchankin.com Website: www.marchankin.com > > > >> > > > >> This e-mail message is generated from the law firm of the Law > > > >> Offices of Marc B. Hankin, Inc., and may contain information > > > >> that is confidential and may be privileged as an > > > >> attorney/client communication or as attorney work product. The > > > >> information is intended to be disclosed solely to the > > > >> addressee(s). If you are not the intended recipient, any > > > >> disclosure, copying, distribution or use of the contents of > > > >> this e-mail information is prohibited. If you have received > > > >> this e-mail in error, please notify the sender by return e-mail > > > >> and delete it from your computer system.>> > > > >> ******************************************************************** > > > >> > > > >> > > > >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: > > > >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila > > > > >> wrote: I am in the process of porting the tutorial to PySide and > > > >> Python 3.x. If there are no objections, I would like to post it in > > > >> the PySide newbie tutorial section in a similar style to > > > >> PySideSimplicissimus: > > > >> > > > >> From wiki/PySideTutorials link to new page PySideSimple > > > >> from PySideSimple links to probably 4 separate stage pages with > > > >> return to PySideSimple, which in turn returns to PySideTutorials. > > > >> > > > >> Al (aka OldAl) > > > >> > > > >> Hi Al, the newbie tutorials are a great idea. The > > > >> PySideSimplicissimus series were well-written and easy to follow. > > > >> > > > >> What modules do you plan on covering in these new tutorials? The > > > >> tutorials we currently have are great but it's not comprehensive in > > > >> covering more Qt modules. Here's hoping to see more modules covered > > > >> in newer tutorials. > > > >> > > > >> Thanks! > > > >> > > > >> _______________________________________________ > > > >> PySide mailing list > > > >> PySide at qt-project.org > > > >> http://lists.qt-project.org/mailman/listinfo/pyside > > > >> > > > >> > > > >> > > > >> > > > >> _______________________________________________ > > > >> PySide mailing list > > > >> > > > >> PySide at qt-project.org > > > >> http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > > > _______________________________________________ > > > > PySide mailing list > > > > PySide at qt-project.org > > > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > _______________________________________________ > > > PySide mailing list > > > PySide at qt-project.org > > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > > > > > -- > > > > > > > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > -- ** [image: San's personal blog] * * -------------- next part -------------- An HTML attachment was scrubbed... URL: From techtonik at gmail.com Wed Apr 3 21:42:24 2013 From: techtonik at gmail.com (anatoly techtonik) Date: Wed, 3 Apr 2013 22:42:24 +0300 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: <515B5CF5.7080102@bluewin.ch> <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> <1880990.7qVRghPlsz@supremo> <9DAD15F5-F2DD-4E52-8835-D7066E6ED07E@mac.com> Message-ID: Since everyone is posting links to their totally noob PySide tutorials, here is mine. =) https://bitbucket.org/techtonik/pyside-copy-paste/src I've stopped after a few days. Seems like it was some Qt or PySide bug that drained my energy on the last file. The source code is in public domain, though, so feel free to fork and continue. As for editor - I used Spyder IDE - it is open source, MIT licensed and you can learn A LOT about PySide by reading and improving (fixing?) its code. Well, until PySide was frozen, this was my favorite toy. And also, Pakt looks for authors to write a book on PySide. I am not an English native and writing in proper language is very exhaustive for me, so I realistically can not do this. If somebody feels capable - feel free to email me and I'll give you the contact. ;) -- anatoly t. On Wed, Apr 3, 2013 at 6:55 PM, šãñ wrote: > oh here is one of my contribution to PySide newbie tutorial with very less > explanation though > > > http://www.devilsan.com/1/post/2013/01/pyside-version-of-rename-selected-node.html > > Its a tool to rename selected node in Autodesk maya.. > i hope this is of any useful, it was more of fun doing it. > > > On Wed, Apr 3, 2013 at 5:22 PM, Tim Doty wrote: > >> oh, its out of date true enough. It still remains the best text I know of. >> >> My main point was the approach where he did cover basics of Python so >> while you would be better off having other sources the book did stand on >> its own. IMO a newbie tutorial set is better at being self contained in >> this fashion than either assuming a knowledge of Python or sending the user >> elsewhere. I understand the desire to not duplicate effort, and it wouldn't >> be to teach Python per se, just to provide sufficient basis for the >> tutorial. Again, IMO, this important for something seen as a newbie >> tutorial. >> >> I didn't see it directly referenced on the page I linked, but I remember >> reading a statement by him about doing it for PySide and roughly his >> response was that PyQt and PySide were similar enough you could get by with >> the present book and he lacked the time (other commitments) to address it. >> Perhaps if he was persuaded to do a Python and Qt5 book it would be enough >> different to be seen as worth his while. >> >> Tim Doty >> On Apr 3, 2013, at 4:02 AM, šãñ wrote: >> >> > well, I have found Yasin's tutorial on Model View programming a lot >> better than the ones refer in Mark Summerfield's book. Also the book is >> older edition , and many new things were introduced later like >> QFileSystemModel etc... >> > >> > Last time I talked to Mark a month back, he had no plans for a new >> edition. however it could have been nice if he or someone contribute in >> going over different areas giving focus to PySide. >> > >> > >> > On Wed, Apr 3, 2013 at 1:26 PM, Algis Kabaila >> wrote: >> > Tim, >> > >> > You wrote: >> > > Mark Summerfield's excellent book "Rapid GUI Programming with Python >> and > Qt" (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, >> but it >> > > does cover things. >> > >> > I want to second that. An extract from the "simple editor" tutorial of >> PyQt that I wrote some years ago has this statement: >> > >> > """Have I mentioned that all that I know about PyQt I have learned from >> an excellent text "Rapid GUI Programming with Python and Qt" by Mark >> Summerfield? Well, I mention it now - it is a great text book. This >> tutorial is meant to be a "gentle" introduction to the PyQt world and it >> would be a disservice to the reader not to point out the direction to a >> more thorough treatment of the subject.""" >> > >> > Your point is really appreciated. >> > >> > @Aaron Richiger - Mark Summerfield does a great job of revision of >> python in the introduction. Good read, indeed. >> > >> > Al. >> > >> > On Tuesday 02 April 2013 17:49:25 Tim Doty wrote: >> > > To a point I agree about focusing on PySide, but it doesn't hurt to >> > > cover (at least cursorily) some elementary Python as well. Mark >> > > Summerfield's excellent book "Rapid GUI Programming with Python and >> Qt" >> > > (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it >> > > does cover things. >> > > >> > > In fact, one of the best things IMO would be if he adapted that book >> to >> > > PySide. Regrettably, I doubt he has the time to do so >> > > (http://www.qtrac.eu/pyqtbook.html#pyside). >> > > >> > > I'm coming from PyQt so I'm not a *complete* newbie, but there is a >> real >> > > advantage to having the content in one place rather than being >> directed >> > > to other tutorials (not to mention the problem with links going >> stale). >> > > >> > > Tim Doty >> > > >> > > On Apr 2, 2013, at 5:34 PM, Aaron Richiger >> wrote: >> > > > Hello Al and Marc! >> > > > >> > > > Many thanks for your offer, good tutorials are always essential for >> a >> > > > popular project. I just wanted to have a look at your tuts, but the >> > > > top five results of a google search after "pyside simplicissimus >> > > > tutorial" >> > > > directed me to dead links. So, this would be a good starting point:) >> > > > >> > > > We also do not have to reinvent the wheel, there are many examples >> > > > coming with pyside already, have a look at them, you could probably >> > > > use some of them, but enrich them with comments and explanations in >> > > > your HTML. >> > > > >> > > > Marcs offer sounds great! It's always great to have "customers" >> > > > helping designing the "products", because we sometimes can't imagine >> > > > what's needed or missing for beginners. Having some newbies to test >> > > > the tutorials would be great I think! >> > > > >> > > > Just one note, I think, your tutorials should not cover general >> python >> > > > stuff but just PySide related stuff. There are plenty of good python >> > > > tuts out there, we only need more PySide tuts. I know, that many of >> > > > the PySide newbies are also python newbies (as Marc), but you could >> > > > place some links to good python tuts at the beginning or start page >> > > > of the tutorial and if you use some non-obvious python magic give >> > > > another link to the specific explanation of this python feature >> (e.g. >> > > > when you first use list comprehension). Our tutorials should focus >> on >> > > > the important (=PySide) stuff! >> > > > >> > > > Happy coding! >> > > > Aaron >> > > > >> > > > Am 02.04.2013 23:41, schrieb Marc Hankin: >> > > >> Hi. I'm a python newbie and a pyside newbie. >> > > >> I've gone through the zetcode tutorial and the simplicitimus (or >> > > >> whatever it is called), and I still feel crippled in using pyside. >> I >> > > >> used to teach law at a law school and I like to think about >> > > >> pedagogical issues. So, if you folks want to try out some of your >> > > >> tutorials on me and get my questionable feedback about how to >> > > >> improve your tutorials, I'd be very pleased with the opportunity to >> > > >> give you feedback ... and I confess, I also would like to learn >> from >> > > >> you. >> > > >> >> > > >> It's really wonderful to follow your emails. The open source >> > > >> python/pyside community is so giving/altruistic that it is fun to >> > > >> follow your emails. I wish I could occupy myself with this stuff >> > > >> full time and never see the nasty interior of a courtroom again. >> > > >> >> > > >> Anyway, thanks again, >> > > >> >> > > >> Marc >> > > >> >> > > >> >> ******************************************************************** >> > > >> >> > > >> Marc B. Hankin >> > > >> The Law Offices of Marc B. Hankin, Inc. >> > > >> Post Office Box 3668, Beverly Hills, California 90212 (Not for >> > > >> mail:509S.BeverlyDr.) Tel: (310) 552-3005 Fax: (310) 382-2416 >> > > >> Email: marc at marchankin.com Website: www.marchankin.com >> > > >> >> > > >> This e-mail message is generated from the law firm of the Law >> > > >> Offices of Marc B. Hankin, Inc., and may contain information >> > > >> that is confidential and may be privileged as an >> > > >> attorney/client communication or as attorney work product. The >> > > >> information is intended to be disclosed solely to the >> > > >> addressee(s). If you are not the intended recipient, any >> > > >> disclosure, copying, distribution or use of the contents of >> > > >> this e-mail information is prohibited. If you have received >> > > >> this e-mail in error, please notify the sender by return e-mail >> > > >> and delete it from your computer system.>> >> > > >> >> ******************************************************************** >> > > >> >> > > >> >> > > >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: >> > > >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila < >> akabaila at pcug.org.au> >> > > >> wrote: I am in the process of porting the tutorial to PySide and >> > > >> Python 3.x. If there are no objections, I would like to post it in >> > > >> the PySide newbie tutorial section in a similar style to >> > > >> PySideSimplicissimus: >> > > >> >> > > >> From wiki/PySideTutorials link to new page PySideSimple >> > > >> from PySideSimple links to probably 4 separate stage pages with >> > > >> return to PySideSimple, which in turn returns to PySideTutorials. >> > > >> >> > > >> Al (aka OldAl) >> > > >> >> > > >> Hi Al, the newbie tutorials are a great idea. The >> > > >> PySideSimplicissimus series were well-written and easy to follow. >> > > >> >> > > >> What modules do you plan on covering in these new tutorials? The >> > > >> tutorials we currently have are great but it's not comprehensive in >> > > >> covering more Qt modules. Here's hoping to see more modules covered >> > > >> in newer tutorials. >> > > >> >> > > >> Thanks! >> > > >> >> > > >> _______________________________________________ >> > > >> PySide mailing list >> > > >> PySide at qt-project.org >> > > >> http://lists.qt-project.org/mailman/listinfo/pyside >> > > >> >> > > >> >> > > >> >> > > >> >> > > >> _______________________________________________ >> > > >> PySide mailing list >> > > >> >> > > >> PySide at qt-project.org >> > > >> http://lists.qt-project.org/mailman/listinfo/pyside >> > > > >> > > > _______________________________________________ >> > > > PySide mailing list >> > > > PySide at qt-project.org >> > > > http://lists.qt-project.org/mailman/listinfo/pyside >> > > >> > > _______________________________________________ >> > > PySide mailing list >> > > PySide at qt-project.org >> > > http://lists.qt-project.org/mailman/listinfo/pyside >> > >> > _______________________________________________ >> > PySide mailing list >> > PySide at qt-project.org >> > http://lists.qt-project.org/mailman/listinfo/pyside >> > >> > >> > >> > >> > -- >> > >> > >> > >> > >> > _______________________________________________ >> > PySide mailing list >> > PySide at qt-project.org >> > http://lists.qt-project.org/mailman/listinfo/pyside >> >> > > > -- > ** > > [image: San's personal blog] > > * > * > > _______________________________________________ > 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 lndndev at gmail.com Thu Apr 4 00:31:18 2013 From: lndndev at gmail.com (lndn) Date: Wed, 3 Apr 2013 15:31:18 -0700 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: <515B5CF5.7080102@bluewin.ch> <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> <1880990.7qVRghPlsz@supremo> <9DAD15F5-F2DD-4E52-8835-D7066E6ED07E@mac.com> Message-ID: Hello everyone, Thanks for all the links to the tutorials. I added all of them to the wiki. If you haven't been to the wiki in a while, now's a good time to check it out (http://pyside.org): - 43 new video tutorials - More organized PySide Documentation page -- easier for newbies to get started - More organized PySide Development page -- easier for curious developers to get into the code Many other improvements are coming and your feedback / contribution are always welcome. We need more people to contribute to the PySide Development page. If you're familiar with the pyside source code, shiboken internals, etc, please consider writing a short tutorial/wiki page that you think others might benefit. Documentation at any levels is needed (from high-level overview to explanation of the source code itself). Thanks! On Wed, Apr 3, 2013 at 12:42 PM, anatoly techtonik wrote: > Since everyone is posting links to their totally noob PySide tutorials, > here is mine. =) > https://bitbucket.org/techtonik/pyside-copy-paste/src > > I've stopped after a few days. Seems like it was some Qt or PySide bug > that drained my energy on the last file. The source code is in public > domain, though, so feel free to fork and continue. > > As for editor - I used Spyder IDE - it is open source, MIT licensed and > you can learn A LOT about PySide by reading and improving (fixing?) its > code. Well, until PySide was frozen, this was my favorite toy. > > And also, Pakt looks for authors to write a book on PySide. I am not an > English native and writing in proper language is very exhaustive for me, so > I realistically can not do this. If somebody feels capable - feel free to > email me and I'll give you the contact. ;) > > -- > anatoly t. > > > On Wed, Apr 3, 2013 at 6:55 PM, šãñ wrote: > >> oh here is one of my contribution to PySide newbie tutorial with very >> less explanation though >> >> >> http://www.devilsan.com/1/post/2013/01/pyside-version-of-rename-selected-node.html >> >> Its a tool to rename selected node in Autodesk maya.. >> i hope this is of any useful, it was more of fun doing it. >> >> >> On Wed, Apr 3, 2013 at 5:22 PM, Tim Doty wrote: >> >>> oh, its out of date true enough. It still remains the best text I know >>> of. >>> >>> My main point was the approach where he did cover basics of Python so >>> while you would be better off having other sources the book did stand on >>> its own. IMO a newbie tutorial set is better at being self contained in >>> this fashion than either assuming a knowledge of Python or sending the user >>> elsewhere. I understand the desire to not duplicate effort, and it wouldn't >>> be to teach Python per se, just to provide sufficient basis for the >>> tutorial. Again, IMO, this important for something seen as a newbie >>> tutorial. >>> >>> I didn't see it directly referenced on the page I linked, but I remember >>> reading a statement by him about doing it for PySide and roughly his >>> response was that PyQt and PySide were similar enough you could get by with >>> the present book and he lacked the time (other commitments) to address it. >>> Perhaps if he was persuaded to do a Python and Qt5 book it would be enough >>> different to be seen as worth his while. >>> >>> Tim Doty >>> On Apr 3, 2013, at 4:02 AM, šãñ wrote: >>> >>> > well, I have found Yasin's tutorial on Model View programming a lot >>> better than the ones refer in Mark Summerfield's book. Also the book is >>> older edition , and many new things were introduced later like >>> QFileSystemModel etc... >>> > >>> > Last time I talked to Mark a month back, he had no plans for a new >>> edition. however it could have been nice if he or someone contribute in >>> going over different areas giving focus to PySide. >>> > >>> > >>> > On Wed, Apr 3, 2013 at 1:26 PM, Algis Kabaila >>> wrote: >>> > Tim, >>> > >>> > You wrote: >>> > > Mark Summerfield's excellent book "Rapid GUI Programming with Python >>> and > Qt" (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, >>> but it >>> > > does cover things. >>> > >>> > I want to second that. An extract from the "simple editor" tutorial of >>> PyQt that I wrote some years ago has this statement: >>> > >>> > """Have I mentioned that all that I know about PyQt I have learned >>> from an excellent text "Rapid GUI Programming with Python and Qt" by Mark >>> Summerfield? Well, I mention it now - it is a great text book. This >>> tutorial is meant to be a "gentle" introduction to the PyQt world and it >>> would be a disservice to the reader not to point out the direction to a >>> more thorough treatment of the subject.""" >>> > >>> > Your point is really appreciated. >>> > >>> > @Aaron Richiger - Mark Summerfield does a great job of revision of >>> python in the introduction. Good read, indeed. >>> > >>> > Al. >>> > >>> > On Tuesday 02 April 2013 17:49:25 Tim Doty wrote: >>> > > To a point I agree about focusing on PySide, but it doesn't hurt to >>> > > cover (at least cursorily) some elementary Python as well. Mark >>> > > Summerfield's excellent book "Rapid GUI Programming with Python and >>> Qt" >>> > > (http://www.qtrac.eu/pyqtbook.html) doesn't dwell on basics, but it >>> > > does cover things. >>> > > >>> > > In fact, one of the best things IMO would be if he adapted that book >>> to >>> > > PySide. Regrettably, I doubt he has the time to do so >>> > > (http://www.qtrac.eu/pyqtbook.html#pyside). >>> > > >>> > > I'm coming from PyQt so I'm not a *complete* newbie, but there is a >>> real >>> > > advantage to having the content in one place rather than being >>> directed >>> > > to other tutorials (not to mention the problem with links going >>> stale). >>> > > >>> > > Tim Doty >>> > > >>> > > On Apr 2, 2013, at 5:34 PM, Aaron Richiger >>> wrote: >>> > > > Hello Al and Marc! >>> > > > >>> > > > Many thanks for your offer, good tutorials are always essential >>> for a >>> > > > popular project. I just wanted to have a look at your tuts, but the >>> > > > top five results of a google search after "pyside simplicissimus >>> > > > tutorial" >>> > > > directed me to dead links. So, this would be a good starting >>> point:) >>> > > > >>> > > > We also do not have to reinvent the wheel, there are many examples >>> > > > coming with pyside already, have a look at them, you could probably >>> > > > use some of them, but enrich them with comments and explanations in >>> > > > your HTML. >>> > > > >>> > > > Marcs offer sounds great! It's always great to have "customers" >>> > > > helping designing the "products", because we sometimes can't >>> imagine >>> > > > what's needed or missing for beginners. Having some newbies to test >>> > > > the tutorials would be great I think! >>> > > > >>> > > > Just one note, I think, your tutorials should not cover general >>> python >>> > > > stuff but just PySide related stuff. There are plenty of good >>> python >>> > > > tuts out there, we only need more PySide tuts. I know, that many of >>> > > > the PySide newbies are also python newbies (as Marc), but you could >>> > > > place some links to good python tuts at the beginning or start page >>> > > > of the tutorial and if you use some non-obvious python magic give >>> > > > another link to the specific explanation of this python feature >>> (e.g. >>> > > > when you first use list comprehension). Our tutorials should focus >>> on >>> > > > the important (=PySide) stuff! >>> > > > >>> > > > Happy coding! >>> > > > Aaron >>> > > > >>> > > > Am 02.04.2013 23:41, schrieb Marc Hankin: >>> > > >> Hi. I'm a python newbie and a pyside newbie. >>> > > >> I've gone through the zetcode tutorial and the simplicitimus (or >>> > > >> whatever it is called), and I still feel crippled in using >>> pyside. I >>> > > >> used to teach law at a law school and I like to think about >>> > > >> pedagogical issues. So, if you folks want to try out some of your >>> > > >> tutorials on me and get my questionable feedback about how to >>> > > >> improve your tutorials, I'd be very pleased with the opportunity >>> to >>> > > >> give you feedback ... and I confess, I also would like to learn >>> from >>> > > >> you. >>> > > >> >>> > > >> It's really wonderful to follow your emails. The open source >>> > > >> python/pyside community is so giving/altruistic that it is fun to >>> > > >> follow your emails. I wish I could occupy myself with this stuff >>> > > >> full time and never see the nasty interior of a courtroom again. >>> > > >> >>> > > >> Anyway, thanks again, >>> > > >> >>> > > >> Marc >>> > > >> >>> > > >> >>> ******************************************************************** >>> > > >> >>> > > >> Marc B. Hankin >>> > > >> The Law Offices of Marc B. Hankin, Inc. >>> > > >> Post Office Box 3668, Beverly Hills, California 90212 (Not for >>> > > >> mail:509S.BeverlyDr.) Tel: (310) 552-3005 Fax: (310) 382-2416 >>> > > >> Email: marc at marchankin.com Website: www.marchankin.com >>> > > >> >>> > > >> This e-mail message is generated from the law firm of the Law >>> > > >> Offices of Marc B. Hankin, Inc., and may contain information >>> > > >> that is confidential and may be privileged as an >>> > > >> attorney/client communication or as attorney work product. The >>> > > >> information is intended to be disclosed solely to the >>> > > >> addressee(s). If you are not the intended recipient, any >>> > > >> disclosure, copying, distribution or use of the contents of >>> > > >> this e-mail information is prohibited. If you have received >>> > > >> this e-mail in error, please notify the sender by return e-mail >>> > > >> and delete it from your computer system.>> >>> > > >> >>> ******************************************************************** >>> > > >> >>> > > >> >>> > > >> On Tue, Apr 2, 2013 at 2:23 PM, lndn wrote: >>> > > >> On Mon, Apr 1, 2013 at 5:35 AM, Algis Kabaila < >>> akabaila at pcug.org.au> >>> > > >> wrote: I am in the process of porting the tutorial to PySide and >>> > > >> Python 3.x. If there are no objections, I would like to post it in >>> > > >> the PySide newbie tutorial section in a similar style to >>> > > >> PySideSimplicissimus: >>> > > >> >>> > > >> From wiki/PySideTutorials link to new page PySideSimple >>> > > >> from PySideSimple links to probably 4 separate stage pages with >>> > > >> return to PySideSimple, which in turn returns to PySideTutorials. >>> > > >> >>> > > >> Al (aka OldAl) >>> > > >> >>> > > >> Hi Al, the newbie tutorials are a great idea. The >>> > > >> PySideSimplicissimus series were well-written and easy to follow. >>> > > >> >>> > > >> What modules do you plan on covering in these new tutorials? The >>> > > >> tutorials we currently have are great but it's not comprehensive >>> in >>> > > >> covering more Qt modules. Here's hoping to see more modules >>> covered >>> > > >> in newer tutorials. >>> > > >> >>> > > >> Thanks! >>> > > >> >>> > > >> _______________________________________________ >>> > > >> PySide mailing list >>> > > >> PySide at qt-project.org >>> > > >> http://lists.qt-project.org/mailman/listinfo/pyside >>> > > >> >>> > > >> >>> > > >> >>> > > >> >>> > > >> _______________________________________________ >>> > > >> PySide mailing list >>> > > >> >>> > > >> PySide at qt-project.org >>> > > >> http://lists.qt-project.org/mailman/listinfo/pyside >>> > > > >>> > > > _______________________________________________ >>> > > > PySide mailing list >>> > > > PySide at qt-project.org >>> > > > http://lists.qt-project.org/mailman/listinfo/pyside >>> > > >>> > > _______________________________________________ >>> > > PySide mailing list >>> > > PySide at qt-project.org >>> > > http://lists.qt-project.org/mailman/listinfo/pyside >>> > >>> > _______________________________________________ >>> > PySide mailing list >>> > PySide at qt-project.org >>> > http://lists.qt-project.org/mailman/listinfo/pyside >>> > >>> > >>> > >>> > >>> > -- >>> > >>> > >>> > >>> > >>> > _______________________________________________ >>> > PySide mailing list >>> > PySide at qt-project.org >>> > http://lists.qt-project.org/mailman/listinfo/pyside >>> >>> >> >> >> -- >> ** >> >> [image: San's personal blog] >> >> * >> * >> >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside >> >> > > _______________________________________________ > 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 akabaila at pcug.org.au Thu Apr 4 07:02:06 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Thu, 04 Apr 2013 16:02:06 +1100 Subject: [PySide] Is dual inheritance clearer? Message-ID: <2076730.GdH5OTt5k3@supremo> Hi, I believe that PySide (and PyQt for that matter) are widely used for GUI design. There are two main "orderly" ways to start a GUI program, after designing it in the Qt Creator: (1) With dual inheritance: class MainWindow(QMainWindow, Ui_MainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.setupUi(self) (2) Without dual inheritance: class MainWindow(QMainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.ui = Ui_MainWindow self.ui.setupUi(Ui_MainWindow(),self) There have been some horror stories about the evils of multiple inheritance. What is the preferred method, (1) or (2)? Thank you in anticipation of your response. Al. -------------- next part -------------- An HTML attachment was scrubbed... URL: From techtonik at gmail.com Thu Apr 4 07:10:29 2013 From: techtonik at gmail.com (anatoly techtonik) Date: Thu, 4 Apr 2013 08:10:29 +0300 Subject: [PySide] Is dual inheritance clearer? In-Reply-To: <2076730.GdH5OTt5k3@supremo> References: <2076730.GdH5OTt5k3@supremo> Message-ID: On Thu, Apr 4, 2013 at 8:02 AM, Algis Kabaila wrote: > ** > > Hi, > > > > I believe that PySide (and PyQt for that matter) are widely used for GUI > design. There are two main "orderly" ways to start a GUI program, after > designing it in the Qt Creator: > > > > (1) > > With dual inheritance: > > class MainWindow(QMainWindow, Ui_MainWindow): > > def __init__(self, parent=None): > > super(MainWindow, self).__init__(parent) > > self.setupUi(self) > > > > (2) > > Without dual inheritance: > > class MainWindow(QMainWindow): > > def __init__(self, parent=None): > > super(MainWindow, self).__init__(parent) > > self.ui = Ui_MainWindow > > self.ui.setupUi(Ui_MainWindow(),self) > > > > There have been some horror stories about the evils of multiple > inheritance. What is the preferred method, (1) or (2)? > I'd say - that depends on what Ui_MainWindow is, but in general case (2) is better, because: * self.ui defines a namespace to look for methods of UiMW object * explicit is better than implicit -- anatoly t. -------------- next part -------------- An HTML attachment was scrubbed... URL: From techtonik at gmail.com Thu Apr 4 07:20:09 2013 From: techtonik at gmail.com (anatoly techtonik) Date: Thu, 4 Apr 2013 08:20:09 +0300 Subject: [PySide] Shiboken Tutorials (Was: PySide Newbie Tutorials) Message-ID: On Thu, Apr 4, 2013 at 1:31 AM, lndn wrote: > Many other improvements are coming and your feedback / contribution are > always welcome. We need more people to contribute to the PySide > Development page. If you're familiar with the pyside source code, shiboken > internals, etc, please consider writing a short tutorial/wiki page that you > think others might benefit. Documentation at any levels is needed (from > high-level overview to explanation of the source code itself). > Here is another incomplete Shiboken tutorial that turned out into a small research. I tried to compile extension for C code - that probably was my mistake. Unfortunately, the last part was not committed, because I failed to achieve my goal at that moment. So it contained more questions than answers. Here it is - https://bitbucket.org/techtonik/shiboken-avbin -- anatoly t. -------------- next part -------------- An HTML attachment was scrubbed... URL: From projetmbc at gmail.com Thu Apr 4 07:52:58 2013 From: projetmbc at gmail.com (Christophe BAL) Date: Thu, 4 Apr 2013 07:52:58 +0200 Subject: [PySide] TableWidget in a GraphicsView and drawings Message-ID: Hello, I would like to do one "simple" thing that is to put one TableWidget into a GraphicsView and then draw one cercle over a cell of the table, this drawing beeing done using the "table coordinates" of the cell with a ray equal to the width of the cell. Can you give me some hints ? Best regards. Christophe -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdeibel at wingware.com Thu Apr 4 22:48:26 2013 From: sdeibel at wingware.com (Stephan Deibel) Date: Thu, 04 Apr 2013 16:48:26 -0400 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: <515B5CF5.7080102@bluewin.ch> <1A6F4197-D968-421A-8E01-86F16473D013@mac.com> <1880990.7qVRghPlsz@supremo> <9DAD15F5-F2DD-4E52-8835-D7066E6ED07E@mac.com> Message-ID: <515DE71A.5020509@wingware.com> lndn wrote: > Hello everyone, > > Thanks for all the links to the tutorials. I added all of them to the > wiki. If you haven't been to the wiki in a while, now's a good time > to check it out (http://pyside.org): > > * 43 new video tutorials > * More organized PySide Documentation page -- easier for newbies to > get started > * More organized PySide Development page -- easier for curious > developers to get into the code > > Many other improvements are coming and your feedback / contribution > are always welcome. We need more people to contribute to the PySide > Development page. If you're familiar with the pyside source code, > shiboken internals, etc, please consider writing a short tutorial/wiki > page that you think others might benefit. Documentation at any levels > is needed (from high-level overview to explanation of the source code > itself). Just went to look at this and the wiki seems broken -- just shows "Site Error: Unable to Load Site Preferences; No Preferences Found". But I see the entire site is down, also the main Qt docs so hopefully will be fixed soon. Thanks very much for putting all this together! - Stephan From sean at seanfisk.com Thu Apr 4 23:11:27 2013 From: sean at seanfisk.com (Sean Fisk) Date: Thu, 4 Apr 2013 17:11:27 -0400 Subject: [PySide] TableWidget in a GraphicsView and drawings In-Reply-To: References: Message-ID: <938F42C40C464B4380085DB27B432B6D@gmail.com> Hello Christophe, Give this code a try. I tried to make it as straightforward as possible. Use the ResizeTableGaphicsView class at the top to allow the table to resize to the graphics view if that's what you want. Basically, we are overriding the paintEvent method of QTableWidget to allow us to paint the ellipses on the correct row and column. Don't forget that the rows and columns are labeled one-indexed, but are referred to by zero-index in the code. I hope it helps. Let me know how it works. #!/usr/bin/env python import sys from PySide import QtGui # Use this if you want the the table to resize with the graphics view. class TableResizingGraphicsView(QtGui.QGraphicsView): """Graphics view which contains a table widget that it resizes.""" def __init__(self, scene, table_widget, parent=None): super(TableResizingGraphicsView, self).__init__(scene, parent) self.table_widget = table_widget def resizeEvent(self, resize_event): self.table_widget.resize(resize_event.size()) class EllipseTableWidget(QtGui.QTableWidget): """Table widget that allows drawing ellipses over table cells.""" def __init__(self, rows, columns, parent=None): super(EllipseTableWidget, self).__init__(rows, columns, parent) self._ellipses = [] @property def ellipses(self): return self._ellipses def paintEvent(self, event): """Draw the widget on the screen.""" # Draw the table as normal. super(EllipseTableWidget, self).paintEvent(event) # Paint the table widget. # As stated in the QAbstractScrollArea::paintEven t() documentation, all # painting must be done on the viewport(). painter = QtGui.QPainter(self.viewport()) for ellipse_row, ellipse_col in self.ellipses: left_offset = self.columnViewportPosition(ellipse_col) top_offset = self.rowViewportPosition(ellipse_row) width = self.columnWidth(ellipse_col) height = self.rowHeight(ellipse_row) painter.drawEllipse(left_offset, top_offset, width, height) def main(argv): app = QtGui.QApplication(argv) table_widget = EllipseTableWidget(10, 13) table_widget.ellipses.append((0, 0)) table_widget.ellipses.append((2, 9)) scene = QtGui.QGraphicsScene() proxy = scene.addWidget(table_widget) graphics_view = QtGui.QGraphicsView(scene) # graphics_view = TableResizingGraphicsView(scene, table_widget) graphics_view.showMaximized() graphics_view.raise_() app.exec_() if __name__ == '__main__': raise SystemExit(main(sys.argv)) Sincerely, -- Sean Fisk On Thursday, April 4, 2013 at 1:52 AM, Christophe BAL wrote: > Hello, > I would like to do one "simple" thing that is to put one TableWidget into a GraphicsView and then draw one cercle over a cell of the table, this drawing beeing done using the "table coordinates" of the cell with a ray equal to the width of the cell. > > Can you give me some hints ? > > Best regards. > Christophe > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org (mailto:PySide at qt-project.org) > http://lists.qt-project.org/mailman/listinfo/pyside > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nmelchior at seegrid.com Thu Apr 4 23:09:50 2013 From: nmelchior at seegrid.com (Nik Melchior) Date: Thu, 4 Apr 2013 17:09:50 -0400 Subject: [PySide] Is dual inheritance clearer? In-Reply-To: References: <2076730.GdH5OTt5k3@supremo> Message-ID: <20130404210950.GA5222@a367.seegrid.com> On Thu, Apr 04, 2013 at 08:10:29AM +0300, anatoly techtonik wrote: > On Thu, Apr 4, 2013 at 8:02 AM, Algis Kabaila wrote: > > > ** > > > > Hi, > > > > > > > > I believe that PySide (and PyQt for that matter) are widely used for GUI > > design. There are two main "orderly" ways to start a GUI program, after > > designing it in the Qt Creator: > > > > > > > > (1) > > > > With dual inheritance: > > > > class MainWindow(QMainWindow, Ui_MainWindow): > > > > def __init__(self, parent=None): > > > > super(MainWindow, self).__init__(parent) > > > > self.setupUi(self) > > > > > > > > (2) > > > > Without dual inheritance: > > > > class MainWindow(QMainWindow): > > > > def __init__(self, parent=None): > > > > super(MainWindow, self).__init__(parent) > > > > self.ui = Ui_MainWindow > > > > self.ui.setupUi(Ui_MainWindow(),self) > > > > > > > > There have been some horror stories about the evils of multiple > > inheritance. What is the preferred method, (1) or (2)? > > > > I'd say - that depends on what Ui_MainWindow is, but in general case (2) is > better, because: > > * self.ui defines a namespace to look for methods of UiMW object > * explicit is better than implicit I'm sorry this doesn't help resolve your confusion, but I prefer the opposite approach, due to: * Consistency with hand-written UI: When I write simple applications or widgets that compose other widgets, the contained widgets are merely members; I do not relegate them to a separate namespace. It's quite simple to do most layouts writing the code by hand, without designer. * IS-A vs. HAS-A: Your MainWindow class IS-A QMainWindow as much as it IS-A UI_MainWindow. It cannot be instantiated without both parent classes, and it does not make sense to consider replacing the self.ui object with anything polymorphicly related to the Ui_MainWindow class. I think the only reason the UI_MainWindow is a separate class is due to the convenience of placing auto-generated code into its own file. It's really little more than a style choice, but I think the consistency argument will be important as you start to write more and more Qt/PySide classes. Unless your hand-coded UIs contain a self.ui namespace, you will confuse yourself trying to remember if a particular QObject's member functions should access its widgets as, say, self.labelWidget or self.ui.labelWidget. -- Nik Melchior Sr. Roboticist | 412-379-4500 x147 Seegrid Corporation | www.seegrid.com 216 Park West Drive, Pittsburgh, PA 15275 Email Confidentiality Notice The information contained in this transmission is confidential, proprietary or privileged and may be subject to protection under the law. This message is intended for the sole use of the individual or entity to whom it's addressed. If you are not the intended recipient, you are notified that any use, distribution or copying of the message is strictly prohibited and may subject you to criminal or civil penalties. If you received this transmission in error, please contact the sender immediately by replying to this email and delete the material from any computer. From akabaila at pcug.org.au Fri Apr 5 01:35:54 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Fri, 05 Apr 2013 10:35:54 +1100 Subject: [PySide] Is dual inheritance clearer? In-Reply-To: <20130404210950.GA5222@a367.seegrid.com> References: <2076730.GdH5OTt5k3@supremo> <20130404210950.GA5222@a367.seegrid.com> Message-ID: <11572096.MDzVLyzpXT@supremo> On Thursday 04 April 2013 17:09:50 Nik Melchior wrote: > On Thu, Apr 04, 2013 at 08:10:29AM +0300, anatoly techtonik wrote: > > On Thu, Apr 4, 2013 at 8:02 AM, Algis Kabaila wrote: > > > ** > > > > > > Hi, > > > > > > > > > > > > I believe that PySide (and PyQt for that matter) are widely used for > > > GUI design. There are two main "orderly" ways to start a GUI > > > program, after designing it in the Qt Creator: > > > > > > > > > > > > (1) > > > > > > With dual inheritance: > > > > > > class MainWindow(QMainWindow, Ui_MainWindow): > > > > > > def __init__(self, parent=None): > > > > > > super(MainWindow, self).__init__(parent) > > > > > > self.setupUi(self) > > > > > > > > > > > > (2) > > > > > > Without dual inheritance: > > > > > > class MainWindow(QMainWindow): > > > > > > def __init__(self, parent=None): > > > > > > super(MainWindow, self).__init__(parent) > > > > > > self.ui = Ui_MainWindow > > > > > > self.ui.setupUi(Ui_MainWindow(),self) > > > > > > > > > > > > There have been some horror stories about the evils of multiple > > > inheritance. What is the preferred method, (1) or (2)? > > > > I'd say - that depends on what Ui_MainWindow is, but in general case > > (2) is> > > better, because: > > * self.ui defines a namespace to look for methods of UiMW object > > * explicit is better than implicit > > I'm sorry this doesn't help resolve your confusion, but I prefer the > opposite approach, due to: > > * Consistency with hand-written UI: When I write simple applications > or widgets that compose other widgets, the contained widgets are merely > members; I do not relegate them to a separate namespace. It's quite > simple to do most layouts writing the code by hand, without designer. * > IS-A vs. HAS-A: Your MainWindow class IS-A QMainWindow as much as it > IS-A UI_MainWindow. It cannot be instantiated without both parent > classes, and it does not make sense to consider replacing the self.ui > object with anything polymorphicly related to the Ui_MainWindow class. > I think the only reason the UI_MainWindow is a separate class is due to > the convenience of placing auto-generated code into its own file. > > It's really little more than a style choice, but I think the consistency > argument will be important as you start to write more and more > Qt/PySide classes. Unless your hand-coded UIs contain a self.ui > namespace, you will confuse yourself trying to remember if a particular > QObject's member functions should access its widgets as, say, > self.labelWidget or self.ui.labelWidget. > > -- > Nik Melchior > Sr. Roboticist | 412-379-4500 x147 > Seegrid Corporation | www.seegrid.com > 216 Park West Drive, Pittsburgh, PA 15275 > Email Confidentiality Notice > > The information contained in this transmission is confidential, > proprietary or privileged and may be subject to protection under the > law. This message is intended for the sole use of the individual or > entity to whom it's addressed. If you are not the intended recipient, > you are notified that any use, distribution or copying of the message > is strictly prohibited and may subject you to criminal or civil > penalties. If you received this transmission in error, please contact > the sender immediately by replying to this email and delete the > material from any computer. Thank you for your thoughtful and detail analysis of the question. Your observation that "the UI_MainWindow is a separate class is due to the convenience of placing auto-generated code into its own file." Well IMHO tutorials for the "newbies" (not just in programming GUI with PySide, but also in other endeavours) always should aim at simplicity and consistency. So I read your well considered contribution as +1 for dual inheritance. Thank you for taking time to present an analysis of the problem. Thanks too to Anatoly, who gave the -1 answer. All views are appreciated. Of course, it is a style problem. I just had a reason to look at PEP-8. I think one of the reasons why Python is such a great success is that the author of the original, Guido Van Rossum, is able so clearly to elucidate the need not to follow blindly the rules: "-- sometimes the style guide just doesn't apply. When in doubt, use your best judgment. Look at other examples and decide what looks best. And don't hesitate to ask! " And say thank you! Al. -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Fri Apr 5 09:43:00 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Fri, 05 Apr 2013 18:43 +1100 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: Message-ID: <1421114.UPY6nge8oG@supremo> Anatoly, Looked through all your code. Nice work! Also, started using Spyder - beats kate! Pity that it does not cover Python3. Still, beats kate. Thanks for your contribution to the discussion. Al. On Wednesday 03 April 2013 22:42:24 anatoly techtonik wrote: Since everyone is posting links to their totally noob PySide tutorials, here is mine. =) https://bitbucket.org/techtonik/pyside-copy-paste/src I've stopped after a few days. Seems like it was some Qt or PySide bug that drained my energy on the last file. The source code is in public domain, though, so feel free to fork and continue. As for editor - I used Spyder IDE - it is open source, MIT licensed and you can learn A LOT about PySide by reading and improving (fixing?) its code. Well, until PySide was frozen, this was my favorite toy. And also, Pakt looks for authors to write a book on PySide. I am not an English native and writing in proper language is very exhaustive for me, so I realistically can not do this. If somebody feels capable - feel free to email me and I'll give you the contact. ;) -- anatoly t. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Poinot at onera.fr Fri Apr 5 10:47:20 2013 From: Marc.Poinot at onera.fr (Marc.Poinot at onera.fr) Date: Fri, 05 Apr 2013 10:47:20 +0200 Subject: [PySide] PySide and VTK on Windows 32 Message-ID: <515E8F98.6090005@onera.fr> Hi you all, I've got a PySide/VTK application, connected using the QVTKRenderWindowInteractor. PySide 1.0.9 works ok on Unix based systems with a QT4.8/VTK 5.8. (all Python 2.7.3) Then I port on a Microsoft Windows system (XP 32), with PySide win32 distribution (1.1.x) Qt4 and VTK 5.10, and I have a type error in QVTKRenderWindowInteractor while retrieving the self.winId() which is expected to be castable as int: TypeError: int() argument must be a string or a number, not 'PyCObject' The PySide API actually says the PySide.QtGui.QWidget.winId() returns a long... I'm starting some more tests on both MS-Windows and Unix, but maybe some of you could give me a piece of advice? What and where do I have to look for? Could it be related to a bad cast of this **long** on a **32bits** system, produced by the PySide interface generator to Qt? see line 152 http://sourceforge.net/p/pycgns/code/ci/17b696c3b0ad2b387b7e0ddc5d9b195cbc6abf70/tree/NAVigater/CGNS/NAV/Q7VTKRenderWindowInteractor.py --- this is a repost of: http://stackoverflow.com/questions/15813643/pyside-and-vtk-on-windows-32 -- ----------------------------------------------------------------------- Marc POINOT [ONERA/DSNA] Tel:+33.1.46.73.42.84 Fax:+33.1.46.73.41.66 Avertissement/disclaimer http://www.onera.fr/onera-en/emails-terms From jpe at wingware.com Fri Apr 5 16:23:14 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 05 Apr 2013 10:23:14 -0400 Subject: [PySide] PySide and VTK on Windows 32 In-Reply-To: <515E8F98.6090005@onera.fr> References: <515E8F98.6090005@onera.fr> Message-ID: <515EDE52.5030502@wingware.com> On 4/5/13 4:47 AM, Marc.Poinot at onera.fr wrote: > Then I port on a Microsoft Windows system (XP 32), with PySide win32 > distribution (1.1.x) Qt4 and VTK 5.10, and I have a type error in > QVTKRenderWindowInteractor while retrieving the self.winId() which is > expected to be castable as int: > > TypeError: int() argument must be a string or a number, not 'PyCObject' > > The PySide API actually says the PySide.QtGui.QWidget.winId() returns a > long... This probably is a PySide bug in either the implementation or documentation. A PyCObject is Python C api object used to wrap a void pointer and is not a long. Could you open a bug report on the PySide tracker at https://bugreports.qt-project.org/browse/PYSIDE ? Thanks, John From jpe at wingware.com Fri Apr 5 16:35:33 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 05 Apr 2013 10:35:33 -0400 Subject: [PySide] Stepping down as maintainer, putting new people on board. In-Reply-To: <2073136.8cf90yV8tA@hugodesktop> References: <2073136.8cf90yV8tA@hugodesktop> Message-ID: <515EE135.6060202@wingware.com> On 3/19/13 2:49 PM, Hugo Parente Lima wrote: > Following what's described on Qt Governance Model I'm sending this > e-mail to step down as maintainer of PySide and to propose/nominate > new approvers and a new maintaner. ... Before quit I would like to > propose John Ehresman as the new maintainer and Roman Lacko and > John Cummings as approvers. What are the steps needed to complete the transition to a new team of maintainers and approvers for PySide? I'd like to be able to start to work with the bug tracker and repository tools. Is there any documentation, list, or forum on how to use the bug tracker and other tools effectively? Thanks again to Hugo, Marcelo, and everyone else who has contributed to PySide! John From nathanjsmith at gmail.com Fri Apr 5 18:28:23 2013 From: nathanjsmith at gmail.com (Nathan Smith) Date: Fri, 5 Apr 2013 11:28:23 -0500 Subject: [PySide] PySide and VTK on Windows 32 In-Reply-To: <515EDE52.5030502@wingware.com> References: <515E8F98.6090005@onera.fr> <515EDE52.5030502@wingware.com> Message-ID: I looked into this several months back. I believe I decided that it is a bug in the XML wrapping specifications used by shiboken. I was going to change the XML so that it cast the internal value to a long (winid in windows is the address of the window cast to a long; yeah, it's that awesome) but I ran out of time and never got back to it. Nathan On Apr 5, 2013 9:23 AM, "John Ehresman" wrote: > On 4/5/13 4:47 AM, Marc.Poinot at onera.fr wrote: > > Then I port on a Microsoft Windows system (XP 32), with PySide win32 > > distribution (1.1.x) Qt4 and VTK 5.10, and I have a type error in > > QVTKRenderWindowInteractor while retrieving the self.winId() which is > > expected to be castable as int: > > > > TypeError: int() argument must be a string or a number, not > 'PyCObject' > > > > The PySide API actually says the PySide.QtGui.QWidget.winId() returns a > > long... > > This probably is a PySide bug in either the implementation or > documentation. A PyCObject is Python C api object used to wrap a void > pointer and is not a long. Could you open a bug report on the PySide > tracker at https://bugreports.qt-project.org/browse/PYSIDE ? > > Thanks, > > John > > _______________________________________________ > 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 hugo.lima at openbossa.org Fri Apr 5 19:20:05 2013 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Fri, 05 Apr 2013 14:20:05 -0300 Subject: [PySide] Stepping down as maintainer, putting new people on board. In-Reply-To: <515EE135.6060202@wingware.com> References: <2073136.8cf90yV8tA@hugodesktop> <515EE135.6060202@wingware.com> Message-ID: <7343246.B6BV27PiyG@hugodesktop> On Friday, April 05, 2013 10:35:33 AM John Ehresman wrote: > On 3/19/13 2:49 PM, Hugo Parente Lima wrote: > > Following what's described on Qt Governance Model I'm sending this > > e-mail to step down as maintainer of PySide and to propose/nominate > > new approvers and a new maintaner. ... Before quit I would like to > > propose John Ehresman as the new maintainer and Roman Lacko and > > John Cummings as approvers. > > What are the steps needed to complete the transition to a new team of > maintainers and approvers for PySide? I'd like to be able to start to > work with the bug tracker and repository tools. Is there any > documentation, list, or forum on how to use the bug tracker and other > tools effectively? Are you already the project maintainer on Gerrit? If not, contact Lars, he's copied on this thread. About how to use the tools, you may find some documentation on Qt-Project wiki. > Thanks again to Hugo, Marcelo, and everyone else who has contributed > to PySide! > > John -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From jpe at wingware.com Fri Apr 5 19:24:24 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 05 Apr 2013 13:24:24 -0400 Subject: [PySide] PySide and VTK on Windows 32 In-Reply-To: References: <515E8F98.6090005@onera.fr> <515EDE52.5030502@wingware.com> Message-ID: <515F08C8.4020905@wingware.com> On 4/5/13 12:28 PM, Nathan Smith wrote: > I looked into this several months back. I believe I decided that it is a > bug in the XML wrapping specifications used by shiboken. I was going to > change the XML so that it cast the internal value to a long (winid in > windows is the address of the window cast to a long; yeah, it's that > awesome) but I ran out of time and never got back to it. It sounds like you were headed in the right direction -- most of the custom code for PySide is in the typesystem xml files. If you do have time to get back to this, a patch would be most welcome. Thanks, John From hugo.lima at openbossa.org Fri Apr 5 19:36:27 2013 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Fri, 05 Apr 2013 14:36:27 -0300 Subject: [PySide] Document about problem and solutions for C++ bindings Message-ID: <1605883.B0qPjiQEmc@hugodesktop> Hi, In 2011 Marcelo wrote a document with various issues found while our team was developing Shiboken, he wrote it with the intent of having a fallback for our memory, despite of the Converters stuff, the document still up to date and a good resource about the problems involved in creating C++ bindings for a high level language, so I think it will be useful for everyone interested in contribute with PySide, here is the document: http://setanta.wordpress.com/binding-c/ Regards, -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From felix.morency at gmail.com Fri Apr 5 19:59:30 2013 From: felix.morency at gmail.com (=?UTF-8?Q?F=C3=A9lix_C=2E_Morency?=) Date: Fri, 5 Apr 2013 13:59:30 -0400 Subject: [PySide] PySide and VTK on Windows 32 In-Reply-To: <515F08C8.4020905@wingware.com> References: <515E8F98.6090005@onera.fr> <515EDE52.5030502@wingware.com> <515F08C8.4020905@wingware.com> Message-ID: It is a known bug that's been there for quite a while: https://bugreports.qt-project.org/browse/PYSIDE-46 On Fri, Apr 5, 2013 at 1:24 PM, John Ehresman wrote: > On 4/5/13 12:28 PM, Nathan Smith wrote: > > I looked into this several months back. I believe I decided that it is a > > bug in the XML wrapping specifications used by shiboken. I was going to > > change the XML so that it cast the internal value to a long (winid in > > windows is the address of the window cast to a long; yeah, it's that > > awesome) but I ran out of time and never got back to it. > > It sounds like you were headed in the right direction -- most of the > custom code for PySide is in the typesystem xml files. If you do have > time to get back to this, a patch would be most welcome. > > Thanks, > > John > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -- Félix C. Morency, M.Sc. Plateforme d’analyse et de visualisation d’images Centre Hospitalier Universitaire de Sherbrooke Centre de recherche clinique Étienne-Le Bel Local Z5-3031 | 819.346.1110 ext 16634 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vasure at gmail.com Fri Apr 5 22:57:40 2013 From: vasure at gmail.com (Srini Kommoori) Date: Fri, 5 Apr 2013 13:57:40 -0700 Subject: [PySide] Document about problem and solutions for C++ bindings In-Reply-To: <1605883.B0qPjiQEmc@hugodesktop> References: <1605883.B0qPjiQEmc@hugodesktop> Message-ID: Pretty good write up - thanks for sharing. On Fri, Apr 5, 2013 at 10:36 AM, Hugo Parente Lima wrote: > Hi, > > In 2011 Marcelo wrote a document with various issues found while our team > was > developing Shiboken, he wrote it with the intent of having a fallback for > our > memory, despite of the Converters stuff, the document still up to date and > a > good resource about the problems involved in creating C++ bindings for a > high > level language, so I think it will be useful for everyone interested in > contribute with PySide, here is the document: > > http://setanta.wordpress.com/binding-c/ > > Regards, > _______________________________________________ > 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 sean at seanfisk.com Sat Apr 6 23:51:28 2013 From: sean at seanfisk.com (Sean Fisk) Date: Sat, 6 Apr 2013 17:51:28 -0400 Subject: [PySide] Help with resource files Message-ID: <3D86DB953BCA44FB914C1523226F8613@gmail.com> Hello everyone, I want to embed some images and fonts in my PySide program using Qt's resource system. I've used it very successfully in C++. However, I'm having some trouble getting resource files to work with PySide. The resource files seem to compile it all right, but I can't read my files in my program. I've created a minimum example to illustrate the problem: test.py #!/usr/bin/env python # test.py import PySide from PySide import QtCore import resources # Versions print 'Running PySide {0} / Qt {1}'.format( PySide.__version__, QtCore.__version__) print 'PySide compiled with Qt {0}'.format(QtCore.qVersion()) # Read resource test_txt = QtCore.QFile(':/test.txt') print 'Does it exist?: {0}'.format(test_txt.exists()) print "readAll(): `{0}'".format(test_txt.readAll()) resources.qrc test.txt test.txt This is just a test. Instructions Compile the resource file and then run: $ pyside-rcc resources.qrc -o resources.py $ python test.py Running PySide 1.1.2 / Qt 4.8.4 PySide compiled with Qt 4.8.4 Does it exist?: True readAll(): `' Interestingly, if I change the readAll() call to readLine(), the program segfaults. Anyone have any suggestions? I'd be open to other ways to distribute fonts and images with my program as well. Sincerely, -- Sean Fisk -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Sun Apr 7 07:19:43 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Sun, 07 Apr 2013 15:19:43 +1000 Subject: [PySide] Help with resource files In-Reply-To: <3D86DB953BCA44FB914C1523226F8613@gmail.com> References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> Message-ID: <1394783.XTDRcZCk3B@supremo> Hi Sean, You do not give much away: to begin with, your OS and Python version would be useful. If it is Python 3.x then a small change may help: pyside-rcc -py3 resources.qrc -o resources.py Just a shot in the dark, Sean! Al. On Saturday 06 April 2013 17:51:28 Sean Fisk wrote: Hello everyone, I want to embed some images and fonts in my PySide program using Qt's resource system. I've used it very successfully in C++. However, I'm having some trouble getting resource files to work with PySide. The resource files seem to compile it all right, but I can't read my files in my program. I've created a minimum example to illustrate the problem: test.py #!/usr/bin/env python # test.py import PySide from PySide import QtCore import resources # Versions print 'Running PySide {0} / Qt {1}'.format( PySide.__version__, QtCore.__version__) print 'PySide compiled with Qt {0}'.format(QtCore.qVersion()) # Read resource test_txt = QtCore.QFile(':/test.txt') print 'Does it exist?: {0}'.format(test_txt.exists()) print "readAll(): `{0}'".format(test_txt.readAll()) resources.qrc test.txt test.txt This is just a test. Instructions Compile the resource file and then run: $ pyside-rcc resources.qrc -o resources.py $ python test.py Running PySide 1.1.2 / Qt 4.8.4 PySide compiled with Qt 4.8.4 Does it exist?: True readAll(): `' Interestingly, if I change the readAll() call to readLine(), the program segfaults. Anyone have any suggestions? I'd be open to other ways to distribute fonts and images with my program as well. Sincerely, -- Sean Fisk -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at seanfisk.com Sun Apr 7 07:27:24 2013 From: sean at seanfisk.com (Sean Fisk) Date: Sun, 7 Apr 2013 01:27:24 -0400 Subject: [PySide] Help with resource files In-Reply-To: <1394783.XTDRcZCk3B@supremo> References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <1394783.XTDRcZCk3B@supremo> Message-ID: <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> Hello Al, My bad. I'm using Python 2.7.3 64-bit on Mac OS 10.6 with PySide 1.1.2 and Qt 4.8.4. It's not the system Python nor one installed from the distributions on python.org; I compiled it myself and am using virtualenvwrapper to manage my virtualenvs, if any of that matters. Thanks for the tip on Python 3. I'm using Python 2 and I believe that pyside-rcc defaults to Python 2. The resource module is in fact importing fine. There are no syntax errors or anything like that. It's weird: I tried importing in ipython and the import was fine. I just can't read the resource content as I should be able to. Thanks, -- Sean Fisk On Sunday, April 7, 2013 at 1:19 AM, Algis Kabaila wrote: > > Hi Sean, > > > > > > You do not give much away: to begin with, your OS and Python version would be useful. > > > > > > If it is Python 3.x then a small change may help: > > > > > > pyside-rcc -py3 resources.qrc -o resources.py > > > > > > Just a shot in the dark, Sean! > > > > > > Al. > > > > > > On Saturday 06 April 2013 17:51:28 Sean Fisk wrote: > > > > Hello everyone, > > > > > > > I want to embed some images and fonts in my PySide program using Qt's resource system. I've used it very successfully in C++. However, I'm having some trouble getting resource files to work with PySide. The resource files seem to compile it all right, but I can't read my files in my program. > > > > > > > I've created a minimum example to illustrate the problem: > > > > > > > test.py > > #!/usr/bin/env python > # test.py > import PySide > from PySide import QtCore > import resources > > # Versions > print 'Running PySide {0} / Qt {1}'.format( > PySide.__version__, QtCore.__version__) > print 'PySide compiled with Qt {0}'.format(QtCore.qVersion()) > > # Read resource > test_txt = QtCore.QFile(':/test.txt') > print 'Does it exist?: {0}'.format(test_txt.exists()) > print "readAll(): `{0}'".format(test_txt.readAll()) > resources.qrc > > > test.txt > > > > test.txt > > This is just a test. > Instructions > Compile the resource file and then run: > $ pyside-rcc resources.qrc -o resources.py > $ python test.py > Running PySide 1.1.2 / Qt 4.8.4 > PySide compiled with Qt 4.8.4 > Does it exist?: True > readAll(): `' > > Interestingly, if I change the readAll() call to readLine(), the program segfaults. Anyone have any suggestions? I'd be open to other ways to distribute fonts and images with my program as well. > > > > > > > Sincerely, > > > > > > > -- > > > Sean Fisk > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Sun Apr 7 08:14:52 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Sun, 07 Apr 2013 16:14:52 +1000 Subject: [PySide] Help with resource files In-Reply-To: <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <1394783.XTDRcZCk3B@supremo> <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> Message-ID: <1739690.NPq3KqI3is@supremo> Hello Sean, It is not a fault of python version. I am on linux kubuntu 12.04 LTS OS with "python" pointing to python 2.7 and python3 to python 3.2. Changed your script to python3 syntax and repeated the exercise with the same lemon result at the end: ak at supremo:~/Documents/2013/Algis/linux$ python3 test.py Running PySide 1.1.0 / Qt 4.8.1 PySide compiled with Qt 4.8.1 Does it exist?: True readAll(): `' ak at supremo:~/Documents/2013/Algis/linux$ "supremo" is a funny name for my old black big and clunky computer (with a decent PCU etc.) There is a small reference to accessing files in Mark Summerfields "bible" on PyQt. But now I must quit this keyboard - one of our grand daughters is comming to watch a film on Lithuanian basketball, named "the other dream team". Sorry for butting in to the list - hope to be back sometime and might try to concoct my own example and see if it shows where the "dog is burried". Al. On Sunday 07 April 2013 01:27:24 Sean Fisk wrote: Hello Al, My bad. I'm using Python 2.7.3 64-bit on Mac OS 10.6 with PySide 1.1.2 and Qt 4.8.4. It's not the system Python nor one installed from the distributions on python.org; I compiled it myself and am using virtualenvwrapper to manage my virtualenvs, if any of that matters. Thanks for the tip on Python 3. I'm using Python 2 and I believe that pyside-rcc defaults to Python 2. The resource module is in fact importing fine. There are no syntax errors or anything like that. It's weird: I tried importing in ipython and the import was fine. I just can't read the resource content as I should be able to. Thanks, -- Sean Fisk On Sunday, April 7, 2013 at 1:19 AM, Algis Kabaila wrote: Hi Sean, You do not give much away: to begin with, your OS and Python version would be useful. If it is Python 3.x then a small change may help: pyside-rcc -py3 resources.qrc -o resources.py Just a shot in the dark, Sean! Al. On Saturday 06 April 2013 17:51:28 Sean Fisk wrote: Hello everyone, I want to embed some images and fonts in my PySide program using Qt's resource system. I've used it very successfully in C++. However, I'm having some trouble getting resource files to work with PySide. The resource files seem to compile it all right, but I can't read my files in my program. I've created a minimum example to illustrate the problem: test.py #!/usr/bin/env python # test.py import PySide from PySide import QtCore import resources # Versions print 'Running PySide {0} / Qt {1}'.format( PySide.__version__, QtCore.__version__) print 'PySide compiled with Qt {0}'.format(QtCore.qVersion()) # Read resource test_txt = QtCore.QFile(':/test.txt') print 'Does it exist?: {0}'.format(test_txt.exists()) print "readAll(): `{0}'".format(test_txt.readAll()) resources.qrc test.txt test.txt This is just a test. Instructions Compile the resource file and then run: $ pyside-rcc resources.qrc -o resources.py $ python test.py Running PySide 1.1.2 / Qt 4.8.4 PySide compiled with Qt 4.8.4 Does it exist?: True readAll(): `' Interestingly, if I change the readAll() call to readLine(), the program segfaults. Anyone have any suggestions? I'd be open to other ways to distribute fonts and images with my program as well. Sincerely, -- Sean Fisk -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Sun Apr 7 15:33:29 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Sun, 07 Apr 2013 23:33:29 +1000 Subject: [PySide] Help with resource files In-Reply-To: <1739690.NPq3KqI3is@supremo> References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> <1739690.NPq3KqI3is@supremo> Message-ID: <9621251.d7HDiYvpjM@supremo> Hi Sean, I think that the last statement of your program is based on wrong premise the python print statement will print a pyside (or pyqt) object - a pyside file. But python does not really directly know much about pyside objects. I think that for the script to work you need to have something like textEdit and use something like textEdit.setText(. I have not used qrc resoources only for icons (images), though in M Summerfields "Rapid GUI Programming with Python and QT" chapter 6 pp 165 to 203 described is an example "The Image Changer". The code should still be on the web. He does use the html files that are referred to via qrc resources. To use icon images as qrc resources, you might like to take a quick look at simplistic tutorial that has links to source code and other materials for download: http://qt-project.org/wiki/PySideSimplicissimus_Module_5_Combine In particular, combineAllIn1 module may be closer to your liking: http://qt-project.org/wiki/PySideSimplicissimus_Module_7_CombineAllIn1 They are simple newbie examples and are well below your standards, but it never hurts to stoop down a bit. These examples were written in python 2.x and are being changed to pthon3. Your feedback would be appreciated! I think you will be suitably impressed how readily PySide can be used in Python 2.x and in Python 3.x with minimal change of code! Al. On Sunday 07 April 2013 16:14:52 Algis Kabaila wrote: Hello Sean, It is not a fault of python version. I am on linux kubuntu 12.04 LTS OS with "python" pointing to python 2.7 and python3 to python 3.2. Changed your script to python3 syntax and repeated the exercise with the same lemon result at the end: ak at supremo:~/Documents/2013/Algis/linux$ python3 test.py Running PySide 1.1.0 / Qt 4.8.1 PySide compiled with Qt 4.8.1 Does it exist?: True readAll(): `' ak at supremo:~/Documents/2013/Algis/linux$ "supremo" is a funny name for my old black big and clunky computer (with a decent PCU etc.) There is a small reference to accessing files in Mark Summerfields "bible" on PyQt. But now I must quit this keyboard - one of our grand daughters is comming to watch a film on Lithuanian basketball, named "the other dream team". Sorry for butting in to the list - hope to be back sometime and might try to concoct my own example and see if it shows where the "dog is burried". Al. On Sunday 07 April 2013 01:27:24 Sean Fisk wrote: Hello Al, My bad. I'm using Python 2.7.3 64-bit on Mac OS 10.6 with PySide 1.1.2 and Qt 4.8.4. It's not the system Python nor one installed from the distributions on python.org; I compiled it myself and am using virtualenvwrapper to manage my virtualenvs, if any of that matters. Thanks for the tip on Python 3. I'm using Python 2 and I believe that pyside-rcc defaults to Python 2. The resource module is in fact importing fine. There are no syntax errors or anything like that. It's weird: I tried importing in ipython and the import was fine. I just can't read the resource content as I should be able to. Thanks, -- Sean Fisk On Sunday, April 7, 2013 at 1:19 AM, Algis Kabaila wrote: Hi Sean, You do not give much away: to begin with, your OS and Python version would be useful. If it is Python 3.x then a small change may help: pyside-rcc -py3 resources.qrc -o resources.py Just a shot in the dark, Sean! Al. On Saturday 06 April 2013 17:51:28 Sean Fisk wrote: Hello everyone, I want to embed some images and fonts in my PySide program using Qt's resource system. I've used it very successfully in C++. However, I'm having some trouble getting resource files to work with PySide. The resource files seem to compile it all right, but I can't read my files in my program. I've created a minimum example to illustrate the problem: test.py #!/usr/bin/env python # test.py import PySide from PySide import QtCore import resources # Versions print 'Running PySide {0} / Qt {1}'.format( PySide.__version__, QtCore.__version__) print 'PySide compiled with Qt {0}'.format(QtCore.qVersion()) # Read resource test_txt = QtCore.QFile(':/test.txt') print 'Does it exist?: {0}'.format(test_txt.exists()) print "readAll(): `{0}'".format(test_txt.readAll()) resources.qrc test.txt test.txt This is just a test. Instructions Compile the resource file and then run: $ pyside-rcc resources.qrc -o resources.py $ python test.py Running PySide 1.1.2 / Qt 4.8.4 PySide compiled with Qt 4.8.4 Does it exist?: True readAll(): `' Interestingly, if I change the readAll() call to readLine(), the program segfaults. Anyone have any suggestions? I'd be open to other ways to distribute fonts and images with my program as well. Sincerely, -- Sean Fisk -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marc.Poinot at onera.fr Mon Apr 8 09:08:32 2013 From: Marc.Poinot at onera.fr (Marc.Poinot at onera.fr) Date: Mon, 08 Apr 2013 09:08:32 +0200 Subject: [PySide] PySide and VTK on Windows 32 In-Reply-To: References: <515E8F98.6090005@onera.fr> <515EDE52.5030502@wingware.com> <515F08C8.4020905@wingware.com> Message-ID: <51626CF0.1070708@onera.fr> Félix C. Morency wrote: > It is a known bug that's been there for quite a > while: https://bugreports.qt-project.org/browse/PYSIDE-46 > > Ok, I've successfully use the hint in this bug report. There are some other small and weird behaviors around the Qt/VTK on win32 but maybe it's only a matter of unportable use of the libs, I'll check by porting/backporting on both platform. Thanks all Merci Sherbrooke -- ----------------------------------------------------------------------- Marc POINOT [ONERA/DSNA] Tel:+33.1.46.73.42.84 Fax:+33.1.46.73.41.66 Avertissement/disclaimer http://www.onera.fr/onera-en/emails-terms From william.dias at gmail.com Mon Apr 8 17:01:12 2013 From: william.dias at gmail.com (William Dias) Date: Mon, 8 Apr 2013 12:01:12 -0300 Subject: [PySide] Signal emitted on a worker thread not being received by main thread Message-ID: Hi, I am facing an intermittent problem with my PySide application. I have a GUI that spawns several threads that are responsible for sending photos to a web server. The threads are created as shown bellow: photoConnectionThread = QThread() photoConnectionObject = http_connection.PhotoConnection(self.filename) photoConnectionObject.photoStatus.connect(self.photoStatus) photoConnectionObject.moveToThread(photoConnectionThread) photoConnectionThread.started.connect(photoConnectionObject.work) photoConnectionThread.finished.connect(self.threadFinished) photoConnectionThread.start() My worker thread tries to upload a photo only once and then emits a signal to the main thread so that the status can be updated in a database. def work(self): logger.info("photo object created on thread " + str(self.thread())) status = sendPhoto(self.filename) self.photoStatus.emit(self.filename, status) QThread.sleep(5) logger.info("exiting thread " + str(self.thread())) self.thread().exit(0) The problem is that, sporadically, the main thread does not receive the signal and consequently doesn't get the status updated. Does anybody have any idea why this is happening? I am using: Python 2.7 PySide 1.1.1 Windows 7 Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at seanfisk.com Mon Apr 8 18:35:42 2013 From: sean at seanfisk.com (Sean Fisk) Date: Mon, 8 Apr 2013 12:35:42 -0400 Subject: [PySide] Help with resource files In-Reply-To: <9621251.d7HDiYvpjM@supremo> References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> <1739690.NPq3KqI3is@supremo> <9621251.d7HDiYvpjM@supremo> Message-ID: <55A5649DCB9948249DC382322502F08E@gmail.com> Hi Al, Thanks for the confirmation with Python 2 and 3 on Ubuntu. Although we don't yet know whether it is a bug or just incorrect code by me. On Sunday, April 7, 2013 at 9:33 AM, Algis Kabaila wrote: > > Hi Sean, > > > > > > I think that the last statement of your program is based on wrong premise the python print statement will print a pyside (or pyqt) object - a pyside file. But python does not really directly know much about pyside objects. > > > I wrapped a repr() around the readAll() call. It is returning a QByteArray as it should, but the QByteArray is empty: #!/usr/bin/env python # test.py import PySide from PySide import QtCore import resources # Versions print 'Running PySide {0} / Qt {1}'.format( PySide.__version__, QtCore.__version__) print 'PySide compiled with Qt {0}'.format(QtCore.qVersion()) # Read resource test_txt = QtCore.QFile(':/test.txt') print 'Does it exist?: {0}'.format(test_txt.exists()) print "readAll(): `{0}'".format(repr(test_txt.readAll())) Yields Running PySide 1.1.2 / Qt 4.8.4 PySide compiled with Qt 4.8.4 Does it exist?: True readAll(): `PySide.QtCore.QByteArray('')' > > > > > I think that for the script to work you need to have something like textEdit and use something like textEdit.setText(. I have not used qrc resoources only for icons (images), though in M Summerfields "Rapid GUI Programming with Python and QT" chapter 6 pp 165 to 203 described is an example "The Image Changer". The code should still be on the web. He does use the html files that are referred to via qrc resources. > > > > > > To use icon images as qrc resources, you might like to take a quick look at simplistic tutorial that has links to source code and other materials for download: > > > http://qt-project.org/wiki/PySideSimplicissimus_Module_5_Combine > > > > > > In particular, combineAllIn1 module may be closer to your liking: > > > http://qt-project.org/wiki/PySideSimplicissimus_Module_7_CombineAllIn1 > > > > > > They are simple newbie examples and are well below your standards, but it never hurts to stoop down a bit. These examples were written in python 2.x and are being changed to pthon3. Your feedback would be appreciated! > > > > > > I think you will be suitably impressed how readily PySide can be used in Python 2.x and in Python 3.x with minimal change of code! > > > I actually learned PySide from the Simplicissiimus tutorials about a year ago after using Qt/C++ for a year. They were extremely helpful! In fact, I think I do remember running these examples with the icons and having it work. I'm going to try running the Combine programs again, using resources only for icons and observing whether it works. If it does, I'll check out Mark's code and try to get that working. I'll report back when that's done. > > > > > Al. > > > > > > On Sunday 07 April 2013 16:14:52 Algis Kabaila wrote: > > > > Hello Sean, > > > > > > It is not a fault of python version. I am on linux kubuntu 12.04 LTS OS with "python" pointing to python 2.7 and python3 to python 3.2. Changed your script to python3 syntax and repeated the exercise with the same lemon result at the end: > > > > > > ak at supremo:~/Documents/2013/Algis/linux$ python3 test.py > > > Running PySide 1.1.0 / Qt 4.8.1 > > > PySide compiled with Qt 4.8.1 > > > Does it exist?: True > > > readAll(): `' > > > ak at supremo:~/Documents/2013/Algis/linux$ > > > > > > "supremo" is a funny name for my old black big and clunky computer (with a decent PCU etc.) > > > > > > There is a small reference to accessing files in Mark Summerfields "bible" on PyQt. But now I must quit this keyboard - one of our grand daughters is comming to watch a film on Lithuanian basketball, named "the other dream team". > > > > > > Sorry for butting in to the list - hope to be back sometime and might try to concoct my own example and see if it shows where the "dog is burried". > > > > > > Al. > > > > > > On Sunday 07 April 2013 01:27:24 Sean Fisk wrote: > > > > Hello Al, > > > > > > > My bad. I'm using Python 2.7.3 64-bit on Mac OS 10.6 with PySide 1.1.2 and Qt 4.8.4. It's not the system Python nor one installed from the distributions on python.org (http://python.org); I compiled it myself and am using virtualenvwrapper to manage my virtualenvs, if any of that matters. > > > > > > > Thanks for the tip on Python 3. I'm using Python 2 and I believe that pyside-rcc defaults to Python 2. The resource module is in fact importing fine. There are no syntax errors or anything like that. It's weird: I tried importing in ipython and the import was fine. I just can't read the resource content as I should be able to. > > > > > > > Thanks, > > > > > > > -- > > > Sean Fisk > > > > > > > On Sunday, April 7, 2013 at 1:19 AM, Algis Kabaila wrote: > > > > > > Hi Sean, > > > > > > You do not give much away: to begin with, your OS and Python version would be useful. > > > > > > If it is Python 3.x then a small change may help: > > > > > > pyside-rcc -py3 resources.qrc -o resources.py > > > > > > Just a shot in the dark, Sean! > > > > > > Al. > > > > > > On Saturday 06 April 2013 17:51:28 Sean Fisk wrote: > > > > Hello everyone, > > > > > > > I want to embed some images and fonts in my PySide program using Qt's resource system. I've used it very successfully in C++. However, I'm having some trouble getting resource files to work with PySide. The resource files seem to compile it all right, but I can't read my files in my program. > > > > > > > I've created a minimum example to illustrate the problem: > > > > > > > test.py > > > #!/usr/bin/env python > > > # test.py > > > import PySide > > > from PySide import QtCore > > > import resources > > > > > > # Versions > > > print 'Running PySide {0} / Qt {1}'.format( > > > PySide.__version__, QtCore.__version__) > > > print 'PySide compiled with Qt {0}'.format(QtCore.qVersion()) > > > > > > # Read resource > > > test_txt = QtCore.QFile(':/test.txt') > > > print 'Does it exist?: {0}'.format(test_txt.exists()) > > > print "readAll(): `{0}'".format(test_txt.readAll()) > > > resources.qrc > > > > > > > > > test.txt > > > > > > > > > test.txt > > > This is just a test. > > > Instructions > > > Compile the resource file and then run: > > > $ pyside-rcc resources.qrc -o resources.py > > > $ python test.py > > > Running PySide 1.1.2 / Qt 4.8.4 > > > PySide compiled with Qt 4.8.4 > > > Does it exist?: True > > > readAll(): `' > > > Interestingly, if I change the readAll() call to readLine(), the program segfaults. Anyone have any suggestions? I'd be open to other ways to distribute fonts and images with my program as well. > > > > > > > Sincerely, > > > > > > > -- > > > Sean Fisk > > > > > > > > > > > > > > > > > > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hardware at darcygirl.com Mon Apr 8 21:18:11 2013 From: hardware at darcygirl.com (Eric Johnson) Date: Mon, 8 Apr 2013 19:18:11 +0000 (UTC) Subject: [PySide] Help with resource files References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> <1739690.NPq3KqI3is@supremo> <9621251.d7HDiYvpjM@supremo> <55A5649DCB9948249DC382322502F08E@gmail.com> Message-ID: Sean Fisk seanfisk.com> writes: > > Thanks for the confirmation with Python 2 and 3 on Ubuntu. Although we > don't yet know whether it is a bug or just incorrect code by me. > Works fine for me on Windows (cygwin/bash shell but win32 version of Python 2.7.2) if I open the file first. I'm surprised there is no exception thrown if you don't do this. I can try on OS X tonight. ... # Read resource test_txt = QtCore.QFile(':/test.txt') test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text) print 'Does it exist?: {0}'.format(test_txt.exists()) print "readAll(): `{0}'".format(test_txt.readAll()) gives output $ python test.py Running PySide 1.1.0 / Qt 4.7.4 PySide compiled with Qt 4.7.4 Does it exist?: True readAll(): `This is just a test. ' Eric From sean at seanfisk.com Mon Apr 8 22:41:13 2013 From: sean at seanfisk.com (Sean Fisk) Date: Mon, 8 Apr 2013 16:41:13 -0400 Subject: [PySide] Help with resource files In-Reply-To: References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> <1739690.NPq3KqI3is@supremo> <9621251.d7HDiYvpjM@supremo> <55A5649DCB9948249DC382322502F08E@gmail.com> Message-ID: <0FB6FCD414E44EA9B9E81028CB090260@gmail.com> That's good to know, Eric. Eventually we will be doing Windows distribution so I'm glad there are no problems. Here is another update. I tried putting Lena on a button using QIcon on my OS X installation and it worked: That leads me to believe it's a problem with QFile, not the actual generated resource file. I'm going to try messing around with the QResource class next. Thanks for all the help, guys! Sincerely, -- Sean Fisk On Monday, April 8, 2013 at 3:18 PM, Eric Johnson wrote: > Sean Fisk seanfisk.com (http://seanfisk.com)> writes: > > > > > Thanks for the confirmation with Python 2 and 3 on Ubuntu. Although we > > don't yet know whether it is a bug or just incorrect code by me. > > > > > > > Works fine for me on Windows (cygwin/bash shell but win32 version of > Python 2.7.2) if I open the file first. > > I'm surprised there is no exception thrown if you don't do this. > I can try on OS X tonight. > > ... > # Read resource > test_txt = QtCore.QFile(':/test.txt') > test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text) > print 'Does it exist?: {0}'.format(test_txt.exists()) > print "readAll(): `{0}'".format(test_txt.readAll()) > > gives output > > $ python test.py > Running PySide 1.1.0 / Qt 4.7.4 > PySide compiled with Qt 4.7.4 > Does it exist?: True > readAll(): `This is just a test. > ' > > Eric > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org (mailto:PySide at qt-project.org) > http://lists.qt-project.org/mailman/listinfo/pyside > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: resource-qicon-lena.png Type: image/png Size: 15393 bytes Desc: not available URL: From sean at seanfisk.com Mon Apr 8 23:04:48 2013 From: sean at seanfisk.com (Sean Fisk) Date: Mon, 8 Apr 2013 17:04:48 -0400 Subject: [PySide] Help with resource files In-Reply-To: <0FB6FCD414E44EA9B9E81028CB090260@gmail.com> References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> <1739690.NPq3KqI3is@supremo> <9621251.d7HDiYvpjM@supremo> <55A5649DCB9948249DC382322502F08E@gmail.com> <0FB6FCD414E44EA9B9E81028CB090260@gmail.com> Message-ID: OK, I have an interim solution. While I do believe that QFile.readAll() should return the file contents as a QByteArray, QResource.data() seems to work! Here is the code: #!/usr/bin/env python # test.py import PySide from PySide import QtCore import resources # Versions print 'Running PySide {0} / Qt {1}'.format( PySide.__version__, QtCore.__version__) print 'PySide compiled with Qt {0}'.format(QtCore.qVersion()) # Read resource test_txt = QtCore.QResource(':/test.txt') data = test_txt.data() print "type(data()): {0}".format(type(data)) print "data(): `{0}'".format(data) which yields Running PySide 1.1.2 / Qt 4.8.4 PySide compiled with Qt 4.8.4 type(data()): data(): `This is just a test. ' This returns the resource as a Python buffer (http://docs.python.org/2/library/functions.html#buffer) type. I'm hoping I can coerce this into the source for a font or image in Qt. More updates if I get it to work. Sincerely, -- Sean Fisk On Monday, April 8, 2013 at 4:41 PM, Sean Fisk wrote: > That's good to know, Eric. Eventually we will be doing Windows distribution so I'm glad there are no problems. > > Here is another update. I tried putting Lena on a button using QIcon on my OS X installation and it worked: > > That leads me to believe it's a problem with QFile, not the actual generated resource file. I'm going to try messing around with the QResource class next. > > Thanks for all the help, guys! > > Sincerely, > > -- > Sean Fisk > > > On Monday, April 8, 2013 at 3:18 PM, Eric Johnson wrote: > > > Sean Fisk seanfisk.com (http://seanfisk.com)> writes: > > > > > > > > Thanks for the confirmation with Python 2 and 3 on Ubuntu. Although we > > > don't yet know whether it is a bug or just incorrect code by me. > > > > > > > > > > > > Works fine for me on Windows (cygwin/bash shell but win32 version of > > Python 2.7.2) if I open the file first. > > > > I'm surprised there is no exception thrown if you don't do this. > > I can try on OS X tonight. > > > > ... > > # Read resource > > test_txt = QtCore.QFile(':/test.txt') > > test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text) > > print 'Does it exist?: {0}'.format(test_txt.exists()) > > print "readAll(): `{0}'".format(test_txt.readAll()) > > > > gives output > > > > $ python test.py > > Running PySide 1.1.0 / Qt 4.7.4 > > PySide compiled with Qt 4.7.4 > > Does it exist?: True > > readAll(): `This is just a test. > > ' > > > > Eric > > > > > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org (mailto:PySide at qt-project.org) > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: resource-qicon-lena.png Type: image/png Size: 15393 bytes Desc: not available URL: From kandraitibold at gmail.com Mon Apr 8 23:19:42 2013 From: kandraitibold at gmail.com (Tibold Kandrai) Date: Mon, 8 Apr 2013 23:19:42 +0200 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: References: Message-ID: <001a01ce349e$c99deb50$5cd9c1f0$@gmail.com> Hi, I think you’ll have to use queued connection when you connect the photoStatus signal to the photoStatus slot. See: http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots-across-threads Cheers, Tibold From: pyside-bounces+kandraitibold=gmail.com at qt-project.org [mailto:pyside-bounces+kandraitibold=gmail.com at qt-project.org] On Behalf Of William Dias Sent: 2013 April 08, Monday 17:01 To: pyside at qt-project.org Subject: [PySide] Signal emitted on a worker thread not being received by main thread Hi, I am facing an intermittent problem with my PySide application. I have a GUI that spawns several threads that are responsible for sending photos to a web server. The threads are created as shown bellow: photoConnectionThread = QThread() photoConnectionObject = http_connection.PhotoConnection(self.filename) photoConnectionObject.photoStatus.connect(self.photoStatus) photoConnectionObject.moveToThread(photoConnectionThread) photoConnectionThread.started.connect(photoConnectionObject.work) photoConnectionThread.finished.connect(self.threadFinished) photoConnectionThread.start() My worker thread tries to upload a photo only once and then emits a signal to the main thread so that the status can be updated in a database. def work(self): logger.info ("photo object created on thread " + str(self.thread())) status = sendPhoto(self.filename) self.photoStatus.emit(self.filename, status) QThread.sleep(5) logger.info ("exiting thread " + str(self.thread())) self.thread().exit(0) The problem is that, sporadically, the main thread does not receive the signal and consequently doesn't get the status updated. Does anybody have any idea why this is happening? I am using: Python 2.7 PySide 1.1.1 Windows 7 Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From william.dias at gmail.com Mon Apr 8 23:59:09 2013 From: william.dias at gmail.com (William Dias) Date: Mon, 8 Apr 2013 18:59:09 -0300 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: <001a01ce349e$c99deb50$5cd9c1f0$@gmail.com> References: <001a01ce349e$c99deb50$5cd9c1f0$@gmail.com> Message-ID: Hi, Tibold. Thanks for your reply. If I first move my worker to the new thread and then make the connection should it work? According to the documentation, it would use an auto-connection and since emitter and receiver don't have the same thread affinity, it would create a queued connection. Is it right? Best, 2013/4/8 Tibold Kandrai > Hi,**** > > ** ** > > I think you’ll have to use queued connection when you connect the > photoStatus signal to the photoStatus slot.**** > > ** ** > > See:**** > > > http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots-across-threads > **** > > ** ** > > Cheers,**** > > Tibold**** > > ** ** > > *From:* pyside-bounces+kandraitibold=gmail.com at qt-project.org [mailto: > pyside-bounces+kandraitibold=gmail.com at qt-project.org] *On Behalf Of *William > Dias > *Sent:* 2013 April 08, Monday 17:01 > *To:* pyside at qt-project.org > *Subject:* [PySide] Signal emitted on a worker thread not being received > by main thread**** > > ** ** > > Hi,**** > > ** ** > > I am facing an intermittent problem with my PySide application. I have a > GUI that spawns several threads that are responsible for sending photos to > a web server. The threads are created as shown bellow:**** > > ** ** > > photoConnectionThread = QThread()**** > > photoConnectionObject = http_connection.PhotoConnection(self.filename)**** > > photoConnectionObject.photoStatus.connect(self.photoStatus) ** > ** > > photoConnectionObject.moveToThread(photoConnectionThread)**** > > photoConnectionThread.started.connect(photoConnectionObject.work)**** > > photoConnectionThread.finished.connect(self.threadFinished)**** > > photoConnectionThread.start()**** > > ** ** > > My worker thread tries to upload a photo only once and then emits a signal > to the main thread so that the status can be updated in a database. **** > > ** ** > > def work(self):**** > > logger.info("photo object created on thread " + > str(self.thread()))**** > > status = sendPhoto(self.filename)**** > > self.photoStatus.emit(self.filename, status)**** > > QThread.sleep(5)**** > > logger.info("exiting thread " + > str(self.thread()))**** > > self.thread().exit(0)**** > > ** ** > > The problem is that, sporadically, the main thread does not receive the > signal and consequently doesn't get the status updated.**** > > ** ** > > Does anybody have any idea why this is happening?**** > > ** ** > > I am using:**** > > Python 2.7**** > > PySide 1.1.1**** > > Windows 7**** > > ** ** > > Thank you!**** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hardware at darcygirl.com Tue Apr 9 01:26:57 2013 From: hardware at darcygirl.com (Eric Johnson) Date: Mon, 8 Apr 2013 23:26:57 +0000 (UTC) Subject: [PySide] Help with resource files References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> <1739690.NPq3KqI3is@supremo> <9621251.d7HDiYvpjM@supremo> <55A5649DCB9948249DC382322502F08E@gmail.com> <0FB6FCD414E44EA9B9E81028CB090260@gmail.com> Message-ID: Sean Fisk seanfisk.com> writes: > > OK, I have an interim solution. While I do believe that QFile.readAll() should > return the file contents as a QByteArray, QResource.data() seems to work! > Here is the code: I tested it at home on OS X 10.8.2 using the builtin Python and Qt 4.8.1, PySide 1.1.1 and it works once I opened the file with test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text) Output is: Running PySide 1.1.1 / Qt 4.8.1 PySide compiled with Qt 4.8.1 Does it exist?: True readAll(): `This is just a test. ' Is there a good reason you aren't opening the file? Eric From akabaila at pcug.org.au Tue Apr 9 01:55:18 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Tue, 09 Apr 2013 09:55:18 +1000 Subject: [PySide] Help with resource files In-Reply-To: References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> Message-ID: <1768917.oUYvQzkIKX@supremo> Sean, thanks for letting me know that you actually used PySideSimplicissimus to learn PySide - makes me feel that writting it was worth while! To reiterate, and hopefully making clearer, my earlier remarks in this list. Python's print command prints text string objects what your program snippet via PySide (or PyQt for that matter) returns is not a text string object. To make it a text object one could try to use QplainTextEdit object which may have methods to read your "texty" object and does have a method to "disgorge" a text (that can be printed with Python print() method). I really did not see why one would want to use such inefficient way of carrying text - there is much more data in the encoded format than plain text. I think I now see why - you want to distribute your program as one file that can be run with python Is that right? And you frown upon the possibility of running it as python Is that roughly the situation? Al. On Monday 08 April 2013 23:26:57 Eric Johnson wrote: > Sean Fisk seanfisk.com> writes: > > OK, I have an interim solution. While I do believe that > > QFile.readAll() should return the file contents as a QByteArray, > > QResource.data() seems to work! > > Here is the code: > I tested it at home on OS X 10.8.2 using the builtin Python and Qt > 4.8.1, PySide 1.1.1 and it works once I opened the file with > test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text) > > Output is: > Running PySide 1.1.1 / Qt 4.8.1 > PySide compiled with Qt 4.8.1 > Does it exist?: True > readAll(): `This is just a test. > ' > > Is there a good reason you aren't opening the file? > > Eric > > > > > _______________________________________________ > 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 ltanure at gmail.com Tue Apr 9 02:26:16 2013 From: ltanure at gmail.com (Lucas Tanure) Date: Mon, 8 Apr 2013 21:26:16 -0300 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: References: <001a01ce349e$c99deb50$5cd9c1f0$@gmail.com> Message-ID: Could you use the queue in python ? with Queue.get([*block*[, *timeout*]]) ? Lucas A. Tanure Alves +55 (19) 88176559 On Mon, Apr 8, 2013 at 6:59 PM, William Dias wrote: > Hi, Tibold. Thanks for your reply. > > If I first move my worker to the new thread and then make the connection > should it work? > > According to the documentation, it would use an auto-connection and since > emitter and receiver don't have the same thread affinity, it would create a > queued connection. Is it right? > > Best, > > > 2013/4/8 Tibold Kandrai > >> Hi,**** >> >> ** ** >> >> I think you’ll have to use queued connection when you connect the >> photoStatus signal to the photoStatus slot.**** >> >> ** ** >> >> See:**** >> >> >> http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots-across-threads >> **** >> >> ** ** >> >> Cheers,**** >> >> Tibold**** >> >> ** ** >> >> *From:* pyside-bounces+kandraitibold=gmail.com at qt-project.org [mailto: >> pyside-bounces+kandraitibold=gmail.com at qt-project.org] *On Behalf Of *William >> Dias >> *Sent:* 2013 April 08, Monday 17:01 >> *To:* pyside at qt-project.org >> *Subject:* [PySide] Signal emitted on a worker thread not being received >> by main thread**** >> >> ** ** >> >> Hi,**** >> >> ** ** >> >> I am facing an intermittent problem with my PySide application. I have a >> GUI that spawns several threads that are responsible for sending photos to >> a web server. The threads are created as shown bellow:**** >> >> ** ** >> >> photoConnectionThread = QThread()**** >> >> photoConnectionObject = http_connection.PhotoConnection(self.filename)*** >> * >> >> photoConnectionObject.photoStatus.connect(self.photoStatus) * >> *** >> >> photoConnectionObject.moveToThread(photoConnectionThread)**** >> >> photoConnectionThread.started.connect(photoConnectionObject.work)**** >> >> photoConnectionThread.finished.connect(self.threadFinished)**** >> >> photoConnectionThread.start()**** >> >> ** ** >> >> My worker thread tries to upload a photo only once and then emits a >> signal to the main thread so that the status can be updated in a database. >> **** >> >> ** ** >> >> def work(self):**** >> >> logger.info("photo object created on thread " + >> str(self.thread()))**** >> >> status = sendPhoto(self.filename)**** >> >> self.photoStatus.emit(self.filename, status)**** >> >> QThread.sleep(5)**** >> >> logger.info("exiting thread " + >> str(self.thread()))**** >> >> self.thread().exit(0)**** >> >> ** ** >> >> The problem is that, sporadically, the main thread does not receive the >> signal and consequently doesn't get the status updated.**** >> >> ** ** >> >> Does anybody have any idea why this is happening?**** >> >> ** ** >> >> I am using:**** >> >> Python 2.7**** >> >> PySide 1.1.1**** >> >> Windows 7**** >> >> ** ** >> >> Thank you!**** >> > > > _______________________________________________ > 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 akabaila at pcug.org.au Tue Apr 9 02:43:02 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Tue, 09 Apr 2013 10:43:02 +1000 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: References: Message-ID: <1455303.DWSU6n94Jb@supremo> IMHO if you remove the sleep(5), if it still works sometimes, it will work every time. If a sent signal does not find slot, it just "fades away". That is my understanding how it works. And if the "sleep" between emitting the signal and receiving it is long enough, it will always fail. Try it with sleep(1000) and with sleep(1) and tell us what happens. On Monday 08 April 2013 21:26:16 Lucas Tanure wrote: Could you use the queue in python ? with Queue.get([block[, timeout]]) ? Lucas A. Tanure Alves +55 (19) 88176559 On Mon, Apr 8, 2013 at 6:59 PM, William Dias wrote: Hi, Tibold. Thanks for your reply. If I first move my worker to the new thread and then make the connection should it work? According to the documentation, it would use an auto-connection and since emitter and receiver don't have the same thread affinity, it would create a queued connection. Is it right? Best, 2013/4/8 Tibold Kandrai Hi, I think you’ll have to use queued connection when you connect the photoStatus signal to the photoStatus slot. See: http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots- across-threads Cheers, Tibold From: pyside-bounces+kandraitibold=gmail.com at qt-project.org [mailto:pyside-bounces+kandraitibold=gmail.com at qt-project.org] On Behalf Of William Dias Sent: 2013 April 08, Monday 17:01 To: pyside at qt-project.org Subject: [PySide] Signal emitted on a worker thread not being received by main thread Hi, I am facing an intermittent problem with my PySide application. I have a GUI that spawns several threads that are responsible for sending photos to a web server. The threads are created as shown bellow: photoConnectionThread = QThread() photoConnectionObject = http_connection.PhotoConnection(self.filename) photoConnectionObject.photoStatus.connect(self.photoStatus) photoConnectionObject.moveToThread(photoConnectionThread) photoConnectionThread.started.connect(photoConnectionObject.work) photoConnectionThread.finished.connect(self.threadFinished) photoConnectionThread.start() My worker thread tries to upload a photo only once and then emits a signal to the main thread so that the status can be updated in a database. def work(self): logger.info("photo object created on thread " + str(self.thread())) status = sendPhoto(self.filename) self.photoStatus.emit(self.filename, status) QThread.sleep(5) logger.info("exiting thread " + str(self.thread())) self.thread().exit(0) The problem is that, sporadically, the main thread does not receive the signal and consequently doesn't get the status updated. Does anybody have any idea why this is happening? I am using: Python 2.7 PySide 1.1.1 Windows 7 Sean Fisk Thank you! _______________________________________________ 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 sean at seanfisk.com Tue Apr 9 03:18:51 2013 From: sean at seanfisk.com (Sean Fisk) Date: Mon, 8 Apr 2013 21:18:51 -0400 Subject: [PySide] Help with resource files In-Reply-To: References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <4690731BCE9F4A47A78AD89D8E265E40@gmail.com> <1739690.NPq3KqI3is@supremo> <9621251.d7HDiYvpjM@supremo> <55A5649DCB9948249DC382322502F08E@gmail.com> <0FB6FCD414E44EA9B9E81028CB090260@gmail.com> Message-ID: On Monday, April 8, 2013 at 7:26 PM, Eric Johnson wrote: > Sean Fisk seanfisk.com (http://seanfisk.com)> writes: > > > > > OK, I have an interim solution. While I do believe that QFile.readAll() should > > return the file contents as a QByteArray, QResource.data() seems to work! > > Here is the code: > > > > > I tested it at home on OS X 10.8.2 using the builtin Python and Qt 4.8.1, > PySide 1.1.1 and it works once I opened the file with > test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text) > > Output is: > Running PySide 1.1.1 / Qt 4.8.1 > PySide compiled with Qt 4.8.1 > Does it exist?: True > readAll(): `This is just a test. > ' > > Is there a good reason you aren't opening the file? No, there isn't! I added that to mine as well and it worked great. Having to open the file like that isn't the most intuitive interface, but I should probably read the docs a little closer too. Thanks for the help! > > Eric > > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org (mailto:PySide at qt-project.org) > http://lists.qt-project.org/mailman/listinfo/pyside > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at seanfisk.com Tue Apr 9 03:48:46 2013 From: sean at seanfisk.com (Sean Fisk) Date: Mon, 8 Apr 2013 21:48:46 -0400 Subject: [PySide] Help with resource files In-Reply-To: <1768917.oUYvQzkIKX@supremo> References: <3D86DB953BCA44FB914C1523226F8613@gmail.com> <1768917.oUYvQzkIKX@supremo> Message-ID: <85AA6CAC6C0D4C6ABB0F8F3B90CCACCA@gmail.com> On Monday, April 8, 2013 at 7:55 PM, Algis Kabaila wrote: > > Sean, thanks for letting me know that you actually used PySideSimplicissimus to learn PySide - makes me feel that writting it was worth while! > > > It was most certainly useful. The tutorials illustrated not only how to do specific Qt things using PySide, but also a variety of things that are possible with Qt/PySide. > > > > > To reiterate, and hopefully making clearer, my earlier remarks in this list. Python's print command prints text string objects what your program snippet via PySide (or PyQt for that matter) returns is not a text string object. > > > > > > To make it a text object one could try to use QplainTextEdit object which may have methods to read your "texty" object and does have a method to "disgorge" a text (that can be printed with Python print() method). > > > > > > I really did not see why one would want to use such inefficient way of carrying text - there is much more data in the encoded format than plain text. > > > That's not necessarily true. Qt resources can be compressed in the ZIP format (http://qt-project.org/doc/qt-4.8/resources.html#compression), and text files are great candidates for compression. Of course, the byte representation (\x00), which takes 4 bytes in a Python source file, is rather inefficient. Add to that the overhead of other things in the source file. However, the byte compiled python files are not so storage-inefficient. I downloaded a PNG of Lena and ran her through pyside-rcc, then ran python -m py_compile on the generated resource file to byte compile it. Here are the results: $ du -h lena.png lena.py lena.pyc 464K lena.png 1.3M lena.py 464K lena.pyc So I don't think it's all that much less efficient. > > I think I now see why - you want to distribute your program as one file that can be run with > > > python > > > Is that right? > > > And you frown upon the possibility of running it as > > > python > > > > > > Is that roughly the situation? > > > Correct. We would like to distribute this application using py2app on Mac OS X and pyinstaller on Windows (pyinstaller and PySide/Qt do not get along very well on OS X, but py2app works well). We want to use the resource files to bundle our necessary external files with our program. At this point that includes images and fonts, but it will soon include license texts as well. Thanks for your suggestions and help. > > Al. > > > > > > On Monday 08 April 2013 23:26:57 Eric Johnson wrote: > > > > Sean Fisk seanfisk.com (http://seanfisk.com)> writes: > > > > > OK, I have an interim solution. While I do believe that > > > > > QFile.readAll() should return the file contents as a QByteArray, > > > > > QResource.data() seems to work! > > > > > Here is the code: > > > > I tested it at home on OS X 10.8.2 using the builtin Python and Qt > > > > 4.8.1, PySide 1.1.1 and it works once I opened the file with > > > > test_txt.open(QtCore.QIODevice.ReadOnly | QtCore.QIODevice.Text) > > > > > > > > Output is: > > > > Running PySide 1.1.1 / Qt 4.8.1 > > > > PySide compiled with Qt 4.8.1 > > > > Does it exist?: True > > > > readAll(): `This is just a test. > > > > ' > > > > > > > > Is there a good reason you aren't opening the file? > > > > > > > > Eric > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > PySide mailing list > > > > PySide at qt-project.org (mailto:PySide at qt-project.org) > > > > http://lists.qt-project.org/mailman/listinfo/pyside > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From william.dias at gmail.com Tue Apr 9 04:32:45 2013 From: william.dias at gmail.com (William Dias) Date: Mon, 8 Apr 2013 23:32:45 -0300 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: References: <001a01ce349e$c99deb50$5cd9c1f0$@gmail.com> Message-ID: Lucas, Yes, I could, but the question is: why this is not working properly with qt libraries only? Why the slot is not being called? The weird thing is that the issue just occurs occasionally. In the last battery of tests I ran, I've got 149 threads created and only 2 of them didn't make the call to the slot. 2013/4/8 Lucas Tanure > Could you use the queue in python ? with Queue.get([*block*[, *timeout*]]) > ? > > Lucas A. Tanure Alves > +55 (19) 88176559 > > > On Mon, Apr 8, 2013 at 6:59 PM, William Dias wrote: > >> Hi, Tibold. Thanks for your reply. >> >> If I first move my worker to the new thread and then make the connection >> should it work? >> >> According to the documentation, it would use an auto-connection and since >> emitter and receiver don't have the same thread affinity, it would create a >> queued connection. Is it right? >> >> Best, >> >> >> 2013/4/8 Tibold Kandrai >> >>> Hi,**** >>> >>> ** ** >>> >>> I think you’ll have to use queued connection when you connect the >>> photoStatus signal to the photoStatus slot.**** >>> >>> ** ** >>> >>> See:**** >>> >>> >>> http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots-across-threads >>> **** >>> >>> ** ** >>> >>> Cheers,**** >>> >>> Tibold**** >>> >>> ** ** >>> >>> *From:* pyside-bounces+kandraitibold=gmail.com at qt-project.org [mailto: >>> pyside-bounces+kandraitibold=gmail.com at qt-project.org] *On Behalf Of *William >>> Dias >>> *Sent:* 2013 April 08, Monday 17:01 >>> *To:* pyside at qt-project.org >>> *Subject:* [PySide] Signal emitted on a worker thread not being >>> received by main thread**** >>> >>> ** ** >>> >>> Hi,**** >>> >>> ** ** >>> >>> I am facing an intermittent problem with my PySide application. I have a >>> GUI that spawns several threads that are responsible for sending photos to >>> a web server. The threads are created as shown bellow:**** >>> >>> ** ** >>> >>> photoConnectionThread = QThread()**** >>> >>> photoConnectionObject = http_connection.PhotoConnection(self.filename)** >>> ** >>> >>> photoConnectionObject.photoStatus.connect(self.photoStatus) >>> **** >>> >>> photoConnectionObject.moveToThread(photoConnectionThread)**** >>> >>> photoConnectionThread.started.connect(photoConnectionObject.work)**** >>> >>> photoConnectionThread.finished.connect(self.threadFinished)**** >>> >>> photoConnectionThread.start()**** >>> >>> ** ** >>> >>> My worker thread tries to upload a photo only once and then emits a >>> signal to the main thread so that the status can be updated in a database. >>> **** >>> >>> ** ** >>> >>> def work(self):**** >>> >>> logger.info("photo object created on thread " + >>> str(self.thread()))**** >>> >>> status = sendPhoto(self.filename)**** >>> >>> self.photoStatus.emit(self.filename, status)**** >>> >>> QThread.sleep(5)**** >>> >>> logger.info("exiting thread " + >>> str(self.thread()))**** >>> >>> self.thread().exit(0)**** >>> >>> ** ** >>> >>> The problem is that, sporadically, the main thread does not receive the >>> signal and consequently doesn't get the status updated.**** >>> >>> ** ** >>> >>> Does anybody have any idea why this is happening?**** >>> >>> ** ** >>> >>> I am using:**** >>> >>> Python 2.7**** >>> >>> PySide 1.1.1**** >>> >>> Windows 7**** >>> >>> ** ** >>> >>> Thank you!**** >>> >> >> >> _______________________________________________ >> 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 william.dias at gmail.com Tue Apr 9 04:43:58 2013 From: william.dias at gmail.com (William Dias) Date: Mon, 8 Apr 2013 23:43:58 -0300 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: <1455303.DWSU6n94Jb@supremo> References: <1455303.DWSU6n94Jb@supremo> Message-ID: Algis, The signal is emitted by one thread and received by another. So I think the sleep command will not interfere in the process given that I am dealing with 2 different event loops. I've already tested without it and unfortunately got the same results. 2013/4/8 Algis Kabaila > ** > > IMHO if you remove the sleep(5), if it still works sometimes, it will work > every time. If a sent signal does not find slot, it just "fades away". That > is my understanding how it works. And if the "sleep" between emitting the > signal and receiving it is long enough, it will always fail. Try it with > sleep(1000) and with sleep(1) and tell us what happens. > > > > On Monday 08 April 2013 21:26:16 Lucas Tanure wrote: > > Could you use the queue in python ? with Queue.get([block[, timeout]]) ? > > > Lucas A. Tanure Alves > +55 (19) 88176559 > > > > On Mon, Apr 8, 2013 at 6:59 PM, William Dias > wrote: > > Hi, Tibold. Thanks for your reply. > > > If I first move my worker to the new thread and then make the connection > should it work? > > > According to the documentation, it would use an auto-connection and since > emitter and receiver don't have the same thread affinity, it would create a > queued connection. Is it right? > > > Best, > > > > 2013/4/8 Tibold Kandrai > > Hi, > > > > I think you’ll have to use queued connection when you connect the > photoStatus signal to the photoStatus slot. > > > > See: > > > http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots-across-threads > > > > Cheers, > > Tibold > > > > From: pyside-bounces+kandraitibold=gmail.com at qt-project.org [mailto: > pyside-bounces+kandraitibold=gmail.com at qt-project.org] On Behalf Of William > Dias > Sent: 2013 April 08, Monday 17:01 > To: pyside at qt-project.org > Subject: [PySide] Signal emitted on a worker thread not being received by > main thread > > > > Hi, > > > > I am facing an intermittent problem with my PySide application. I have a > GUI that spawns several threads that are responsible for sending photos to > a web server. The threads are created as shown bellow: > > > > photoConnectionThread = QThread() > > photoConnectionObject = http_connection.PhotoConnection(self.filename) > > photoConnectionObject.photoStatus.connect(self.photoStatus) > > photoConnectionObject.moveToThread(photoConnectionThread) > > photoConnectionThread.started.connect(photoConnectionObject.work) > > photoConnectionThread.finished.connect(self.threadFinished) > > photoConnectionThread.start() > > > > My worker thread tries to upload a photo only once and then emits a signal > to the main thread so that the status can be updated in a database. > > > > def work(self): > > logger.info("photo object created on thread " + > str(self.thread())) > > status = sendPhoto(self.filename) > > self.photoStatus.emit(self.filename, status) > > QThread.sleep(5) > > logger.info("exiting thread " + > str(self.thread())) > > self.thread().exit(0) > > > > The problem is that, sporadically, the main thread does not receive the > signal and consequently doesn't get the status updated. > > > > Does anybody have any idea why this is happening? > > > > I am using: > > Python 2.7 > > PySide 1.1.1 > > Windows 7 Sean Fisk > > > > Thank you! > > > > _______________________________________________ > 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 ltanure at gmail.com Tue Apr 9 04:46:47 2013 From: ltanure at gmail.com (Lucas Tanure) Date: Mon, 8 Apr 2013 23:46:47 -0300 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: References: <1455303.DWSU6n94Jb@supremo> Message-ID: A outra coisa, um antigo chefe meu, me ensinou que se eu preciso de sleep ou yield no meu código, eu estou usando a arquitetura errada. Você pode até tentar criar a coneção de sinais e slots dentro da thread, ou usar threads de python, mas o bom mesmo seria uma forma melhor de fazer seu objetivo. -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Tue Apr 9 09:41:00 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Tue, 09 Apr 2013 17:41 +1000 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: References: Message-ID: <2486639.sxMLbEnpqW@supremo> William, It may bee worth while to read about QTimer [QtCore]( Mark Summerfield's "Rapid GUI Porgramming with Python and Qt", pp. 373, 376. Also QTime [QtCore] and [QTimeEdit [QTGui] p 576. I vaguely recall that there was discussion why he used QTimer of Qt library rather than the simpler "sleep" of Python. Just a shot in the dark - it might be just what is needed. Worth a try, I think. Al. On Monday 08 April 2013 23:32:45 William Dias wrote: Lucas, Yes, I could, but the question is: why this is not working properly with qt libraries only? Why the slot is not being called? The weird thing is that the issue just occurs occasionally. In the last battery of tests I ran, I've got 149 threads created and only 2 of them didn't make the call to the slot. 2013/4/8 Lucas Tanure Could you use the queue in python ? with Queue.get([block[, timeout]]) ? Lucas A. Tanure Alves +55 (19) 88176559 On Mon, Apr 8, 2013 at 6:59 PM, William Dias wrote: Hi, Tibold. Thanks for your reply. If I first move my worker to the new thread and then make the connection should it work? According to the documentation, it would use an auto-connection and since emitter and receiver don't have the same thread affinity, it would create a queued connection. Is it right? Best, 2013/4/8 Tibold Kandrai Hi, I think you’ll have to use queued connection when you connect the photoStatus signal to the photoStatus slot. See: http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots- across-threads Cheers, Tibold From: pyside-bounces+kandraitibold=gmail.com at qt-project.org [mailto:pyside-bounces+kandraitibold=gmail.com at qt-project.org] On Behalf Of William Dias Sent: 2013 April 08, Monday 17:01 To: pyside at qt-project.org Subject: [PySide] Signal emitted on a worker thread not being received by main thread Hi, I am facing an intermittent problem with my PySide application. I have a GUI that spawns several threads that are responsible for sending photos to a web server. The threads are created as shown bellow: photoConnectionThread = QThread() photoConnectionObject = http_connection.PhotoConnection(self.filename) photoConnectionObject.photoStatus.connect(self.photoStatus) photoConnectionObject.moveToThread(photoConnectionThread) photoConnectionThread.started.connect(photoConnectionObject.work) photoConnectionThread.finished.connect(self.threadFinished) photoConnectionThread.start() My worker thread tries to upload a photo only once and then emits a signal to the main thread so that the status can be updated in a database. def work(self): logger.info("photo object created on thread " + str(self.thread())) status = sendPhoto(self.filename) self.photoStatus.emit(self.filename, status) QThread.sleep(5) logger.info("exiting thread " + str(self.thread())) self.thread().exit(0) The problem is that, sporadically, the main thread does not receive the signal and consequently doesn't get the status updated. Does anybody have any idea why this is happening? I am using: Python 2.7 PySide 1.1.1 Windows 7 Thank you! _______________________________________________ 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 jpe at wingware.com Tue Apr 9 17:27:06 2013 From: jpe at wingware.com (John Ehresman) Date: Tue, 09 Apr 2013 11:27:06 -0400 Subject: [PySide] Stepping down as maintainer, putting new people on board. In-Reply-To: <7343246.B6BV27PiyG@hugodesktop> References: <2073136.8cf90yV8tA@hugodesktop> <515EE135.6060202@wingware.com> <7343246.B6BV27PiyG@hugodesktop> Message-ID: <5164334A.3060000@wingware.com> On 4/5/13 1:20 PM, Hugo Parente Lima wrote: >> What are the steps needed to complete the transition to a new >> team of maintainers and approvers for PySide? I'd like to be >> able to start to work with the bug tracker and repository tools. >> Is there any documentation, list, or forum on how to use the bug >> tracker and other tools effectively? > > Are you already the project maintainer on Gerrit? If not, contact > Lars, he's copied on this thread. I don't think I'm a project maintainer on Gerrit or the bug tracker. Is there anything I can do to move this process forward? Thanks, John From jpe at wingware.com Wed Apr 10 17:22:17 2013 From: jpe at wingware.com (John Ehresman) Date: Wed, 10 Apr 2013 11:22:17 -0400 Subject: [PySide] Development Digest, Vol 19, Issue 19 In-Reply-To: References: Message-ID: <516583A9.7050804@wingware.com> On 4/10/13 3:30 AM, development-request at qt-project.org wrote: >> Done the Gerrit part. >> > >> >John, you might want to update http://qt-project.org/wiki/Maintainers as >> >well. > I've now also updated Jira permissions. John, you're now the project owner > for pyside, and should have all required permissions there. > > In addition, I added Roman Lacko and John Cummings as Approvers for > pyside. Thanks! I've updated http://qt-project.org/wiki/Maintainers Should I remove API Extractor and Generatorrunner from the wiki table since the code for these is now folded into shiboken? John From mike at pythonlibrary.org Wed Apr 10 17:30:59 2013 From: mike at pythonlibrary.org (Mike Driscoll) Date: Wed, 10 Apr 2013 10:30:59 -0500 Subject: [PySide] PySide Newbie Tutorials In-Reply-To: References: Message-ID: Hi, Not sure if anyone will be interested, but as I am learning PySide / PyQt right now, I am writing articles about what I learn on my own blog. Here's my first one: http://www.blog.pythonlibrary.org/2013/04/09/pyside-creating-a-currency-converter/ I'll be posting another one later this week that will be a little more original. ------------------- Mike Driscoll Blog: http://blog.pythonlibrary.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcummings2 at users.sf.net Wed Apr 10 17:44:45 2013 From: jcummings2 at users.sf.net (John Cummings) Date: Wed, 10 Apr 2013 10:44:45 -0500 Subject: [PySide] Development Digest, Vol 19, Issue 19 In-Reply-To: <516583A9.7050804@wingware.com> References: <516583A9.7050804@wingware.com> Message-ID: <516588ED.60309@users.sf.net> On 04/10/2013 10:22 AM, John Ehresman wrote: > On 4/10/13 3:30 AM, development-request at qt-project.org wrote: >>> Done the Gerrit part. >>>> John, you might want to update http://qt-project.org/wiki/Maintainers as >>>> well. >> I've now also updated Jira permissions. John, you're now the project owner >> for pyside, and should have all required permissions there. >> >> In addition, I added Roman Lacko and John Cummings as Approvers for >> pyside. > Thanks! I've updated http://qt-project.org/wiki/Maintainers Should I > remove API Extractor and Generatorrunner from the wiki table since the > code for these is now folded into shiboken? > > John Yes, I think they should be removed from there and probably elsewhere too. -John From hugo.lima at openbossa.org Wed Apr 10 19:00:26 2013 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Wed, 10 Apr 2013 14:00:26 -0300 Subject: [PySide] PySide repositories, approvers, maintainers, etc In-Reply-To: <516583A9.7050804@wingware.com> References: <516583A9.7050804@wingware.com> Message-ID: <2845862.yf4hLaO1rq@hugodesktop> On Wednesday, April 10, 2013 11:22:17 AM John Ehresman wrote: > On 4/10/13 3:30 AM, development-request at qt-project.org wrote: > >> Done the Gerrit part. > >> > >> >John, you might want to update http://qt-project.org/wiki/Maintainers as > >> >well. > > > > I've now also updated Jira permissions. John, you're now the project owner > > for pyside, and should have all required permissions there. > > > > In addition, I added Roman Lacko and John Cummings as Approvers for > > pyside. > > Thanks! I've updated http://qt-project.org/wiki/Maintainers Should I > remove API Extractor and Generatorrunner from the wiki table since the > code for these is now folded into shiboken? You could ask to remove those repositories from qt-project, all history were already merged into on Shiboken repository, so there'll be no history lost. You can also ask to create a new repository for PySide-Tools. Those are in the list: "Things I never did while being PySide maintainer" :-P > John > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From hugo.lima at openbossa.org Wed Apr 10 19:00:26 2013 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Wed, 10 Apr 2013 14:00:26 -0300 Subject: [PySide] PySide repositories, approvers, maintainers, etc In-Reply-To: <516583A9.7050804@wingware.com> References: <516583A9.7050804@wingware.com> Message-ID: <2845862.yf4hLaO1rq@hugodesktop> On Wednesday, April 10, 2013 11:22:17 AM John Ehresman wrote: > On 4/10/13 3:30 AM, development-request at qt-project.org wrote: > >> Done the Gerrit part. > >> > >> >John, you might want to update http://qt-project.org/wiki/Maintainers as > >> >well. > > > > I've now also updated Jira permissions. John, you're now the project owner > > for pyside, and should have all required permissions there. > > > > In addition, I added Roman Lacko and John Cummings as Approvers for > > pyside. > > Thanks! I've updated http://qt-project.org/wiki/Maintainers Should I > remove API Extractor and Generatorrunner from the wiki table since the > code for these is now folded into shiboken? You could ask to remove those repositories from qt-project, all history were already merged into on Shiboken repository, so there'll be no history lost. You can also ask to create a new repository for PySide-Tools. Those are in the list: "Things I never did while being PySide maintainer" :-P > John > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From Erik.Janssens at conceptive.be Fri Apr 12 12:09:21 2013 From: Erik.Janssens at conceptive.be (Erik Janssens) Date: Fri, 12 Apr 2013 12:09:21 +0200 Subject: [PySide] Camelot 13.04.13 Message-ID: Hello, Camelot 13.04.13 has been released. Camelot provides components to build business applications on top SQLAlchemy and Qt. For screenshots, see : http://www.python-camelot.com/ Source packages are available for both PyQt and PySide. An overview of the changes can be found here : http://www.python-camelot.com/3/post/2013/04/release-130413.html Cheers, Erik -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpe at wingware.com Fri Apr 12 18:14:55 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 12 Apr 2013 12:14:55 -0400 Subject: [PySide] Development Digest, Vol 19, Issue 19 In-Reply-To: <516588ED.60309@users.sf.net> References: <516583A9.7050804@wingware.com> <516588ED.60309@users.sf.net> Message-ID: <516832FF.5060009@wingware.com> On 4/10/13 11:44 AM, John Cummings wrote: >> Thanks! I've updated http://qt-project.org/wiki/Maintainers Should I >> remove API Extractor and Generatorrunner from the wiki table since the >> code for these is now folded into shiboken? >> >> John > > Yes, I think they should be removed from there and probably elsewhere too. I just removed API Extractor and Generatorrunner from http://qt-project.org/wiki/Maintainers I agree that they should be removed from other pages as well, particularly from http://qt.gitorious.org/pyside That page should also be rearranged so that the repositories that are not historical should be at the top rather than at the bottom. Does anyone want to take on figuring out how to do this? I also changed the bug tracker so that I'm the component lead for both pyside and shiboken and that new issues will be unassigned by default so that the assigned field will more accurately reflect if anyone is working on something -- an issue will be changed when someone says that he or she will try to fix it. I plan to go through the existing bugs, see if they've been fixed, and probably unassign most of them. If anyone wants to help with this, please let me know. I was unable to figure out how to set up the bug tracker to email me when anything happens -- does anyone know how to do this? Thanks, John From jpe at wingware.com Fri Apr 12 18:19:44 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 12 Apr 2013 12:19:44 -0400 Subject: [PySide] Improving web pages and bug tracker In-Reply-To: <516588ED.60309@users.sf.net> References: <516583A9.7050804@wingware.com> <516588ED.60309@users.sf.net> Message-ID: <51683420.8090604@wingware.com> [Resending with a more appropriate subject; sorry for not changing the subject the first time around] On 4/10/13 11:44 AM, John Cummings wrote: >> Thanks! I've updated http://qt-project.org/wiki/Maintainers Should I >> remove API Extractor and Generatorrunner from the wiki table since the >> code for these is now folded into shiboken? >> >> John > > Yes, I think they should be removed from there and probably elsewhere too. I just removed API Extractor and Generatorrunner from http://qt-project.org/wiki/Maintainers I agree that they should be removed from other pages as well, particularly from http://qt.gitorious.org/pyside That page should also be rearranged so that the repositories that are not historical should be at the top rather than at the bottom. Does anyone want to take on figuring out how to do this? I also changed the bug tracker so that I'm the component lead for both pyside and shiboken and that new issues will be unassigned by default so that the assigned field will more accurately reflect if anyone is working on something -- an issue will be changed when someone says that he or she will try to fix it. I plan to go through the existing bugs, see if they've been fixed, and probably unassign most of them. If anyone wants to help with this, please let me know. I was unable to figure out how to set up the bug tracker to email me when anything happens -- does anyone know how to do this? Thanks, John _______________________________________________ PySide mailing list PySide at qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside From hugo.lima at openbossa.org Fri Apr 12 19:26:39 2013 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Fri, 12 Apr 2013 14:26:39 -0300 Subject: [PySide] Development Digest, Vol 19, Issue 19 In-Reply-To: <516832FF.5060009@wingware.com> References: <516588ED.60309@users.sf.net> <516832FF.5060009@wingware.com> Message-ID: <1974460.xdPQuYO9WA@hugodesktop> On Friday, April 12, 2013 12:14:55 PM John Ehresman wrote: > On 4/10/13 11:44 AM, John Cummings wrote: > >> Thanks! I've updated http://qt-project.org/wiki/Maintainers Should I > >> remove API Extractor and Generatorrunner from the wiki table since the > >> code for these is now folded into shiboken? > >> > >> John > > > > Yes, I think they should be removed from there and probably elsewhere too. > > I just removed API Extractor and Generatorrunner from > http://qt-project.org/wiki/Maintainers I agree that they should be > removed from other pages as well, particularly from > http://qt.gitorious.org/pyside That page should also be rearranged so > that the repositories that are not historical should be at the top > rather than at the bottom. Does anyone want to take on figuring out how > to do this? I have admin rights on qt.gitorious.org/pyside, so I can solve this. > I also changed the bug tracker so that I'm the component lead for both > pyside and shiboken and that new issues will be unassigned by default so > that the assigned field will more accurately reflect if anyone is > working on something -- an issue will be changed when someone says that > he or she will try to fix it. I plan to go through the existing bugs, > see if they've been fixed, and probably unassign most of them. If > anyone wants to help with this, please let me know. > > I was unable to figure out how to set up the bug tracker to email me > when anything happens -- does anyone know how to do this? > > Thanks, > > John > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From hugo.lima at openbossa.org Fri Apr 12 19:31:50 2013 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Fri, 12 Apr 2013 14:31:50 -0300 Subject: [PySide] Improving web pages and bug tracker In-Reply-To: <51683420.8090604@wingware.com> References: <516588ED.60309@users.sf.net> <51683420.8090604@wingware.com> Message-ID: <2236111.Gffzo8I1qO@hugodesktop> On Friday, April 12, 2013 12:19:44 PM John Ehresman wrote: > [Resending with a more appropriate subject; sorry for not changing the > subject the first time around] > > On 4/10/13 11:44 AM, John Cummings wrote: > >> Thanks! I've updated http://qt-project.org/wiki/Maintainers Should I > >> remove API Extractor and Generatorrunner from the wiki table since the > >> code for these is now folded into shiboken? > >> > >> John > > > > Yes, I think they should be removed from there and probably elsewhere too. > > I just removed API Extractor and Generatorrunner from > http://qt-project.org/wiki/Maintainers I agree that they should be > removed from other pages as well, particularly from > http://qt.gitorious.org/pyside That page should also be rearranged so > that the repositories that are not historical should be at the top > rather than at the bottom. Does anyone want to take on figuring out how > to do this? Ok, so as no history will be lost, I'll be removing the following repositories: apiextractor-archive shiboken-archive generatorrunner-archive pyde-archive apiextractor generatorrunner Hope this will help to reduce the current mess on qt.gitorious.org/pyside. > I also changed the bug tracker so that I'm the component lead for both > pyside and shiboken and that new issues will be unassigned by default so > that the assigned field will more accurately reflect if anyone is > working on something -- an issue will be changed when someone says that > he or she will try to fix it. I plan to go through the existing bugs, > see if they've been fixed, and probably unassign most of them. If > anyone wants to help with this, please let me know. > > I was unable to figure out how to set up the bug tracker to email me > when anything happens -- does anyone know how to do this? > > Thanks, > > John > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From schampailler at skynet.be Sat Apr 13 14:03:55 2013 From: schampailler at skynet.be (Stefan Champailler) Date: Sat, 13 Apr 2013 14:03:55 +0200 Subject: [PySide] Building a debug PySide+python+valgrind [Newbie dev Tutorial ? :-)] Message-ID: <516949AB.5000605@skynet.be> Dear ml, A while ago I posted my notes about compiling PySide in debug mode + python + valgrind (see below). I've got some questions : 1. Do these notes seem right to you ? I ask because I'm not very knowledgeable about cmake and I may be doing things that are just not necessary (such as setting all those env. variables, or maybe not using the PySide build scripts to their full power) 2. Maybe these notes qualify for the wiki as well ? (provided they are correct) 3. Once I had built pyside debug, python debug and valgrind, I started to use them. However it didn't help me much to track some memory leaks. So i was wondering if that's a productive way of looking at bugs. Maybe there are more powerful tools to track issues ? I was dreaming of a way to print the list of PySide managed objects... Stefan ----- * Valgrind (bugged on Debian => I build it myself) ./configure --prefix=/home/stefan/Projects/valgrind make make install export VALGRIND_LIB=/home/stefan/Projects/valgrind/lib/valgrind * I build a Python debug like this : Download Python source then : make clean ./configure --without-pymalloc --with-valgrind --with-pydebug --enable-shared --prefix=/home/stefan/Projects/python-valgrind --enable-unicode=ucs4 make make install Note the --enable-unicode, somehow it was hard to figure out... I'm also thinking that --with-valgrind implies --without-pymalloc... * PySide debug built with : export PYTHONBASE=$HOME/Projects/python-valgrind export PYSIDESANDBOXPATH=$HOME/Projects/PL/pyside-valgrind # Prepare to tell cmake to use our Python debug build export PYTHON_EXEC=$PYTHONBASE/bin/python export PYTHON_LIB=$PYTHONBASE/lib export PYTHON_INC=$PYTHONBASE/include export PYTHONPATH=$PYSIDESANDBOXPATH/lib/python2.7/site-packages:$PYTHONBASE export PATH=$PYSIDESANDBOXPATH/bin:$PATH export LD_LIBRARY_PATH=$PYSIDESANDBOXPATH/lib:$PYTHONBASE/lib #I guess the following is for the build only export PKG_CONFIG_PATH=$PYSIDESANDBOXPATH/lib/pkgconfig:$PKG_CONFIG_PATH # set -DENABLE_ICECC=1 if you're using the icecream distributed compiler alias runcmake='cmake .. -DCMAKE_INSTALL_PREFIX=$PYSIDESANDBOXPATH -DCMAKE_BUILD_TYPE=Debug -DENABLE_ICECC=0' and, as explianed on the wiki, but extended for the prupose of a debug build (so I've added a few var. definitions -D): cmake .. -DCMAKE_INSTALL_PREFIX=$PYSIDESANDBOXPATH -DCMAKE_BUILD_TYPE=Debug -DENABLE_ICECC=0 -DPYTHON_EXECUTABLE:PATH=$PYTHON_EXEC -DPYTHON_INCLUDE_DIRS:PATH=$PYT\ HON_INC -DPYTHON_LIBRARY:FILEPATH=$PYTHON_LIB/libpython2.7.so && make -j4 && make install ... on all the directories of PySide ("apiextractor" "generatorrunner" "shiboken" "pyside") * Running some python code in Valgrind : /home/stefan/Projects/valgrind/bin/valgrind --tool=memcheck /home/stefan/Projects/python-valgrind/bin/python python.py * Debug the same code with gdb : export LD_LIBRARY_PATH= # This makes gdb mad, will have to redefine it in gdb environment, see below gdb /home/stefan/Projects/python-valgrind/bin/python and once in gdb : (gdb) set environment LD_LIBRARY_PATH=/home/stefan/Projects/PL/pyside-valgrind/lib:/home/stefan/Projects/python-valgrind/lib (gdb) r python.py -- Timeo Danaos et dona ferentes -------------- next part -------------- An HTML attachment was scrubbed... URL: From chigga101 at gmail.com Sat Apr 13 19:33:50 2013 From: chigga101 at gmail.com (Matthew Ngaha) Date: Sat, 13 Apr 2013 18:33:50 +0100 Subject: [PySide] Is QtCreator included with Pyside? Message-ID: hi i have a few questions. I want to download Qt Quick Colibri but im unsure of the download process. I read that in order to use Colibri i need Qt 4.7.0 and Qt Creator 2.0.1 or higher. Im just learning Pyside and ive come across QtDesigner but never QtCreator, can anyone tell me what this is or what its used for? and more importantly if its included in the Pyside download? If it is, should i be able to use Colibra as its included or do i need to download something else to get Colibra to work? Thanks From a.richi at bluewin.ch Sat Apr 13 19:49:38 2013 From: a.richi at bluewin.ch (Aaron Richiger) Date: Sat, 13 Apr 2013 19:49:38 +0200 Subject: [PySide] Is QtCreator included with Pyside? In-Reply-To: References: Message-ID: <51699AB2.8000204@bluewin.ch> Hello Matthew! I never used the colibri qml components. But I can tell you, that QtCreator is an IDE for C++, Javascript, qml, etc. development. I never used it for PySide development. QtCreator does not come with PySide, but it's simple to install (you'll find it with google...), but I think you don't need it at all. "Qt4.7 or higher" comes with PySide, so this is no problem. You can find a tutorial about colibri and PySide here: http://qt-project.org/wiki/Utilizing-Qt-Quick-Colibri-in-PySide You may also be interested in another set of qml components (I think, it also has very nice components): qt-components, you can get it here: http://qt.gitorious.org/qt-components I hope, this helps, to get you started! Aaron Am 13.04.2013 19:33, schrieb Matthew Ngaha: > hi i have a few questions. I want to download Qt Quick Colibri but im > unsure of the download process. > > I read that in order to use Colibri i need Qt 4.7.0 and Qt Creator > 2.0.1 or higher. Im just learning Pyside and ive come across > QtDesigner but never QtCreator, can anyone tell me what this is or > what its used for? and more importantly if its included in the Pyside > download? > > If it is, should i be able to use Colibra as its included or do i need > to download something else to get Colibra to work? > > Thanks > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From jpe at wingware.com Sat Apr 13 21:14:58 2013 From: jpe at wingware.com (John Ehresman) Date: Sat, 13 Apr 2013 15:14:58 -0400 Subject: [PySide] Building a debug PySide+python+valgrind [Newbie dev Tutorial ? :-)] In-Reply-To: <516949AB.5000605@skynet.be> References: <516949AB.5000605@skynet.be> Message-ID: <5169AEB2.5090606@wingware.com> On 4/13/13 8:03 AM, Stefan Champailler wrote: > Dear ml, > > A while ago I posted my notes about compiling PySide in debug mode + > python + valgrind (see below). > > I've got some questions : > > 1. Do these notes seem right to you ? I ask because I'm not very > knowledgeable about cmake and I may be doing things that are just not > necessary (such as setting all those env. variables, or maybe not using > the PySide build scripts to their full power) Some changes / comments: * the apiextractor and generatorrunner directories are no longer needed (the code is now in shiboken). * I think the environment variables other than PATH and LD_LIBRARY_PATH are only used withing the script itself; in other words, the child cmake and other processes do not look them up in the environment * it's worth noting that this is Linux specific; OS X needs DYLD_LIBRARY_PATH rather than LD_LIBRARY_PATH and win32 only needs PATH. > 3. Once I had built pyside debug, python debug and valgrind, I started > to use them. However it didn't help me much to track some memory leaks. > So i was wondering if that's a productive way of looking at bugs. Maybe > there are more powerful tools to track issues ? I was dreaming of a way > to print the list of PySide managed objects... Are you looking for shiboken.getAllValidWrappers() ? As far as if valgrind is a productive way to look at bugs, I think it depends on the bug. I do think debug enabled builds of pyside, python, and qt help a lot when tracking down problems in C++ level code. Thanks, John From schampailler at skynet.be Sun Apr 14 10:31:15 2013 From: schampailler at skynet.be (Stefan Champailler) Date: Sun, 14 Apr 2013 10:31:15 +0200 Subject: [PySide] Building a debug PySide+python+valgrind [Newbie dev Tutorial ? :-)] In-Reply-To: <5169AEB2.5090606@wingware.com> References: <516949AB.5000605@skynet.be> <5169AEB2.5090606@wingware.com> Message-ID: <516A6953.3@skynet.be> Ok. Whenever I'll start debugging again, I'll read your instruction carefully :-) And if that ends up in a nice debug build procedure, I'll post it here again. Now for the *proper* way to track bugs, that indeed depends on the kind of bug. I inconsciously had in mind stacktrace and memory leaks... Best regards, Stefan On 04/13/2013 09:14 PM, John Ehresman wrote: > On 4/13/13 8:03 AM, Stefan Champailler wrote: >> Dear ml, >> >> A while ago I posted my notes about compiling PySide in debug mode + >> python + valgrind (see below). >> >> I've got some questions : >> >> 1. Do these notes seem right to you ? I ask because I'm not very >> knowledgeable about cmake and I may be doing things that are just not >> necessary (such as setting all those env. variables, or maybe not using >> the PySide build scripts to their full power) > Some changes / comments: > * the apiextractor and generatorrunner directories are no longer needed > (the code is now in shiboken). > * I think the environment variables other than PATH and LD_LIBRARY_PATH > are only used withing the script itself; in other words, the child cmake > and other processes do not look them up in the environment > * it's worth noting that this is Linux specific; OS X needs > DYLD_LIBRARY_PATH rather than LD_LIBRARY_PATH and win32 only needs PATH. > >> 3. Once I had built pyside debug, python debug and valgrind, I started >> to use them. However it didn't help me much to track some memory leaks. >> So i was wondering if that's a productive way of looking at bugs. Maybe >> there are more powerful tools to track issues ? I was dreaming of a way >> to print the list of PySide managed objects... > Are you looking for shiboken.getAllValidWrappers() ? As far as if > valgrind is a productive way to look at bugs, I think it depends on the > bug. I do think debug enabled builds of pyside, python, and qt help a > lot when tracking down problems in C++ level code. > > Thanks, > > John > -- Timeo Danaos et dona ferentes From vihorev at gmail.com Sun Apr 14 12:03:21 2013 From: vihorev at gmail.com (Alexey Vihorev) Date: Sun, 14 Apr 2013 13:03:21 +0300 Subject: [PySide] Strange behaviour of QLocale.toString() Message-ID: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> Hi! 1. from PySide.QtCore import QLocale as PySideLocale #PySide 1.1.2 on Win32 2. from PyQt4.QtCore import QLocale as PyQtLocale 3. 4. print(PySideLocale().toString(9999999.99, 'f', 2)) #prints '10 000 000,00' 5. print(PyQtLocale().toString(9999999.99, 'f', 2)) #prints '9 999 999,99' I guess it's a bug, right? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chigga101 at gmail.com Sun Apr 14 15:24:16 2013 From: chigga101 at gmail.com (Matthew Ngaha) Date: Sun, 14 Apr 2013 14:24:16 +0100 Subject: [PySide] PySide Digest, Vol 15, Issue 31 In-Reply-To: References: Message-ID: > Hello Matthew! > > I never used the colibri qml components. But I can tell you, that > QtCreator is an IDE for C++, Javascript, qml, etc. development. I never > used it for PySide development. QtCreator does not come with PySide, but > it's simple to install (you'll find it with google...), but I think you > don't need it at all. > "Qt4.7 or higher" comes with PySide, so this is no problem. > > You can find a tutorial about colibri and PySide here: > http://qt-project.org/wiki/Utilizing-Qt-Quick-Colibri-in-PySide > > You may also be interested in another set of qml components (I think, it > also has very nice components): qt-components, you can get it here: > http://qt.gitorious.org/qt-components > > I hope, this helps, to get you started! > Aaron > Thanks Aaron. following that pyside/colibri tutorial you gave me, trying to run the file i get an import error: colibri.qml:2:1: "colibri": no such directory import "colibri" i went to their site and i cant seem to find any downloads to install this package. i was at their installation page also: https://projects.forum.nokia.com/colibri/wiki/InstallationAndUsage https://projects.forum.nokia.com/colibri/wiki but their is no link to download? is there an easier way to install this project? ive been stuck at this point for some time now and i would really like to try it out. Im not good at understanding git, can u please tell me about the 2nd link you showed me: http://qt.gitorious.org/qt-components are these like ongoing projects normal users are contributing to? Thanks for all your help:) From pyside at m.allo.ws Sun Apr 14 17:51:33 2013 From: pyside at m.allo.ws (Zak) Date: Sun, 14 Apr 2013 11:51:33 -0400 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> Message-ID: <516AD085.5090902@m.allo.ws> I wouldn't call it a bug. Floating point values get rounded, that is an unavoidable part of computer science. There are two sources of rounding: First, only a limited amount of memory is allocated for each floating point value, usually 32 or 64 bits. 32 bits can hold about 6 or 7 decimal digits of information. Your example number is 9 digits (9 significant figures), and that is more information than you can store in just 32 bits. 64 bits can hold about 15 to 17 decimal digits of information. For reference, Python floats use 64 bits (it doesn't matter whether it is a 64-bit or 32-bit version of the Python interpreter). Second, floating point values are stored in binary (base 2) format, not in decimal (base 10) format. This can cause strange imprecision. (Of note, it is possible to store floating point numbers in base 10, see the formats decimal32 and decimal64 on Wikipedia. These formats are not used by Python, C, or C++, so this is not relevant to the present discussion.) To see the problems inherent in converting between base 2 and base 10, look at the following pure Python example: >>> 0.1 * 0.1 0.010000000000000002 Why did Python return 0.010000000000000002 and not the correct answer, which is 0.01 exactly? The answer is that 0.01 (base 10) is only one significant figure in base 10, but it is non-terminating in base 2. In base 2, it is 0b0.00000010100011110101110000101... and it goes on forever, although the digits do repeat. This is similar to the base 10 number 1 / 3 = 0.3333... . Rational numbers that terminate in base 10 may be non-terminating in base 2. Because 0.01 is non-terminating in base 2, Python was forced to round the number so that it will fit in a 64 bit bucket. When converted back to base 10, the rounded result is 0.010000000000000002. Notice that this is 17 significant figures, and remember that 64 bits can hold 15 to 17 decimal digits. It has come full-circle. The matter is even more complicated in your example, because you are using PySide and PyQt, which use C++ internally. The number must first be converted from base 10 to base 2, then it must be rounded to fit in 64 bits for Python, then it must be converted from Python into C++. C++ has several different floating point types, one allocates 32 bits, one allocates 64 bits. I don't know which type PySide and PyQt use, perhaps they only allocate 32 bits. In that case, it is necessary to round down from the 64 bits in Python to 32 bits for C++. After passing through so many non-exact steps, it is no wonder the value is fudged slightly. Remember that in terms of percent, the change is very small. If even small rounding is not acceptable, I would recommend the Python standard library decimal. decimal.Decimal objects store numbers in base 10, not base 2, and you can choose the precision. It is pretty great. Good luck, Zak Fallows From thoromyr at mac.com Sun Apr 14 19:32:17 2013 From: thoromyr at mac.com (Tim Doty) Date: Sun, 14 Apr 2013 12:32:17 -0500 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> Message-ID: <5D68AA6E-E26E-459E-A759-8F20993D4DAD@mac.com> For the PySide what is really happening is not a rounding error/precision as suggested, but printing an integer with floating point notation. When the floating point is converted to an integer it is rounded. To satisfy yourself that this is in fact happening change the number to be printed (e.g., 9999999.5 vs 9999999.4). I'm not really conversant with PySide, but from http://srinikom.github.io/pyside-docs/PySide/QtCore/QLocale.html it appears that there is no floating point version of the toString() function, just integer, date, and dateTime. As Qt has a variety of floating point overloads for that function (https://qt-project.org/doc/qt-4.8/qlocale.html#toString) it would look to me like a bug/oversight on the part of the PySide implementation. Tim Doty On Apr 14, 2013, at 5:03 AM, Alexey Vihorev wrote: > Hi! > 1. from PySide.QtCore import QLocale as PySideLocale #PySide 1.1.2 on Win32 > 2. from PyQt4.QtCore import QLocale as PyQtLocale > 3. > 4. print(PySideLocale().toString(9999999.99, 'f', 2)) #prints '10 000 000,00' > 5. print(PyQtLocale().toString(9999999.99, 'f', 2)) #prints '9 999 999,99' > I guess it’s a bug, right? > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From vihorev at gmail.com Sun Apr 14 21:02:40 2013 From: vihorev at gmail.com (Alexey Vihorev) Date: Sun, 14 Apr 2013 22:02:40 +0300 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <516AD085.5090902@m.allo.ws> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516AD085.5090902@m.allo.ws> Message-ID: <000101ce3942$a4015aa0$ec040fe0$@gmail.com> Two considerations: 1. No rounding should take place in this case - the decimal precision of the input and output is exactly the same. 2. In PyQt it *does* work correctly, so fundamental lows of computer science are certainly not the reason. -----Original Message----- From: Zak [mailto:pyside at m.allo.ws] Sent: Sunday, April 14, 2013 6:52 PM To: pyside at qt-project.org; vihorev at gmail.com Subject: Re: [PySide] Strange behaviour of QLocale.toString() I wouldn't call it a bug. Floating point values get rounded, that is an unavoidable part of computer science. There are two sources of rounding: -----Original Message----- From: Zak [mailto:pyside at m.allo.ws] Sent: Sunday, April 14, 2013 6:52 PM To: pyside at qt-project.org; vihorev at gmail.com Subject: Re: [PySide] Strange behaviour of QLocale.toString() I wouldn't call it a bug. Floating point values get rounded, that is an unavoidable part of computer science. There are two sources of rounding: First, only a limited amount of memory is allocated for each floating point value, usually 32 or 64 bits. 32 bits can hold about 6 or 7 decimal digits of information. Your example number is 9 digits (9 significant figures), and that is more information than you can store in just 32 bits. 64 bits can hold about 15 to 17 decimal digits of information. For reference, Python floats use 64 bits (it doesn't matter whether it is a 64-bit or 32-bit version of the Python interpreter). Second, floating point values are stored in binary (base 2) format, not in decimal (base 10) format. This can cause strange imprecision. (Of note, it is possible to store floating point numbers in base 10, see the formats decimal32 and decimal64 on Wikipedia. These formats are not used by Python, C, or C++, so this is not relevant to the present discussion.) To see the problems inherent in converting between base 2 and base 10, look at the following pure Python example: >>> 0.1 * 0.1 0.010000000000000002 Why did Python return 0.010000000000000002 and not the correct answer, which is 0.01 exactly? The answer is that 0.01 (base 10) is only one significant figure in base 10, but it is non-terminating in base 2. In base 2, it is 0b0.00000010100011110101110000101... and it goes on forever, although the digits do repeat. This is similar to the base 10 number 1 / 3 = 0.3333... . Rational numbers that terminate in base 10 may be non-terminating in base 2. Because 0.01 is non-terminating in base 2, Python was forced to round the number so that it will fit in a 64 bit bucket. When converted back to base 10, the rounded result is 0.010000000000000002. Notice that this is 17 significant figures, and remember that 64 bits can hold 15 to 17 decimal digits. It has come full-circle. The matter is even more complicated in your example, because you are using PySide and PyQt, which use C++ internally. The number must first be converted from base 10 to base 2, then it must be rounded to fit in 64 bits for Python, then it must be converted from Python into C++. C++ has several different floating point types, one allocates 32 bits, one allocates 64 bits. I don't know which type PySide and PyQt use, perhaps they only allocate 32 bits. In that case, it is necessary to round down from the 64 bits in Python to 32 bits for C++. After passing through so many non-exact steps, it is no wonder the value is fudged slightly. Remember that in terms of percent, the change is very small. If even small rounding is not acceptable, I would recommend the Python standard library decimal. decimal.Decimal objects store numbers in base 10, not base 2, and you can choose the precision. It is pretty great. Good luck, Zak Fallows From pyside at m.allo.ws Sun Apr 14 22:35:40 2013 From: pyside at m.allo.ws (Zak) Date: Sun, 14 Apr 2013 16:35:40 -0400 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <000101ce3942$a4015aa0$ec040fe0$@gmail.com> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516AD085.5090902@m.allo.ws> <000101ce3942$a4015aa0$ec040fe0$@gmail.com> Message-ID: <516B131C.8010204@m.allo.ws> My original email was correct, let me provide proof and explain further. The proof is attached as a Python script, you can run it yourself. I ran it on Mac OS X and also on Windows 7, and I ran it with both 32-bit and 64-bit versions of PySide and PyQt (and matching 32- or 64-bit versions of the Python interpreter). The results were as follows: 1. PySide uses 32-bit floating points. It does not matter whether PySide was compiled in 32-bit or 64-bit mode (x86 or x64). 2. PyQt uses 64-bit floating points. It does not matter whether PyQt was compiled in 32-bit or 64-bit mode. PyQt has better precision than PySide, because PyQt uses 64-bit floats (just like Python itself). However, both PyQt and PySide are internally representing the numbers as binary floating point numbers. Let me address a few specific points: Tim Doty wrote: > For the PySide what is really happening is not a rounding > error/precision as suggested, but printing an integer with floating > point notation. When the floating point is converted to an integer > it is rounded. To satisfy yourself that this is in fact happening > change the number to be printed (e.g., 9999999.5 vs 9999999.4). This is incorrect, what is happening is a rounding error. The number is being rounded to fit in a 32 bit piece of memory. The counter-example above is misleading because it uses bad values. Try the values 1.4 and 1.6 instead. These values are used in the attached Python script. The number is not at any point represented as an integer (data structure), it is always a floating point. Even if the number's value is a whole number, it is represented as a floating point. For instance, Python interprets '1.0' as a floating point literal. A mathematician would say 1.0 is an integer, but computer science uses different terminology. In computer science, in the language Python, '1' is an integer and '1.0' is a floating point, and they are equal in numerical value. They are represented differently in memory. Alexey Vihorev wrote: > Two considerations: > 1. No rounding should take place in this case - the decimal precision of the > input and output is exactly the same. > 2. In PyQt it *does* work correctly, so fundamental lows of computer science > are certainly not the reason. In response to 1: That is just your opinion. You do not want rounding to take place. The designers of Python and Qt had a different opinion. To make things faster, they decided to round numbers so that they can fit in either 32 or 64 bits of memory. If you want to use larger chunks of memory and keep higher precision, then you should use the Python standard library 'decimal', as I said before. Using decimal.Decimal objects, you can set the precision yourself. Because you are not using this library, Python, PySide, and PyQt are making a decision about how to round the number. PySide chose 32 bits, PyQt chose 64 bits. The Python language itself chose 64 bits, so PySide and PyQt cannot possibly choose higher precision, the extra bits have already been thrown away. In response to 2: You are using incorrect logic. As you can see from my example, PyQt also suffers rounding errors, they just occur around 15 to 17 digits. You didn't use that many digits so you didn't see the rounding error. Zak Fallows # File: num_print.py from PyQt4.QtCore import QLocale as PyQtLocale from PySide.QtCore import QLocale as PySideLocale def pb(num): """pb stands for Print Both""" print "Original: " + num flt = eval(num) print " PyQt: ", print PyQtLocale().toString(flt, 'f', 6) print " PySide: ", print PySideLocale().toString(flt, 'f', 6) print '' test_list = [ '1.4', '1.6', '1000.4', '1000.6', '10**6 + .4', '10**6 + .6', '10**7 + .4', '10**7 + .6', '10**8 + .4', '10**8 + .6', '10**9 + .4', '10**9 + .6', '10**14 + .4', '10**14 + .6', '10**15 + .4', '10**15 + .6', '10**16 + .4', '10**16 + .6', '10**17 + .4', '10**17 + .6', ] for num in test_list: pb(num) """ #======================== How to Check Version Numbers ========================# PyQt: PyQt4.QtCore.PYQT_VERSION_STR PySide: PySide.__version__ #=============================== Sample Output ================================# Here is some sample output from running the program: #---------------------------------- Mac OS X ----------------------------------# Mac OS X 10.8.3 Python 2.7.3, 64-bit, from Python.org PySide 1.1.1, 64-bit PyQt 4.9.4, 64-bit >>> import num_print Original: 1.4 PyQt: 1.400000 PySide: 1.400000 Original: 1.6 PyQt: 1.600000 PySide: 1.600000 Original: 1000.4 PyQt: 1,000.400000 PySide: 1,000.400024 Original: 1000.6 PyQt: 1,000.600000 PySide: 1,000.599976 Original: 10**6 + .4 PyQt: 1,000,000.400000 PySide: 1,000,000.375000 Original: 10**6 + .6 PyQt: 1,000,000.600000 PySide: 1,000,000.625000 Original: 10**7 + .4 PyQt: 10,000,000.400000 PySide: 10,000,000.000000 Original: 10**7 + .6 PyQt: 10,000,000.600000 PySide: 10,000,001.000000 Original: 10**8 + .4 PyQt: 100,000,000.400000 PySide: 100,000,000.000000 Original: 10**8 + .6 PyQt: 100,000,000.600000 PySide: 100,000,000.000000 Original: 10**9 + .4 PyQt: 1,000,000,000.400000 PySide: 1,000,000,000.000000 Original: 10**9 + .6 PyQt: 1,000,000,000.600000 PySide: 1,000,000,000.000000 Original: 10**14 + .4 PyQt: 100,000,000,000,000.406250 PySide: 100,000,000,376,832.000000 Original: 10**14 + .6 PyQt: 100,000,000,000,000.593750 PySide: 100,000,000,376,832.000000 Original: 10**15 + .4 PyQt: 1,000,000,000,000,000.375000 PySide: 999,999,986,991,104.000000 Original: 10**15 + .6 PyQt: 1,000,000,000,000,000.625000 PySide: 999,999,986,991,104.000000 Original: 10**16 + .4 PyQt: 10,000,000,000,000,000.000000 PySide: 10,000,000,272,564,224.000000 Original: 10**16 + .6 PyQt: 10,000,000,000,000,000.000000 PySide: 10,000,000,272,564,224.000000 Original: 10**17 + .4 PyQt: 100,000,000,000,000,000.000000 PySide: 99,999,998,430,674,944.000000 Original: 10**17 + .6 PyQt: 100,000,000,000,000,000.000000 PySide: 99,999,998,430,674,944.000000 #--------------------------------- Windows 7 ----------------------------------# Windows 7, 64-bit Python 2.7.3, 32-bit, from Python.org PySide 1.1.1, 32-bit PyQt 4.10, 32-bit >>> import num_print Original: 1.4 PyQt: 1.400000 PySide: 1.400000 Original: 1.6 PyQt: 1.600000 PySide: 1.600000 Original: 1000.4 PyQt: 1,000.400000 PySide: 1,000.400024 Original: 1000.6 PyQt: 1,000.600000 PySide: 1,000.599976 Original: 10**6 + .4 PyQt: 1,000,000.400000 PySide: 1,000,000.375000 Original: 10**6 + .6 PyQt: 1,000,000.600000 PySide: 1,000,000.625000 Original: 10**7 + .4 PyQt: 10,000,000.400000 PySide: 10,000,000.000000 Original: 10**7 + .6 PyQt: 10,000,000.600000 PySide: 10,000,001.000000 Original: 10**8 + .4 PyQt: 100,000,000.400000 PySide: 100,000,000.000000 Original: 10**8 + .6 PyQt: 100,000,000.600000 PySide: 100,000,000.000000 Original: 10**9 + .4 PyQt: 1,000,000,000.400000 PySide: 1,000,000,000.000000 Original: 10**9 + .6 PyQt: 1,000,000,000.600000 PySide: 1,000,000,000.000000 Original: 10**14 + .4 PyQt: 100,000,000,000,000.406250 PySide: 100,000,000,376,832.000000 Original: 10**14 + .6 PyQt: 100,000,000,000,000.593750 PySide: 100,000,000,376,832.000000 Original: 10**15 + .4 PyQt: 1,000,000,000,000,000.375000 PySide: 999,999,986,991,104.000000 Original: 10**15 + .6 PyQt: 1,000,000,000,000,000.625000 PySide: 999,999,986,991,104.000000 Original: 10**16 + .4 PyQt: 10,000,000,000,000,000.000000 PySide: 10,000,000,272,564,224.000000 Original: 10**16 + .6 PyQt: 10,000,000,000,000,000.000000 PySide: 10,000,000,272,564,224.000000 Original: 10**17 + .4 PyQt: 100,000,000,000,000,000.000000 PySide: 99,999,998,430,674,944.000000 Original: 10**17 + .6 PyQt: 100,000,000,000,000,000.000000 PySide: 99,999,998,430,674,944.000000 """ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: num_print.py Type: text/x-python-script Size: 4991 bytes Desc: not available URL: From pyside at m.allo.ws Sun Apr 14 22:43:32 2013 From: pyside at m.allo.ws (Zak) Date: Sun, 14 Apr 2013 16:43:32 -0400 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <516B131C.8010204@m.allo.ws> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516AD085.5090902@m.allo.ws> <000101ce3942$a4015aa0$ec040fe0$@gmail.com> <516B131C.8010204@m.allo.ws> Message-ID: <516B14F4.1010208@m.allo.ws> Here is a summary for the people who don't want to read a wall of text: This is not a bug, PySide uses 32 bit floating points and PyQt uses 64 bit floating points, so they round numbers differently. I recommend using decimal.Decimal in the Python standard library to avoid rounding errors. Unfortunately, this makes it a little harder to do localization (switching commas for periods and such). Zak F. From thoromyr at mac.com Sun Apr 14 23:04:15 2013 From: thoromyr at mac.com (Tim Doty) Date: Sun, 14 Apr 2013 16:04:15 -0500 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <516B131C.8010204@m.allo.ws> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516AD085.5090902@m.allo.ws> <000101ce3942$a4015aa0$ec040fe0$@gmail.com> <516B131C.8010204@m.allo.ws> Message-ID: On Apr 14, 2013, at 3:35 PM, Zak wrote: > My original email was correct, let me provide proof and explain further. > > Let me address a few specific points: > > Tim Doty wrote: > > > For the PySide what is really happening is not a rounding > > error/precision as suggested, but printing an integer with floating > > point notation. When the floating point is converted to an integer > > it is rounded. To satisfy yourself that this is in fact happening > > change the number to be printed (e.g., 9999999.5 vs 9999999.4). > > This is incorrect, what is happening is a rounding error. The number is being rounded to fit in a 32 bit piece of memory. The counter-example above is misleading because it uses bad values. Try the values 1.4 and 1.6 instead. These values are used in the attached Python script. As I said, I don't know the PySide internals. I referred to the published documentation which implies that floats are being coerced into integers due to lack of a float overload. Apparently the docs are wrong… go figure. Interestingly, if you drop the millions (e.g., 999999.62) you can see the rounding in action. I'm not going to dredge through a wall of text looking for a point in the preceding post, but -- as it so happens -- the example I give above outputs correctly making it seem as if there is inconsistent precision. But it is an accident. 999999.65 also prints as 999999.62 while 999999.66 prints as 999999.69 So it is just an artifact of 32-bit precision float representations. Now, why it is being constrained to a 32-bit float on a 64-bit architecture is a different conversation and, while I recognize there would be disagreement, I call that a bug on its face and the fact that the sibling implementation uses 64-bit precision underscores the point. Tim Doty > > The number is not at any point represented as an integer (data structure), it is always a floating point. Even if the number's value is a whole number, it is represented as a floating point. For instance, Python interprets '1.0' as a floating point literal. A mathematician would say 1.0 is an integer, but computer science uses different terminology. In computer science, in the language Python, '1' is an integer and '1.0' is a floating point, and they are equal in numerical value. They are represented differently in memory. > > Alexey Vihorev wrote: > > > Two considerations: > > 1. No rounding should take place in this case - the decimal precision of the > > input and output is exactly the same. > > 2. In PyQt it *does* work correctly, so fundamental lows of computer science > > are certainly not the reason. > > In response to 1: That is just your opinion. You do not want rounding to take place. The designers of Python and Qt had a different opinion. To make things faster, they decided to round numbers so that they can fit in either 32 or 64 bits of memory. If you want to use larger chunks of memory and keep higher precision, then you should use the Python standard library 'decimal', as I said before. Using decimal.Decimal objects, you can set the precision yourself. Because you are not using this library, Python, PySide, and PyQt are making a decision about how to round the number. PySide chose 32 bits, PyQt chose 64 bits. The Python language itself chose 64 bits, so PySide and PyQt cannot possibly choose higher precision, the extra bits have already been thrown away. > > In response to 2: You are using incorrect logic. As you can see from my example, PyQt also suffers rounding errors, they just occur around 15 to 17 digits. You didn't use that many digits so you didn't see the rounding error. > > Zak Fallows > > # File: num_print.py > > from PyQt4.QtCore import QLocale as PyQtLocale > from PySide.QtCore import QLocale as PySideLocale > > def pb(num): > """pb stands for Print Both""" > > print "Original: " + num > flt = eval(num) > print " PyQt: ", > print PyQtLocale().toString(flt, 'f', 6) > print " PySide: ", > print PySideLocale().toString(flt, 'f', 6) > print '' > > test_list = [ > '1.4', > '1.6', > '1000.4', > '1000.6', > '10**6 + .4', > '10**6 + .6', > '10**7 + .4', > '10**7 + .6', > '10**8 + .4', > '10**8 + .6', > '10**9 + .4', > '10**9 + .6', > '10**14 + .4', > '10**14 + .6', > '10**15 + .4', > '10**15 + .6', > '10**16 + .4', > '10**16 + .6', > '10**17 + .4', > '10**17 + .6', > ] > > for num in test_list: > pb(num) > > """ > > #======================== How to Check Version Numbers ========================# > > PyQt: > > PyQt4.QtCore.PYQT_VERSION_STR > > PySide: > > PySide.__version__ > > #=============================== Sample Output ================================# > > Here is some sample output from running the program: > > #---------------------------------- Mac OS X ----------------------------------# > > Mac OS X 10.8.3 > Python 2.7.3, 64-bit, from Python.org > PySide 1.1.1, 64-bit > PyQt 4.9.4, 64-bit > > >>> import num_print > Original: 1.4 > PyQt: 1.400000 > PySide: 1.400000 > > Original: 1.6 > PyQt: 1.600000 > PySide: 1.600000 > > Original: 1000.4 > PyQt: 1,000.400000 > PySide: 1,000.400024 > > Original: 1000.6 > PyQt: 1,000.600000 > PySide: 1,000.599976 > > Original: 10**6 + .4 > PyQt: 1,000,000.400000 > PySide: 1,000,000.375000 > > Original: 10**6 + .6 > PyQt: 1,000,000.600000 > PySide: 1,000,000.625000 > > Original: 10**7 + .4 > PyQt: 10,000,000.400000 > PySide: 10,000,000.000000 > > Original: 10**7 + .6 > PyQt: 10,000,000.600000 > PySide: 10,000,001.000000 > > Original: 10**8 + .4 > PyQt: 100,000,000.400000 > PySide: 100,000,000.000000 > > Original: 10**8 + .6 > PyQt: 100,000,000.600000 > PySide: 100,000,000.000000 > > Original: 10**9 + .4 > PyQt: 1,000,000,000.400000 > PySide: 1,000,000,000.000000 > > Original: 10**9 + .6 > PyQt: 1,000,000,000.600000 > PySide: 1,000,000,000.000000 > > Original: 10**14 + .4 > PyQt: 100,000,000,000,000.406250 > PySide: 100,000,000,376,832.000000 > > Original: 10**14 + .6 > PyQt: 100,000,000,000,000.593750 > PySide: 100,000,000,376,832.000000 > > Original: 10**15 + .4 > PyQt: 1,000,000,000,000,000.375000 > PySide: 999,999,986,991,104.000000 > > Original: 10**15 + .6 > PyQt: 1,000,000,000,000,000.625000 > PySide: 999,999,986,991,104.000000 > > Original: 10**16 + .4 > PyQt: 10,000,000,000,000,000.000000 > PySide: 10,000,000,272,564,224.000000 > > Original: 10**16 + .6 > PyQt: 10,000,000,000,000,000.000000 > PySide: 10,000,000,272,564,224.000000 > > Original: 10**17 + .4 > PyQt: 100,000,000,000,000,000.000000 > PySide: 99,999,998,430,674,944.000000 > > Original: 10**17 + .6 > PyQt: 100,000,000,000,000,000.000000 > PySide: 99,999,998,430,674,944.000000 > > #--------------------------------- Windows 7 ----------------------------------# > > Windows 7, 64-bit > Python 2.7.3, 32-bit, from Python.org > PySide 1.1.1, 32-bit > PyQt 4.10, 32-bit > > >>> import num_print > Original: 1.4 > PyQt: 1.400000 > PySide: 1.400000 > > Original: 1.6 > PyQt: 1.600000 > PySide: 1.600000 > > Original: 1000.4 > PyQt: 1,000.400000 > PySide: 1,000.400024 > > Original: 1000.6 > PyQt: 1,000.600000 > PySide: 1,000.599976 > > Original: 10**6 + .4 > PyQt: 1,000,000.400000 > PySide: 1,000,000.375000 > > Original: 10**6 + .6 > PyQt: 1,000,000.600000 > PySide: 1,000,000.625000 > > Original: 10**7 + .4 > PyQt: 10,000,000.400000 > PySide: 10,000,000.000000 > > Original: 10**7 + .6 > PyQt: 10,000,000.600000 > PySide: 10,000,001.000000 > > Original: 10**8 + .4 > PyQt: 100,000,000.400000 > PySide: 100,000,000.000000 > > Original: 10**8 + .6 > PyQt: 100,000,000.600000 > PySide: 100,000,000.000000 > > Original: 10**9 + .4 > PyQt: 1,000,000,000.400000 > PySide: 1,000,000,000.000000 > > Original: 10**9 + .6 > PyQt: 1,000,000,000.600000 > PySide: 1,000,000,000.000000 > > Original: 10**14 + .4 > PyQt: 100,000,000,000,000.406250 > PySide: 100,000,000,376,832.000000 > > Original: 10**14 + .6 > PyQt: 100,000,000,000,000.593750 > PySide: 100,000,000,376,832.000000 > > Original: 10**15 + .4 > PyQt: 1,000,000,000,000,000.375000 > PySide: 999,999,986,991,104.000000 > > Original: 10**15 + .6 > PyQt: 1,000,000,000,000,000.625000 > PySide: 999,999,986,991,104.000000 > > Original: 10**16 + .4 > PyQt: 10,000,000,000,000,000.000000 > PySide: 10,000,000,272,564,224.000000 > > Original: 10**16 + .6 > PyQt: 10,000,000,000,000,000.000000 > PySide: 10,000,000,272,564,224.000000 > > Original: 10**17 + .4 > PyQt: 100,000,000,000,000,000.000000 > PySide: 99,999,998,430,674,944.000000 > > Original: 10**17 + .6 > PyQt: 100,000,000,000,000,000.000000 > PySide: 99,999,998,430,674,944.000000 > > """ > > From akabaila at pcug.org.au Mon Apr 15 01:30:39 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Mon, 15 Apr 2013 09:30:39 +1000 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516B131C.8010204@m.allo.ws> Message-ID: <4179481.zAQxvPVlqz@supremo> Just to add a little fuel to this fire: First, by hand try to convert the "exact" 0.1 then 0.01 decimal to their binary equivalent. Send to this list the binary value. Is it exact? Second, who would care about 1 cent in $10 000 ? Al. On Sunday 14 April 2013 16:04:15 Tim Doty wrote: > On Apr 14, 2013, at 3:35 PM, Zak wrote: > > My original email was correct, let me provide proof and explain > > further. > > > > Let me address a few specific points: > > > > Tim Doty wrote: > > > For the PySide what is really happening is not a rounding > > > error/precision as suggested, but printing an integer with floating > > > point notation. When the floating point is converted to an integer > > > it is rounded. To satisfy yourself that this is in fact happening > > > change the number to be printed (e.g., 9999999.5 vs 9999999.4). > > > > This is incorrect, what is happening is a rounding error. The number > > is being rounded to fit in a 32 bit piece of memory. The > > counter-example above is misleading because it uses bad values. Try > > the values 1.4 and 1.6 instead. These values are used in the attached > > Python script. > As I said, I don't know the PySide internals. I referred to the > published documentation which implies that floats are being coerced > into integers due to lack of a float overload. Apparently the docs are > wrong… go figure. > > Interestingly, if you drop the millions (e.g., 999999.62) you can see > the rounding in action. I'm not going to dredge through a wall of text > looking for a point in the preceding post, but -- as it so happens -- > the example I give above outputs correctly making it seem as if there > is inconsistent precision. But it is an accident. 999999.65 also prints > as 999999.62 while 999999.66 prints as 999999.69 > > So it is just an artifact of 32-bit precision float representations. > Now, why it is being constrained to a 32-bit float on a 64-bit > architecture is a different conversation and, while I recognize there > would be disagreement, I call that a bug on its face and the fact that > the sibling implementation uses 64-bit precision underscores the point. > > Tim Doty > > > The number is not at any point represented as an integer (data > > structure), it is always a floating point. Even if the number's value > > is a whole number, it is represented as a floating point. For > > instance, Python interprets '1.0' as a floating point literal. A > > mathematician would say 1.0 is an integer, but computer science uses > > different terminology. In computer science, in the language Python, > > '1' is an integer and '1.0' is a floating point, and they are equal > > in numerical value. They are represented differently in memory.> > > Alexey Vihorev wrote: > > > Two considerations: > > > 1. No rounding should take place in this case - the decimal > > > precision of the input and output is exactly the same. > > > 2. In PyQt it *does* work correctly, so fundamental lows of computer > > > science are certainly not the reason. > > > > In response to 1: That is just your opinion. You do not want rounding > > to take place. The designers of Python and Qt had a different > > opinion. To make things faster, they decided to round numbers so that > > they can fit in either 32 or 64 bits of memory. If you want to use > > larger chunks of memory and keep higher precision, then you should > > use the Python standard library 'decimal', as I said before. Using > > decimal.Decimal objects, you can set the precision yourself. Because > > you are not using this library, Python, PySide, and PyQt are making a > > decision about how to round the number. PySide chose 32 bits, PyQt > > chose 64 bits. The Python language itself chose 64 bits, so PySide > > and PyQt cannot possibly choose higher precision, the extra bits have > > already been thrown away. > > > > In response to 2: You are using incorrect logic. As you can see from > > my example, PyQt also suffers rounding errors, they just occur around > > 15 to 17 digits. You didn't use that many digits so you didn't see > > the rounding error. > > > > Zak Fallows > > > > # File: num_print.py > > > > from PyQt4.QtCore import QLocale as PyQtLocale > > from PySide.QtCore import QLocale as PySideLocale > > > > def pb(num): > > """pb stands for Print Both""" > > > > print "Original: " + num > > flt = eval(num) > > print " PyQt: ", > > print PyQtLocale().toString(flt, 'f', 6) > > print " PySide: ", > > print PySideLocale().toString(flt, 'f', 6) > > print '' > > > > test_list = [ > > > > '1.4', > > '1.6', > > '1000.4', > > '1000.6', > > '10**6 + .4', > > '10**6 + .6', > > '10**7 + .4', > > '10**7 + .6', > > '10**8 + .4', > > '10**8 + .6', > > '10**9 + .4', > > '10**9 + .6', > > '10**14 + .4', > > '10**14 + .6', > > '10**15 + .4', > > '10**15 + .6', > > '10**16 + .4', > > '10**16 + .6', > > '10**17 + .4', > > '10**17 + .6', > > > > ] > > > > for num in test_list: > > pb(num) > > > > """ > > > > #======================== How to Check Version Numbers > > ========================#> > > PyQt: > > PyQt4.QtCore.PYQT_VERSION_STR > > > > PySide: > > PySide.__version__ > > > > #=============================== Sample Output > > ================================# > > > > Here is some sample output from running the program: > > > > #---------------------------------- Mac OS X > > ----------------------------------# > > > > Mac OS X 10.8.3 > > Python 2.7.3, 64-bit, from Python.org > > PySide 1.1.1, 64-bit > > PyQt 4.9.4, 64-bit > > > > >>> import num_print > > > > Original: 1.4 > > > > PyQt: 1.400000 > > PySide: 1.400000 > > > > Original: 1.6 > > > > PyQt: 1.600000 > > PySide: 1.600000 > > > > Original: 1000.4 > > > > PyQt: 1,000.400000 > > PySide: 1,000.400024 > > > > Original: 1000.6 > > > > PyQt: 1,000.600000 > > PySide: 1,000.599976 > > > > Original: 10**6 + .4 > > > > PyQt: 1,000,000.400000 > > PySide: 1,000,000.375000 > > > > Original: 10**6 + .6 > > > > PyQt: 1,000,000.600000 > > PySide: 1,000,000.625000 > > > > Original: 10**7 + .4 > > > > PyQt: 10,000,000.400000 > > PySide: 10,000,000.000000 > > > > Original: 10**7 + .6 > > > > PyQt: 10,000,000.600000 > > PySide: 10,000,001.000000 > > > > Original: 10**8 + .4 > > > > PyQt: 100,000,000.400000 > > PySide: 100,000,000.000000 > > > > Original: 10**8 + .6 > > > > PyQt: 100,000,000.600000 > > PySide: 100,000,000.000000 > > > > Original: 10**9 + .4 > > > > PyQt: 1,000,000,000.400000 > > PySide: 1,000,000,000.000000 > > > > Original: 10**9 + .6 > > > > PyQt: 1,000,000,000.600000 > > PySide: 1,000,000,000.000000 > > > > Original: 10**14 + .4 > > > > PyQt: 100,000,000,000,000.406250 > > PySide: 100,000,000,376,832.000000 > > > > Original: 10**14 + .6 > > > > PyQt: 100,000,000,000,000.593750 > > PySide: 100,000,000,376,832.000000 > > > > Original: 10**15 + .4 > > > > PyQt: 1,000,000,000,000,000.375000 > > PySide: 999,999,986,991,104.000000 > > > > Original: 10**15 + .6 > > > > PyQt: 1,000,000,000,000,000.625000 > > PySide: 999,999,986,991,104.000000 > > > > Original: 10**16 + .4 > > > > PyQt: 10,000,000,000,000,000.000000 > > PySide: 10,000,000,272,564,224.000000 > > > > Original: 10**16 + .6 > > > > PyQt: 10,000,000,000,000,000.000000 > > PySide: 10,000,000,272,564,224.000000 > > > > Original: 10**17 + .4 > > > > PyQt: 100,000,000,000,000,000.000000 > > PySide: 99,999,998,430,674,944.000000 > > > > Original: 10**17 + .6 > > > > PyQt: 100,000,000,000,000,000.000000 > > PySide: 99,999,998,430,674,944.000000 > > > > #--------------------------------- Windows 7 > > ----------------------------------# > > > > Windows 7, 64-bit > > Python 2.7.3, 32-bit, from Python.org > > PySide 1.1.1, 32-bit > > PyQt 4.10, 32-bit > > > > >>> import num_print > > > > Original: 1.4 > > > > PyQt: 1.400000 > > PySide: 1.400000 > > > > Original: 1.6 > > > > PyQt: 1.600000 > > PySide: 1.600000 > > > > Original: 1000.4 > > > > PyQt: 1,000.400000 > > PySide: 1,000.400024 > > > > Original: 1000.6 > > > > PyQt: 1,000.600000 > > PySide: 1,000.599976 > > > > Original: 10**6 + .4 > > > > PyQt: 1,000,000.400000 > > PySide: 1,000,000.375000 > > > > Original: 10**6 + .6 > > > > PyQt: 1,000,000.600000 > > PySide: 1,000,000.625000 > > > > Original: 10**7 + .4 > > > > PyQt: 10,000,000.400000 > > PySide: 10,000,000.000000 > > > > Original: 10**7 + .6 > > > > PyQt: 10,000,000.600000 > > PySide: 10,000,001.000000 > > > > Original: 10**8 + .4 > > > > PyQt: 100,000,000.400000 > > PySide: 100,000,000.000000 > > > > Original: 10**8 + .6 > > > > PyQt: 100,000,000.600000 > > PySide: 100,000,000.000000 > > > > Original: 10**9 + .4 > > > > PyQt: 1,000,000,000.400000 > > PySide: 1,000,000,000.000000 > > > > Original: 10**9 + .6 > > > > PyQt: 1,000,000,000.600000 > > PySide: 1,000,000,000.000000 > > > > Original: 10**14 + .4 > > > > PyQt: 100,000,000,000,000.406250 > > PySide: 100,000,000,376,832.000000 > > > > Original: 10**14 + .6 > > > > PyQt: 100,000,000,000,000.593750 > > PySide: 100,000,000,376,832.000000 > > > > Original: 10**15 + .4 > > > > PyQt: 1,000,000,000,000,000.375000 > > PySide: 999,999,986,991,104.000000 > > > > Original: 10**15 + .6 > > > > PyQt: 1,000,000,000,000,000.625000 > > PySide: 999,999,986,991,104.000000 > > > > Original: 10**16 + .4 > > > > PyQt: 10,000,000,000,000,000.000000 > > PySide: 10,000,000,272,564,224.000000 > > > > Original: 10**16 + .6 > > > > PyQt: 10,000,000,000,000,000.000000 > > PySide: 10,000,000,272,564,224.000000 > > > > Original: 10**17 + .4 > > > > PyQt: 100,000,000,000,000,000.000000 > > PySide: 99,999,998,430,674,944.000000 > > > > Original: 10**17 + .6 > > > > PyQt: 100,000,000,000,000,000.000000 > > PySide: 99,999,998,430,674,944.000000 > > > > """ > > > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pysidea -------------- next part -------------- An HTML attachment was scrubbed... URL: From pyside at m.allo.ws Mon Apr 15 02:44:50 2013 From: pyside at m.allo.ws (Zak) Date: Sun, 14 Apr 2013 20:44:50 -0400 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <4179481.zAQxvPVlqz@supremo> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516B131C.8010204@m.allo.ws> <4179481.zAQxvPVlqz@supremo> Message-ID: <516B4D82.5090305@m.allo.ws> An HTML attachment was scrubbed... URL: From pyside at m.allo.ws Mon Apr 15 02:55:17 2013 From: pyside at m.allo.ws (Zak) Date: Sun, 14 Apr 2013 20:55:17 -0400 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <516B4D82.5090305@m.allo.ws> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516B131C.8010204@m.allo.ws> <4179481.zAQxvPVlqz@supremo> <516B4D82.5090305@m.allo.ws> Message-ID: <516B4FF5.5040008@m.allo.ws> In case this wasn't clear, the binary values I gave are perfectly exact. If you let the digits repeat forever, then it is exact. If you truncate the number at any point, then it is not exact. I calculated the binary values of 1 / 10 and 1 / 100 using long division, on paper. I checked the values by doing this in Python: # 0b0.000110011 should be appoximately 0.1. # We need to shift left until there is no decimal place. # Shifting left by one digit is equal to multiplying by 2. # 0b0.000110011 --> 0b110011 (we shifted 9 digits) # 0.1 --> 0.1 * 2 ^ 9 = 51.2 # 0b110011 and 51.2 should be almost equivalent. # Let's check: >>> 0b110011 51 # Yup, that's pretty close. It is off by 0.2 because # I truncated the binary after 9 decimal places. If I used # more decimal places then it would be closer to exact. As you add more and more digits, you get closer and closer to exact equality. This is a convergent series. This is also an example of a mathematical limit. With infinite digits, the equality is exact. Zak Fallows On 4/14/13 8:44 PM, Zak wrote: > The Wikipedia page on repeating decimals > is relevant to this > discussion. I will use "bracket notation" as defined on that page. > First, let's explain bracket notation: > > One third = 1 / 3 = 0.3333... = 0.(3) > > One eleventh = 1 / 11 = 0.090909... = 0.(09) > > As you can see, the sequence of digits inside parentheses is repeated > forever. > > To denote numbers in different bases, I will use Python notation. Thus > "1234" is in base 10, "0x12ab" is in base 16, "0o1234" is in base 8, > and "0b101101" is in base 2. You can use these prefixes (0x, 0o, and > 0b) in Python code, did you know that? > > Now on to the results: > > 1 / 10 = 0.1 = 0b0.0(0011) = 0b0.000110011001100110011... > > 1 / 100 = 0.01 = 0b0.00(00001010001111010111) = > = 0b0.00000010100011110101110000101... > > As you can see, one hundredth has a period of 20 digits in base 2. > There is a block of 20 digits that is repeated forever. > > Here is a great fraction: > > 1 / 81 = 0.(0123456789) = 0.01234567890123456789... > > Why is 1 / 81 so fantastic? Well, we are in base 10. Base 9 is one > off. 9 squared is 81. That is why 1 / 81 is so fantastic. Base 10 and > base 9 have a very special relationship, look up "casting out nines" > for more mind-blowing but simple math. > > Zak Fallows > > On 4/14/13 7:30 PM, Algis Kabaila wrote: >> >> Just to add a little fuel to this fire: >> >> First, by hand try to convert the "exact" 0.1 then 0.01 decimal to >> their binary equivalent. Send to this list the binary value. Is it exact? >> >> Second, who would care about 1 cent in $10 000 ? >> >> Al. >> > > > > _______________________________________________ > 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 thoromyr at mac.com Mon Apr 15 03:14:02 2013 From: thoromyr at mac.com (Tim Doty) Date: Sun, 14 Apr 2013 20:14:02 -0500 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <4179481.zAQxvPVlqz@supremo> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516B131C.8010204@m.allo.ws> <4179481.zAQxvPVlqz@supremo> Message-ID: <35D4479D-0C52-4A9D-BA4E-9E8298A46BCE@mac.com> On Apr 14, 2013, at 6:30 PM, Algis Kabaila wrote: > Just to add a little fuel to this fire: > > First, by hand try to convert the "exact" 0.1 then 0.01 decimal to their binary equivalent. Send to this list the binary value. Is it exact? > > Second, who would care about 1 cent in $10 000 ? people who are stealing money :) Its been some years, but taking the roundings has actually been done. It has always amused me when people insist on using float for "dollars" rather than tracking cents exactly. > > Al. > > On Sunday 14 April 2013 16:04:15 Tim Doty wrote: > > On Apr 14, 2013, at 3:35 PM, Zak wrote: > > > My original email was correct, let me provide proof and explain > > > further. > > > > > > Let me address a few specific points: > > > > > > Tim Doty wrote: > > > > For the PySide what is really happening is not a rounding > > > > error/precision as suggested, but printing an integer with floating > > > > point notation. When the floating point is converted to an integer > > > > it is rounded. To satisfy yourself that this is in fact happening > > > > change the number to be printed (e.g., 9999999.5 vs 9999999.4). > > > > > > This is incorrect, what is happening is a rounding error. The number > > > is being rounded to fit in a 32 bit piece of memory. The > > > counter-example above is misleading because it uses bad values. Try > > > the values 1.4 and 1.6 instead. These values are used in the attached > > > Python script. > > As I said, I don't know the PySide internals. I referred to the > > published documentation which implies that floats are being coerced > > into integers due to lack of a float overload. Apparently the docs are > > wrong… go figure. > > > > Interestingly, if you drop the millions (e.g., 999999.62) you can see > > the rounding in action. I'm not going to dredge through a wall of text > > looking for a point in the preceding post, but -- as it so happens -- > > the example I give above outputs correctly making it seem as if there > > is inconsistent precision. But it is an accident. 999999.65 also prints > > as 999999.62 while 999999.66 prints as 999999.69 > > > > So it is just an artifact of 32-bit precision float representations. > > Now, why it is being constrained to a 32-bit float on a 64-bit > > architecture is a different conversation and, while I recognize there > > would be disagreement, I call that a bug on its face and the fact that > > the sibling implementation uses 64-bit precision underscores the point. > > > > Tim Doty > > > > > The number is not at any point represented as an integer (data > > > structure), it is always a floating point. Even if the number's value > > > is a whole number, it is represented as a floating point. For > > > instance, Python interprets '1.0' as a floating point literal. A > > > mathematician would say 1.0 is an integer, but computer science uses > > > different terminology. In computer science, in the language Python, > > > '1' is an integer and '1.0' is a floating point, and they are equal > > > in numerical value. They are represented differently in memory.> > > > Alexey Vihorev wrote: > > > > Two considerations: > > > > 1. No rounding should take place in this case - the decimal > > > > precision of the input and output is exactly the same. > > > > 2. In PyQt it *does* work correctly, so fundamental lows of computer > > > > science are certainly not the reason. > > > > > > In response to 1: That is just your opinion. You do not want rounding > > > to take place. The designers of Python and Qt had a different > > > opinion. To make things faster, they decided to round numbers so that > > > they can fit in either 32 or 64 bits of memory. If you want to use > > > larger chunks of memory and keep higher precision, then you should > > > use the Python standard library 'decimal', as I said before. Using > > > decimal.Decimal objects, you can set the precision yourself. Because > > > you are not using this library, Python, PySide, and PyQt are making a > > > decision about how to round the number. PySide chose 32 bits, PyQt > > > chose 64 bits. The Python language itself chose 64 bits, so PySide > > > and PyQt cannot possibly choose higher precision, the extra bits have > > > already been thrown away. > > > > > > In response to 2: You are using incorrect logic. As you can see from > > > my example, PyQt also suffers rounding errors, they just occur around > > > 15 to 17 digits. You didn't use that many digits so you didn't see > > > the rounding error. > > > > > > Zak Fallows > > > > > > # File: num_print.py > > > > > > from PyQt4.QtCore import QLocale as PyQtLocale > > > from PySide.QtCore import QLocale as PySideLocale > > > > > > def pb(num): > > > """pb stands for Print Both""" > > > > > > print "Original: " + num > > > flt = eval(num) > > > print " PyQt: ", > > > print PyQtLocale().toString(flt, 'f', 6) > > > print " PySide: ", > > > print PySideLocale().toString(flt, 'f', 6) > > > print '' > > > > > > test_list = [ > > > > > > '1.4', > > > '1.6', > > > '1000.4', > > > '1000.6', > > > '10**6 + .4', > > > '10**6 + .6', > > > '10**7 + .4', > > > '10**7 + .6', > > > '10**8 + .4', > > > '10**8 + .6', > > > '10**9 + .4', > > > '10**9 + .6', > > > '10**14 + .4', > > > '10**14 + .6', > > > '10**15 + .4', > > > '10**15 + .6', > > > '10**16 + .4', > > > '10**16 + .6', > > > '10**17 + .4', > > > '10**17 + .6', > > > > > > ] > > > > > > for num in test_list: > > > pb(num) > > > > > > """ > > > > > > #======================== How to Check Version Numbers > > > ========================#> > > > PyQt: > > > PyQt4.QtCore.PYQT_VERSION_STR > > > > > > PySide: > > > PySide.__version__ > > > > > > #=============================== Sample Output > > > ================================# > > > > > > Here is some sample output from running the program: > > > > > > #---------------------------------- Mac OS X > > > ----------------------------------# > > > > > > Mac OS X 10.8.3 > > > Python 2.7.3, 64-bit, from Python.org > > > PySide 1.1.1, 64-bit > > > PyQt 4.9.4, 64-bit > > > > > > >>> import num_print > > > > > > Original: 1.4 > > > > > > PyQt: 1.400000 > > > PySide: 1.400000 > > > > > > Original: 1.6 > > > > > > PyQt: 1.600000 > > > PySide: 1.600000 > > > > > > Original: 1000.4 > > > > > > PyQt: 1,000.400000 > > > PySide: 1,000.400024 > > > > > > Original: 1000.6 > > > > > > PyQt: 1,000.600000 > > > PySide: 1,000.599976 > > > > > > Original: 10**6 + .4 > > > > > > PyQt: 1,000,000.400000 > > > PySide: 1,000,000.375000 > > > > > > Original: 10**6 + .6 > > > > > > PyQt: 1,000,000.600000 > > > PySide: 1,000,000.625000 > > > > > > Original: 10**7 + .4 > > > > > > PyQt: 10,000,000.400000 > > > PySide: 10,000,000.000000 > > > > > > Original: 10**7 + .6 > > > > > > PyQt: 10,000,000.600000 > > > PySide: 10,000,001.000000 > > > > > > Original: 10**8 + .4 > > > > > > PyQt: 100,000,000.400000 > > > PySide: 100,000,000.000000 > > > > > > Original: 10**8 + .6 > > > > > > PyQt: 100,000,000.600000 > > > PySide: 100,000,000.000000 > > > > > > Original: 10**9 + .4 > > > > > > PyQt: 1,000,000,000.400000 > > > PySide: 1,000,000,000.000000 > > > > > > Original: 10**9 + .6 > > > > > > PyQt: 1,000,000,000.600000 > > > PySide: 1,000,000,000.000000 > > > > > > Original: 10**14 + .4 > > > > > > PyQt: 100,000,000,000,000.406250 > > > PySide: 100,000,000,376,832.000000 > > > > > > Original: 10**14 + .6 > > > > > > PyQt: 100,000,000,000,000.593750 > > > PySide: 100,000,000,376,832.000000 > > > > > > Original: 10**15 + .4 > > > > > > PyQt: 1,000,000,000,000,000.375000 > > > PySide: 999,999,986,991,104.000000 > > > > > > Original: 10**15 + .6 > > > > > > PyQt: 1,000,000,000,000,000.625000 > > > PySide: 999,999,986,991,104.000000 > > > > > > Original: 10**16 + .4 > > > > > > PyQt: 10,000,000,000,000,000.000000 > > > PySide: 10,000,000,272,564,224.000000 > > > > > > Original: 10**16 + .6 > > > > > > PyQt: 10,000,000,000,000,000.000000 > > > PySide: 10,000,000,272,564,224.000000 > > > > > > Original: 10**17 + .4 > > > > > > PyQt: 100,000,000,000,000,000.000000 > > > PySide: 99,999,998,430,674,944.000000 > > > > > > Original: 10**17 + .6 > > > > > > PyQt: 100,000,000,000,000,000.000000 > > > PySide: 99,999,998,430,674,944.000000 > > > > > > #--------------------------------- Windows 7 > > > ----------------------------------# > > > > > > Windows 7, 64-bit > > > Python 2.7.3, 32-bit, from Python.org > > > PySide 1.1.1, 32-bit > > > PyQt 4.10, 32-bit > > > > > > >>> import num_print > > > > > > Original: 1.4 > > > > > > PyQt: 1.400000 > > > PySide: 1.400000 > > > > > > Original: 1.6 > > > > > > PyQt: 1.600000 > > > PySide: 1.600000 > > > > > > Original: 1000.4 > > > > > > PyQt: 1,000.400000 > > > PySide: 1,000.400024 > > > > > > Original: 1000.6 > > > > > > PyQt: 1,000.600000 > > > PySide: 1,000.599976 > > > > > > Original: 10**6 + .4 > > > > > > PyQt: 1,000,000.400000 > > > PySide: 1,000,000.375000 > > > > > > Original: 10**6 + .6 > > > > > > PyQt: 1,000,000.600000 > > > PySide: 1,000,000.625000 > > > > > > Original: 10**7 + .4 > > > > > > PyQt: 10,000,000.400000 > > > PySide: 10,000,000.000000 > > > > > > Original: 10**7 + .6 > > > > > > PyQt: 10,000,000.600000 > > > PySide: 10,000,001.000000 > > > > > > Original: 10**8 + .4 > > > > > > PyQt: 100,000,000.400000 > > > PySide: 100,000,000.000000 > > > > > > Original: 10**8 + .6 > > > > > > PyQt: 100,000,000.600000 > > > PySide: 100,000,000.000000 > > > > > > Original: 10**9 + .4 > > > > > > PyQt: 1,000,000,000.400000 > > > PySide: 1,000,000,000.000000 > > > > > > Original: 10**9 + .6 > > > > > > PyQt: 1,000,000,000.600000 > > > PySide: 1,000,000,000.000000 > > > > > > Original: 10**14 + .4 > > > > > > PyQt: 100,000,000,000,000.406250 > > > PySide: 100,000,000,376,832.000000 > > > > > > Original: 10**14 + .6 > > > > > > PyQt: 100,000,000,000,000.593750 > > > PySide: 100,000,000,376,832.000000 > > > > > > Original: 10**15 + .4 > > > > > > PyQt: 1,000,000,000,000,000.375000 > > > PySide: 999,999,986,991,104.000000 > > > > > > Original: 10**15 + .6 > > > > > > PyQt: 1,000,000,000,000,000.625000 > > > PySide: 999,999,986,991,104.000000 > > > > > > Original: 10**16 + .4 > > > > > > PyQt: 10,000,000,000,000,000.000000 > > > PySide: 10,000,000,272,564,224.000000 > > > > > > Original: 10**16 + .6 > > > > > > PyQt: 10,000,000,000,000,000.000000 > > > PySide: 10,000,000,272,564,224.000000 > > > > > > Original: 10**17 + .4 > > > > > > PyQt: 100,000,000,000,000,000.000000 > > > PySide: 99,999,998,430,674,944.000000 > > > > > > Original: 10**17 + .6 > > > > > > PyQt: 100,000,000,000,000,000.000000 > > > PySide: 99,999,998,430,674,944.000000 > > > > > > """ > > > > > > > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pysidea From adrian.klaver at gmail.com Mon Apr 15 04:07:51 2013 From: adrian.klaver at gmail.com (Adrian Klaver) Date: Sun, 14 Apr 2013 19:07:51 -0700 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <35D4479D-0C52-4A9D-BA4E-9E8298A46BCE@mac.com> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516B131C.8010204@m.allo.ws> <4179481.zAQxvPVlqz@supremo> <35D4479D-0C52-4A9D-BA4E-9E8298A46BCE@mac.com> Message-ID: <516B60F7.7030706@gmail.com> On 04/14/2013 06:14 PM, Tim Doty wrote: > > On Apr 14, 2013, at 6:30 PM, Algis Kabaila wrote: > >> Just to add a little fuel to this fire: >> >> First, by hand try to convert the "exact" 0.1 then 0.01 decimal to their binary equivalent. Send to this list the binary value. Is it exact? >> >> Second, who would care about 1 cent in $10 000 ? > > people who are stealing money :) Its been some years, but taking the roundings has actually been done. It has always amused me when people insist on using float for "dollars" rather than tracking cents exactly. Yes, the modern equivalent of shaving coins. Why coins have knurled edges. > > >> >> Al. -- Adrian Klaver adrian.klaver at gmail.com From akabaila at pcug.org.au Mon Apr 15 07:31:53 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Mon, 15 Apr 2013 15:31:53 +1000 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <516B60F7.7030706@gmail.com> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <35D4479D-0C52-4A9D-BA4E-9E8298A46BCE@mac.com> <516B60F7.7030706@gmail.com> Message-ID: <1483019.AWrLzGVW5i@supremo> Hi there, Actually Python has a type that will compute your cents exactly. It is designed to fend of accusations, just like those I hear. It is inefficient and I would object to have to use it in a program, other than accountancy. I am not an accountant - I am an engineer. From my perspective, 1 c in a million dollars is negligible. It is as simple as that. Python, however, provides facilities for "exact" calculations in the "decimal module". Mark Summerfield in his excellent book "Programming in Python 3" (Second Edition) describes it in pp 63-65 as follows: "In some cases we prefer [..] complete accuracy, even at the cost of speed." He also gives some examples. First, a trivial one, then a more realistic one: ~$ python3 Python 3.2.3 (default, Oct 19 2012, 20:10:41) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import decimal >>> b = decimal.Decimal("54321.012345678987654321") >>> a = decimal.Decimal(9876) >>> a + b Decimal('64197.012345678987654321') >>> *********************** Floating point division: >>> 23 / 1.05 21.904761904761905 >>> print (23 / 1.05) 21.904761904761905 >>> using decimal module: $ python3 Python 3.2.3 (default, Oct 19 2012, 20:10:41) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. Everybody may choose what they need or what they want. For an engineer, if the divisor 1.050000000000000000000000 was known with high precision (as light heartedly indicated by lots of zeros) and the accuracy of the answer needed also to be of high precision, then use of Python3 decimal module would be indicated. Does not happen too often... Somebody with an abacus is invited to test the accuracy of this "exact" solution. Al. >>> import decimal >>> print(decimal.Decimal(23) / decimal.Decimal("1.05")) 21.90476190476190476190476190 >>> On Sunday 14 April 2013 19:07:51 Adrian Klaver wrote: > On 04/14/2013 06:14 PM, Tim Doty wrote: > > On Apr 14, 2013, at 6:30 PM, Algis Kabaila wrote: > >> Just to add a little fuel to this fire: > >> > >> First, by hand try to convert the "exact" 0.1 then 0.01 decimal to > >> their binary equivalent. Send to this list the binary value. Is it > >> exact? > >> > >> Second, who would care about 1 cent in $10 000 ? > > > > people who are stealing money :) Its been some years, but taking the > > roundings has actually been done. It has always amused me when people > > insist on using float for "dollars" rather than tracking cents > > exactly. > Yes, the modern equivalent of shaving coins. Why coins have knurled > edges. > >> Al. -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Mon Apr 15 07:59:12 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Mon, 15 Apr 2013 15:59:12 +1000 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <1483019.AWrLzGVW5i@supremo> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516B60F7.7030706@gmail.com> <1483019.AWrLzGVW5i@supremo> Message-ID: <39032109.5zdi5anP0E@supremo> On Monday 15 April 2013 15:31:53 Algis Kabaila wrote: Hi there, Actually Python has a type that will compute your cents exactly. It is designed to fend of accusations, just like those I hear. It is inefficient and I would object to have to use it in a program, other than accountancy. I am not an accountant - I am an engineer. From my perspective, 1 c in a million dollars is negligible. It is as simple as that. Python, however, provides facilities for "exact" calculations in the "decimal module". Mark Summerfield in his excellent book "Programming in Python 3" (Second Edition) describes it in pp 63-65 as follows: "In some cases we prefer [..] complete accuracy, even at the cost of speed." He also gives some examples. First, a trivial one, then a more realistic one: ~$ python3 Python 3.2.3 (default, Oct 19 2012, 20:10:41) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import decimal >>> b = decimal.Decimal("54321.012345678987654321") >>> a = decimal.Decimal(9876) >>> a + b Decimal('64197.012345678987654321') >>> *********************** Floating point division: >>> 23 / 1.05 21.904761904761905 >>> print (23 / 1.05) 21.904761904761905 >>> using decimal module: $ python3 Python 3.2.3 (default, Oct 19 2012, 20:10:41) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a = decimal.Decimal(23) / decimal.Decimal("1.05") >>> a Decimal('21.90476190476190476190476190') >>> "Check the result" 'Check the result' >>> a * decimal.Decimal("1.05") Decimal('23.00000000000000000000000000') >>> Everybody may choose what they need or what they want. For an engineer, if the divisor 1.050000000000000000000000 was known with high precision (as light heartedly indicated by lots of zeros) and the accuracy of the answer needed also to be of high precision, then use of Python3 decimal module would be indicated. Does not happen too often... Somebody with an abacus is invited to test the accuracy of this "exact" solution. Al. >>> import decimal >>> print(decimal.Decimal(23) / decimal.Decimal("1.05")) 21.90476190476190476190476190 >>> On Sunday 14 April 2013 19:07:51 Adrian Klaver wrote: > On 04/14/2013 06:14 PM, Tim Doty wrote: > > On Apr 14, 2013, at 6:30 PM, Algis Kabaila wrote: > >> Just to add a little fuel to this fire: > >> > >> First, by hand try to convert the "exact" 0.1 then 0.01 decimal to > >> their binary equivalent. Send to this list the binary value. Is it > >> exact? > >> > >> Second, who would care about 1 cent in $10 000 ? > > > > people who are stealing money :) Its been some years, but taking the > > roundings has actually been done. It has always amused me when people > > insist on using float for "dollars" rather than tracking cents > > exactly. > Yes, the modern equivalent of shaving coins. Why coins have knurled > edges. > >> Al. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vihorev at gmail.com Mon Apr 15 08:21:26 2013 From: vihorev at gmail.com (Alexey Vihorev) Date: Mon, 15 Apr 2013 09:21:26 +0300 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <516B131C.8010204@m.allo.ws> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516AD085.5090902@m.allo.ws> <000101ce3942$a4015aa0$ec040fe0$@gmail.com> <516B131C.8010204@m.allo.ws> Message-ID: <002201ce39a1$76d743a0$6485cae0$@gmail.com> First of all - Zak, thank you for your opinion and your efforts to back it with data - you obviously spend much time and effort on it. The only thing that I would ask of you is to add a little more brevity into your arguments. Thanks. About the matter at hand. When I see something like this.: val = 999999.9 print(PySideLocale().toString(val, 'f', 2)) #999 999,88 print(PyQtLocale().toString(val, 'f', 2)) #999 999,90 print(str(val)) #999999.9 .I will inevitably arrive to a conclusion that PySide's behavior is inconsistent with that of the language it's written for and of the library it tries to imitate. You see, maybe you are completely right about rounding, conversions, math etc and PySide is really giving correct/reasonable results. But people doing software development need consistency and predictability. And in this particular case PySide fails to deliver both. From: Zak [mailto:pyside at m.allo.ws] Sent: Sunday, April 14, 2013 11:36 PM To: Alexey Vihorev Cc: pyside at qt-project.org; thoromyr at mac.com Subject: Re: [PySide] Strange behaviour of QLocale.toString() My original email was correct, let me provide proof and explain further. The proof is attached as a Python script, you can run it yourself. I ran it on Mac OS X and also on Windows 7, and I ran it with both 32-bit and 64-bit versions of PySide and PyQt (and matching 32- or 64-bit versions of the Python interpreter). The results were as follows: 1. PySide uses 32-bit floating points. It does not matter whether PySide was compiled in 32-bit or 64-bit mode (x86 or x64). 2. PyQt uses 64-bit floating points. It does not matter whether PyQt was compiled in 32-bit or 64-bit mode. PyQt has better precision than PySide, because PyQt uses 64-bit floats (just like Python itself). However, both PyQt and PySide are internally representing the numbers as binary floating point numbers. Let me address a few specific points: Tim Doty wrote: > For the PySide what is really happening is not a rounding > error/precision as suggested, but printing an integer with floating > point notation. When the floating point is converted to an integer > it is rounded. To satisfy yourself that this is in fact happening > change the number to be printed (e.g., 9999999.5 vs 9999999.4). This is incorrect, what is happening is a rounding error. The number is being rounded to fit in a 32 bit piece of memory. The counter-example above is misleading because it uses bad values. Try the values 1.4 and 1.6 instead. These values are used in the attached Python script. The number is not at any point represented as an integer (data structure), it is always a floating point. Even if the number's value is a whole number, it is represented as a floating point. For instance, Python interprets '1.0' as a floating point literal. A mathematician would say 1.0 is an integer, but computer science uses different terminology. In computer science, in the language Python, '1' is an integer and '1.0' is a floating point, and they are equal in numerical value. They are represented differently in memory. Alexey Vihorev wrote: > Two considerations: > 1. No rounding should take place in this case - the decimal precision of the > input and output is exactly the same. > 2. In PyQt it *does* work correctly, so fundamental lows of computer science > are certainly not the reason. In response to 1: That is just your opinion. You do not want rounding to take place. The designers of Python and Qt had a different opinion. To make things faster, they decided to round numbers so that they can fit in either 32 or 64 bits of memory. If you want to use larger chunks of memory and keep higher precision, then you should use the Python standard library 'decimal', as I said before. Using decimal.Decimal objects, you can set the precision yourself. Because you are not using this library, Python, PySide, and PyQt are making a decision about how to round the number. PySide chose 32 bits, PyQt chose 64 bits. The Python language itself chose 64 bits, so PySide and PyQt cannot possibly choose higher precision, the extra bits have already been thrown away. In response to 2: You are using incorrect logic. As you can see from my example, PyQt also suffers rounding errors, they just occur around 15 to 17 digits. You didn't use that many digits so you didn't see the rounding error. Zak Fallows # File: num_print.py from PyQt4.QtCore import QLocale as PyQtLocale from PySide.QtCore import QLocale as PySideLocale def pb(num): """pb stands for Print Both""" print "Original: " + num flt = eval(num) print " PyQt: ", print PyQtLocale().toString(flt, 'f', 6) print " PySide: ", print PySideLocale().toString(flt, 'f', 6) print '' test_list = [ '1.4', '1.6', '1000.4', '1000.6', '10**6 + .4', '10**6 + .6', '10**7 + .4', '10**7 + .6', '10**8 + .4', '10**8 + .6', '10**9 + .4', '10**9 + .6', '10**14 + .4', '10**14 + .6', '10**15 + .4', '10**15 + .6', '10**16 + .4', '10**16 + .6', '10**17 + .4', '10**17 + .6', ] for num in test_list: pb(num) """ #======================== How to Check Version Numbers ========================# PyQt: PyQt4.QtCore.PYQT_VERSION_STR PySide: PySide.__version__ #=============================== Sample Output ================================# Here is some sample output from running the program: #---------------------------------- Mac OS X ----------------------------------# Mac OS X 10.8.3 Python 2.7.3, 64-bit, from Python.org PySide 1.1.1, 64-bit PyQt 4.9.4, 64-bit >>> import num_print Original: 1.4 PyQt: 1.400000 PySide: 1.400000 Original: 1.6 PyQt: 1.600000 PySide: 1.600000 Original: 1000.4 PyQt: 1,000.400000 PySide: 1,000.400024 Original: 1000.6 PyQt: 1,000.600000 PySide: 1,000.599976 Original: 10**6 + .4 PyQt: 1,000,000.400000 PySide: 1,000,000.375000 Original: 10**6 + .6 PyQt: 1,000,000.600000 PySide: 1,000,000.625000 Original: 10**7 + .4 PyQt: 10,000,000.400000 PySide: 10,000,000.000000 Original: 10**7 + .6 PyQt: 10,000,000.600000 PySide: 10,000,001.000000 Original: 10**8 + .4 PyQt: 100,000,000.400000 PySide: 100,000,000.000000 Original: 10**8 + .6 PyQt: 100,000,000.600000 PySide: 100,000,000.000000 Original: 10**9 + .4 PyQt: 1,000,000,000.400000 PySide: 1,000,000,000.000000 Original: 10**9 + .6 PyQt: 1,000,000,000.600000 PySide: 1,000,000,000.000000 Original: 10**14 + .4 PyQt: 100,000,000,000,000.406250 PySide: 100,000,000,376,832.000000 Original: 10**14 + .6 PyQt: 100,000,000,000,000.593750 PySide: 100,000,000,376,832.000000 Original: 10**15 + .4 PyQt: 1,000,000,000,000,000.375000 PySide: 999,999,986,991,104.000000 Original: 10**15 + .6 PyQt: 1,000,000,000,000,000.625000 PySide: 999,999,986,991,104.000000 Original: 10**16 + .4 PyQt: 10,000,000,000,000,000.000000 PySide: 10,000,000,272,564,224.000000 Original: 10**16 + .6 PyQt: 10,000,000,000,000,000.000000 PySide: 10,000,000,272,564,224.000000 Original: 10**17 + .4 PyQt: 100,000,000,000,000,000.000000 PySide: 99,999,998,430,674,944.000000 Original: 10**17 + .6 PyQt: 100,000,000,000,000,000.000000 PySide: 99,999,998,430,674,944.000000 #--------------------------------- Windows 7 ----------------------------------# Windows 7, 64-bit Python 2.7.3, 32-bit, from Python.org PySide 1.1.1, 32-bit PyQt 4.10, 32-bit >>> import num_print Original: 1.4 PyQt: 1.400000 PySide: 1.400000 Original: 1.6 PyQt: 1.600000 PySide: 1.600000 Original: 1000.4 PyQt: 1,000.400000 PySide: 1,000.400024 Original: 1000.6 PyQt: 1,000.600000 PySide: 1,000.599976 Original: 10**6 + .4 PyQt: 1,000,000.400000 PySide: 1,000,000.375000 Original: 10**6 + .6 PyQt: 1,000,000.600000 PySide: 1,000,000.625000 Original: 10**7 + .4 PyQt: 10,000,000.400000 PySide: 10,000,000.000000 Original: 10**7 + .6 PyQt: 10,000,000.600000 PySide: 10,000,001.000000 Original: 10**8 + .4 PyQt: 100,000,000.400000 PySide: 100,000,000.000000 Original: 10**8 + .6 PyQt: 100,000,000.600000 PySide: 100,000,000.000000 Original: 10**9 + .4 PyQt: 1,000,000,000.400000 PySide: 1,000,000,000.000000 Original: 10**9 + .6 PyQt: 1,000,000,000.600000 PySide: 1,000,000,000.000000 Original: 10**14 + .4 PyQt: 100,000,000,000,000.406250 PySide: 100,000,000,376,832.000000 Original: 10**14 + .6 PyQt: 100,000,000,000,000.593750 PySide: 100,000,000,376,832.000000 Original: 10**15 + .4 PyQt: 1,000,000,000,000,000.375000 PySide: 999,999,986,991,104.000000 Original: 10**15 + .6 PyQt: 1,000,000,000,000,000.625000 PySide: 999,999,986,991,104.000000 Original: 10**16 + .4 PyQt: 10,000,000,000,000,000.000000 PySide: 10,000,000,272,564,224.000000 Original: 10**16 + .6 PyQt: 10,000,000,000,000,000.000000 PySide: 10,000,000,272,564,224.000000 Original: 10**17 + .4 PyQt: 100,000,000,000,000,000.000000 PySide: 99,999,998,430,674,944.000000 Original: 10**17 + .6 PyQt: 100,000,000,000,000,000.000000 PySide: 99,999,998,430,674,944.000000 """ -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.richi at bluewin.ch Mon Apr 15 08:25:12 2013 From: a.richi at bluewin.ch (Aaron Richiger) Date: Mon, 15 Apr 2013 08:25:12 +0200 Subject: [PySide] PySide Digest, Vol 15, Issue 31 In-Reply-To: <516B9C02.1070809@bluewin.ch> References: <516B9C02.1070809@bluewin.ch> Message-ID: <516B9D48.3090703@bluewin.ch> Am 15.04.2013 08:19, schrieb Aaron Richiger: > Hello Matthew! > > This are the required steps to get a running colibri example (all > commands for Ubuntu or similar, you have to adapt them to your OS): > > 1) Install git on your system (we don't know your OS, but google will > tell you how...) > sudo apt-get install git > > 2) Clone Thomas Perls great qml-examples by executing the following on > your command line (this will create a new folder callled > pyside-qml-examples, colibri is already included in there (see folder > "colibri")): > git clone > git://gitorious.org/pyside-qml-examples/pyside-qml-examples.git > > 3) Change the current directory to this new directory: > cd pyside-qml-examples > > 4) Run your first colibri example: > python CarAnalogy.py > > To get info about git, this is the wrong place:)! Google will help you > more and there are plenty of good git tutorials out there. > But you are on the right track: It's a versioning system which > basically means, that it allows you to keep track of different > versions of your software. If you push your git project to github or > other platforms, then it also acts as a backup and you can then share > your code from there with others (just like Thomas Perl did this with > his qml-examples). And finally, it allows collaboration of more than > one developer by supporting branching, merging and other functionality. > To sum up: git (or hg or svn or others....) make our world a better > place and I think it's worth having a look at it for every developer, > you won't regret it! > > Cheers > Aaron > > Am 14.04.2013 15:24, schrieb Matthew Ngaha: >>> Hello Matthew! >>> >>> I never used the colibri qml components. But I can tell you, that >>> QtCreator is an IDE for C++, Javascript, qml, etc. development. I never >>> used it for PySide development. QtCreator does not come with PySide, >>> but >>> it's simple to install (you'll find it with google...), but I think you >>> don't need it at all. >>> "Qt4.7 or higher" comes with PySide, so this is no problem. >>> >>> You can find a tutorial about colibri and PySide here: >>> http://qt-project.org/wiki/Utilizing-Qt-Quick-Colibri-in-PySide >>> >>> You may also be interested in another set of qml components (I >>> think, it >>> also has very nice components): qt-components, you can get it here: >>> http://qt.gitorious.org/qt-components >>> >>> I hope, this helps, to get you started! >>> Aaron >>> >> Thanks Aaron. following that pyside/colibri tutorial you gave me, >> trying to run the file i get an import error: >> >> colibri.qml:2:1: "colibri": no such directory >> import "colibri" >> >> i went to their site and i cant seem to find any downloads to install >> this package. i was at their installation page also: >> >> https://projects.forum.nokia.com/colibri/wiki/InstallationAndUsage >> https://projects.forum.nokia.com/colibri/wiki >> >> but their is no link to download? is there an easier way to install >> this project? ive been stuck at this point for some time now and i >> would really like to try it out. >> >> Im not good at understanding git, can u please tell me about the 2nd >> link you showed me: >> >> http://qt.gitorious.org/qt-components >> >> are these like ongoing projects normal users are contributing to? >> >> Thanks for all your help:) >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside > From a.richi at bluewin.ch Mon Apr 15 10:19:34 2013 From: a.richi at bluewin.ch (Aaron Richiger) Date: Mon, 15 Apr 2013 10:19:34 +0200 Subject: [PySide] PySide Digest, Vol 15, Issue 31 Message-ID: <516BB816.1030104@bluewin.ch> [Repost of the previous message, which was forwarded and seemed to be empty, because it's text was quoted as a response, so here again, the unquoted message:] Hello Matthew! This are the required steps to get a running colibri example (all commands for Ubuntu or similar, you have to adapt them to your OS): 1) Install git on your system (we don't know your OS, but google will tell you how...) sudo apt-get install git 2) Clone Thomas Perls great qml-examples by executing the following on your command line (this will create a new folder callled pyside-qml-examples, colibri is already included in there (see folder "colibri")): git clone git://gitorious.org/pyside-qml-examples/pyside-qml-examples.git 3) Change the current directory to this new directory: cd pyside-qml-examples 4) Run your first colibri example: python CarAnalogy.py To get info about git, this is the wrong place:)! Google will help you more and there are plenty of good git tutorials out there. But you are on the right track: It's a versioning system which basically means, that it allows you to keep track of different versions of your software. If you push your git project to github or other platforms, then it also acts as a backup and you can then share your code from there with others (just like Thomas Perl did this with his qml-examples). And finally, it allows collaboration of more than one developer by supporting branching, merging and other functionality. To sum up: git (or hg or svn or others....) make our world a better place and I think it's worth having a look at it for every developer, you won't regret it! Cheers Aaron Am 14.04.2013 15:24, schrieb Matthew Ngaha: >> Hello Matthew! >> >> I never used the colibri qml components. But I can tell you, that >> QtCreator is an IDE for C++, Javascript, qml, etc. development. I never >> used it for PySide development. QtCreator does not come with PySide, but >> it's simple to install (you'll find it with google...), but I think you >> don't need it at all. >> "Qt4.7 or higher" comes with PySide, so this is no problem. >> >> You can find a tutorial about colibri and PySide here: >> http://qt-project.org/wiki/Utilizing-Qt-Quick-Colibri-in-PySide >> >> You may also be interested in another set of qml components (I think, it >> also has very nice components): qt-components, you can get it here: >> http://qt.gitorious.org/qt-components >> >> I hope, this helps, to get you started! >> Aaron >> > Thanks Aaron. following that pyside/colibri tutorial you gave me, > trying to run the file i get an import error: > > colibri.qml:2:1: "colibri": no such directory > import "colibri" > > i went to their site and i cant seem to find any downloads to install > this package. i was at their installation page also: > > https://projects.forum.nokia.com/colibri/wiki/InstallationAndUsage > https://projects.forum.nokia.com/colibri/wiki > > but their is no link to download? is there an easier way to install > this project? ive been stuck at this point for some time now and i > would really like to try it out. > > Im not good at understanding git, can u please tell me about the 2nd > link you showed me: > > http://qt.gitorious.org/qt-components > > are these like ongoing projects normal users are contributing to? > > Thanks for all your help:) > _______________________________________________ > 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 chigga101 at gmail.com Mon Apr 15 15:46:30 2013 From: chigga101 at gmail.com (Matthew Ngaha) Date: Mon, 15 Apr 2013 14:46:30 +0100 Subject: [PySide] PySide Digest, Vol 15, Issue 37 In-Reply-To: References: Message-ID: > 4) Run your first colibri example: > python CarAnalogy.py > Hi Aaron. Sorry about not saying my OS before. I use Windows. I also did manage to get that folder following what you said. When i run the file as you said from the command line it runs fine so im very pleased. I just wondered why if i double click the file it returns this error: QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files D:\Data\Python\mywork\tutorials\pyside-qml-examples\CarAnalogy.qml:3:1: import "colibri" has no qmldir and no namespace Is there something special about running it from the command line or shouldn't it matter? Im not so fussed about it as im just happy i can follow the tutorial, thankfully the folder also provides a lot of extra examples i can look at. I have also bookmarked some guides on git. Thanks for all the help. From a.richi at bluewin.ch Mon Apr 15 17:21:10 2013 From: a.richi at bluewin.ch (Aaron Richiger) Date: Mon, 15 Apr 2013 17:21:10 +0200 Subject: [PySide] PySide Digest, Vol 15, Issue 37 In-Reply-To: References: Message-ID: <516C1AE6.8050303@bluewin.ch> Am 15.04.2013 15:46, schrieb Matthew Ngaha: >> 4) Run your first colibri example: >> python CarAnalogy.py >> > Hi Aaron. Sorry about not saying my OS before. I use Windows. I also > did manage to get that folder following what you said. When i run the > file as you said from the command line it runs fine so im very > pleased. I just wondered why if i double click the file it returns > this error: > > QNetworkAccessFileBackendFactory: URL has no schema set, use file:// for files > D:\Data\Python\mywork\tutorials\pyside-qml-examples\CarAnalogy.qml:3:1: > import "colibri" has no qmldir and no namespace I guess, it's a "working-directory" issue, but I'm not working with Windows, so could you please insert the following line before loading the qml file and show me it's output after double-clicking the file: import os; print os.getcwd() If this shows something different from D:\Data\Python\mywork\tutorials\pyside-qml-examples then this may be the reason for your issue. Cheers! Aaron > > Is there something special about running it from the command line or > shouldn't it matter? Im not so fussed about it as im just happy i can > follow the tutorial, thankfully the folder also provides a lot of > extra examples i can look at. > > I have also bookmarked some guides on git. Thanks for all the help. > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From a.richi at bluewin.ch Mon Apr 15 17:39:43 2013 From: a.richi at bluewin.ch (Aaron Richiger) Date: Mon, 15 Apr 2013 17:39:43 +0200 Subject: [PySide] PySide and git Message-ID: <516C1F3F.4040807@bluewin.ch> Dear PySiders! Because more and more PySide starters are asking questions about how to work with git and not about directly PySide related topics and because PySide development and example/tutorial distribution is mostly done via git repositories, I want to show you two good references to get started with git and for further questions, stackoverflow or similar platforms may be the better choice: Git cheat sheet (short and enough for most usages, but doesn't help getting a better git understanding...): http://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf Top ten git tutorials (most of them are quite a lot of reading, but worth it...): http://sixrevisions.com/resources/git-tutorials-beginners/ And in case you just want to get some code, knowing the following command is enough: git clone e.g. for getting the pyside examples: git clone git://gitorious.org/pyside/pyside-examples.git I hope, that future starters may find this links useful and allow us focusing on the interesting part (which are the PySide related topics) :)! Regards, Aaron From sean at seanfisk.com Tue Apr 16 03:46:12 2013 From: sean at seanfisk.com (Sean Fisk) Date: Mon, 15 Apr 2013 21:46:12 -0400 Subject: [PySide] PySide and git In-Reply-To: <516C1F3F.4040807@bluewin.ch> References: <516C1F3F.4040807@bluewin.ch> Message-ID: <7BB31EC35F5C4C5F9C3E90D8928866C3@gmail.com> On Monday, April 15, 2013 at 11:39 AM, Aaron Richiger wrote: > Dear PySiders! > > Because more and more PySide starters are asking questions about how to > work with git and not about directly PySide related topics and because > PySide development and example/tutorial distribution is mostly done via > git repositories, I want to show you two good references to get started > with git and for further questions, stackoverflow or similar platforms > may be the better choice: > > Git cheat sheet (short and enough for most usages, but doesn't help > getting a better git understanding...): > http://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf > > Top ten git tutorials (most of them are quite a lot of reading, but > worth it...): > http://sixrevisions.com/resources/git-tutorials-beginners/ > > +1 for ProGit! I believe that ProGit and the "Git community book" are now one and the same. Anyway, it's a great book! > > And in case you just want to get some code, knowing the following > command is enough: > git clone > e.g. for getting the pyside examples: > git clone git://gitorious.org/pyside/pyside-examples.git (http://gitorious.org/pyside/pyside-examples.git) > > I hope, that future starters may find this links useful and allow us > focusing on the interesting part (which are the PySide related topics) :)! > > Regards, > Aaron > > _______________________________________________ > PySide mailing list > PySide at qt-project.org (mailto:PySide at qt-project.org) > http://lists.qt-project.org/mailman/listinfo/pyside > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.kern at gmail.com Tue Apr 16 09:46:01 2013 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 16 Apr 2013 13:16:01 +0530 Subject: [PySide] Strange behaviour of QLocale.toString() In-Reply-To: <516B14F4.1010208@m.allo.ws> References: <000901ce38f7$4c6f4040$e54dc0c0$@gmail.com> <516AD085.5090902@m.allo.ws> <000101ce3942$a4015aa0$ec040fe0$@gmail.com> <516B131C.8010204@m.allo.ws> <516B14F4.1010208@m.allo.ws> Message-ID: On 2013-04-15 02:13, Zak wrote: > Here is a summary for the people who don't want to read a wall of text: > > This is not a bug, PySide uses 32 bit floating points and PyQt uses 64 > bit floating points, so they round numbers differently. QLocale::toString() is an overloaded method. It has definitions for both C float and C double values. If it is true that PySide is picking the C float overload, then I have to think that that is a bug. Python float objects are internally C doubles. It should not be implicitly downcast to a C float when the C double override is available. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From akabaila at pcug.org.au Tue Apr 16 12:38:04 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Tue, 16 Apr 2013 20:38:04 +1000 Subject: [PySide] PySide and git In-Reply-To: <7BB31EC35F5C4C5F9C3E90D8928866C3@gmail.com> References: <516C1F3F.4040807@bluewin.ch> <7BB31EC35F5C4C5F9C3E90D8928866C3@gmail.com> Message-ID: <35035798.YhFjHiasQW@supremo> There is a huge amount of useful information here. I have promptly downloaded the pyside-examples, which will keep me occupied for a very long time indeed. Thank you for making it available and thank you for the links to git information. Fabulous collection of great stuff! Al. On Monday 15 April 2013 21:46:12 Sean Fisk wrote: On Monday, April 15, 2013 at 11:39 AM, Aaron Richiger wrote: Dear PySiders! Because more and more PySide starters are asking questions about how to work with git and not about directly PySide related topics and because PySide development and example/tutorial distribution is mostly done via git repositories, I want to show you two good references to get started with git and for further questions, stackoverflow or similar platforms may be the better choice: Git cheat sheet (short and enough for most usages, but doesn't help getting a better git understanding...): http://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf Top ten git tutorials (most of them are quite a lot of reading, but worth it...): http://sixrevisions.com/resources/git-tutorials-beginners/ +1 for ProGit! I believe that ProGit and the "Git community book" are now one and the same. Anyway, it's a great book! And in case you just want to get some code, knowing the following command is enough: git clone e.g. for getting the pyside examples: git clone git://gitorious.org/pyside/pyside-examples.git I hope, that future starters may find this links useful and allow us focusing on the interesting part (which are the PySide related topics) :)! Regards, Aaron _______________________________________________ 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 chigga101 at gmail.com Tue Apr 16 14:49:29 2013 From: chigga101 at gmail.com (Matthew Ngaha) Date: Tue, 16 Apr 2013 13:49:29 +0100 Subject: [PySide] PySide Digest, Vol 15, Issue 38 In-Reply-To: References: Message-ID: Hi Aaron, after the import and print statement it prints the same directory: D:\Data\Python\mywork\tutorials\pyside-qml-examples The qml files in that same folder that dont use colibra load up fine with double clicking. After all the time i spent lost trying to figure out colibri i think im just happy to have it working. Thanks again for all your help, I really appreciate it. >> >show me it's output after double-clicking the file: > import os; print os.getcwd() > > If this shows something different from > > D:\Data\Python\mywork\tutorials\pyside-qml-examples > From Erik.Janssens at conceptive.be Thu Apr 18 23:31:47 2013 From: Erik.Janssens at conceptive.be (Erik Janssens) Date: Thu, 18 Apr 2013 23:31:47 +0200 Subject: [PySide] EuroPython Message-ID: Hello, will there be somebody with some internal knowledge of PySide at EuroPython ? I would like to spend some time trying to wrap the new Qt Desktop components with PySide, just to see how that goes. Regards, Erik -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdeibel at wingware.com Mon Apr 22 15:36:23 2013 From: sdeibel at wingware.com (Stephan Deibel) Date: Mon, 22 Apr 2013 09:36:23 -0400 Subject: [PySide] Document about problem and solutions for C++ bindings In-Reply-To: <1605883.B0qPjiQEmc@hugodesktop> References: <1605883.B0qPjiQEmc@hugodesktop> Message-ID: <51753CD7.10809@wingware.com> Hugo Parente Lima wrote: > In 2011 Marcelo wrote a document with various issues found while our team was > developing Shiboken, he wrote it with the intent of having a fallback for our > memory, despite of the Converters stuff, the document still up to date and a > good resource about the problems involved in creating C++ bindings for a high > level language, so I think it will be useful for everyone interested in > contribute with PySide, here is the document: > > http://setanta.wordpress.com/binding-c/ > Thanks. I've added a link to this from the PySide wiki page, Development section. - Stephan From lucericml at gmail.com Tue Apr 23 22:47:55 2013 From: lucericml at gmail.com (Luc-Eric Rousseau) Date: Tue, 23 Apr 2013 16:47:55 -0400 Subject: [PySide] random crashes in pyside during signals Message-ID: Hello, I'm getting frequent crashes in pyside, in different circumstances but always in the same call stack, although it might be for different controls. I'm wondering if anyone else is getting these, if there are fixes for this, or if you'd have suggestion of cases when this might occur. The crash occurs because in SignalManager::retriveMetaObject the metaObject pointer is NULL. I've put a sample callstack at the end of this mail. I'm using pyside 1.1.2 with qt4.8 and the crash reproducible on OSX or Windows, 64-bit. We built pyside ourselves on windows, but we are using the binary distribution on the Mac from the website. The app is a big dialog box that is completely written in Python, and all the controls are created dynamically. It's not rocket science or hack-y code, there is no weird hooking of events or anything advanced. You might get the crash right away, or need to do a lot of operations in the dialog box before the crash occurs: Sometime it will crash when clicking a button or when the code calls clear() on a QListWidget I've tried to reproduce the crash in a simpler test app, but up to now I haven't been able to. In the actual app, changing code around does make the crash stop, but then it can show up in another place. I've stubbed out all the logic from the dialog to rule out anything that might not be python/pyside related. pyside-python2.7.dll!PySide::SignalManager::retriveMetaObject(_object * self=0x0000000010a04c98) Line 546 + 0xe bytes C++ QtGui_d.pyd!QWidgetWrapper::metaObject() Line 1353 C++ > QtGui_d.pyd!Sbk_QWidget_Init(_object * self=0x0000000010c11bb8, _object * args=0x0000000011e8d058, _object * kwds=0x0000000000000000) Line 1480 + 0xf bytes C++ python27_d.dll!type_call(_typeobject * type=0x000007fed2475280, _object * args=0x0000000011e8d058, _object * kwds=0x0000000000000000) Line 737 + 0x45 bytes C python27_d.dll!PyObject_Call(_object * func=0x000007fed2475280, _object * arg=0x0000000011e8d058, _object * kw=0x0000000000000000) Line 2529 + 0x13 bytes C python27_d.dll!do_call(_object * func=0x0000000000000000, _object * * * pp_stack=0x0000000001117670, int na=-767077760, int nk=17921560) Line 4239 + 0xe bytes C python27_d.dll!call_function(_object * * * pp_stack=0x0000000001117670, int oparg=760758252) Line 4046 C python27_d.dll!PyEval_EvalFrameEx(_frame * f=0x0000000026b88f48, int throwflag=197437088) Line 2668 C python27_d.dll!PyEval_EvalCodeEx(PyCodeObject * co=0x0000000000000003, _object * globals=0x0000000000000004, _object * locals=0x0000000034b73be8, _object * * args=0x0000000000000000, int argcount=4, _object * * kws=0x0000000000000000, int kwcount=0, _object * * defs=0x00000000327d3780, int defcount=4, _object * closure=0x0000000000000000) Line 3253 + 0xf bytes C python27_d.dll!function_call(_object * func=0x00000000327d8698, _object * arg=0x0000000034e6e058, _object * kw=0x0000000000000000) Line 531 + 0x73 bytes C python27_d.dll!PyObject_Call(_object * func=0x00000000327d8698, _object * arg=0x0000000034e6e058, _object * kw=0x0000000000000000) Line 2529 + 0x13 bytes C python27_d.dll!instancemethod_call(_object * func=0x00000000327d8698, _object * arg=0x0000000034e6e058, _object * kw=0x0000000000000000) Line 2578 + 0x1d bytes C python27_d.dll!PyObject_Call(_object * func=0x0000000010715a30, _object * arg=0x0000000032b5d6e8, _object * kw=0x0000000000000000) Line 2529 + 0x13 bytes C python27_d.dll!slot_tp_init(_object * self=0x0000000010c11988, _object * args=0x0000000032b5d6e8, _object * kwds=0x0000000000000000) Line 5663 + 0x14 bytes C python27_d.dll!type_call(_typeobject * type=0x000000003131e538, _object * args=0x0000000032b5d6e8, _object * kwds=0x0000000000000000) Line 737 + 0x45 bytes C python27_d.dll!PyObject_Call(_object * func=0x000000003131e538, _object * arg=0x0000000032b5d6e8, _object * kw=0x0000000000000000) Line 2529 + 0x13 bytes C python27_d.dll!do_call(_object * func=0x0000000000000003, _object * * * pp_stack=0x0000000001117e30, int na=825353528, int nk=17923544) Line 4239 + 0xe bytes C python27_d.dll!call_function(_object * * * pp_stack=0x0000000001117e30, int oparg=337306920) Line 4046 C From jpe at wingware.com Tue Apr 23 23:10:53 2013 From: jpe at wingware.com (John Ehresman) Date: Tue, 23 Apr 2013 17:10:53 -0400 Subject: [PySide] random crashes in pyside during signals In-Reply-To: References: Message-ID: <5176F8DD.9070108@wingware.com> On 4/23/13 4:47 PM, Luc-Eric Rousseau wrote: > Hello, I'm getting frequent crashes in pyside, in different > circumstances but always in the same call stack, although it might be > for different controls. Could you try the sources in git at: https://qt.gitorious.org/pyside/shiboken https://qt.gitorious.org/pyside/pyside I have fixed bugs that cause segfaults with similar stack traces. Thanks, John From lucericml at gmail.com Thu Apr 25 00:21:33 2013 From: lucericml at gmail.com (Luc-Eric Rousseau) Date: Wed, 24 Apr 2013 18:21:33 -0400 Subject: [PySide] random crashes in pyside during signals In-Reply-To: <5176F8DD.9070108@wingware.com> References: <5176F8DD.9070108@wingware.com> Message-ID: On Tue, Apr 23, 2013 at 5:10 PM, John Ehresman wrote: > On 4/23/13 4:47 PM, Luc-Eric Rousseau wrote: >> Hello, I'm getting frequent crashes in pyside, in different >> circumstances but always in the same call stack, although it might be >> for different controls. > > Could you try the sources in git at: > https://qt.gitorious.org/pyside/shiboken > https://qt.gitorious.org/pyside/pyside > > I have fixed bugs that cause segfaults with similar stack traces. Thanks for the reply, John. I've compiled pyside and shiboken from the latest source in github, but I'm still getting the same crash: the metaobject ends up being null after a while. I'm not sure where to go next.. is it some kind of cache that isn't getting refreshed? I have a dialog box with a QListWidget, and changing the selection in it causes a dialog in another pane to update with different controls. this is the call stack on the Mac #0 PySide::DynamicQMetaObject::update (this=0x0) at /Users/dev/git/pyside/libpyside/dynamicqmetaobject.cpp:431 #1 PySide::SignalManager::retriveMetaObject (self=0x11e716d40) at /Users/dev/git/pyside/libpyside/signalmanager.cpp:561 #2 QCheckBoxWrapper::metaObject (this=0x147681100) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qcheckbox_wrapper.cpp:1335 #3 Sbk_QCheckBox_Init (self=0x11e748d40, args=0x124450050, kwds=0x0) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qcheckbox_wrapper.cpp:1489 #4 type_call () #5 PyObject_Call () #6 PyEval_EvalFrameEx () #7 PyEval_EvalCodeEx () #8 function_call () #9 PyObject_Call () #10 instancemethod_call () #11 PyObject_Call () #12 slot_tp_init () #13 type_call () #14 PyObject_Call () #15 PyEval_EvalFrameEx () #16 PyEval_EvalFrameEx () #17 PyEval_EvalCodeEx () #18 function_call () #19 PyObject_Call () #20 instancemethod_call () #21 PyObject_Call () #22 slot_tp_init () #23 type_call () #24 PyObject_Call () #25 PyEval_EvalFrameEx () #26 PyEval_EvalFrameEx () #27 PyEval_EvalFrameEx () #28 PyEval_EvalFrameEx () #29 PyEval_EvalFrameEx () #30 PyEval_EvalCodeEx () #31 function_call () #32 PyObject_Call () #33 instancemethod_call () #34 PyObject_Call () #35 PyEval_CallObjectWithKeywords () #36 PySide::SignalManager::callPythonMetaMethod (method=@0x7fff5fbfddc0, args=0x7fff5fbfe048, pyMethod=0x145f81460, isShortCuit=false) at /Users/dev/git/pyside/libpyside/signalmanager.cpp:475 #37 callMethod (object=0x1373b9800, id=28, args=0x7fff5fbfe048) at /Users/dev/git/pyside/libpyside/signalmanager.cpp:581 #38 PySide::SignalManager::qt_metacall (object=0x1373b9800, call=QMetaObject::InvokeMetaMethod, id=28, args=0x7fff5fbfe048) at /Users/dev/git/pyside/libpyside/signalmanager.cpp:428 #39 QWidgetWrapper::qt_metacall (this=0x1373b9800, call=QMetaObject::InvokeMetaMethod, id=28, args=0x7fff5fbfe048) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp:1338 #40 QMetaObject::activate () #41 QAbstractButton::clicked () #42 QAbstractButtonPrivate::emitClicked () #43 QAbstractButtonPrivate::click () #44 QAbstractButton::mouseReleaseEvent () #45 QToolButton::mouseReleaseEvent () #46 QToolButtonWrapper::mouseReleaseEvent (this=0x1373bab10, arg__1=0x7fff5fbfec38) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qtoolbutton_wrapper.cpp:1020 #47 QWidget::event () #48 QAbstractButton::event () #49 QToolButton::event () #50 QToolButtonWrapper::event (this=0x1373bab10, e=0x7fff5fbfec38) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qtoolbutton_wrapper.cpp:478 #51 QApplicationPrivate::notify_helper () From chigga101 at gmail.com Thu Apr 25 00:59:12 2013 From: chigga101 at gmail.com (Matthew Ngaha) Date: Wed, 24 Apr 2013 23:59:12 +0100 Subject: [PySide] complicated dictionaries Message-ID: Can anybody please explain this tutorial to me: http://qt-project.org/wiki/Auto-generating-QObject-from-template-in-PySide Im about to give up. im not great at python and trying to figure out the python syntax vs what pyside is meant to be doing is really confusing me. There are some fancy builtin objects being used that are behaving like dictionaries kwarggs, __dict__, and some confusing inner functions. As it is a pyside tutorial why didnt it just focus mainly on pyside and just use a normal dictionary and basic function process for the python code? From jpe at wingware.com Thu Apr 25 01:17:12 2013 From: jpe at wingware.com (John Ehresman) Date: Wed, 24 Apr 2013 19:17:12 -0400 Subject: [PySide] complicated dictionaries In-Reply-To: References: Message-ID: <517867F8.2020402@wingware.com> On 4/24/13 6:59 PM, Matthew Ngaha wrote: > Can anybody please explain this tutorial to me: > > http://qt-project.org/wiki/Auto-generating-QObject-from-template-in-PySide > > Im about to give up. im not great at python and trying to figure out > the python syntax vs what pyside is meant to be doing is really > confusing me. There are some fancy builtin objects being used that are > behaving like dictionaries kwarggs, __dict__, and some confusing inner > functions. As it is a pyside tutorial why didnt it just focus mainly > on pyside and just use a normal dictionary and basic function process > for the python code? Agreed. I just looked at the page for the first time and can't figure out what it's trying to accomplish (and I know a fair bit about python and pyside). I'd suggest just skipping it out or are you trying to do something similar? Cheers, John From jpe at wingware.com Thu Apr 25 01:34:13 2013 From: jpe at wingware.com (John Ehresman) Date: Wed, 24 Apr 2013 19:34:13 -0400 Subject: [PySide] random crashes in pyside during signals In-Reply-To: References: <5176F8DD.9070108@wingware.com> Message-ID: <51786BF5.8020102@wingware.com> On 4/24/13 6:21 PM, Luc-Eric Rousseau wrote: >> I have fixed bugs that cause segfaults with similar stack traces. > > Thanks for the reply, John. > I've compiled pyside and shiboken from the latest source in github, > but I'm still getting the same crash: the metaobject ends up being > null after a while. > I'm not sure where to go next.. is it some kind of cache that isn't > getting refreshed? Do you have a test case? Do you have a subclass of QCheckBox? The immediate cause is that mo in SignalManager::retriveMetaObject ends up being NULL, but the bug probably occurred earlier. Thanks, John From a.richi at bluewin.ch Thu Apr 25 01:40:37 2013 From: a.richi at bluewin.ch (Aaron Richiger) Date: Thu, 25 Apr 2013 01:40:37 +0200 Subject: [PySide] complicated dictionaries In-Reply-To: <517867F8.2020402@wingware.com> References: <517867F8.2020402@wingware.com> Message-ID: <51786D75.8010201@bluewin.ch> Am 25.04.2013 01:17, schrieb John Ehresman: > On 4/24/13 6:59 PM, Matthew Ngaha wrote: >> Can anybody please explain this tutorial to me: >> >> http://qt-project.org/wiki/Auto-generating-QObject-from-template-in-PySide >> >> Im about to give up. im not great at python and trying to figure out >> the python syntax vs what pyside is meant to be doing is really >> confusing me. There are some fancy builtin objects being used that are >> behaving like dictionaries kwarggs, __dict__, and some confusing inner >> functions. As it is a pyside tutorial why didnt it just focus mainly >> on pyside and just use a normal dictionary and basic function process >> for the python code? > Agreed. I just looked at the page for the first time and can't figure > out what it's trying to accomplish (and I know a fair bit about python > and pyside). I'd suggest just skipping it out or are you trying to do > something similar? > > Cheers, > > John Partially agreed:) The tutorial is an interesting puzzle, but definitively not a beginners tutorial. It's fairly advanced python and I had to study the code for a moment to understand it even if I'm using Python almost every day... I would also suggest to skip it, because it's at most 10% PySide related, 90% or more is Python related. I would study other tutorials if you want to get used to PySide. For people still interested in this tutorial: It goes towards meta programming. It allows you defining many different classes with very little code (but only as long as the classes exactly fit into the limitations of this template). E.g. if you need classes for Persons, Buildings and Cars, the following will set them up for you: Car = AutoQObject( ('model', str), ('inStock', bool), name='Car' ) Person = AutoQObject( ('age', int), ('car', Car), name='Person' ) Building = AutoQObject( ('id_', int), name='Building' ) The text in the tutorial description describes best, what the template (which is AutoQObject) does: "Attributes, getters, setters and notification methods are automatically generated." I can hardly think of a realistic example, where one would need this, because the classes generated from the template are quite limited, most often, you need more flexibility (e.g. don't need all notification methods, but need other methods). Please also note, that the code is not even PEP8 conform, which makes it even harder to understand and in my opinion, the author is mixing up classes with objects in the text, but this is just a detail:) Hope this helps! Aaron > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From chigga101 at gmail.com Thu Apr 25 01:43:29 2013 From: chigga101 at gmail.com (Matthew Ngaha) Date: Thu, 25 Apr 2013 00:43:29 +0100 Subject: [PySide] complicated dictionaries In-Reply-To: <517867F8.2020402@wingware.com> References: <517867F8.2020402@wingware.com> Message-ID: no i was just trying to follow along with every pyside tutorial i could find. To be honest i dont even know what its doing to know if i want to do something similar. ive already spent 2 days just staring at it, i think i'll take your advise and skip it:) Thanks On Thu, Apr 25, 2013 at 12:17 AM, John Ehresman wrote: > On 4/24/13 6:59 PM, Matthew Ngaha wrote: >> Can anybody please explain this tutorial to me: >> >> http://qt-project.org/wiki/Auto-generating-QObject-from-template-in-PySide >> >> Im about to give up. im not great at python and trying to figure out >> the python syntax vs what pyside is meant to be doing is really >> confusing me. There are some fancy builtin objects being used that are >> behaving like dictionaries kwarggs, __dict__, and some confusing inner >> functions. As it is a pyside tutorial why didnt it just focus mainly >> on pyside and just use a normal dictionary and basic function process >> for the python code? > > Agreed. I just looked at the page for the first time and can't figure > out what it's trying to accomplish (and I know a fair bit about python > and pyside). I'd suggest just skipping it out or are you trying to do > something similar? > > Cheers, > > John > From jpe at wingware.com Thu Apr 25 01:58:22 2013 From: jpe at wingware.com (John Ehresman) Date: Wed, 24 Apr 2013 19:58:22 -0400 Subject: [PySide] complicated dictionaries In-Reply-To: <51786D75.8010201@bluewin.ch> References: <517867F8.2020402@wingware.com> <51786D75.8010201@bluewin.ch> Message-ID: <5178719E.8050900@wingware.com> On 4/24/13 7:40 PM, Aaron Richiger wrote: > For people still interested in this tutorial: It goes towards meta > programming. It allows you defining many different classes with very > little code (but only as long as the classes exactly fit into the > limitations of this template). Yes, I can kind of see how it generates classes. It's probably better to do something like this via metaclasses. I just get scared when I see code that uses locals() to set things in the local namespace ;). Cheers, John From akabaila at pcug.org.au Thu Apr 25 08:59:57 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Thu, 25 Apr 2013 16:59:57 +1000 Subject: [PySide] pyside-uic Message-ID: <1609920.Kb7cXbylBV@supremo> Hi, Aaron Richiger had kindly indicated where the pyside-examples "live". There seems to be very few examples that use QtDesigner. From my perspective of GUI programming, QtDesigner is a major attraction. I have spent a little time with the calculator form example (pyside-examples/examples/designer/calculatorform), which does use QtDesigner. The QtDesigner produces calculatorform.ui file, which when processed with pyside-uic creates a python file ui_calculatorform.py. Line 25 of the code is self.gridlayout.setMargin(9) My reading of the Qt Documentation seems to indicate that setMargin is as well as margin and margin() "class members are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code." The code seems to work most of the tme, though the "Spyder" editor catches the error as AttributeError:'PySide.QtGui.QGridLayout' object has no attribute 'setMargin' As code is produced via QtDesigner and pyside-uic, there is not much that a user can do about it, short of edit the file and ignore the warning that "the sky will fall down, if you do it". Any advice? The example is not "clever" - a much nicer "calculator" is presented in the PyQt Book by Mark Summerfield. However, the example has the merit that it hardly has any Python code and it shows how the spin boxes can be accessed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From akabaila at pcug.org.au Thu Apr 25 09:25:57 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Thu, 25 Apr 2013 17:25:57 +1000 Subject: [PySide] pyside-uic rename QtDesigner In-Reply-To: <1609920.Kb7cXbylBV@supremo> References: <1609920.Kb7cXbylBV@supremo> Message-ID: <1759893.BciFtT67yU@supremo> That was a badly chosen subject. Clearly, the QtDesigner produces a code that appears to require to use setMargin. Part of the calculatorform.ui file is as follows: Calculator Form 9 So as I can not make head or tail of the documentation, where did I slip up? High marks to "Spyder" - in spite of my inability of getting the version number of it :) Al. On Thursday 25 April 2013 16:59:57 Algis Kabaila wrote: Hi, Aaron Richiger had kindly indicated where the pyside-examples "live". There seems to be very few examples that use QtDesigner. From my perspective of GUI programming, QtDesigner is a major attraction. -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.richi at bluewin.ch Thu Apr 25 10:41:27 2013 From: a.richi at bluewin.ch (Aaron Richiger) Date: Thu, 25 Apr 2013 10:41:27 +0200 Subject: [PySide] pyside-uic rename QtDesigner In-Reply-To: <1759893.BciFtT67yU@supremo> References: <1609920.Kb7cXbylBV@supremo> <1759893.BciFtT67yU@supremo> Message-ID: <5178EC37.5040809@bluewin.ch> Hello Al! I tried to reproduce this, but failed, pyside-uic didn't generate invalid code for me (but incorrect code, see below). Could you please show us the output of pyside-uic --version On my Ubuntu 12.10, I got pyside-uic via apt-get and got the following output: PySide User Interface Compiler version 0.2.13, running on PySide 1.1.1. Interesting side mark: The generated python code wasn't correct: Input: 20 Compiled to: self.gridLayout.setContentsMargins(20, 20, 20, 20) self.gridLayout.setContentsMargins(0, 0, 0, 0) So, initially, the margins are set as expected, but they get reset directly after!? Is this bug fixed in newer versions of pyside-uic? To reproduce it: - open Qt4Designer - New ui project for Widget - drag and drop a gridlayout into it and add some pushbuttons to it - Change the margins to some value >0 in the property editor on the right side of Qt4Designer - Save it as test.ui - Translate it to python code with: pyside-uic -o ui.py -x test.ui - Run the example: python ui.py Cheers! Aaron Am 25.04.2013 09:25, schrieb Algis Kabaila: > > That was a badly chosen subject. Clearly, the QtDesigner produces a > code that appears to require to use setMargin. Part of the > calculatorform.ui file is as follows: > > Calculator Form > > > > > > > > 9 > > So as I can not make head or tail of the documentation, where did I > slip up? > > High marks to "Spyder" - in spite of my inability of getting the > version number of it :) > > Al. > > On Thursday 25 April 2013 16:59:57 Algis Kabaila wrote: > > Hi, > > Aaron Richiger had kindly indicated where the pyside-examples "live". > There seems to be very few examples that use QtDesigner. From my > perspective of GUI programming, QtDesigner is a major attraction. > > > > _______________________________________________ > 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 akabaila at pcug.org.au Thu Apr 25 12:15:58 2013 From: akabaila at pcug.org.au (Algis Kabaila) Date: Thu, 25 Apr 2013 20:15:58 +1000 Subject: [PySide] pyside-uic rename QtDesigner In-Reply-To: <5178EC37.5040809@bluewin.ch> References: <1609920.Kb7cXbylBV@supremo> <1759893.BciFtT67yU@supremo> <5178EC37.5040809@bluewin.ch> Message-ID: <3150466.2VJxAPT99r@supremo> Hi Aaron, Just a quick answer before I "hit the sack": ak at supremo:~$ pyside-uic --version PySide User Interface Compiler version 0.2.13, running on PySide 1.1.0. ak at supremo:~$ So it looks that we have the same version. I am still on ubuntu12.04 LTS. I "decided" that it was time to stop 6 monthly updates and planned to stay with 12.04 till 14.04 - if I am still here. Today, Australia commemorates its dead in various wars that the people of this country have been involved. It is called Anzac Day. The Kabaila's seniors live within walking distance from the War Memorial where the center of ceremonies is. After all, Canberra is the capital. So I had my little whiskey and will go to an early night. I sure would like to follow up on the experiment, but not in the half drunk state... Cheers, Al. PS: Thank you for the huge amount of time you spent when introducing me to the mysteries of PySide and the storage. Really appreciated! A. On Thursday 25 April 2013 10:41:27 Aaron Richiger wrote: Hello Al! I tried to reproduce this, but failed, pyside-uic didn't generate invalid code for me (but incorrect code, see below). Could you please show us the output of pyside-uic --version On my Ubuntu 12.10, I got pyside-uic via apt-get and got the following output: PySide User Interface Compiler version 0.2.13, running on PySide 1.1.1. Interesting side mark: The generated python code wasn't correct: Input: 20 Compiled to: self.gridLayout.setContentsMargins(20, 20, 20, 20) self.gridLayout.setContentsMargins(0, 0, 0, 0) So, initially, the margins are set as expected, but they get reset directly after!? Is this bug fixed in newer versions of pyside-uic? To reproduce it: - open Qt4Designer - New ui project for Widget - drag and drop a gridlayout into it and add some pushbuttons to it - Change the margins to some value >0 in the property editor on the right side of Qt4Designer - Save it as test.ui - Translate it to python code with: pyside-uic -o ui.py -x test.ui - Run the example: python ui.py Cheers! Aaron Am 25.04.2013 09:25, schrieb Algis Kabaila: That was a badly chosen subject. Clearly, the QtDesigner produces a code that appears to require to use setMargin. Part of the calculatorform.ui file is as follows: Calculator Form 9 So as I can not make head or tail of the documentation, where did I slip up? High marks to "Spyder" - in spite of my inability of getting the version number of it :) Al. On Thursday 25 April 2013 16:59:57 Algis Kabaila wrote: Hi, Aaron Richiger had kindly indicated where the pyside-examples "live". There seems to be very few examples that use QtDesigner. >From my perspective of GUI programming, QtDesigner is a major attraction. _______________________________________________PySide mailing listPySide at qt-project.orghttp://lists.qt- project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From william.dias at gmail.com Thu Apr 25 20:00:04 2013 From: william.dias at gmail.com (William Dias) Date: Thu, 25 Apr 2013 15:00:04 -0300 Subject: [PySide] Signal emitted on a worker thread not being received by main thread In-Reply-To: <2486639.sxMLbEnpqW@supremo> References: <2486639.sxMLbEnpqW@supremo> Message-ID: I think I solved the problem by switching the order of some commands. First I move my object to the thread and then I do all the signal/slot connections. This way, the PySide is able to user the proper connection to handle communication across threads. I did some tests here and everything worked fine. 2013/4/9 Algis Kabaila > ** > > William, > > > > It may bee worth while to read about QTimer [QtCore]( Mark Summerfield's > "Rapid GUI Porgramming with Python and Qt", pp. 373, 376. Also QTime > [QtCore] and > > [QTimeEdit [QTGui] p 576. I vaguely recall that there was discussion why > he used QTimer of Qt library rather than the simpler "sleep" of Python. > > Just a shot in the dark - it might be just what is needed. Worth a try, I > think. > > > > Al. > > > > > > On Monday 08 April 2013 23:32:45 William Dias wrote: > > Lucas, > > > Yes, I could, but the question is: why this is not working properly with > qt libraries only? Why the slot is not being called? The weird thing is > that the issue just occurs occasionally. In the last battery of tests I > ran, I've got 149 threads created and only 2 of them didn't make the call > to the slot. > > > > 2013/4/8 Lucas Tanure > > Could you use the queue in python ? with Queue.get([block[, timeout]]) ? > > > Lucas A. Tanure Alves > +55 (19) 88176559 > > > > On Mon, Apr 8, 2013 at 6:59 PM, William Dias > wrote: > > Hi, Tibold. Thanks for your reply. > > > If I first move my worker to the new thread and then make the connection > should it work? > > > According to the documentation, it would use an auto-connection and since > emitter and receiver don't have the same thread affinity, it would create a > queued connection. Is it right? > > > Best, > > > > 2013/4/8 Tibold Kandrai > > Hi, > > > > I think you’ll have to use queued connection when you connect the > photoStatus signal to the photoStatus slot. > > > > See: > > > http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots-across-threads > > > > Cheers, > > Tibold > > > > From: pyside-bounces+kandraitibold=gmail.com at qt-project.org [mailto: > pyside-bounces+kandraitibold=gmail.com at qt-project.org] On Behalf Of William > Dias > Sent: 2013 April 08, Monday 17:01 > To: pyside at qt-project.org > Subject: [PySide] Signal emitted on a worker thread not being received by > main thread > > > > Hi, > > > > I am facing an intermittent problem with my PySide application. I have a > GUI that spawns several threads that are responsible for sending photos to > a web server. The threads are created as shown bellow: > > > > photoConnectionThread = QThread() > > photoConnectionObject = http_connection.PhotoConnection(self.filename) > > photoConnectionObject.photoStatus.connect(self.photoStatus) > > photoConnectionObject.moveToThread(photoConnectionThread) > > photoConnectionThread.started.connect(photoConnectionObject.work) > > photoConnectionThread.finished.connect(self.threadFinished) > > photoConnectionThread.start() > > > > My worker thread tries to upload a photo only once and then emits a signal > to the main thread so that the status can be updated in a database. > > > > def work(self): > > logger.info("photo object created on thread " + > str(self.thread())) > > status = sendPhoto(self.filename) > > self.photoStatus.emit(self.filename, status) > > QThread.sleep(5) > > logger.info("exiting thread " + > str(self.thread())) > > self.thread().exit(0) > > > > The problem is that, sporadically, the main thread does not receive the > signal and consequently doesn't get the status updated. > > > > Does anybody have any idea why this is happening? > > > > I am using: > > Python 2.7 > > PySide 1.1.1 > > Windows 7 > > > > Thank you! > > > > _______________________________________________ > 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 backup.rlacko at gmail.com Fri Apr 26 16:27:40 2013 From: backup.rlacko at gmail.com (Roman Lacko) Date: Fri, 26 Apr 2013 16:27:40 +0200 Subject: [PySide] New PySide release date Message-ID: Dear PySide core devs, what you think about creating new PySide release ? I have commited good amount of fixes and enhanecements to PySide setup script and i would like to publish new release to PyPI. Thanks R. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bootch at nc.rr.com Fri Apr 26 16:36:04 2013 From: bootch at nc.rr.com (lloyd konneker) Date: Fri, 26 Apr 2013 14:36:04 +0000 (UTC) Subject: [PySide] pickling enums (again) Message-ID: I know this is not a high priority and has been visited before. 1) I posted an unreliable workaround at https://bugreports.qt-project.org/browse/PYSIDE-15 (unreliable since dict.keys() is arbitrarily ordered?) 2) Is pickling of Qt enums working in PyQt and just needs someone to port it to PySide? (If so, I might try.) 3) In a previous post http://article.gmane.org/gmane.comp.lib.qt.pyside/1083 Hugo objected to allowing type int in Qt methods where a type Qt enum was expected. IMHO that is too strong and unPythonic. It is not always the duty of PySide to enforce type checking. Especially since enums in C++ are not very strict (allow comparison to ints, allow comparison between different enum types, etc. See discussions of "enum class" for C++11.) Maybe relaxing enforcement for those methods that take parameters of type Qt enum where the enum is a subclass of int would allow easier unpickling of Qt enums (But not all Qt enums such as Qt.GlobalColor are subclasses of int?) And maybe there is a better solution. From tismer at stackless.com Fri Apr 26 16:51:58 2013 From: tismer at stackless.com (Christian Tismer) Date: Fri, 26 Apr 2013 16:51:58 +0200 Subject: [PySide] complicated dictionaries In-Reply-To: <5178719E.8050900@wingware.com> References: <517867F8.2020402@wingware.com> <51786D75.8010201@bluewin.ch> <5178719E.8050900@wingware.com> Message-ID: <517A948E.4030301@stackless.com> On 25.04.13 01:58, John Ehresman wrote: > On 4/24/13 7:40 PM, Aaron Richiger wrote: >> For people still interested in this tutorial: It goes towards meta >> programming. It allows you defining many different classes with very >> little code (but only as long as the classes exactly fit into the >> limitations of this template). > Yes, I can kind of see how it generates classes. It's probably better > to do something like this via metaclasses. I just get scared when I see > code that uses locals() to set things in the local namespace ;). > Just saw this advanced tutorial example. I agree, this is all about Python "tricks" to save a lot of typing, with the drawback that such implementations are rarely general-purpose and hard to understand. Using such descriptive tuples for attributes to be generated becomes quite common if you are dealing with legacy file formats ore database structures which all follow a certain layout pattern. The code can pretty easily be converted into using metaclasses. This way it can get a bit more understandable. In any case, the necessity to fiddle with __dict__, getters and setters and so on remains. Such code should get a lot of good comments every few lines, what they are for and how they work, with references to other documentation and so on. Otherwise the code is only understandable by people who had written something similar, before. (Yes, I confess :-) ) And although by the "metaclass" idiom this technique pretends to be advanced, it still needs much knowledge about Python to do them right, to let inheritance work consistently, so I highly recommend to avoid them unless you have a real use case (like many similar classes where the error-prone code repetition is more painful that remembering the short but twisted meta hack). If this example stays, it should be re-written, better documented, and avoid making the reader feel dumb. Instead he should be warned and pointed at further reading, for instance http://jakevdp.github.io/blog/2012/12/01/a-primer-on-python-metaclasses/ contains a slow and step-wise introduction. (Python 2.x) Btw., the use of locals() is the only way to get access to the dictionary of a class during its construction; it can even be helpful for introspection in metaclasses. But you may never use it for assignment. See http://docs.python.org/2/library/functions.html#locals -- Christian Tismer :^) Software Consulting : Have a break! Take a ride on Python's Karl-Liebknecht-Str. 121 : *Starship* http://starship.python.net/ 14482 Potsdam : PGP key -> http://pgp.uni-mainz.de phone +49 173 24 18 776 fax +49 (30) 700143-0023 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/ From hugo.lima at openbossa.org Fri Apr 26 17:41:38 2013 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Fri, 26 Apr 2013 12:41:38 -0300 Subject: [PySide] pickling enums (again) In-Reply-To: References: Message-ID: <1848021.mybhaHnkWf@hugodesktop> On Friday, April 26, 2013 02:36:04 PM lloyd konneker wrote: > I know this is not a high priority and has been visited before. > > 1) I posted an unreliable workaround at > https://bugreports.qt-project.org/browse/PYSIDE-15 (unreliable since > dict.keys() is arbitrarily ordered?) > > 2) Is pickling of Qt enums working in PyQt and just needs someone to port it > to PySide? (If so, I might try.) > > 3) In a previous post http://article.gmane.org/gmane.comp.lib.qt.pyside/1083 > Hugo objected to allowing type int in Qt methods where a type Qt enum was > expected. IMHO that is too strong and unPythonic. It is not always the > duty of PySide to enforce type checking. Especially since enums in C++ are > not very strict (allow comparison to ints, allow comparison between > different enum types, etc. See discussions of "enum class" for C++11.) > Maybe relaxing enforcement for those methods that take parameters of type > Qt enum where the enum is a subclass of int would allow easier unpickling > of Qt enums (But not all Qt enums such as Qt.GlobalColor are subclasses of > int?) And maybe there is a better solution. Hi, I still object to "cast any integer to an enum", you could argue that this isn't pythonic due to the strong type check, however this would imply into a possible segmentation fault on C++ side which I would say isn't pythonic either. > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From jpe at wingware.com Fri Apr 26 17:46:12 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 26 Apr 2013 11:46:12 -0400 Subject: [PySide] pickling enums (again) In-Reply-To: <1848021.mybhaHnkWf@hugodesktop> References: <1848021.mybhaHnkWf@hugodesktop> Message-ID: <517AA144.6050705@wingware.com> On 4/26/13 11:41 AM, Hugo Parente Lima wrote: > I still object to "cast any integer to an enum", you could argue > that this isn't pythonic due to the strong type check, however this > would imply into a possible segmentation fault on C++ side which I > would say isn't pythonic either. How would converting integers into enums after checking that they were valid cause a segfault? Thanks, John From tismer at stackless.com Fri Apr 26 18:02:25 2013 From: tismer at stackless.com (Christian Tismer) Date: Fri, 26 Apr 2013 18:02:25 +0200 Subject: [PySide] New PySide release date In-Reply-To: References: Message-ID: <517AA511.8000704@stackless.com> On 26.04.13 16:27, Roman Lacko wrote: > Dear PySide core devs, > > what you think about creating new PySide release ? > I have commited good amount of fixes and enhanecements to PySide setup > script and i would like to publish new release to PyPI. Great idea. Maybe we should fix some small things which are not tested on Python 3? For instance pyside_postinstall.py will crash after line 80 because python 3 returns bytes(). I'd like to volunteer to do some final testing. cheers - chris -- Christian Tismer :^) Software Consulting : Have a break! Take a ride on Python's Karl-Liebknecht-Str. 121 : *Starship* http://starship.python.net/ 14482 Potsdam : PGP key -> http://pgp.uni-mainz.de phone +49 173 24 18 776 fax +49 (30) 700143-0023 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/ From jpe at wingware.com Fri Apr 26 18:18:44 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 26 Apr 2013 12:18:44 -0400 Subject: [PySide] New PySide release date In-Reply-To: References: Message-ID: <517AA8E4.3020109@wingware.com> On 4/26/13 10:27 AM, Roman Lacko wrote: > Dear PySide core devs, > > what you think about creating new PySide release ? > I have commited good amount of fixes and enhanecements to PySide setup > script and i would like to publish new release to PyPI. While I want to create a new release, I don't think one is imminent. There are a few more patches that I'd like to get in and I suspect that there are a few problems with the current git sources that will need to be fixed. I've spent some time setting up a system to test against various qt releases and python releases and I hope to be able to easily run the test suites against different python versions soon. Cheers, John From hugo.lima at openbossa.org Fri Apr 26 18:50:57 2013 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Fri, 26 Apr 2013 13:50:57 -0300 Subject: [PySide] pickling enums (again) In-Reply-To: <517AA144.6050705@wingware.com> References: <1848021.mybhaHnkWf@hugodesktop> <517AA144.6050705@wingware.com> Message-ID: <9627462.yUxrY7zoZh@hugodesktop> On Friday, April 26, 2013 11:46:12 AM John Ehresman wrote: > On 4/26/13 11:41 AM, Hugo Parente Lima wrote: > > I still object to "cast any integer to an enum", you could argue > > that this isn't pythonic due to the strong type check, however this > > would imply into a possible segmentation fault on C++ side which I > > would say isn't pythonic either. > > How would converting integers into enums after checking that they were > valid cause a segfault? After checking they are valid wont cause any problems, but checking if they are valid on every function call seems like a unnecessary overhead IMO, although I don't have numbers to prove this possible overhead :-) My point is about not doing the check plus converting every integer with a reinterpret_cast. > Thanks, > > John -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From jpe at wingware.com Fri Apr 26 19:06:41 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 26 Apr 2013 13:06:41 -0400 Subject: [PySide] pickling enums (again) In-Reply-To: <9627462.yUxrY7zoZh@hugodesktop> References: <1848021.mybhaHnkWf@hugodesktop> <517AA144.6050705@wingware.com> <9627462.yUxrY7zoZh@hugodesktop> Message-ID: <517AB421.5040603@wingware.com> On 4/26/13 12:50 PM, Hugo Parente Lima wrote: >> How would converting integers into enums after checking that they >> were valid cause a segfault? > > After checking they are valid wont cause any problems, but checking > if they are valid on every function call seems like a unnecessary > overhead IMO, although I don't have numbers to prove this possible > overhead :-) > > My point is about not doing the check plus converting every integer > with a reinterpret_cast. Yes, not checking would be a problem. I tend to think the overhead from checking would be negligible. Does anyone know if PyQt would accept an integer in these cases? Thanks, John From lucericml at gmail.com Fri Apr 26 19:13:36 2013 From: lucericml at gmail.com (Luc-Eric Rousseau) Date: Fri, 26 Apr 2013 13:13:36 -0400 Subject: [PySide] random crashes in pyside during signals In-Reply-To: <51786BF5.8020102@wingware.com> References: <5176F8DD.9070108@wingware.com> <51786BF5.8020102@wingware.com> Message-ID: On Wed, Apr 24, 2013 at 7:34 PM, John Ehresman wrote: > Do you have a test case? Do you have a subclass of QCheckBox? The > immediate cause is that mo in SignalManager::retriveMetaObject ends up > being NULL, but the bug probably occurred earlier. > > Thanks, I've been trying to isolate in a smaller test case and I haven't been able to yet. There was mention of a checkbox in that callstack, however in other times it's elsewhere (for example as below). I do not have a subclass of QCheckBox, it might have been the checkbox part of QT's QListWidget if there was one. The way I'm reproducing the crash 100% of the time is to click a push button a few times fast that changes the selection in a QListBox, which then causes another pane to refresh with new controls. However, if you don't do that, every once in a while you can click another control elsewhere and *poof*, you'll crash with the same call stack. It's just harder to reproduce an other way. So I've come to the conclusion that there isn't anything wrong specially with that QListWidget UI, it's just much easier to reproduce it there. Btw, I've got a few QScrollArea containing controls. Is are there known problems with those, control deletion and pyside - I think I've seen a discussion about this. #0 PySide::DynamicQMetaObject::update (this=0x0) at /Users/dev/git/pyside/libpyside/dynamicqmetaobject.cpp:431 #1 0x0000000140169f66 in PySide::SignalManager::retriveMetaObject (self=0x15492fb90) at /Users/dev/git/pyside/libpyside/signalmanager.cpp:561 #2 0x000000014d73e919 in QWidgetWrapper::metaObject (this=0x13e5e1070) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp:1332 #3 0x000000014d73f63a in Sbk_QWidget_Init (self=0x1516f8bd8, args=0x11ffbf050, kwds=0x0) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp:1460 #4 0x000000010f8fccc5 in type_call () [...] #43 0x000000010f942947 in PyEval_CallObjectWithKeywords () #44 0x0000000140169731 in PySide::SignalManager::callPythonMetaMethod (method=@0x7fff5fbfddc0, args=0x7fff5fbfe048, pyMethod=0x14ebac500, isShortCuit=false) at /Users/dev/git/pyside/libpyside/signalmanager.cpp:475 #45 0x0000000140169423 in callMethod (object=0x15428deb0, id=28, args=0x7fff5fbfe048) at /Users/dev/git/pyside/libpyside/signalmanager.cpp:581 #46 0x00000001401690f5 in PySide::SignalManager::qt_metacall (object=0x15428deb0, call=QMetaObject::InvokeMetaMethod, id=28, args=0x7fff5fbfe048) at /Users/dev/git/pyside/libpyside/signalmanager.cpp:428 #47 0x000000014d73e994 in QWidgetWrapper::qt_metacall (this=0x15428deb0, call=QMetaObject::InvokeMetaMethod, id=28, args=0x7fff5fbfe048) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp:1338 #48 0x000000010dd12d75 in QMetaObject::activate () #49 0x000000010e589d41 in QAbstractButton::clicked () #50 0x000000010e2fc58e in QAbstractButtonPrivate::emitClicked () #51 0x000000010e2fd2aa in QAbstractButtonPrivate::click () #52 0x000000010e2fd46c in QAbstractButton::mouseReleaseEvent () #53 0x000000010e3b7262 in QToolButton::mouseReleaseEvent () #54 0x000000014d69e3b5 in QToolButtonWrapper::mouseReleaseEvent (this=0x15428f290, arg__1=0x7fff5fbfec38) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qtoolbutton_wrapper.cpp:1020 #55 0x000000010dff5c0d in QWidget::event () #56 0x000000010e2fc557 in QAbstractButton::event () #57 0x000000010e3b6e82 in QToolButton::event () #58 0x000000014d69a1ff in QToolButtonWrapper::event (this=0x15428f290, e=0x7fff5fbfec38) at /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qtoolbutton_wrapper.cpp:478 #59 0x000000010dfaad52 in QApplicationPrivate::notify_helper () #60 0x000000010dfab698 in QApplication::notify () #61 0x0000000102820fcb in QxxxApplication::notify (this=0x11a223760, receiver=0x15428f290, event=0x7fff5fbfec38) at QmayaApplication.cpp:153 #62 0x000000010dcfdfc6 in QCoreApplication::notifyInternal () #63 0x000000010dfb3308 in QApplicationPrivate::sendMouseEvent () #64 0x000000010df62cf4 in qt_mac_handleMouseEvent () #65 0x00007fff85b75606 in -[NSWindow sendEvent:] () #66 0x000000010df5a7bf in -[QCocoaWindow sendEvent:] () #67 0x00007fff85b71674 in -[NSApplication sendEvent:] () #68 0x000000010df5e140 in -[QNSApplication sendEvent:] () #69 0x00007fff85a8724a in -[NSApplication run] () #70 0x000000010df66f3f in QEventDispatcherMac::processEvents () #71 0x000000010dcfb428 in QEventLoop::exec () #72 0x000000010dcfe6fb in QCoreApplication::exec () From jmohler at gamry.com Fri Apr 26 20:11:30 2013 From: jmohler at gamry.com (Joel B. Mohler) Date: Fri, 26 Apr 2013 14:11:30 -0400 Subject: [PySide] random crashes in pyside during signals In-Reply-To: References: <5176F8DD.9070108@wingware.com> <51786BF5.8020102@wingware.com> Message-ID: <517AC352.2040405@gamry.com> On 4/26/2013 1:13 PM, Luc-Eric Rousseau wrote: > On Wed, Apr 24, 2013 at 7:34 PM, John Ehresman wrote: >> Do you have a test case? Do you have a subclass of QCheckBox? The >> immediate cause is that mo in SignalManager::retriveMetaObject ends up >> being NULL, but the bug probably occurred earlier. >> >> Thanks, > I've been trying to isolate in a smaller test case and I haven't been > able to yet. > There was mention of a checkbox in that callstack, however in other > times it's elsewhere (for example as below). I do not have a subclass > of QCheckBox, it might have been the checkbox part of QT's > QListWidget if there was one. The way I'm reproducing the crash 100% > of the time is to click a push button a few times fast that changes > the selection in a QListBox, which then causes another pane to refresh > with new controls. However, if you don't do that, every once in a > while you can click another control elsewhere and *poof*, you'll crash > with the same call stack. It's just harder to reproduce an other way. > So I've come to the conclusion that there isn't anything wrong > specially with that QListWidget UI, it's just much easier to reproduce > it there. I'm not sure how helpful this is, but I add an anecdote. I reported both https://bugreports.qt-project.org/browse/PYSIDE-160 and https://bugreports.qt-project.org/browse/PYSIDE-144 which are memory issues of some sort. Both resulted in crashes which seem similar to yours. The only way I found them was by eliminating code paths bit by bit until I found the crucial element. Both manifested most repeatedly after calls to QLayout::takeAt to replace widgets in views related to a list. I'm assuming this is because the shiboken pointer lists become corrupt and takeAt and subsequent garbage collection aggravated that corruption. Joel From techtonik at gmail.com Fri Apr 26 21:30:05 2013 From: techtonik at gmail.com (anatoly techtonik) Date: Fri, 26 Apr 2013 22:30:05 +0300 Subject: [PySide] New PySide release date In-Reply-To: <517AA8E4.3020109@wingware.com> References: <517AA8E4.3020109@wingware.com> Message-ID: On Fri, Apr 26, 2013 at 7:18 PM, John Ehresman wrote: > On 4/26/13 10:27 AM, Roman Lacko wrote: > > Dear PySide core devs, > > > > what you think about creating new PySide release ? > > I have commited good amount of fixes and enhanecements to PySide setup > > script and i would like to publish new release to PyPI. > > While I want to create a new release, I don't think one is imminent. > There are a few more patches that I'd like to get in and I suspect that > there are a few problems with the current git sources that will need to > be fixed. I've spent some time setting up a system to test against > various qt releases and python releases and I hope to be able to easily > run the test suites against different python versions soon. > Maybe publishing the list of problems can make the next release appear sooner? -------------- next part -------------- An HTML attachment was scrubbed... URL: From backup.rlacko at gmail.com Sat Apr 27 11:37:24 2013 From: backup.rlacko at gmail.com (Roman Lacko) Date: Sat, 27 Apr 2013 11:37:24 +0200 Subject: [PySide] New PySide release date In-Reply-To: <517AA511.8000704@stackless.com> References: <517AA511.8000704@stackless.com> Message-ID: 2013/4/26 Christian Tismer > On 26.04.13 16:27, Roman Lacko wrote: > >> Dear PySide core devs, >> >> what you think about creating new PySide release ? >> I have commited good amount of fixes and enhanecements to PySide setup >> script and i would like to publish new release to PyPI. >> > > Great idea. > Maybe we should fix some small things which are not tested on Python 3? > > For instance pyside_postinstall.py will crash after line 80 because > python 3 returns bytes(). > > Hi Christian, the code is called only when installing on OSX (all OSX code was submitted by Matthew Brett), I can support only Linux and Windows related code. But feel free to send patches :) And please if you have any issues with setup script use issue tracker, thanks. R. > I'd like to volunteer to do some final testing. > > cheers - chris > > -- > Christian Tismer :^) > Software Consulting : Have a break! Take a ride on Python's > Karl-Liebknecht-Str. 121 : *Starship* http://starship.python.net/ > 14482 Potsdam : PGP key -> http://pgp.uni-mainz.de > phone +49 173 24 18 776 fax +49 (30) 700143-0023 > PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 > whom do you want to sponsor today? http://www.stackless.com/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitas at GracefulBoot.com Mon Apr 29 18:26:49 2013 From: vitas at GracefulBoot.com (Vitas Povilaitis) Date: Mon, 29 Apr 2013 12:26:49 -0400 Subject: [PySide] random crashes in pyside during signals In-Reply-To: References: <5176F8DD.9070108@wingware.com> <51786BF5.8020102@wingware.com> Message-ID: I've also been running into a problem under Linux that seems similar to this problem. It occurs when I update a QTableWidget. It seems that after I set QTableWIdgetItems to the table, I occasionally see that a cell becomes a QWidget when I immediately get it back. The code later seg faults. #0 0x00000002 in ?? () #1 0xf78cb057 in PySide::getMetaDataFromQObject (cppSelf=0x86f70c0, self=0xf5bd670c, name=0xf7ee7c20) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/libpyside/pyside.cpp:245 #2 0xf79c2b05 in Sbk_QObject_getattro (self=0xf5bd670c, name=0xf7ee7c20) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/build/PySide/QtCore/PySide/QtCore/qobject_wrapper.cpp:3004 #3 0x080e0f11 in PyEval_EvalFrameEx () #4 0x080e5be1 in PyEval_EvalCodeEx () #5 0x080e4233 in PyEval_EvalFrameEx () #6 0x080e5be1 in PyEval_EvalCodeEx () #7 0x080e4233 in PyEval_EvalFrameEx () #8 0x080e5be1 in PyEval_EvalCodeEx () #9 0x0813f46f in PyClassMethod_New () #10 0x0806389a in PyObject_Call () #11 0x0806d017 in PyClass_IsSubclass () #12 0x0806389a in PyObject_Call () #13 0x080dded2 in PyEval_CallObjectWithKeywords () #14 0x08063930 in PyObject_CallObject () #15 0xf78b9491 in PySide::SignalManager::callPythonMetaMethod (method=@0xffffbd0c, args=0xffffbe2c, pyMethod=0xf5bb3cac, isShortCuit=false) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/libpyside/signalmanager.cpp:466 #16 0xf78b98bc in PySide::SignalManager::qt_metacall (object=0x85fb598, call=QMetaObject::InvokeMetaMethod, id=37, args=0xffffbe2c) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/libpyside/signalmanager.cpp:572 #17 0xf69f8598 in QDialogWrapper::qt_metacall (this=0x85fb598, call=QMetaObject::InvokeMetaMethod, id=37, args=0xffffbe2c) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/build/PySide/QtGui/PySide/QtGui/qdialog_wrapper.cpp:1325 ---Type to continue, or q to quit--- #18 0xf75a90c5 in QMetaObject::metacall () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtCore.so.4 #19 0xf75b8d91 in QMetaObject::activate () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtCore.so.4 #20 0xf65e7239 in QAbstractButton::clicked () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #21 0xf62c4ef9 in QAbstractButton::event () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #22 0xf62c5d54 in QAbstractButton::keyPressEvent () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #23 0xf62c5ffe in QAbstractButton::mouseReleaseEvent () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #24 0xf6cf9e22 in QPushButtonWrapper::mouseReleaseEvent (this=0x86046e0, e=0xffffc73c) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/build/PySide/QtGui/PySide/QtGui/qpushbutton_wrapper.cpp:1029 #25 0xf5f28ae8 in QWidget::event () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #26 0xf62c4d9e in QAbstractButton::event () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #27 0xf63714c5 in QPushButton::event () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #28 0xf6cf77da in QPushButtonWrapper::event (this=0x86046e0, e=0xffffc73c) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/build/PySide/QtGui/PySide/QtGui/qpushbutton_wrapper.cpp:487 #29 0xf5ec7fec in QApplicationPrivate::notify_helper () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #30 0xf5ed0856 in QApplication::notify () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #31 0xf69500b4 in QApplicationWrapper::notify (this=0x85651e8, arg__1=0x86046e0, arg__2=0xffffc73c) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/build/PySide/QtGui/PySide/QtGui/qapplication_wrapper.cpp:348 #32 0xf75a3ccb in QCoreApplication::notifyInternal () ---Type to continue, or q to quit--- from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtCore.so.4 #33 0xf5ecf211 in QApplicationPrivate::sendMouseEvent () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #34 0xf5f5cc7d in QApplication::x11ProcessEvent () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #35 0xf5f5b93b in QApplication::x11ProcessEvent () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #36 0xf5f8756f in QX11Info::copyX11Data () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #37 0xf75a22ca in QEventLoop::processEvents () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtCore.so.4 #38 0xf75a2712 in QEventLoop::exec () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtCore.so.4 #39 0xf75a6789 in QCoreApplication::exec () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtCore.so.4 #40 0xf5ec8097 in QApplication::exec () from /proj/dist/orm/0.4d/dist/x86_linux/lib/libQtGui.so.4 #41 0xf694c7f4 in Sbk_QApplicationFunc_exec_ (self=0x0) at /fs/geom/PM_working_dirs/chuck/pyside/pyside-qt4.8+1.1.2/build/PySide/QtGui/PySide/QtGui/qapplication_wrapper.cpp:1146 #42 0x080e40af in PyEval_EvalFrameEx () #43 0x080e535e in PyEval_EvalFrameEx () #44 0x080e5be1 in PyEval_EvalCodeEx () #45 0x080e5d47 in PyEval_EvalCode () #46 0x08104a5e in PyRun_FileExFlags () #47 0x08104daa in PyRun_SimpleFileExFlags () #48 0x0805ee2d in Py_Main () #49 0x0805e042 in main () The same code works under Windows with no problems. I hope this helps track down the bug, but it makes PySide unusable under Linux. Sincerely, Vitas Povilaitis Vitas Povilaitis (vitas at GracefulBoot.com) Blog for my film: http://beforedecember.blogspot.com/ Preserve due process of the law: http://tinyurl.com/repeal-ndaa Click here for my signature file: http://www.gracefulboot.com/signature On Fri, Apr 26, 2013 at 1:13 PM, Luc-Eric Rousseau wrote: > On Wed, Apr 24, 2013 at 7:34 PM, John Ehresman wrote: > > Do you have a test case? Do you have a subclass of QCheckBox? The > > immediate cause is that mo in SignalManager::retriveMetaObject ends up > > being NULL, but the bug probably occurred earlier. > > > > Thanks, > > I've been trying to isolate in a smaller test case and I haven't been > able to yet. > There was mention of a checkbox in that callstack, however in other > times it's elsewhere (for example as below). I do not have a subclass > of QCheckBox, it might have been the checkbox part of QT's > QListWidget if there was one. The way I'm reproducing the crash 100% > of the time is to click a push button a few times fast that changes > the selection in a QListBox, which then causes another pane to refresh > with new controls. However, if you don't do that, every once in a > while you can click another control elsewhere and *poof*, you'll crash > with the same call stack. It's just harder to reproduce an other way. > So I've come to the conclusion that there isn't anything wrong > specially with that QListWidget UI, it's just much easier to reproduce > it there. > > Btw, I've got a few QScrollArea containing controls. Is are there > known problems with those, control deletion and pyside - I think I've > seen a discussion about this. > > > #0 PySide::DynamicQMetaObject::update (this=0x0) at > /Users/dev/git/pyside/libpyside/dynamicqmetaobject.cpp:431 > #1 0x0000000140169f66 in PySide::SignalManager::retriveMetaObject > (self=0x15492fb90) at > /Users/dev/git/pyside/libpyside/signalmanager.cpp:561 > #2 0x000000014d73e919 in QWidgetWrapper::metaObject > (this=0x13e5e1070) at > > /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp:1332 > #3 0x000000014d73f63a in Sbk_QWidget_Init (self=0x1516f8bd8, > args=0x11ffbf050, kwds=0x0) at > > /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp:1460 > #4 0x000000010f8fccc5 in type_call () > [...] > #43 0x000000010f942947 in PyEval_CallObjectWithKeywords () > #44 0x0000000140169731 in PySide::SignalManager::callPythonMetaMethod > (method=@0x7fff5fbfddc0, args=0x7fff5fbfe048, pyMethod=0x14ebac500, > isShortCuit=false) at > /Users/dev/git/pyside/libpyside/signalmanager.cpp:475 > #45 0x0000000140169423 in callMethod (object=0x15428deb0, id=28, > args=0x7fff5fbfe048) at > /Users/dev/git/pyside/libpyside/signalmanager.cpp:581 > #46 0x00000001401690f5 in PySide::SignalManager::qt_metacall > (object=0x15428deb0, call=QMetaObject::InvokeMetaMethod, id=28, > args=0x7fff5fbfe048) at > /Users/dev/git/pyside/libpyside/signalmanager.cpp:428 > #47 0x000000014d73e994 in QWidgetWrapper::qt_metacall > (this=0x15428deb0, call=QMetaObject::InvokeMetaMethod, id=28, > args=0x7fff5fbfe048) at > > /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp:1338 > #48 0x000000010dd12d75 in QMetaObject::activate () > #49 0x000000010e589d41 in QAbstractButton::clicked () > #50 0x000000010e2fc58e in QAbstractButtonPrivate::emitClicked () > #51 0x000000010e2fd2aa in QAbstractButtonPrivate::click () > #52 0x000000010e2fd46c in QAbstractButton::mouseReleaseEvent () > #53 0x000000010e3b7262 in QToolButton::mouseReleaseEvent () > #54 0x000000014d69e3b5 in QToolButtonWrapper::mouseReleaseEvent > (this=0x15428f290, arg__1=0x7fff5fbfec38) at > > /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qtoolbutton_wrapper.cpp:1020 > #55 0x000000010dff5c0d in QWidget::event () > #56 0x000000010e2fc557 in QAbstractButton::event () > #57 0x000000010e3b6e82 in QToolButton::event () > #58 0x000000014d69a1ff in QToolButtonWrapper::event (this=0x15428f290, > e=0x7fff5fbfec38) at > > /Users/dev/git/pyside/build/PySide/QtGui/PySide/QtGui/qtoolbutton_wrapper.cpp:478 > #59 0x000000010dfaad52 in QApplicationPrivate::notify_helper () > #60 0x000000010dfab698 in QApplication::notify () > #61 0x0000000102820fcb in QxxxApplication::notify (this=0x11a223760, > receiver=0x15428f290, event=0x7fff5fbfec38) at > QmayaApplication.cpp:153 > #62 0x000000010dcfdfc6 in QCoreApplication::notifyInternal () > #63 0x000000010dfb3308 in QApplicationPrivate::sendMouseEvent () > #64 0x000000010df62cf4 in qt_mac_handleMouseEvent () > #65 0x00007fff85b75606 in -[NSWindow sendEvent:] () > #66 0x000000010df5a7bf in -[QCocoaWindow sendEvent:] () > #67 0x00007fff85b71674 in -[NSApplication sendEvent:] () > #68 0x000000010df5e140 in -[QNSApplication sendEvent:] () > #69 0x00007fff85a8724a in -[NSApplication run] () > #70 0x000000010df66f3f in QEventDispatcherMac::processEvents () > #71 0x000000010dcfb428 in QEventLoop::exec () > #72 0x000000010dcfe6fb in QCoreApplication::exec () > _______________________________________________ > 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 rdunn at enthought.com Tue Apr 30 00:38:51 2013 From: rdunn at enthought.com (Robin Dunn) Date: Mon, 29 Apr 2013 15:38:51 -0700 Subject: [PySide] Submitting PySide patches Message-ID: <517EF67B.1050604@enthought.com> Hi all, I've got a couple PySide and shiboken patches that are nearly ready to be submitted. Is doing it through Gerrit as described on the Qt wiki still the preferred way to do it? -- Robin Dunn Software Engineer Enthought, Inc. rdunn at enthought.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpe at wingware.com Tue Apr 30 01:34:50 2013 From: jpe at wingware.com (John Ehresman) Date: Mon, 29 Apr 2013 19:34:50 -0400 Subject: [PySide] Submitting PySide patches In-Reply-To: <517EF67B.1050604@enthought.com> References: <517EF67B.1050604@enthought.com> Message-ID: <517F039A.1030009@wingware.com> On 4/29/13 6:38 PM, Robin Dunn wrote: > I've got a couple PySide and shiboken patches that are nearly ready to > be submitted. Is doing it through Gerrit as described on the Qt wiki > still the preferred way to do it? Yes, all patches should be submitted through Gerrit. Please assign them to me for review. Thanks, John