From techtonik at gmail.com Wed Oct 1 20:49:51 2014 From: techtonik at gmail.com (anatoly techtonik) Date: Wed, 1 Oct 2014 21:49:51 +0300 Subject: [PySide] Pyside for iOS? In-Reply-To: <541F5E23.6000200@gmail.com> References: <541F5E23.6000200@gmail.com> Message-ID: Look like iOS support is a Qt5 only feature. http://blog.qt.digia.com/blog/2013/03/05/qt-for-ios-preview/ So before that becomes possible, PySide should be cleaned up and ported to Qt5. On Mon, Sep 22, 2014 at 2:24 AM, Eko Wibowo wrote: > Hi, > > Currently I am researching whether we can do PySide for mobile > development for Android and iOS. > I have tried PySide for Android, and it works well : > http://qt-project.org/wiki/PySide_for_Android_guide > > But, is there any work mentioned for the PySide for iOS? > Haven't found any mention for that > > Thanks, > Eko > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -- anatoly t. From techtonik at gmail.com Wed Oct 1 20:58:06 2014 From: techtonik at gmail.com (anatoly techtonik) Date: Wed, 1 Oct 2014 21:58:06 +0300 Subject: [PySide] Contributing to documentation? In-Reply-To: References: Message-ID: Hi Eric, To answer that question, the first thing is to see how this documentation is built. I found http://qt-project.org/wiki/PySideDevelopment and then at the bottom there is http://qt-project.org/wiki/Generating_PySide_Reference_Documentation It definitely lacks details on what's going on behind the scenes, so I can't say how to fix examples to make them last. IMHO the information about "How this documentation is generated" should be present in API docs. If you can hack on it - that would be a good step forward. On Tue, Sep 2, 2014 at 12:08 AM, Eric Thomson wrote: > As I learn PySide, the online documentation is my lifeline, but there > are quite a few gaps. For instance, at > http://pyside.github.io/docs/pyside/PySide/QtCore/QMimeData.html, we > have the following: > > "There are three approaches for storing custom data in a > PySide.QtCore.QMimeData object: " > > And then...nothing. It does not list the three approaches, which are > described at the Qt documentation in some detail > (http://doc.qt.digia.com/4.6/qmimedata.html). There it is obviously > for C++ users, obviously. > > I would really like to help translate some of this stuff into Python, > where I can, but am not sure how to go about helping, or if such work > would even last. For instance, would such contributions be lost when > documentation is automatically updated? > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -- anatoly t. From sean at seanfisk.com Thu Oct 2 00:00:29 2014 From: sean at seanfisk.com (Sean Fisk) Date: Wed, 1 Oct 2014 18:00:29 -0400 Subject: [PySide] Contributing to documentation? In-Reply-To: References: Message-ID: Hi Eric, A while ago, I wrote a script to generate the PySide documentation . It’s intensely complex because it requires a qdoc3 executable from Qt 4.6.4 for XML output support (if my memory serves). That repository might be a place to start. For what it’s worth, I usually just use the C++ documentation and prior knowledge of porting patterns to write my PySide code. I realize that’s not really an answer, but it’s worked for me thus far. Good luck, ​ -- Sean Fisk On Mon, Sep 1, 2014 at 5:08 PM, Eric Thomson wrote: > As I learn PySide, the online documentation is my lifeline, but there > are quite a few gaps. For instance, at > http://pyside.github.io/docs/pyside/PySide/QtCore/QMimeData.html, we > have the following: > > "There are three approaches for storing custom data in a > PySide.QtCore.QMimeData object: " > > And then...nothing. It does not list the three approaches, which are > described at the Qt documentation in some detail > (http://doc.qt.digia.com/4.6/qmimedata.html). There it is obviously > for C++ users, obviously. > > I would really like to help translate some of this stuff into Python, > where I can, but am not sure how to go about helping, or if such work > would even last. For instance, would such contributions be lost when > documentation is automatically updated? > _______________________________________________ > 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 techtonik at gmail.com Thu Oct 2 20:58:30 2014 From: techtonik at gmail.com (anatoly techtonik) Date: Thu, 2 Oct 2014 21:58:30 +0300 Subject: [PySide] Contributing to documentation? In-Reply-To: References: Message-ID: In addition, there is now a new Documentation component in PySide bug tracker at https://bugreports.qt-project.org/browse/PYSIDE On Thu, Oct 2, 2014 at 1:00 AM, Sean Fisk wrote: > Hi Eric, > > A while ago, I wrote a script to generate the PySide documentation. It’s > intensely complex because it requires a qdoc3 executable from Qt 4.6.4 for > XML output support (if my memory serves). That repository might be a place > to start. > > For what it’s worth, I usually just use the C++ documentation and prior > knowledge of porting patterns to write my PySide code. I realize that’s not > really an answer, but it’s worked for me thus far. > > Good luck, > > > > -- > Sean Fisk > > On Mon, Sep 1, 2014 at 5:08 PM, Eric Thomson wrote: >> >> As I learn PySide, the online documentation is my lifeline, but there >> are quite a few gaps. For instance, at >> http://pyside.github.io/docs/pyside/PySide/QtCore/QMimeData.html, we >> have the following: >> >> "There are three approaches for storing custom data in a >> PySide.QtCore.QMimeData object: " >> >> And then...nothing. It does not list the three approaches, which are >> described at the Qt documentation in some detail >> (http://doc.qt.digia.com/4.6/qmimedata.html). There it is obviously >> for C++ users, obviously. >> >> I would really like to help translate some of this stuff into Python, >> where I can, but am not sure how to go about helping, or if such work >> would even last. For instance, would such contributions be lost when >> documentation is automatically updated? >> _______________________________________________ >> 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 > -- anatoly t. From techtonik at gmail.com Thu Oct 2 21:18:50 2014 From: techtonik at gmail.com (anatoly techtonik) Date: Thu, 2 Oct 2014 22:18:50 +0300 Subject: [PySide] Status of API Extractor Message-ID: It looks like API Extractor is no longer alive. I've updated broken links to its documentation on wiki page. It is said that it is no longer needed, so was it just abandoned or is it merged into Shiboken? http://qt-project.org/wiki/PySide_API_Extractor And how does this diagram look like now? It mentions API Extractor. Is it actual? http://qt-project.org/wiki/PySide_Binding_Generator -- anatoly t. From rymg19 at gmail.com Thu Oct 2 21:43:04 2014 From: rymg19 at gmail.com (Ryan Gonzalez) Date: Thu, 2 Oct 2014 14:43:04 -0500 Subject: [PySide] Status of API Extractor In-Reply-To: References: Message-ID: I *think* it got merged in do to the ApiExtractor folder in the Shiboken source. Not quite sure, though. On Thu, Oct 2, 2014 at 2:18 PM, anatoly techtonik wrote: > It looks like API Extractor is no longer alive. I've updated broken > links to its documentation on wiki page. It is said that it is no > longer needed, so was it just abandoned or is it merged into Shiboken? > > http://qt-project.org/wiki/PySide_API_Extractor > > And how does this diagram look like now? It mentions API Extractor. Is > it actual? > http://qt-project.org/wiki/PySide_Binding_Generator > -- > anatoly t. > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -- Ryan If anybody ever asks me why I prefer C++ to C, my answer will be simple: "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was nul-terminated." Personal reality distortion fields are immune to contradictory evidence. - srean Check out my website: http://kirbyfan64.github.io/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpe at wingware.com Thu Oct 2 21:44:48 2014 From: jpe at wingware.com (John Ehresman) Date: Thu, 02 Oct 2014 15:44:48 -0400 Subject: [PySide] Status of API Extractor In-Reply-To: References: Message-ID: <542DAB30.2080709@wingware.com> On 10/2/14, 3:18 PM, anatoly techtonik wrote: > It looks like API Extractor is no longer alive. I've updated broken > links to its documentation on wiki page. It is said that it is no > longer needed, so was it just abandoned or is it merged into Shiboken? > > http://qt-project.org/wiki/PySide_API_Extractor It was merged into shiboken. > And how does this diagram look like now? It mentions API Extractor. Is > it actual? > http://qt-project.org/wiki/PySide_Binding_Generator The components in the top diagram are all within shiboken; I'd consider them implementation details of the shiboken generator. John From techtonik at gmail.com Thu Oct 2 21:48:53 2014 From: techtonik at gmail.com (anatoly techtonik) Date: Thu, 2 Oct 2014 22:48:53 +0300 Subject: [PySide] Status of API Extractor In-Reply-To: <542DAB30.2080709@wingware.com> References: <542DAB30.2080709@wingware.com> Message-ID: On Thu, Oct 2, 2014 at 10:44 PM, John Ehresman wrote: > On 10/2/14, 3:18 PM, anatoly techtonik wrote: >> >> It looks like API Extractor is no longer alive. I've updated broken >> links to its documentation on wiki page. It is said that it is no >> longer needed, so was it just abandoned or is it merged into Shiboken? >> >> http://qt-project.org/wiki/PySide_API_Extractor > > It was merged into shiboken. Thanks for clarification. I wonder where is the documentation for the typesystem now? http://pyside.github.io/docs/shiboken/contents.html I can see it on old API Extractor pages: http://pyside.github.io/docs/api-extractor/typesystem.html but it is not linked from anywhere. Is it still actual? >> And how does this diagram look like now? It mentions API Extractor. Is >> it actual? >> http://qt-project.org/wiki/PySide_Binding_Generator > > The components in the top diagram are all within shiboken; I'd consider them > implementation details of the shiboken generator. Looks like this wiki page needs an update for that. -- anatoly t. From JeffHoogland at linux.com Sat Oct 4 01:38:46 2014 From: JeffHoogland at linux.com (Jeff Hoogland) Date: Fri, 3 Oct 2014 18:38:46 -0500 Subject: [PySide] Have application listen for certain key strokes while out of focus (such as multi-media keys) Message-ID: I’m working on creating an application that plays music and I would like to have the ability for the application to have hotkeys for triggering play/pause/next track/volume up/down while it is out of focus (by default via multi-media keys). Does anyone know if there is a good example out there somewhere of how you would have PySide listen for defined key combinations to trigger such events? I’ve been looking online with no luck. -- ~Jeff Hoogland -------------- next part -------------- An HTML attachment was scrubbed... URL: From JMohler at Gamry.com Wed Oct 8 19:32:37 2014 From: JMohler at Gamry.com (Joel B. Mohler) Date: Wed, 08 Oct 2014 13:32:37 -0400 Subject: [PySide] QtNetwork.QSslSocket.supportsSsl() Message-ID: <54357535.8050307@Gamry.com> I just found an annoying bit in PySide.__init__ while examining application start-up time. On my windows 7 32 bit machine, the call to QtNetwork.QSslSocket.supportsSsl() takes almost exactly 1 second. This seems inappropriate to me to force that call at that location since it takes that long. Many applications would be conceivable that don't use QtNetwork at all or ssl but they all need to pay that cost. A related point is that I might want to use QSplashScreen but the most basic PySide import already imposes this 1-second delay. That partly defeats the purpose of the splash screen. My question is two-fold then: 1) Is there a plausible way to generally delay the action until it is more specifically needed? 2) Is there a way I can forcibly remove that check for myself in a maintainable way? Well, there is sort of an answer to #2 by deleting the openssl directory since my app uses pure python for network access (if any) -- that's ugly to have to delete it though. It's frustrating that I can't monkey patch this because I have to import PySide to monkeypatch and then the time is already wasted. Joel From backup.rlacko at gmail.com Wed Oct 8 21:16:17 2014 From: backup.rlacko at gmail.com (Roman Lacko) Date: Wed, 8 Oct 2014 21:16:17 +0200 Subject: [PySide] QtNetwork.QSslSocket.supportsSsl() In-Reply-To: <54357535.8050307@Gamry.com> References: <54357535.8050307@Gamry.com> Message-ID: What about adding some environment variable check, PYSIDE_INIT_OPENSSL: # On Windows add the PySide\openssl folder (if it exists) to the # PATH so the SSL DLLs can be found when Qt tries to dynamically # load them. Tell Qt to load them and then reset the PATH. if sys.platform == 'win32': initOpenSsl = os.environ['PYSIDE_INIT_OPENSSL'] opensslDir = os.path.join(pysideDir, 'openssl') if initOpenSsl and os.path.exists(opensslDir): path = os.environ['PATH'] try: os.environ['PATH'] = opensslDir + os.pathsep + path try: from . import QtNetwork except ImportError: pass else: QtNetwork.QSslSocket.supportsSsl() finally: os.environ['PATH'] = path 2014-10-08 19:32 GMT+02:00 Joel B. Mohler : > I just found an annoying bit in PySide.__init__ while examining > application start-up time. On my windows 7 32 bit machine, the call to > QtNetwork.QSslSocket.supportsSsl() takes almost exactly 1 second. > This seems inappropriate to me to force that call at that location since > it takes that long. Many applications would be conceivable that don't > use QtNetwork at all or ssl but they all need to pay that cost. > > A related point is that I might want to use QSplashScreen but the most > basic PySide import already imposes this 1-second delay. That partly > defeats the purpose of the splash screen. > > My question is two-fold then: > 1) Is there a plausible way to generally delay the action until it is > more specifically needed? > 2) Is there a way I can forcibly remove that check for myself in a > maintainable way? > > Well, there is sort of an answer to #2 by deleting the openssl directory > since my app uses pure python for network access (if any) -- that's ugly > to have to delete it though. It's frustrating that I can't monkey patch > this because I have to import PySide to monkeypatch and then the time is > already wasted. > > Joel > > _______________________________________________ > 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 me at the-compiler.org Wed Oct 8 22:35:57 2014 From: me at the-compiler.org (Florian Bruhin) Date: Wed, 8 Oct 2014 22:35:57 +0200 Subject: [PySide] QtNetwork.QSslSocket.supportsSsl() In-Reply-To: <54357535.8050307@Gamry.com> References: <54357535.8050307@Gamry.com> Message-ID: <20141008203557.GA23422@lupin> * Joel B. Mohler [2014-10-08 13:32:37 -0400]: > I just found an annoying bit in PySide.__init__ while examining > application start-up time. Sorry for the (slight) offtopic, but how do you measure this? All the profilers I've checked so far don't profile what happens inside Qt and the mainloop when Python isn't involved. I'd be glad if there is some way to do this :) > On my windows 7 32 bit machine, the call to > QtNetwork.QSslSocket.supportsSsl() takes almost exactly 1 second. With my PyQt applications, I *sometimes* have a similiar delay when initializing the QNetworkAccessManager the first time. Maybe this is the same issue? I thought it happens more when I have a slow network connection (I always notice it when I'm in a bus) but some experiments and wireshark dumps seem to tell me it's not actually doing any network stuff. My bugreport: https://github.com/The-Compiler/qutebrowser/issues/147 > This seems inappropriate to me to force that call at that location since > it takes that long. Many applications would be conceivable that don't > use QtNetwork at all or ssl but they all need to pay that cost. Is this a Qt or a PySide(/PyQt?) issue? > A related point is that I might want to use QSplashScreen but the most > basic PySide import already imposes this 1-second delay. That partly > defeats the purpose of the splash screen. You probably (just a wild guess though) can import QSplashScreen without importing anything QtNetwork related. Then you'd just have to adjust your imports so the splashscreen gets shown before everthing else is reported. There also seem some approaches to lazily import stuff when it is first used, I tracked some ideas here: https://github.com/The-Compiler/qutebrowser/issues/153 Florian -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From JMohler at Gamry.com Wed Oct 8 22:50:45 2014 From: JMohler at Gamry.com (Joel B. Mohler) Date: Wed, 08 Oct 2014 16:50:45 -0400 Subject: [PySide] QtNetwork.QSslSocket.supportsSsl() In-Reply-To: <20141008203557.GA23422@lupin> References: <54357535.8050307@Gamry.com> <20141008203557.GA23422@lupin> Message-ID: <5435A3A5.2020606@Gamry.com> On 10/8/2014 4:35 PM, Florian Bruhin wrote: > * Joel B. Mohler [2014-10-08 13:32:37 -0400]: >> I just found an annoying bit in PySide.__init__ while examining >> application start-up time. > Sorry for the (slight) offtopic, but how do you measure this? All the > profilers I've checked so far don't profile what happens inside Qt and > the mainloop when Python isn't involved. I'd be glad if there is some > way to do this :) Right, I'm using the standard python profiler and it won't measure inside C function calls. However, in this case that was enough to highlight this specific code in PySide. I actually use IPython and type "%prun import PySide". I show the output in the PS (because IPython is extremely handy and worth illustrating!). >> On my windows 7 32 bit machine, the call to >> QtNetwork.QSslSocket.supportsSsl() takes almost exactly 1 second. > With my PyQt applications, I *sometimes* have a similiar delay when > initializing the QNetworkAccessManager the first time. Maybe this is > the same issue? It might be the same thing in a different form. Whether or not "supportsSsl" is legitimately taking 1 second, I don't really know (or care). The reason I don't care is because I don't want to call it at all, but PySide has coded it directly in the root PySide.__init__: https://qt.gitorious.org/pyside/pyside/source/0c64d1b2c6e5e0951675ad9b22294db4a10741c7:PySide/__init__.py.in#L37 Joel PS: C:\> ipython Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] Type "copyright", "credits" or "license" for more information. IPython 2.2.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: %prun import PySide 1476 function calls (1473 primitive calls) in 0.975 seconds Ordered by: internal time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.941 0.941 0.941 0.941 {supportsSsl} 1 0.018 0.018 0.018 0.018 _utils.py:91(get_pyside_dir) 1 0.007 0.007 0.975 0.975 :1() 1 0.005 0.005 0.968 0.968 __init__.py:6(_setupQtDirectories) 21 0.001 0.000 0.001 0.000 {nt._isdir} ..... From JMohler at Gamry.com Wed Oct 8 22:56:34 2014 From: JMohler at Gamry.com (Joel B. Mohler) Date: Wed, 08 Oct 2014 16:56:34 -0400 Subject: [PySide] QtNetwork.QSslSocket.supportsSsl() In-Reply-To: References: <54357535.8050307@Gamry.com> Message-ID: <5435A502.8060804@Gamry.com> On 10/8/2014 3:16 PM, Roman Lacko wrote: > What about adding some environment variable check, PYSIDE_INIT_OPENSSL: This went through my mind too so I'm glad to hear a vote in this direction from somebody else. I also agree with the semantics of your boolean -- you should have to explicitly set this to have this code run. My rationale for this is that I tend to view my work as Python first and would use Python libraries for my networking rather than PySide if possible. If I don't hear any ideas to the contrary, I'll probably put this in a patch in the next day or so. > > # On Windows add the PySide\openssl folder (if it exists) to the > # PATH so the SSL DLLs can be found when Qt tries to dynamically > # load them. Tell Qt to load them and then reset the PATH. > if sys.platform == 'win32': > initOpenSsl = os.environ['PYSIDE_INIT_OPENSSL'] > opensslDir = os.path.join(pysideDir, 'openssl') > if initOpenSsl and os.path.exists(opensslDir): > path = os.environ['PATH'] > try: > os.environ['PATH'] = opensslDir + os.pathsep + path > try: > from . import QtNetwork > except ImportError: > pass > else: > QtNetwork.QSslSocket.supportsSsl() > finally: > os.environ['PATH'] = path From backup.rlacko at gmail.com Wed Oct 8 23:41:48 2014 From: backup.rlacko at gmail.com (Roman Lacko) Date: Wed, 8 Oct 2014 23:41:48 +0200 Subject: [PySide] QtNetwork.QSslSocket.supportsSsl() In-Reply-To: <5435A502.8060804@Gamry.com> References: <54357535.8050307@Gamry.com> <5435A502.8060804@Gamry.com> Message-ID: 2014-10-08 22:56 GMT+02:00 Joel B. Mohler : > On 10/8/2014 3:16 PM, Roman Lacko wrote: > > What about adding some environment variable check, PYSIDE_INIT_OPENSSL: > > This went through my mind too so I'm glad to hear a vote in this > direction from somebody else. I also agree with the semantics of your > boolean -- you should have to explicitly set this to have this code > run. My rationale for this is that I tend to view my work as Python > first and would use Python libraries for my networking rather than > PySide if possible. > I just realized that for backward compatibility it would be better to leave the actual behavior and let users to explicitly disable loading the openssl libs. But this is subject to further discussion... > > If I don't hear any ideas to the contrary, I'll probably put this in a > patch in the next day or so. > > > > > # On Windows add the PySide\openssl folder (if it exists) to the > > # PATH so the SSL DLLs can be found when Qt tries to dynamically > > # load them. Tell Qt to load them and then reset the PATH. > > if sys.platform == 'win32': > > initOpenSsl = os.environ['PYSIDE_INIT_OPENSSL'] > > opensslDir = os.path.join(pysideDir, 'openssl') > > if initOpenSsl and os.path.exists(opensslDir): > > path = os.environ['PATH'] > > try: > > os.environ['PATH'] = opensslDir + os.pathsep + path > > try: > > from . import QtNetwork > > except ImportError: > > pass > > else: > > QtNetwork.QSslSocket.supportsSsl() > > finally: > > os.environ['PATH'] = path > > > _______________________________________________ > 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 Wed Oct 8 23:58:40 2014 From: backup.rlacko at gmail.com (Roman Lacko) Date: Wed, 8 Oct 2014 23:58:40 +0200 Subject: [PySide] QtNetwork.QSslSocket.supportsSsl() In-Reply-To: References: <54357535.8050307@Gamry.com> <5435A502.8060804@Gamry.com> Message-ID: 2014-10-08 23:41 GMT+02:00 Roman Lacko : > 2014-10-08 22:56 GMT+02:00 Joel B. Mohler : > >> On 10/8/2014 3:16 PM, Roman Lacko wrote: >> > What about adding some environment variable check, PYSIDE_INIT_OPENSSL: >> >> This went through my mind too so I'm glad to hear a vote in this >> direction from somebody else. I also agree with the semantics of your >> boolean -- you should have to explicitly set this to have this code >> run. My rationale for this is that I tend to view my work as Python >> first and would use Python libraries for my networking rather than >> PySide if possible. >> > > I just realized that for backward compatibility it would be better to > leave the actual behavior and let users to explicitly disable loading the > openssl libs. But this is subject to further discussion... > the sample implementation can look like this: if sys.platform == 'win32': ignoreOpenSsl = os.environ['PYSIDE_IGNORE_ OPENSSL'] opensslDir = os.path.join(pysideDir, 'openssl') if not ignoreOpenSsl and os.path.exists(opensslDir): path = os.environ['PATH'] ... > > > >> >> If I don't hear any ideas to the contrary, I'll probably put this in a >> patch in the next day or so. >> >> > >> > # On Windows add the PySide\openssl folder (if it exists) to the >> > # PATH so the SSL DLLs can be found when Qt tries to dynamically >> > # load them. Tell Qt to load them and then reset the PATH. >> > if sys.platform == 'win32': >> > initOpenSsl = os.environ['PYSIDE_INIT_OPENSSL'] >> > opensslDir = os.path.join(pysideDir, 'openssl') >> > if initOpenSsl and os.path.exists(opensslDir): >> > path = os.environ['PATH'] >> > try: >> > os.environ['PATH'] = opensslDir + os.pathsep + path >> > try: >> > from . import QtNetwork >> > except ImportError: >> > pass >> > else: >> > QtNetwork.QSslSocket.supportsSsl() >> > finally: >> > os.environ['PATH'] = path >> >> >> _______________________________________________ >> 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 pflegit at gmail.com Fri Oct 10 16:35:59 2014 From: pflegit at gmail.com (Pat Flegit) Date: Fri, 10 Oct 2014 10:35:59 -0400 Subject: [PySide] Can the developers add support for setEventFilter? Message-ID: PySide currently does not include QAbstractEventDispatcher.setEventFilter(), which makes catching certain events like WM_HOTKEY impossible. (A regular eventFilter or winEventFilter do not work for this.) Is it possible to add support for QAbstractEventDispatcher.setEventFilter()? PyQt has it. This would enable code like this: http://www.riverbankcomputing.com/pipermail/pyqt/2011-March/029449.html , which uses QAbstractEventDispatcher.instance().setEventFilter(myEventFilter) (Ironically, the post I linked to is what caused PyQt to add support for setEventFilter.) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Thorsten.Kaufmann at mackevision.com Wed Oct 15 12:12:00 2014 From: Thorsten.Kaufmann at mackevision.com (Thorsten Kaufmann) Date: Wed, 15 Oct 2014 10:12:00 +0000 Subject: [PySide] Anything like qtwinmigrate for PySide? Message-ID: <1413462ff31e4050921184c719a1a947@SV-STR-EX001.mvision.lan> Hi there, is there anything for PySide that serves the same purpose (parenting Qt Widgets with MFC/win32 Applications on windows). Anything that is NOT an addon (using ctypes or whatever) would be even better. Purpose: 3D Studio Max now comes with integrated Python and includes a PySide distribution, but windows created with that are no child window of the main window. There is a "SetAsParent" function, but that restricts the window to be INSIDE the main window only which does not really help. Cheers, Thorsten --- Thorsten Kaufmann Production Pipeline Architect Mackevision Medien Design GmbH Forststra?e 7 70174 Stuttgart T +49 711 93 30 48 606 F +49 711 93 30 48 90 M +49 151 19 55 55 02 Thorsten.Kaufmann at mackevision.com www.mackevision.de Gesch?ftsf?hrer: Armin Pohl, Joachim Lincke, Karin Suttheimer HRB 243735 Amtsgericht Stuttgart --- MACKEVISION SHOWREEL: Out now! ANIMAGO AWARD: Die Projekte "Game of Thrones" und "Mercedes-Benz 4MATIC Schneemonster" sind f?r den renommierten Animago Award nominiert. REFERENZEN: Mackevision inszeniert den Porsche Macan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From John.Black at cor.gov Mon Oct 20 20:22:07 2014 From: John.Black at cor.gov (John.Black at cor.gov) Date: Mon, 20 Oct 2014 13:22:07 -0500 Subject: [PySide] questions about changes to Qt open-source related to pyside Message-ID: I am a novice Python programmer and have been using Qt 4.8 with Pyside successfully for over a year. https://pypi.python.org/pypi/PySide/1.2.2 The way I understand it, Qt is owned by Digia which licenses Qt 5.4, but the open source version, Qt 4.8 has been available for free. It now appears that Digia is now offering the open source version as LPGL-version 3 from their corporate web-site - I'm trying to understand this without hiring a lawyer ;-) http://blog.qt.digia.com/blog/2014/08/20/adding-lgpl-v3-to-qt/ http://www.gnu.org/licenses/ The open source product (Community Version) is available from: http://www.qt.io/download/ I did not try installing the Community Version because I don't want to disrupt my current development environment. Can someone tell me if Pyside is going to incorporate the Qt 5.4 Community Version and whether it will be available on https://pypi.python.org/pypi ? I really like using Qt Designer to build my GUI interface in Python but I'm confused about where Pyside will be a year from now and whether I should be moving to the Community Version from Digia??? Thanks in advance, John Black Traffic Operations Engineer 972-744-4468 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2B887634.gif Type: image/gif Size: 18558 bytes Desc: not available URL: From thomson.eric at gmail.com Tue Oct 21 18:38:47 2014 From: thomson.eric at gmail.com (Eric Thomson) Date: Tue, 21 Oct 2014 12:38:47 -0400 Subject: [PySide] Contributing to documentation? In-Reply-To: References: Message-ID: Thanks a lot for those suggestions, and the information about how the documentation is generated. I will look at the documentation side of the bug tracker, that seems like an excellent place to start. On 10/2/14, anatoly techtonik wrote: > In addition, there is now a new Documentation component in PySide bug > tracker at https://bugreports.qt-project.org/browse/PYSIDE > > On Thu, Oct 2, 2014 at 1:00 AM, Sean Fisk wrote: >> Hi Eric, >> >> A while ago, I wrote a script to generate the PySide documentation. It’s >> intensely complex because it requires a qdoc3 executable from Qt 4.6.4 >> for >> XML output support (if my memory serves). That repository might be a >> place >> to start. >> >> For what it’s worth, I usually just use the C++ documentation and prior >> knowledge of porting patterns to write my PySide code. I realize that’s >> not >> really an answer, but it’s worked for me thus far. >> >> Good luck, >> >> >> >> -- >> Sean Fisk >> >> On Mon, Sep 1, 2014 at 5:08 PM, Eric Thomson >> wrote: >>> >>> As I learn PySide, the online documentation is my lifeline, but there >>> are quite a few gaps. For instance, at >>> http://pyside.github.io/docs/pyside/PySide/QtCore/QMimeData.html, we >>> have the following: >>> >>> "There are three approaches for storing custom data in a >>> PySide.QtCore.QMimeData object: " >>> >>> And then...nothing. It does not list the three approaches, which are >>> described at the Qt documentation in some detail >>> (http://doc.qt.digia.com/4.6/qmimedata.html). There it is obviously >>> for C++ users, obviously. >>> >>> I would really like to help translate some of this stuff into Python, >>> where I can, but am not sure how to go about helping, or if such work >>> would even last. For instance, would such contributions be lost when >>> documentation is automatically updated? >>> _______________________________________________ >>> 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 >> > > > > -- > anatoly t. > From jf_byrnes at comcast.net Wed Oct 22 02:15:06 2014 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Tue, 21 Oct 2014 19:15:06 -0500 Subject: [PySide] Error installing PySide Message-ID: I am trying to install PySide 1.2.2 on Ubuntu 12.04 fully up to date. I have been following the instructions here: http://pyside.readthedocs.org/en/latest/building/linux.html I get down to step 4 under Building PySide distribution and get this error: jfb at jims1204:~$ cd PySide-1.2.2 jfb at jims1204:~/PySide-1.2.2$ python2.7 setup.py bdist_wheel --qmake=/usr/bin/qmake-qt4 Removing /home/jfb/PySide-1.2.2/pyside_package usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'bdist_wheel' If I do pip list I see that wheel was installed. Can anyone tell me how to get past this error? Thanks, Jim From backup.rlacko at gmail.com Wed Oct 22 09:15:51 2014 From: backup.rlacko at gmail.com (Roman Lacko) Date: Wed, 22 Oct 2014 09:15:51 +0200 Subject: [PySide] Error installing PySide In-Reply-To: References: Message-ID: Hi, Did you install all prerequisities from install instructions ? I did quick test on latest Ubuntu 12.04 and everything works. Thanks R. 2014-10-22 2:15 GMT+02:00 Jim Byrnes : > I am trying to install PySide 1.2.2 on Ubuntu 12.04 fully up to date. > > I have been following the instructions here: > http://pyside.readthedocs.org/en/latest/building/linux.html > > I get down to step 4 under Building PySide distribution and get this error: > > jfb at jims1204:~$ cd PySide-1.2.2 > jfb at jims1204:~/PySide-1.2.2$ python2.7 setup.py bdist_wheel > --qmake=/usr/bin/qmake-qt4 > Removing /home/jfb/PySide-1.2.2/pyside_package > usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] > or: setup.py --help [cmd1 cmd2 ...] > or: setup.py --help-commands > or: setup.py cmd --help > > error: invalid command 'bdist_wheel' > > If I do pip list I see that wheel was installed. > > Can anyone tell me how to get past this error? > > Thanks, Jim > > > _______________________________________________ > 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 alexandre.gauthier-foichat at inria.fr Wed Oct 22 09:19:11 2014 From: alexandre.gauthier-foichat at inria.fr (Alexandre) Date: Wed, 22 Oct 2014 09:19:11 +0200 Subject: [PySide] Python bindings generation Message-ID: Hi, First of all thank you for the amazing development regarding Pyside. We’re currently in the process of implementing Python bindings for the C++ based application Natron (https://github.com/MrKepzie/Natron ). We’re using Shiboken and are running into some issues which maybe some of you can answer ;) 1) One of the main issue I have is to understand what needs to have a conversion-rule and what needs not. For example is this kind of conversion really needed ? return PyLong_FromSize_t(%in); %out = %OUTTYPE(PyLong_AsSsize_t(%in)); Couldn't someone just write PyObject* %out = PyString_AsStringAndSize(%in.c_str(),%in.size()); return %out; char* cstr = PyString_AsString(%in); %out = std::string(cstr); return %out; But I have no clue if this is the right way to do it. 2) About STL containers I saw that for QtCore, templates are used to convert all containers, I decided then to do the same for all STL containers, this way : But when running shiboken2-7 with the include-paths and typesystem-paths pointing to the template files I get the following: insert-template referring to non-existing template 'stdListToPyList' With the templates defined as such: 3) I don’t understand the separation between primitive/value/container/object types, to me they all sound the same. In which category should a C++ template class fall-in ? A container or an object ? 4) Also after reading the following documentation on Shiboken github https://github.com/PySide/shiboken-docs/blob/master/docs/typeconverters.rst I saw that this is possible to write a template Converter class with a toPython and toCpp methods to handle the conversion. What does this technique offers ? Is this just a different way to provide a conversion rule ? 5) Is it right that in order to be able to use %CONVERTTOPYTHON one must provide a conversion-rule for that primitive/value/object beforehand ? 6) I have some global functions in a namespace, such as the following : namespace XXX { inline std::list getPluginIDs() { // Code logic } } In the type system file should I list this function under then XXX namespace tag the following way: Or is the namespace-type tag not at all needed ? Well whatever is the good way to bind global function in a namespace, I always get the following error: Global function 'getPluginIDs()' is specified in typesystem, but not defined. This could potentially lead to compilation errors. But in mjb_rejected_functions.log I can’t see any error regarding this function. Is this because the return type std::list is not recognised ? That’s weird because I provided a conversion for it already in the type system. 7) Finally I reported a bug here https://bugreports.qt-project.org/browse/PYSIDE-260 because I can’t figure out why there are QtGui includes in a QtCore module! Our application is really segmented and the “Core” part relies on QtCore and the “Gui” part relies on QtGui, using QtGui for the “Core” part is really not an option because we may want to use our application on a device without a display server for instance. 8) I had some segmentation faults because of boost includes, I had to define #define SBK_RUN (the same way Q_MOC_RUN is defined for moc) in the global.h header of my library and wrap up all boost include with a #ifndef SBK_RUN and the crash was gone. Maybe you could document it somewhere;) Anyway, that’s all for the swarm of questions for now;) Thank you for developing this and taking your time to answer to my questions. The bindings generation looks really great but maybe a bit more explanations and guidance on how to write the type system would be great;) Having to look into the typesystem_core.xml file is quite complicated when you’re not familiar with all the philosophy around Shiboken! Just for the record, here’s the documentation that I have read so far and I can’t seem to find more doc online: Python binding generation with Shiboken tutorial: http://qt-project.org/wiki/PySide_Binding_Generation_Tutorial tests/samplebinding in the source code repository: https://qt.gitorious.org/pyside/shiboken/source/4e0031258b9098c5dc02b34e5eb570e54307e6b5:tests/samplebinding Typsystem files for QtCore and QtGui in the source code repository: https://qt.gitorious.org/pyside/pyside/source/0c64d1b2c6e5e0951675ad9b22294db4a10741c7:PySide/QtCore Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gauthier-foichat at inria.fr Wed Oct 22 14:29:08 2014 From: alexandre.gauthier-foichat at inria.fr (Alexandre) Date: Wed, 22 Oct 2014 14:29:08 +0200 Subject: [PySide] Python bindings generation In-Reply-To: References: Message-ID: <54003963-C691-43F6-8DBD-A8F11241671F@inria.fr> Hi Tom, Thank you for your quick answer. Indeed with the wrapper around global functions I could make it work!;) However I still don’t understand one thing: If I supplied the a conversion for std::list and for std::string, do I need to also provide a conversion for std::list ? My function signature is the following: inline std::list getPluginIDs() { // Code logic } I’m declaring it in the type system this way: std::list and std::string conversion are declared as told in the previous mail. The generated code by Shiboken looks like this, with empty functions: // C++ to Python conversion for type 'std::list'. static PyObject* std_list_std_string__CppToPython_std_list_std_string_(const void* cppIn) { ::std::list& cppInRef = *((::std::list*)cppIn); } static void std_list_std_string__PythonToCpp_std_list_std_string_(PyObject* pyIn, void* cppOut) { ::std::list& cppOutRef = *((::std::list*)cppOut); } And I get the following warning: insert-template referring to non-existing template 'stdListToPyList' Any clue on what might cause this ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jf_byrnes at comcast.net Wed Oct 22 18:01:53 2014 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Wed, 22 Oct 2014 11:01:53 -0500 Subject: [PySide] Error installing PySide In-Reply-To: References: Message-ID: On 10/22/2014 02:15 AM, Roman Lacko wrote: > Hi, > > Did you install all prerequisities from install instructions ? > > I did quick test on latest Ubuntu 12.04 and everything works. > > Thanks R. Yes I started at the top and worked my way down. I did a little research and found that wheel needs setuptools >= to 0.8.0. My versions was 0.6.xx. I updated that using pip and now it works. I now have PySide installed and working and ready to start the tutorials. Maybe the need for wheel >= to 0.8.0 should be mentioned as a prerequisite? regards, Jim > > 2014-10-22 2:15 GMT+02:00 Jim Byrnes : > >> I am trying to install PySide 1.2.2 on Ubuntu 12.04 fully up to >> date. >> >> I have been following the instructions here: >> http://pyside.readthedocs.org/en/latest/building/linux.html >> >> I get down to step 4 under Building PySide distribution and get >> this error: >> >> jfb at jims1204:~$ cd PySide-1.2.2 jfb at jims1204:~/PySide-1.2.2$ >> python2.7 setup.py bdist_wheel --qmake=/usr/bin/qmake-qt4 Removing >> /home/jfb/PySide-1.2.2/pyside_package usage: setup.py [global_opts] >> cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 >> cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help >> >> error: invalid command 'bdist_wheel' >> >> If I do pip list I see that wheel was installed. >> >> Can anyone tell me how to get past this error? >> >> Thanks, Jim >> >> >> _______________________________________________ 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 backup.rlacko at gmail.com Wed Oct 22 20:31:33 2014 From: backup.rlacko at gmail.com (Roman Lacko) Date: Wed, 22 Oct 2014 20:31:33 +0200 Subject: [PySide] Error installing PySide In-Reply-To: References: Message-ID: I will update the install instructions Thanks R. 2014-10-22 18:01 GMT+02:00 Jim Byrnes : > On 10/22/2014 02:15 AM, Roman Lacko wrote: > > Hi, > > > > Did you install all prerequisities from install instructions ? > > > > I did quick test on latest Ubuntu 12.04 and everything works. > > > > Thanks R. > > Yes I started at the top and worked my way down. > > I did a little research and found that wheel needs setuptools >= to > 0.8.0. My versions was 0.6.xx. I updated that using pip and now it > works. I now have PySide installed and working and ready to start the > tutorials. > > Maybe the need for wheel >= to 0.8.0 should be mentioned as a prerequisite? > > regards, Jim > > > > > 2014-10-22 2:15 GMT+02:00 Jim Byrnes : > > > >> I am trying to install PySide 1.2.2 on Ubuntu 12.04 fully up to > >> date. > >> > >> I have been following the instructions here: > >> http://pyside.readthedocs.org/en/latest/building/linux.html > >> > >> I get down to step 4 under Building PySide distribution and get > >> this error: > >> > >> jfb at jims1204:~$ cd PySide-1.2.2 jfb at jims1204:~/PySide-1.2.2$ > >> python2.7 setup.py bdist_wheel --qmake=/usr/bin/qmake-qt4 Removing > >> /home/jfb/PySide-1.2.2/pyside_package usage: setup.py [global_opts] > >> cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 > >> cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help > >> > >> error: invalid command 'bdist_wheel' > >> > >> If I do pip list I see that wheel was installed. > >> > >> Can anyone tell me how to get past this error? > >> > >> Thanks, Jim > >> > >> > >> _______________________________________________ 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 superslimme at netscape.net Wed Oct 22 20:47:41 2014 From: superslimme at netscape.net (robbert) Date: Wed, 22 Oct 2014 20:47:41 +0200 Subject: [PySide] QStringListModel.stringList returns copy of list. Message-ID: <5447FBCD.3050806@netscape.net> Hi, I'm trying to dynamically add words to a QStringListModel, for the use with a QCompleter. It seems that you cannot add an item to the List returned from stringList. The List returned by stringList seems to be a copy, but the documentation suggests otherwise: stringList(): "Returns the string list used by the model to store data." [1] Is this the correct behavior? Here a snippet to show the effect. from PySide.QtGui import QStringListModel model = QStringListModel(["A", "B", "C"]) print model.stringList() model.stringList().append("D") print model.stringList() myStringList = model.stringList() myStringList.append("E") model.setStringList(myStringList) print model.stringList() Returns: [u'A', u'B', u'C'] [u'A', u'B', u'C'] [u'A', u'B', u'C', u'E'] I would expect "D" to be added to list. Btw, the example given in the documentation doesn't work. The following line works, and should do the same. model = QStringListModel(["a", "b", "c"]) Kind regards, Robbert [1] http://pyside.github.io/docs/pyside/PySide/QtGui/QStringListModel.html#PySide.QtGui.PySide.QtGui.QStringListModel.stringList From jf_byrnes at comcast.net Thu Oct 23 02:17:23 2014 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Wed, 22 Oct 2014 19:17:23 -0500 Subject: [PySide] Why doesn't this example work? Message-ID: In looking at the lists archives, I see that most of the participants seem to be experienced developers. As a novice programmer I hope I am not intruding by asking some basic questions. I am working my way through examples in a PySide book I bought. According to the author the example should display a 200 x 150 window, pause 3 seconds and then display a 300 x 300 window. On my system (Ubuntu 12.04) there is a approx 3 second delay after starting the program and then I see the 300 x 300 window. I never see the first window. Could someone explain to me why it does not act as described? # Import required modules import sys import time from PySide.QtGui import QApplication, QWidget class SampleWindow(QWidget): """ Our main window class """ # Constructor function def __init__(self): QWidget.__init__(self) self.setWindowTitle("Sample Window") self.setGeometry(300, 300, 200, 150) self.setMinimumHeight(100) self.setMinimumWidth(250) self.setMaximumHeight(200) self.setMaximumWidth(800) if __name__ == '__main__': # Exception Handling try: myApp = QApplication(sys.argv) myWindow = SampleWindow() myWindow.show() time.sleep(3) myWindow.resize(300, 300) myWindow.setWindowTitle("Sample Window Resized") myWindow.repaint() myApp.exec_() sys.exit(0) except NameError: print("Name Error:", sys.exc_info()[1]) except SystemExit: print("Closing Window...") except Exception: print (sys.exc_info()[1]) Thanks, Jim From thomson.eric at gmail.com Thu Oct 23 05:50:12 2014 From: thomson.eric at gmail.com (Eric Thomson) Date: Wed, 22 Oct 2014 23:50:12 -0400 Subject: [PySide] Why doesn't this example work? In-Reply-To: References: Message-ID: Try putting myWindow.repaint() before myWindow.show(). That took away the weird behavior on my end. I cannot explain it, though. On 10/22/14, Jim Byrnes wrote: > In looking at the lists archives, I see that most of the participants > seem to be experienced developers. As a novice programmer I hope I am > not intruding by asking some basic questions. > > I am working my way through examples in a PySide book I bought. > According to the author the example should display a 200 x 150 window, > pause 3 seconds and then display a 300 x 300 window. On my system > (Ubuntu 12.04) there is a approx 3 second delay after starting the > program and then I see the 300 x 300 window. I never see the first window. > > Could someone explain to me why it does not act as described? > > # Import required modules > import sys > import time > from PySide.QtGui import QApplication, QWidget > > class SampleWindow(QWidget): > """ Our main window class > """ > > # Constructor function > def __init__(self): > QWidget.__init__(self) > self.setWindowTitle("Sample Window") > self.setGeometry(300, 300, 200, 150) > self.setMinimumHeight(100) > self.setMinimumWidth(250) > self.setMaximumHeight(200) > self.setMaximumWidth(800) > > if __name__ == '__main__': > # Exception Handling > try: > myApp = QApplication(sys.argv) > myWindow = SampleWindow() > myWindow.show() > time.sleep(3) > myWindow.resize(300, 300) > myWindow.setWindowTitle("Sample Window Resized") > myWindow.repaint() > myApp.exec_() > sys.exit(0) > except NameError: > print("Name Error:", sys.exc_info()[1]) > except SystemExit: > print("Closing Window...") > except Exception: > print (sys.exc_info()[1]) > > Thanks, Jim > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > From thomson.eric at gmail.com Thu Oct 23 05:52:26 2014 From: thomson.eric at gmail.com (Eric Thomson) Date: Wed, 22 Oct 2014 23:52:26 -0400 Subject: [PySide] Why doesn't this example work? In-Reply-To: References: Message-ID: I meant to write that I put myWindow.repaint() before time.sleep(3). Incidentally, what book are you working through? On 10/22/14, Eric Thomson wrote: > Try putting > myWindow.repaint() > before myWindow.show(). > > That took away the weird behavior on my end. I cannot explain it, though. > > On 10/22/14, Jim Byrnes wrote: >> In looking at the lists archives, I see that most of the participants >> seem to be experienced developers. As a novice programmer I hope I am >> not intruding by asking some basic questions. >> >> I am working my way through examples in a PySide book I bought. >> According to the author the example should display a 200 x 150 window, >> pause 3 seconds and then display a 300 x 300 window. On my system >> (Ubuntu 12.04) there is a approx 3 second delay after starting the >> program and then I see the 300 x 300 window. I never see the first >> window. >> >> Could someone explain to me why it does not act as described? >> >> # Import required modules >> import sys >> import time >> from PySide.QtGui import QApplication, QWidget >> >> class SampleWindow(QWidget): >> """ Our main window class >> """ >> >> # Constructor function >> def __init__(self): >> QWidget.__init__(self) >> self.setWindowTitle("Sample Window") >> self.setGeometry(300, 300, 200, 150) >> self.setMinimumHeight(100) >> self.setMinimumWidth(250) >> self.setMaximumHeight(200) >> self.setMaximumWidth(800) >> >> if __name__ == '__main__': >> # Exception Handling >> try: >> myApp = QApplication(sys.argv) >> myWindow = SampleWindow() >> myWindow.show() >> time.sleep(3) >> myWindow.resize(300, 300) >> myWindow.setWindowTitle("Sample Window Resized") >> myWindow.repaint() >> myApp.exec_() >> sys.exit(0) >> except NameError: >> print("Name Error:", sys.exc_info()[1]) >> except SystemExit: >> print("Closing Window...") >> except Exception: >> print (sys.exc_info()[1]) >> >> Thanks, Jim >> >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside >> > From sean at seanfisk.com Thu Oct 23 06:26:11 2014 From: sean at seanfisk.com (Sean Fisk) Date: Thu, 23 Oct 2014 00:26:11 -0400 Subject: [PySide] Why doesn't this example work? In-Reply-To: References: Message-ID: Hi Jim, With all due respect to the author of the book, I don’t think this is a very good example. The most important thing to realize is that nothing really happens before the event loop is started. The line: myApp.exec_() is what starts the event loop. Without the event loop running, windows won’t appear, user input cannot be handled, and basically nothing QtGui-related will work. *Even if* windows show up before the event loop is started, they won’t be able to respond to user interaction (as far as I understand). I would personally achieve the desired behavior like so: #!/usr/bin/env python import sys from PySide import QtCore, QtGui class SampleWindow(QtGui.QWidget): def __init__(self, parent=None): super(SampleWindow, self).__init__(parent) self.setWindowTitle('Sample Window') self.setGeometry(300, 300, 200, 150) self.setMinimumHeight(100) self.setMinimumWidth(250) self.setMaximumHeight(200) self.setMaximumWidth(800) @QtCore.Slot() def do_resize(self): self.resize(300, 300) self.setWindowTitle('Sample Window Resized') def main(argv): app = QtGui.QApplication(argv) # Create and show the window. window = SampleWindow() window.show() # PySide windows don't auto-raise on Mac OS X. window.raise_() # Set up a timer to fire 3 seconds *after the event loop starts*. QtCore.QTimer.singleShot(3000, window.do_resize) # Start the event loop. Nothing Qt-related happens until this call. return app.exec_() if __name__ == '__main__': raise SystemExit(main(sys.argv)) The key take-away is that nothing QtGui-related *actually* happens before the event loop is started, and everything is done by the time that it exits. Hope this helps. Feel free to let me know if anything doesn’t make sense. ​ -- Sean Fisk On Wed, Oct 22, 2014 at 8:17 PM, Jim Byrnes wrote: > In looking at the lists archives, I see that most of the participants > seem to be experienced developers. As a novice programmer I hope I am > not intruding by asking some basic questions. > > I am working my way through examples in a PySide book I bought. > According to the author the example should display a 200 x 150 window, > pause 3 seconds and then display a 300 x 300 window. On my system > (Ubuntu 12.04) there is a approx 3 second delay after starting the > program and then I see the 300 x 300 window. I never see the first window. > > Could someone explain to me why it does not act as described? > > # Import required modules > import sys > import time > from PySide.QtGui import QApplication, QWidget > > class SampleWindow(QWidget): > """ Our main window class > """ > > # Constructor function > def __init__(self): > QWidget.__init__(self) > self.setWindowTitle("Sample Window") > self.setGeometry(300, 300, 200, 150) > self.setMinimumHeight(100) > self.setMinimumWidth(250) > self.setMaximumHeight(200) > self.setMaximumWidth(800) > > if __name__ == '__main__': > # Exception Handling > try: > myApp = QApplication(sys.argv) > myWindow = SampleWindow() > myWindow.show() > time.sleep(3) > myWindow.resize(300, 300) > myWindow.setWindowTitle("Sample Window Resized") > myWindow.repaint() > myApp.exec_() > sys.exit(0) > except NameError: > print("Name Error:", sys.exc_info()[1]) > except SystemExit: > print("Closing Window...") > except Exception: > print (sys.exc_info()[1]) > > Thanks, Jim > > _______________________________________________ > 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 alexandre.gauthier-foichat at inria.fr Thu Oct 23 08:12:07 2014 From: alexandre.gauthier-foichat at inria.fr (Alexandre) Date: Thu, 23 Oct 2014 08:12:07 +0200 Subject: [PySide] Python bindings generation In-Reply-To: <54003963-C691-43F6-8DBD-A8F11241671F@inria.fr> References: <54003963-C691-43F6-8DBD-A8F11241671F@inria.fr> Message-ID: <435E37E1-25A1-4FF7-AEFE-A996796897DC@inria.fr> Somehow putting the templates in the same type system.xml solved the > insert-template referring to non-existing template 'stdListToPyList' Now when calling my function getPluginIDs() from Python, I get a crash in the call to convertToPython of std::string, any clue about the crash ? // C++ to Python conversion for type 'std::list'. static PyObject* std_list_std_string__CppToPython_std_list_std_string_(const void* cppIn) { ::std::list& cppInRef = *((::std::list*)cppIn); // TEMPLATE - stdListToPyList - START PyObject* pyOut = PyList_New((int) cppInRef.size()); ::std::list::const_iterator it = cppInRef.begin(); for (int idx = 0; it != cppInRef.end(); ++it, ++idx) { ::std::string cppItem(*it); PyList_SET_ITEM(pyOut, idx, // CRASHING IN THE FOLLOWING LINE Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter(), &cppItem)); } return pyOut; // TEMPLATE - stdListToPyList - END } > On 22 Oct 2014, at 14:29, Alexandre wrote: > > Hi Tom, > > Thank you for your quick answer. > Indeed with the wrapper around global functions I could make it work!;) > > However I still don’t understand one thing: > > If I supplied the a conversion for std::list and for std::string, do I need to also provide a conversion for std::list ? > > My function signature is the following: > > inline std::list > getPluginIDs() > { > // Code logic > } > > > I’m declaring it in the type system this way: > > > > std::list and std::string conversion are declared as told in the previous mail. > The generated code by Shiboken looks like this, with empty functions: > > // C++ to Python conversion for type 'std::list'. > static PyObject* std_list_std_string__CppToPython_std_list_std_string_(const void* cppIn) { > ::std::list& cppInRef = *((::std::list*)cppIn); > > > > } > static void std_list_std_string__PythonToCpp_std_list_std_string_(PyObject* pyIn, void* cppOut) { > ::std::list& cppOutRef = *((::std::list*)cppOut); > > > > } > > > And I get the following warning: > insert-template referring to non-existing template 'stdListToPyList' > Any clue on what might cause this ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexandre.gauthier-foichat at inria.fr Fri Oct 24 00:03:39 2014 From: alexandre.gauthier-foichat at inria.fr (Alexandre gauthier) Date: Fri, 24 Oct 2014 00:03:39 +0200 Subject: [PySide] Shiboken: Binding a function returning a pointer Message-ID: <79E9F22F-76E5-4E2E-86D9-8263DA5E9557@inria.fr> Hi, I have the following C++ function that is going to be binded to Python: Effect Effect::getInput(int inputNumber) const { boost::shared_ptr node = _node->getInput(inputNumber); return Effect(node); } The return value has a bool isNull() const method to determine if the object is valid or not. In the type system I do the following: %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%ARGUMENT_NAMES); if (%0.isNull()) { Py_INCREF(Py_None); %PYARG_0 = Py_None; } else { %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0); } Which is expanded in c++ to : // Begin code injection Effect cppResult = cppSelf->getInput(cppArg0); if (cppResult.isNull()) { Py_INCREF(Py_None); pyResult = Py_None; } else { ///Crash in the following line pyResult = Shiboken::Conversions::copyToPython((SbkObjectType*)SbkNatronEngineTypes[SBK_EFFECT_IDX], &cppResult); } // End of code injection Unfortunately the code crashes in the indicated line above when invoking the code from the Python interpreter. Any idea on what I’m doing wrong ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jf_byrnes at comcast.net Fri Oct 24 20:12:41 2014 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Fri, 24 Oct 2014 13:12:41 -0500 Subject: [PySide] Why doesn't this example work? In-Reply-To: References: Message-ID: On 10/22/2014 10:52 PM, Eric Thomson wrote: > I meant to write that I put > myWindow.repaint() > before time.sleep(3). > > Incidentally, what book are you working through? PySideGUI Application Development > > On 10/22/14, Eric Thomson wrote: >> Try putting >> myWindow.repaint() >> before myWindow.show(). >> >> That took away the weird behavior on my end. I cannot explain it, though. As amended above, it worked for me also. Thanks, Jim >> >> On 10/22/14, Jim Byrnes wrote: >>> In looking at the lists archives, I see that most of the participants >>> seem to be experienced developers. As a novice programmer I hope I am >>> not intruding by asking some basic questions. >>> >>> I am working my way through examples in a PySide book I bought. >>> According to the author the example should display a 200 x 150 window, >>> pause 3 seconds and then display a 300 x 300 window. On my system >>> (Ubuntu 12.04) there is a approx 3 second delay after starting the >>> program and then I see the 300 x 300 window. I never see the first >>> window. >>> >>> Could someone explain to me why it does not act as described? >>> >>> # Import required modules >>> import sys >>> import time >>> from PySide.QtGui import QApplication, QWidget >>> >>> class SampleWindow(QWidget): >>> """ Our main window class >>> """ >>> >>> # Constructor function >>> def __init__(self): >>> QWidget.__init__(self) >>> self.setWindowTitle("Sample Window") >>> self.setGeometry(300, 300, 200, 150) >>> self.setMinimumHeight(100) >>> self.setMinimumWidth(250) >>> self.setMaximumHeight(200) >>> self.setMaximumWidth(800) >>> >>> if __name__ == '__main__': >>> # Exception Handling >>> try: >>> myApp = QApplication(sys.argv) >>> myWindow = SampleWindow() >>> myWindow.show() >>> time.sleep(3) >>> myWindow.resize(300, 300) >>> myWindow.setWindowTitle("Sample Window Resized") >>> myWindow.repaint() >>> myApp.exec_() >>> sys.exit(0) >>> except NameError: >>> print("Name Error:", sys.exc_info()[1]) >>> except SystemExit: >>> print("Closing Window...") >>> except Exception: >>> print (sys.exc_info()[1]) >>> >>> Thanks, Jim >>> >>> _______________________________________________ >>> PySide mailing list >>> PySide at qt-project.org >>> http://lists.qt-project.org/mailman/listinfo/pyside >>> >> From jf_byrnes at comcast.net Fri Oct 24 20:29:21 2014 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Fri, 24 Oct 2014 13:29:21 -0500 Subject: [PySide] Why doesn't this example work? In-Reply-To: References: Message-ID: On 10/22/2014 11:26 PM, Sean Fisk wrote: > Hi Jim, > > With all due respect to the author of the book, I don’t think this is a > very good example. The most important thing to realize is that nothing > really happens before the event loop is started. The line: > > myApp.exec_() > > is what starts the event loop. Without the event loop running, windows > won’t appear, user input cannot be handled, and basically nothing > QtGui-related will work. *Even if* windows show up before the event loop is > started, they won’t be able to respond to user interaction (as far as I > understand). > > I would personally achieve the desired behavior like so: > > #!/usr/bin/env python > import sys > from PySide import QtCore, QtGui > class SampleWindow(QtGui.QWidget): > def __init__(self, parent=None): > super(SampleWindow, self).__init__(parent) > self.setWindowTitle('Sample Window') > self.setGeometry(300, 300, 200, 150) > self.setMinimumHeight(100) > self.setMinimumWidth(250) > self.setMaximumHeight(200) > self.setMaximumWidth(800) > > @QtCore.Slot() > def do_resize(self): > self.resize(300, 300) > self.setWindowTitle('Sample Window Resized') > def main(argv): > app = QtGui.QApplication(argv) > > # Create and show the window. > window = SampleWindow() > window.show() > # PySide windows don't auto-raise on Mac OS X. > window.raise_() > > # Set up a timer to fire 3 seconds *after the event loop starts*. > QtCore.QTimer.singleShot(3000, window.do_resize) > > # Start the event loop. Nothing Qt-related happens until this call. > return app.exec_() > if __name__ == '__main__': > raise SystemExit(main(sys.argv)) > > The key take-away is that nothing QtGui-related *actually* happens before > the event loop is started, and everything is done by the time that it exits. > > Hope this helps. Feel free to let me know if anything doesn’t make sense. > ​ Thanks for the code and the explanation. It works and I can follow it and understand what is happening. Thanks, Jim > > -- > Sean Fisk > > On Wed, Oct 22, 2014 at 8:17 PM, Jim Byrnes wrote: > >> In looking at the lists archives, I see that most of the participants >> seem to be experienced developers. As a novice programmer I hope I am >> not intruding by asking some basic questions. >> >> I am working my way through examples in a PySide book I bought. >> According to the author the example should display a 200 x 150 window, >> pause 3 seconds and then display a 300 x 300 window. On my system >> (Ubuntu 12.04) there is a approx 3 second delay after starting the >> program and then I see the 300 x 300 window. I never see the first window. >> >> Could someone explain to me why it does not act as described? >> >> # Import required modules >> import sys >> import time >> from PySide.QtGui import QApplication, QWidget >> >> class SampleWindow(QWidget): >> """ Our main window class >> """ >> >> # Constructor function >> def __init__(self): >> QWidget.__init__(self) >> self.setWindowTitle("Sample Window") >> self.setGeometry(300, 300, 200, 150) >> self.setMinimumHeight(100) >> self.setMinimumWidth(250) >> self.setMaximumHeight(200) >> self.setMaximumWidth(800) >> >> if __name__ == '__main__': >> # Exception Handling >> try: >> myApp = QApplication(sys.argv) >> myWindow = SampleWindow() >> myWindow.show() >> time.sleep(3) >> myWindow.resize(300, 300) >> myWindow.setWindowTitle("Sample Window Resized") >> myWindow.repaint() >> myApp.exec_() >> sys.exit(0) >> except NameError: >> print("Name Error:", sys.exc_info()[1]) >> except SystemExit: >> print("Closing Window...") >> except Exception: >> print (sys.exc_info()[1]) >> >> Thanks, Jim >> >> _______________________________________________ >> 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 peter_karasev at keysight.com Fri Oct 24 20:48:48 2014 From: peter_karasev at keysight.com (peter_karasev at keysight.com) Date: Fri, 24 Oct 2014 18:48:48 +0000 Subject: [PySide] QApplication::processEvents( ), re: Why doesn't this example work? Message-ID: <0FDFE781C3033D44AA32DE14D9BFBD06135814DB@wcosexch01k.cos.is.keysight.com> Related question to this: in C++ you can do this to make events start running before QApplication.exec() is called: QApplication::sendPostedEvents(); QApplication::processEvents( ); // if you do this in a while-loop, you can interact with widgets ... Is it not possible to do this from PySide? I tried to make a C++ wrapper object but it seemed like the PySide objects weren't getting updated, although C++ QT widgets would appear and allow you to interact before QApplication.exec() starts. regards, Peter Karasev ________________________________________ От: pyside-bounces+peter_karasev=keysight.com at qt-project.org [pyside-bounces+peter_karasev=keysight.com at qt-project.org] от имени Jim Byrnes [jf_byrnes at comcast.net] Отправлено: 24 октября 2014 г. 11:29 Кому: pyside at qt-project.org Тема: Re: [PySide] Why doesn't this example work? On 10/22/2014 11:26 PM, Sean Fisk wrote: > Hi Jim, > > With all due respect to the author of the book, I don’t think this is a > very good example. The most important thing to realize is that nothing > really happens before the event loop is started. The line: > > myApp.exec_() > > is what starts the event loop. Without the event loop running, windows > won’t appear, user input cannot be handled, and basically nothing > QtGui-related will work. *Even if* windows show up before the event loop is > started, they won’t be able to respond to user interaction (as far as I > understand). > > I would personally achieve the desired behavior like so: > > #!/usr/bin/env python > import sys > from PySide import QtCore, QtGui > class SampleWindow(QtGui.QWidget): > def __init__(self, parent=None): > super(SampleWindow, self).__init__(parent) > self.setWindowTitle('Sample Window') > self.setGeometry(300, 300, 200, 150) > self.setMinimumHeight(100) > self.setMinimumWidth(250) > self.setMaximumHeight(200) > self.setMaximumWidth(800) > > @QtCore.Slot() > def do_resize(self): > self.resize(300, 300) > self.setWindowTitle('Sample Window Resized') > def main(argv): > app = QtGui.QApplication(argv) > > # Create and show the window. > window = SampleWindow() > window.show() > # PySide windows don't auto-raise on Mac OS X. > window.raise_() > > # Set up a timer to fire 3 seconds *after the event loop starts*. > QtCore.QTimer.singleShot(3000, window.do_resize) > > # Start the event loop. Nothing Qt-related happens until this call. > return app.exec_() > if __name__ == '__main__': > raise SystemExit(main(sys.argv)) > > The key take-away is that nothing QtGui-related *actually* happens before > the event loop is started, and everything is done by the time that it exits. > > Hope this helps. Feel free to let me know if anything doesn’t make sense. > ​ Thanks for the code and the explanation. It works and I can follow it and understand what is happening. Thanks, Jim > > -- > Sean Fisk > > On Wed, Oct 22, 2014 at 8:17 PM, Jim Byrnes wrote: > >> In looking at the lists archives, I see that most of the participants >> seem to be experienced developers. As a novice programmer I hope I am >> not intruding by asking some basic questions. >> >> I am working my way through examples in a PySide book I bought. >> According to the author the example should display a 200 x 150 window, >> pause 3 seconds and then display a 300 x 300 window. On my system >> (Ubuntu 12.04) there is a approx 3 second delay after starting the >> program and then I see the 300 x 300 window. I never see the first window. >> >> Could someone explain to me why it does not act as described? >> >> # Import required modules >> import sys >> import time >> from PySide.QtGui import QApplication, QWidget >> >> class SampleWindow(QWidget): >> """ Our main window class >> """ >> >> # Constructor function >> def __init__(self): >> QWidget.__init__(self) >> self.setWindowTitle("Sample Window") >> self.setGeometry(300, 300, 200, 150) >> self.setMinimumHeight(100) >> self.setMinimumWidth(250) >> self.setMaximumHeight(200) >> self.setMaximumWidth(800) >> >> if __name__ == '__main__': >> # Exception Handling >> try: >> myApp = QApplication(sys.argv) >> myWindow = SampleWindow() >> myWindow.show() >> time.sleep(3) >> myWindow.resize(300, 300) >> myWindow.setWindowTitle("Sample Window Resized") >> myWindow.repaint() >> myApp.exec_() >> sys.exit(0) >> except NameError: >> print("Name Error:", sys.exc_info()[1]) >> except SystemExit: >> print("Closing Window...") >> except Exception: >> print (sys.exc_info()[1]) >> >> Thanks, Jim >> >> _______________________________________________ >> 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 schampailler at skynet.be Fri Oct 24 20:56:48 2014 From: schampailler at skynet.be (Stefan Champailler) Date: Fri, 24 Oct 2014 20:56:48 +0200 Subject: [PySide] Why doesn't this example work? In-Reply-To: References: Message-ID: <20141024205648.4352cf26@debian> Hi! I've no explanation neither... But I'd say that may be due to the fact that during the time.seep, your application is not processing GUI events since at that point app.exec_() has not yet been called). You could try to make a pause by using a QTimer, but that'd imply to app.exec_() before (and maybe you precisely want to avoid that...) you could also try : for t in range(3) for i in range(100): # Strange name to avoid defining local variable... app.processEvents() time.sleep(1) I had to do that to have a QSplashScreen to display properly (and a QSplashScreen definitely is a window outside the application loop, like what I understand you try to do) stF Jim Byrnes wrote: > In looking at the lists archives, I see that most of the participants > seem to be experienced developers. As a novice programmer I hope I am > not intruding by asking some basic questions. > > I am working my way through examples in a PySide book I bought. > According to the author the example should display a 200 x 150 window, > pause 3 seconds and then display a 300 x 300 window. On my system > (Ubuntu 12.04) there is a approx 3 second delay after starting the > program and then I see the 300 x 300 window. I never see the first window. > > Could someone explain to me why it does not act as described? > > # Import required modules > import sys > import time > from PySide.QtGui import QApplication, QWidget > > class SampleWindow(QWidget): > """ Our main window class > """ > > # Constructor function > def __init__(self): > QWidget.__init__(self) > self.setWindowTitle("Sample Window") > self.setGeometry(300, 300, 200, 150) > self.setMinimumHeight(100) > self.setMinimumWidth(250) > self.setMaximumHeight(200) > self.setMaximumWidth(800) > > if __name__ == '__main__': > # Exception Handling > try: > myApp = QApplication(sys.argv) > myWindow = SampleWindow() > myWindow.show() > time.sleep(3) > myWindow.resize(300, 300) > myWindow.setWindowTitle("Sample Window Resized") > myWindow.repaint() > myApp.exec_() > sys.exit(0) > except NameError: > print("Name Error:", sys.exc_info()[1]) > except SystemExit: > print("Closing Window...") > except Exception: > print (sys.exc_info()[1]) > > Thanks, Jim > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -- Timeo Danaos et dona ferentes Twitter : @Arakowa1 From sean at seanfisk.com Fri Oct 24 23:18:32 2014 From: sean at seanfisk.com (Sean Fisk) Date: Fri, 24 Oct 2014 17:18:32 -0400 Subject: [PySide] QApplication::processEvents( ), re: Why doesn't this example work? In-Reply-To: <0FDFE781C3033D44AA32DE14D9BFBD06135814DB@wcosexch01k.cos.is.keysight.com> References: <0FDFE781C3033D44AA32DE14D9BFBD06135814DB@wcosexch01k.cos.is.keysight.com> Message-ID: On Fri, Oct 24, 2014 at 2:48 PM, wrote: > Related question to this: > > in C++ you can do this to make events start running before > QApplication.exec() is called: > > > > > * QApplication::sendPostedEvents(); > QApplication::processEvents( ); // if you do this in a > while-loop, you can interact with widgets ... * > Is it not possible to do this from PySide? > I’m not sure, but this: QApplication::sendPostedEvents(); QApplication::processEvents(); // if you do this in a while-loop, you can interact with widgets ... …is pretty much what PySide.QtGui.QApplication.exec_() does (see here ). So why not just use exec_(), unless you have really specific requirements? ​ I tried to make a C++ wrapper object > but it seemed like the PySide objects weren't getting updated, although > C++ QT widgets would appear and allow you to interact before > QApplication.exec() starts. > > regards, > Peter Karasev > > ________________________________________ > От: pyside-bounces+peter_karasev=keysight.com at qt-project.org > [pyside-bounces+peter_karasev=keysight.com at qt-project.org] от имени Jim > Byrnes [jf_byrnes at comcast.net] > Отправлено: 24 октября 2014 г. 11:29 > Кому: pyside at qt-project.org > Тема: Re: [PySide] Why doesn't this example work? > > On 10/22/2014 11:26 PM, Sean Fisk wrote: > > Hi Jim, > > > > With all due respect to the author of the book, I don’t think this is a > > very good example. The most important thing to realize is that nothing > > really happens before the event loop is started. The line: > > > > myApp.exec_() > > > > is what starts the event loop. Without the event loop running, windows > > won’t appear, user input cannot be handled, and basically nothing > > QtGui-related will work. *Even if* windows show up before the event loop > is > > started, they won’t be able to respond to user interaction (as far as I > > understand). > > > > I would personally achieve the desired behavior like so: > > > > #!/usr/bin/env python > > import sys > > from PySide import QtCore, QtGui > > class SampleWindow(QtGui.QWidget): > > def __init__(self, parent=None): > > super(SampleWindow, self).__init__(parent) > > self.setWindowTitle('Sample Window') > > self.setGeometry(300, 300, 200, 150) > > self.setMinimumHeight(100) > > self.setMinimumWidth(250) > > self.setMaximumHeight(200) > > self.setMaximumWidth(800) > > > > @QtCore.Slot() > > def do_resize(self): > > self.resize(300, 300) > > self.setWindowTitle('Sample Window Resized') > > def main(argv): > > app = QtGui.QApplication(argv) > > > > # Create and show the window. > > window = SampleWindow() > > window.show() > > # PySide windows don't auto-raise on Mac OS X. > > window.raise_() > > > > # Set up a timer to fire 3 seconds *after the event loop starts*. > > QtCore.QTimer.singleShot(3000, window.do_resize) > > > > # Start the event loop. Nothing Qt-related happens until this call. > > return app.exec_() > > if __name__ == '__main__': > > raise SystemExit(main(sys.argv)) > > > > The key take-away is that nothing QtGui-related *actually* happens before > > the event loop is started, and everything is done by the time that it > exits. > > > > Hope this helps. Feel free to let me know if anything doesn’t make sense. > > ​ > > Thanks for the code and the explanation. It works and I can follow it > and understand what is happening. > > Thanks, Jim > > > > > -- > > Sean Fisk > > > > On Wed, Oct 22, 2014 at 8:17 PM, Jim Byrnes > wrote: > > > >> In looking at the lists archives, I see that most of the participants > >> seem to be experienced developers. As a novice programmer I hope I am > >> not intruding by asking some basic questions. > >> > >> I am working my way through examples in a PySide book I bought. > >> According to the author the example should display a 200 x 150 window, > >> pause 3 seconds and then display a 300 x 300 window. On my system > >> (Ubuntu 12.04) there is a approx 3 second delay after starting the > >> program and then I see the 300 x 300 window. I never see the first > window. > >> > >> Could someone explain to me why it does not act as described? > >> > >> # Import required modules > >> import sys > >> import time > >> from PySide.QtGui import QApplication, QWidget > >> > >> class SampleWindow(QWidget): > >> """ Our main window class > >> """ > >> > >> # Constructor function > >> def __init__(self): > >> QWidget.__init__(self) > >> self.setWindowTitle("Sample Window") > >> self.setGeometry(300, 300, 200, 150) > >> self.setMinimumHeight(100) > >> self.setMinimumWidth(250) > >> self.setMaximumHeight(200) > >> self.setMaximumWidth(800) > >> > >> if __name__ == '__main__': > >> # Exception Handling > >> try: > >> myApp = QApplication(sys.argv) > >> myWindow = SampleWindow() > >> myWindow.show() > >> time.sleep(3) > >> myWindow.resize(300, 300) > >> myWindow.setWindowTitle("Sample Window Resized") > >> myWindow.repaint() > >> myApp.exec_() > >> sys.exit(0) > >> except NameError: > >> print("Name Error:", sys.exc_info()[1]) > >> except SystemExit: > >> print("Closing Window...") > >> except Exception: > >> print (sys.exc_info()[1]) > >> > >> Thanks, Jim > >> > >> _______________________________________________ > >> 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 robert.kern at gmail.com Sat Oct 25 11:23:17 2014 From: robert.kern at gmail.com (Robert Kern) Date: Sat, 25 Oct 2014 10:23:17 +0100 Subject: [PySide] questions about changes to Qt open-source related to pyside In-Reply-To: References: Message-ID: On 2014-10-20 19:22, John.Black at cor.gov wrote: > I am a novice Python programmer and have been using Qt 4.8 with Pyside > successfully for over a year. > > https://pypi.python.org/pypi/PySide/1.2.2 > > The way I understand it, Qt is owned by Digia which licenses Qt 5.4, but the > open source version, Qt 4.8 has been available for free. > > It now appears that Digia is now offering the open source version as > LPGL-version 3 from their corporate web-site - I'm trying to understand this > without hiring a lawyer ;-) Just to clear this up, all versions of Qt5 have always been available for free under an open source license, just an earlier version of the LGPL (version 2.1, to be precise). The recent change was just that Digia is also adding LGPLv3 as an option. The differences between the two versions are relatively minor details. > Can someone tell me if Pyside is going to incorporate the Qt 5.4 Community > Version and whether it will be available on https://pypi.python.org/pypi ? However, PySide does not at the moment support Qt5. I think it's mostly a matter of committing resources to porting the wrappers to the Qt5 API and supporting both Qt4 and Qt4 simultaneously. I'm not sure if there are any technical showstoppers, but I don't think there are any. There are certainly no legal showstoppers. It's just a matter of some volunteer finding the time to build and support the Qt5 wrappers. -- 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 pflegit at gmail.com Sun Oct 26 01:09:57 2014 From: pflegit at gmail.com (Pat Flegit) Date: Sat, 25 Oct 2014 19:09:57 -0400 Subject: [PySide] Phonon on Linux Message-ID: I have two copies of Ubuntu (one running 13.10, one running 14.04) and they're having different problems when I try to run a simple PySide program which uses Phonon for music playback. (1) The 14.04 version runs, but it won't play music. When I try, it gives me this kind of error: WARNING: bool Phonon::FactoryPrivate::createBackend() phonon backend plugin could not be loaded Windows has a phonon_ds94.dll file which apparently runs the Phonon backend, and there are a few different Linux versions; I can't find any file like those listed here in my PySide folder: http://www.qtcentre.org/wiki/index.php?title=How_to_get_Phonon_working (2) The 13.10 version won't even get that far. Just running a program with Phonon in it causes this error: pyside phonon.so: undefined symbol: _ZN6Phonon17registerMetaTypesEv I have no idea what to do about that at all. If anyone can shed some light on one or either of these problems it would be most welcome! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jf_byrnes at comcast.net Tue Oct 28 01:21:56 2014 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Mon, 27 Oct 2014 19:21:56 -0500 Subject: [PySide] Why doesn't this example work? [followup] In-Reply-To: References: Message-ID: On 10/24/2014 01:12 PM, Jim Byrnes wrote: > On 10/22/2014 10:52 PM, Eric Thomson wrote: >> I meant to write that I put >> myWindow.repaint() >> before time.sleep(3). >> >> Incidentally, what book are you working through? > > PySideGUI Application Development > >> >> On 10/22/14, Eric Thomson wrote: >>> Try putting >>> myWindow.repaint() >>> before myWindow.show(). >>> >>> That took away the weird behavior on my end. I cannot explain it, though. > > As amended above, it worked for me also. > > Thanks, Jim I guess I should have flipped the page and read a little further, I would have found this text. You might not initially see a window when executing this program on an XWindow based system such as Linux, because the main application loop has not been called yet, so none of the objects has been really constructed and buffered out to the underlying XWindow system. I am running Ubuntu. To be fair to the author I thought I should mention this. Regards, Jim >>> >>> On 10/22/14, Jim Byrnes wrote: >>>> In looking at the lists archives, I see that most of the participants >>>> seem to be experienced developers. As a novice programmer I hope I am >>>> not intruding by asking some basic questions. >>>> >>>> I am working my way through examples in a PySide book I bought. >>>> According to the author the example should display a 200 x 150 window, >>>> pause 3 seconds and then display a 300 x 300 window. On my system >>>> (Ubuntu 12.04) there is a approx 3 second delay after starting the >>>> program and then I see the 300 x 300 window. I never see the first >>>> window. >>>> >>>> Could someone explain to me why it does not act as described? >>>> >>>> # Import required modules >>>> import sys >>>> import time >>>> from PySide.QtGui import QApplication, QWidget >>>> >>>> class SampleWindow(QWidget): >>>> """ Our main window class >>>> """ >>>> >>>> # Constructor function >>>> def __init__(self): >>>> QWidget.__init__(self) >>>> self.setWindowTitle("Sample Window") >>>> self.setGeometry(300, 300, 200, 150) >>>> self.setMinimumHeight(100) >>>> self.setMinimumWidth(250) >>>> self.setMaximumHeight(200) >>>> self.setMaximumWidth(800) >>>> >>>> if __name__ == '__main__': >>>> # Exception Handling >>>> try: >>>> myApp = QApplication(sys.argv) >>>> myWindow = SampleWindow() >>>> myWindow.show() >>>> time.sleep(3) >>>> myWindow.resize(300, 300) >>>> myWindow.setWindowTitle("Sample Window Resized") >>>> myWindow.repaint() >>>> myApp.exec_() >>>> sys.exit(0) >>>> except NameError: >>>> print("Name Error:", sys.exc_info()[1]) >>>> except SystemExit: >>>> print("Closing Window...") >>>> except Exception: >>>> print (sys.exc_info()[1]) >>>> >>>> Thanks, Jim >>>> >>>> _______________________________________________ >>>> PySide mailing list >>>> PySide at qt-project.org >>>> http://lists.qt-project.org/mailman/listinfo/pyside >>>> >>> From jnabozny1 at ltu.edu Tue Oct 28 18:18:10 2014 From: jnabozny1 at ltu.edu (Jonathan Nabozny) Date: Tue, 28 Oct 2014 13:18:10 -0400 Subject: [PySide] PySide for QT 5.x Message-ID: Hello All, I've been using both QT in c++ at work for a while now and python for several years for my own projects and academia. I'd like to get involved in helping bring QT 5.x support to PySide. Is there anyone else currently working towards this goal that I can aid / any information I should know before beginning to look at what's there currently? Thanks, -- Widmo Software Engineer -------------- next part -------------- An HTML attachment was scrubbed... URL: From jf_byrnes at comcast.net Tue Oct 28 19:03:01 2014 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Tue, 28 Oct 2014 13:03:01 -0500 Subject: [PySide] Button order on QMessageBox Message-ID: Is the order of the buttons on a QMessageBox platform specific? I ask because in the book Pyside GUI Application Development the example shows the buttons as Yes/No but when I run the code the buttons show up No/Yes. I am on linux and the examples appear to be on Windows. Here is the code: def quitApp(self): """ Function to confirm a message from the user """ userInfo = QMessageBox.question(self, 'Confirmation', "This will quit the application. Do you want to Continue", QMessageBox.Yes | QMessageBox.No) if userInfo == QMessageBox.Yes: myApp.quit() if userInfo == QMessageBox.No: pass Thanks, Jim From me at the-compiler.org Tue Oct 28 19:09:34 2014 From: me at the-compiler.org (Florian Bruhin) Date: Tue, 28 Oct 2014 19:09:34 +0100 Subject: [PySide] Button order on QMessageBox In-Reply-To: References: Message-ID: <20141028180934.GQ4524@lupin> * Jim Byrnes [2014-10-28 13:03:01 -0500]: > Is the order of the buttons on a QMessageBox platform specific? From http://qt-project.org/doc/qt-4.8/qmessagebox.html : "The display order for the buttons is platform-dependent. For example, on Windows, Save is displayed to the left of Cancel, whereas on Mac OS, the order is reversed." I guess it depends on the style guidelines released by the respective platforms. Florian -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From me at the-compiler.org Tue Oct 28 19:11:14 2014 From: me at the-compiler.org (Florian Bruhin) Date: Tue, 28 Oct 2014 19:11:14 +0100 Subject: [PySide] PySide for QT 5.x In-Reply-To: References: Message-ID: <20141028181114.GR4524@lupin> Hi, * Jonathan Nabozny [2014-10-28 13:18:10 -0400]: > Hello All, > > I've been using both QT in c++ at work for a while now and python for > several years for my own projects and academia. I'd like to get involved in > helping bring QT 5.x support to PySide. Is there anyone else currently > working towards this goal that I can aid / any information I should know > before beginning to look at what's there currently? I can't really tell you anything useful, but thanks for your efforts! The main reason I never looked at PySide (as opposed to PyQt) is because of the lack of Qt5 compatibility :) Florian -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG 0xFD55A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From jf_byrnes at comcast.net Tue Oct 28 19:38:49 2014 From: jf_byrnes at comcast.net (Jim Byrnes) Date: Tue, 28 Oct 2014 13:38:49 -0500 Subject: [PySide] PySide for QT 5.x In-Reply-To: <20141028181114.GR4524@lupin> References: <20141028181114.GR4524@lupin> Message-ID: On 10/28/2014 01:11 PM, Florian Bruhin wrote: > Hi, > > * Jonathan Nabozny [2014-10-28 13:18:10 -0400]: >> Hello All, >> >> I've been using both QT in c++ at work for a while now and python for >> several years for my own projects and academia. I'd like to get involved in >> helping bring QT 5.x support to PySide. Is there anyone else currently >> working towards this goal that I can aid / any information I should know >> before beginning to look at what's there currently? > > I can't really tell you anything useful, but thanks for your efforts! > > The main reason I never looked at PySide (as opposed to PyQt) is > because of the lack of Qt5 compatibility :) > > Florian > Thanks, Jim From techtonik at gmail.com Tue Oct 28 22:10:02 2014 From: techtonik at gmail.com (anatoly techtonik) Date: Wed, 29 Oct 2014 00:10:02 +0300 Subject: [PySide] PySide for QT 5.x In-Reply-To: References: Message-ID: On Tue, Oct 28, 2014 at 8:18 PM, Jonathan Nabozny wrote: > Hello All, > > I've been using both QT in c++ at work for a while now and python for > several years for my own projects and academia. I'd like to get involved in > helping bring QT 5.x support to PySide. Is there anyone else currently > working towards this goal that I can aid / any information I should know > before beginning to look at what's there currently? I am interested to see Qt 5.x in PySide, but I am not actively working, because I've stuck on C++ level (which is not my side) while trying to fix https://bugreports.qt-project.org/browse/PYSIDE-243 It will help bring more people from Python side to report bugs in Qt if they could distinguish PySide bugs from Qt bugs. Being stuck at PYSIDE-243 I was thinking about asking somebody to help me with debugging this issue and writing an article about "How to troubleshoot Qt with PySide". -- anatoly t