From jsteele at cert.org Fri Nov 1 16:19:56 2013 From: jsteele at cert.org (Jonathan Steele) Date: Fri, 1 Nov 2013 15:19:56 +0000 Subject: [PySide] PySide QSignalMapper not working In-Reply-To: Message-ID: Hedieh, If I've understood correctly from your previous mails, the basic problem you are trying to solve is how to create a handler function that can be called with different arguments, depending on which widget is triggered. Is that correct? If so, I found this page a very useful resource that covers the different methods available: http://www.blog.pythonlibrary.org/2013/04/10/pyside-connecting-multiple-wid gets-to-the-same-slot/ Which method you use probably comes down to personal preference, but in a similar situation with my application I used the lambda method. For example, here's the line that connects the signal to my handler: clearaction.triggered.connect(lambda col=colnum: self.OnClearMap(col)) In this example I'm connecting the QAction from a menu item to an anonymous function that simply grabs a variable ("colnum) and passes it through to my handler, which is just a regular old method in the same class. You should be able to do something similar for your pushbuttons. If you don't like the lambda method you can see some other options in the link I gave above. Hope this helps. --Jon From sean at seanfisk.com Mon Nov 4 01:49:30 2013 From: sean at seanfisk.com (Sean Fisk) Date: Sun, 3 Nov 2013 19:49:30 -0500 Subject: [PySide] Deploying a PySide app on OS X In-Reply-To: References: Message-ID: Hi Jon, I am successfully deploying a .app bundle with the same versions of OS X, Python, and PySide using py2app. The file generated by py2applet --make-setup rarely works as-is. In particular, I had to add PySide.QtCoreand PySide.QtGui to the list of modules to include, e.g., APP = ['...'] DATA_FILES = [] OPTIONS = { 'argv_emulation': True, 'includes': ['PySide.QtCore', 'PySide.QtGui'], } setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) Include other PySide modules as well if you are using something other than QtGui. Hope this helps, -- Sean Fisk On Mon, Oct 28, 2013 at 11:07 AM, Jonathan Steele wrote: > I have a PySide application that I'm struggling to build into an > application (.app) that other OS X users can run, and hoped that someone > here might have some tips to get me going. I'm running OS X 10.6, python > 2.7, and PySide 4.8.4. I have very little experience with this side of > things, but here is what I've tried so far: > > 1. Using py2app. I generated a basic setup.py and tried to use it to > build the app. The dependencies seem to copy fine, but then I get this > error: > > /usr/bin/strip: the __LINKEDIT segment does not cover the end of the file > (can't be processed) in: > /Users/jsteele/work/releases/ipfixview-0.1.0/dist/main.app/Contents/Framewo > rks/QtCore.framework/Versions/4/QtCore > > Some googling left me with the impression that there's an architecture > mismatch between the way the QtCore library is built and what py2app is > trying to build, but I'm not clear on how to proceed to resolve this. > > 2. Ryan Kelly's myppy. This seemed like a promising idea, but after > installing myppy, I got an error trying to init a workspace: > > BUILDING FOR ARCH ppc > /usr/bin/gcc -Os -arch ppc -mmacosx-version-min=10.4 -isysroot > /Developer/SDKs/MacOSX10.4u.sdk > -I/Users/jsteele/work/myppy/ipfixview.app/Contents/Frameworks/Python.framew > ork/Versions/2.7/include -I. -c -o example.o test/example.c > In file included from ./zconf.h:427, > from ./zlib.h:34, > from test/example.c:8: > /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: > stdarg.h: No such file or directory > In file included from test/example.c:8: > ./zlib.h:1758: error: expected declaration specifiers or Œ...¹ before > Œva_list¹ > make: *** [example.o] Error 1 > > > > 3. Using cx_Freeze. I initially had a problem getting the dependencies > copied correctly because cx_Freeze runs "otool -L" to find them and > expects an absolute path, but the pyside libraries returned only the > library name with no path. I fixed that using install_name_tool -change > to specify the full path, and then seemed to successfully generate the > .app. It runs correctly on my machine. However, when I gave it to a > colleague to try, he got this error: > > LSOpenURLsWithRole() failed with error -10810 > > The error code of -10810 translates to "An unknown error has occurred", > which doesn't exactly help point me towards a resolution! > > Recommendations on how to proceed would be gratefully received. Thanks! > > --Jon > > _______________________________________________ > 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 scarleton at miltonstreet.com Mon Nov 4 13:48:45 2013 From: scarleton at miltonstreet.com (Sam Carleton) Date: Mon, 4 Nov 2013 07:48:45 -0500 Subject: [PySide] Where is the port to Qt5 effort? Message-ID: Hi, I have been using traditional Qt now for a number of years and ready to move into PySide in hopes of speeding up development. The only catches is that I would like to be using Python 3 and Qt5. The Qt5 is a bigger issue then Python 3, so I was wondering where exactly that effort was at this point in time. Myself being a Qt developer, I have no problems getting into the internals and helping, just need to know a starting point. Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmccombs at dyn.com Tue Nov 5 14:32:18 2013 From: dmccombs at dyn.com (Dan McCombs) Date: Tue, 5 Nov 2013 08:32:18 -0500 Subject: [PySide] Creating and deleting instances of QApplication within unit tests In-Reply-To: <527034CC.70008@bluewin.ch> References: <527034CC.70008@bluewin.ch> Message-ID: Thanks Aaron. When I have a single instance of QApplication in my tests, and instantiate the window classes of my application more than once (for instance, in each test case) my tests pass but Python segfaults on exit, which is why I was looking at creating/destroying the QApplication instance on each test run as I thought I was doing it wrong having the same one through all my tests. I tried to create a simple example reproducing this however, and it's not segfaulting. It may be because I'm using a parent class with the borg pattern in my application which contains a dictionary containing the instances for each window, so that each window can easily access the other window instances to show/hide them, etc. I'll try doing that in my example to see if it segfaults. I'm guessing something is being freed twice on exit in that case and causing the problem. Assuming it is, what kind of patterns are people using for having multiple windows that you want to reference from each other? Or is that just being avoided? An example would be there's a main window that needs to show another window, that window needs call a method in the main window to load data in a table, etc. Thanks, -Dan On Tue, Oct 29, 2013 at 6:21 PM, Aaron Richiger wrote: > Hello Dan! > > Sorry for not having replied to your question so far... Don't overestimate > our testing capabilities;-) > Below, you can see some example code with a class with multiple tests. > Hope it helps... > Aaron > > import unittest > import sys > > from PySide.QtGui import * > from PySide.QtCore import * > from PySide.QtTest import * > > > class TestDemo(unittest.TestCase): > > @classmethod > def setUpClass(cls): > try: > cls.app = QApplication(sys.argv) > except: > pass > > def test_widget_1(self): > w1 = QPushButton() > w1.clicked.connect(self.slot) > QTest.mouseClick(w1, Qt.LeftButton) > self.assertTrue(self.clicked) > > def test_widget_2(self): > w2 = QPushButton() > w2.clicked.connect(self.slot) > QTest.mouseClick(w2, Qt.LeftButton) > self.assertTrue(self.clicked) > > def slot(self): > self.clicked = True > > > if __name__ == '__main__': > unittest.main() > > > > > Am 29.10.2013 20:33, schrieb Dan McCombs: > > Ok, let me ask this question - > > Someone out there must be unit testing their PySide code. Could you give > an example of a test class with multiple separate tests? > > Thanks! > > -Dan > > -- > Dan McCombs > Senior Software Engineer / Dyn > http://dyn.com/ > > Are you prepared for website disaster? Find out in two minutes: > http://dyn.com/dynedu-disaster-planning/ > > > On Sat, Oct 26, 2013 at 8:01 AM, Dan McCombs wrote: > >> Hi Matthew, >> >> Yes, the first thing I tried was: >> >> app = QtGui.QApplication([]) >> ... >> del app >> >> But, the next test raises the exception about there already being a >> QApplication instance when it runs that first line. That's why I resorted >> to poking around trying to figure out where PySide is keeping track of that >> original instance causing it to raise that exception. >> >> -Dan >> >> >> -- >> Dan McCombs >> Senior Software Engineer / Dyn >> http://dyn.com/ >> >> Are you prepared for website disaster? Find out in two minutes: >> http://dyn.com/dynedu-disaster-planning/ >> >> >> On Fri, Oct 25, 2013 at 3:13 PM, Dan McCombs wrote: >> >>> Hey all, >>> >>> I've been struggling with unit testing my PySide application. My tests >>> run fine, but if I have more than one test, Python segfaults on quit. It >>> seems the solution would be to destroy/create the QApplication instance on >>> each test run, as I've seen people mentioning in the case of PyQT such as: >>> >>> >>> http://stuvel.eu/blog/127/multiple-instances-of-qapplication-in-one-process >>> >>> I've tried doing something similar in PySide with the following lines >>> in my setUp for each test: >>> >>> QtGui.qApp = QtGui.QApplication([]) >>> >>> And the following in my tearDown: >>> >>> QtGui.quit() >>> QtGui.qApp = none >>> >>> However, the instance still exists (I can get it via >>> QtGui.QApplication.instance()) and when the second test setUp starts to >>> run, I get an exception that "A QApplication instance already exists.". >>> >>> How can I fully remove the QApplication instance between tests? >>> >>> Thanks, >>> >>> -Dan >>> >> >> > > > _______________________________________________ > PySide mailing listPySide at qt-project.orghttp://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 sdeibel at wingware.com Tue Nov 5 17:44:50 2013 From: sdeibel at wingware.com (Stephan Deibel) Date: Tue, 05 Nov 2013 11:44:50 -0500 Subject: [PySide] Where is the port to Qt5 effort? In-Reply-To: References: Message-ID: <52792082.2000201@wingware.com> Sam Carleton wrote: > I have been using traditional Qt now for a number of years and ready > to move into PySide in hopes of speeding up development. The only > catches is that I would like to be using Python 3 and Qt5. The Qt5 is > a bigger issue then Python 3, so I was wondering where exactly that > effort was at this point in time. Myself being a Qt developer, I have > no problems getting into the internals and helping, just need to know > a starting point. As far as I know there isn't yet a currently active effort to support Qt5. http://qt-project.org/wiki/PySide_Roadmap focuses on near-term work and mentions Qt5 only as something in the future. This is because the current developers are mostly focused on using PySide with Qt4 for now. I expect this will start to change over time but perhaps not that quickly. Working on Qt5 and/or Python3 support would be a great way for new developers to get on board with contributing to PySide. We do need more developers. Here's a list of issues for Python 3 support: http://qt-project.org/wiki/PySide_Python_3_Issues (some of this may be old). - Stephan From heng at cantab.net Tue Nov 5 17:54:41 2013 From: heng at cantab.net (Henry Gomersall) Date: Tue, 05 Nov 2013 16:54:41 +0000 Subject: [PySide] Where is the port to Qt5 effort? In-Reply-To: <52792082.2000201@wingware.com> References: <52792082.2000201@wingware.com> Message-ID: <527922D1.8060605@cantab.net> On 05/11/13 16:44, Stephan Deibel wrote: > Sam Carleton wrote: >> >I have been using traditional Qt now for a number of years and ready >> >to move into PySide in hopes of speeding up development. The only >> >catches is that I would like to be using Python 3 and Qt5. The Qt5 is >> >a bigger issue then Python 3, so I was wondering where exactly that >> >effort was at this point in time. Myself being a Qt developer, I have >> >no problems getting into the internals and helping, just need to know >> >a starting point. > As far as I know there isn't yet a currently active effort to support Qt5. > > http://qt-project.org/wiki/PySide_Roadmap focuses on near-term work and > mentions Qt5 only as something in the future. This is because the > current developers are mostly focused on using PySide with Qt4 for now. > I expect this will start to change over time but perhaps not that > quickly. Working on Qt5 and/or Python3 support would be a great way for > new developers to get on board with contributing to PySide. We do need > more developers. > > Here's a list of issues for Python 3 support: > http://qt-project.org/wiki/PySide_Python_3_Issues (some of this may be old). Has the accessibility of the code improved since this was discussed previously? The code generation tools were not fantastically well documented previously. Cheers, Henry From sdeibel at wingware.com Tue Nov 5 18:56:06 2013 From: sdeibel at wingware.com (Stephan Deibel) Date: Tue, 05 Nov 2013 12:56:06 -0500 Subject: [PySide] Where is the port to Qt5 effort? In-Reply-To: <527922D1.8060605@cantab.net> References: <52792082.2000201@wingware.com> <527922D1.8060605@cantab.net> Message-ID: <52793136.8070804@wingware.com> Henry Gomersall wrote: > Has the accessibility of the code improved since this was discussed > previously? The code generation tools were not fantastically well > documented previously. There has been some work on tutorials and development docs at http://qt-project.org/wiki/PySide but not a lot of change in the code base, as far as rewriting the code generation tools. I know there was discussion at the PySide sprint in June but I wasn't there. A few emails that provide a little info about that: http://lists.qt-project.org/pipermail/pyside/2013-June/001445.html http://lists.qt-project.org/pipermail/pyside/2013-July/001495.html - Stephan From basti at redtoad.de Tue Nov 5 21:02:49 2013 From: basti at redtoad.de (Sebastian Rahlf) Date: Tue, 5 Nov 2013 21:02:49 +0100 Subject: [PySide] QStateMachine: Difference between QEvent and Signal? Message-ID: Hi all! I have a question (or three) regarding PySide and QStateMachine which I've posted here: http://stackoverflow.com/q/19784875/294082 Can anyone help me out? Thanks in advance Seabstian -------------- next part -------------- An HTML attachment was scrubbed... URL: From gadiyar at ti.com Wed Nov 6 13:32:22 2013 From: gadiyar at ti.com (Gadiyar, Anand) Date: Wed, 6 Nov 2013 12:32:22 +0000 Subject: [PySide] PySide Bug-fix submission process Message-ID: Hi all, I recently submitted a patch to gerrit that fixes an old PySide bug. https://codereview.qt-project.org/#change,67938 There haven't been any review comments to the patch so far. Do I need to add someone explicitly as a reviewer? Or is there anything more I need to do to get the patch accepted? Thanks in advance, Anand -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpe at wingware.com Wed Nov 6 17:24:54 2013 From: jpe at wingware.com (John Ehresman) Date: Wed, 06 Nov 2013 11:24:54 -0500 Subject: [PySide] PySide Bug-fix submission process In-Reply-To: References: Message-ID: <527A6D56.3070709@wingware.com> On 11/6/13 7:32 AM, Gadiyar, Anand wrote: > Hi all, > > I recently submitted a patch to gerrit that fixes an old PySide bug. > > https://codereview.qt-project.org/#change,67938 > > There haven't been any review comments to the patch so far. Do I need to > add someone I'll try to take a look soon. The patch seems fine, but I want to run the test suite before accepting it. Sorry for not looking at this sooner. John From ochiu at teslamotors.com Thu Nov 7 00:46:43 2013 From: ochiu at teslamotors.com (Otto Chiu) Date: Wed, 6 Nov 2013 23:46:43 +0000 Subject: [PySide] Installing on Ubuntu with python3 Message-ID: <459D4CF76F76B54697869793F5BEF3592D5095EC@SJC04-DAG01-N01.teslamotors.com> Hi All, I want to see if anybody has anybody has any tips or hints on installing pyside on Ubuntu with python3 in a virtualenv. I tried following the instructions here: https://pypi.python.org/pypi/PySide#installing-pyside-on-a-unix-system, but I keep getting syntax errors when I go install the egg. I also tried http://qt-project.org/wiki/PySide_Binaries_Linux with the python3-pyside option but python can't find the PySide package. Any help is much appreciated. Otto -------------- next part -------------- An HTML attachment was scrubbed... URL: From backup.rlacko at gmail.com Thu Nov 7 09:12:59 2013 From: backup.rlacko at gmail.com (Roman Lacko) Date: Thu, 7 Nov 2013 09:12:59 +0100 Subject: [PySide] Installing on Ubuntu with python3 In-Reply-To: <459D4CF76F76B54697869793F5BEF3592D5095EC@SJC04-DAG01-N01.teslamotors.com> References: <459D4CF76F76B54697869793F5BEF3592D5095EC@SJC04-DAG01-N01.teslamotors.com> Message-ID: 2013/11/7 Otto Chiu > Hi All, > > I want to see if anybody has anybody has any tips or hints on installing > pyside on Ubuntu with python3 in a virtualenv. > > > > I tried following the instructions here: > https://pypi.python.org/pypi/PySide#installing-pyside-on-a-unix-system, > but I keep getting syntax errors when I go install the egg. > You can ignore the syntax errors when installing the egg, just don't forget to run the post install script: $ python2.7 pyside_postinstall.py -install BTW, what version of Ubuntu you have ? Thanks Roman I also tried http://qt-project.org/wiki/PySide_Binaries_Linux with the > python3-pyside option but python can’t find the PySide package. > > > > Any help is much appreciated. > > > > Otto > > _______________________________________________ > 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 Thu Nov 7 09:34:22 2013 From: schampailler at skynet.be (S. Champailler) Date: Thu, 7 Nov 2013 09:34:22 +0100 (CET) Subject: [PySide] PySide on Wine Message-ID: <351169723.1091807.1383813262358.JavaMail.open-xchange@webmail.nmp.skynet.be> Hello, Not a bug this time... This mail just to tell you that I've been able to run my PySide-heavy application with Wine on Debian. And in non trivial way. 1. So I've my python 2.7/sqlalchemy/PySide application. 2. I make a nice distributable *.exe version out of it with PyInstaller 3. Then I run the exe with Wine (the latest one) 4. yes! it works My use case is that I want to test my release procedure for windows. And since I'm a Debian fan, well, although I produce Windows executables, I still want to test under Linux :-) Next step is to actually run PyInstaller under Wine. This way I will be able to stay in Linux 100% of the time. Thus one more good point for PySide :-) stF -------------- next part -------------- An HTML attachment was scrubbed... URL: From schampailler at skynet.be Thu Nov 7 10:33:21 2013 From: schampailler at skynet.be (S. Champailler) Date: Thu, 7 Nov 2013 10:33:21 +0100 (CET) Subject: [PySide] PySide on Wine In-Reply-To: References: <351169723.1091807.1383813262358.JavaMail.open-xchange@webmail.nmp.skynet.be> Message-ID: <1699686235.1094038.1383816801141.JavaMail.open-xchange@webmail.nmp.skynet.be> Bonjour Sylvain, > I'm curious, why don't you port your application ? Well, not sure I get your question, but here's the context. I develop a manufacturing system for a customer. This *must* run on Windows (I'd love the to use Linux but well, I'm sure you're aware of the linux-on-the-desktop story :-) ). I develop most of the time on Windows but being an idealist, I'd like two things : - I'd like my software to run on Linux (which it does, provided some careful handling of portability issues; thansk to PySide/python, etc this is quite easy). - I'd like to develop my software on Linux (even if its end target is Windows). Now, you could say that since the target is windows, it's safer/more economical to do the actual testing on Windows. In practice, I spent 95% of my time in that situation. However, there's something practical here. My application is a typical fat client/server one. It is deployed at my customer's premise which is behind a firewall. Since I work 100km away from him, we have established a secure connection between the server and me. That server runs linux. From time to time I want to check that the fat-client behaves correctly once run in the customer's network. So what I do is that I deploy my fat-client over the server and test it there. Since the server is the only machine I have access to and it runs linux, my fat-client must run on Linux as well if I want to be able to do my tests. You see ? Stefan > > > 2013/11/7 S. Champailler > > > > Hello, > > > > Not a bug this time... This mail just to tell you that I've been able to > > run my > > PySide-heavy application with Wine on Debian. > > And in non trivial way. > > > > 1. So I've my python 2.7/sqlalchemy/PySide application. > > 2. I make a nice distributable *.exe version out of it with PyInstaller > > 3. Then I run the exe with Wine (the latest one) > > 4. yes! it works > > > > My use case is that I want to test my release procedure for windows. And > > since > > I'm a Debian fan, well, although I produce Windows executables, I still > > want to > > test under Linux :-) > > > > Next step is to actually run PyInstaller under Wine. This way I will be > > able to > > stay in Linux 100% of the time. > > > > Thus one more good point for PySide :-) > > > > stF > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > > > -- > Sylvain Meunier > mgdesign > From ochiu at teslamotors.com Thu Nov 7 22:45:56 2013 From: ochiu at teslamotors.com (Otto Chiu) Date: Thu, 7 Nov 2013 21:45:56 +0000 Subject: [PySide] Installing on Ubuntu with python3 In-Reply-To: References: <459D4CF76F76B54697869793F5BEF3592D5095EC@SJC04-DAG01-N01.teslamotors.com> Message-ID: <459D4CF76F76B54697869793F5BEF3592D50A673@SJC04-DAG01-N01.teslamotors.com> I have Ubuntu 12.04. Even after running the post install script I am getting ImportError: dynamic module does not define init function (PyInit_QtCore). I was able to import PySide just fine though. Thanks, Otto From: Roman Lacko [mailto:backup.rlacko at gmail.com] Sent: Thursday, November 07, 2013 12:13 AM To: Otto Chiu Cc: PySide at qt-project.org Subject: Re: [PySide] Installing on Ubuntu with python3 2013/11/7 Otto Chiu > Hi All, I want to see if anybody has anybody has any tips or hints on installing pyside on Ubuntu with python3 in a virtualenv. I tried following the instructions here: https://pypi.python.org/pypi/PySide#installing-pyside-on-a-unix-system, but I keep getting syntax errors when I go install the egg. You can ignore the syntax errors when installing the egg, just don't forget to run the post install script: $ python2.7 pyside_postinstall.py -install BTW, what version of Ubuntu you have ? Thanks Roman I also tried http://qt-project.org/wiki/PySide_Binaries_Linux with the python3-pyside option but python can't find the PySide package. Any help is much appreciated. Otto _______________________________________________ PySide mailing list PySide at qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From thoromyr at mac.com Fri Nov 8 13:30:39 2013 From: thoromyr at mac.com (Tim Doty) Date: Fri, 08 Nov 2013 06:30:39 -0600 Subject: [PySide] PySide on OS X 10.9 Message-ID: <3C9129B6-26C8-40A0-ABB0-CC6D6F7C1983@mac.com> I made a mistake and “updated” to OS X 10.9 and PySide can no longer be imported. > $ python > Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import PySide > Traceback (most recent call last): > File "", line 1, in > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PySide/__init__.py", line 2, in > File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PySide/private.py", line 2, in > ImportError: No module named QtCore > So I reinstalled Qt and Python would crash instead. I then reinstalled PySide 1.1.1 and it is back to the above error. As far as I know I can’t revert back to OS X 10.8 (which would be nice as it broke other applications as well), but from list traffic it appears that others are using PySide on 10.9 so my question is: how? Tim Doty From backup.rlacko at gmail.com Fri Nov 8 15:25:59 2013 From: backup.rlacko at gmail.com (Roman Lacko) Date: Fri, 8 Nov 2013 15:25:59 +0100 Subject: [PySide] Installing on Ubuntu with python3 In-Reply-To: <459D4CF76F76B54697869793F5BEF3592D50A673@SJC04-DAG01-N01.teslamotors.com> References: <459D4CF76F76B54697869793F5BEF3592D5095EC@SJC04-DAG01-N01.teslamotors.com> <459D4CF76F76B54697869793F5BEF3592D50A673@SJC04-DAG01-N01.teslamotors.com> Message-ID: 2013/11/7 Otto Chiu > I have Ubuntu 12.04. Even after running the post install script I am > getting ImportError: dynamic module does not define init > function (PyInit_QtCore). I was able to import PySide just fine though. > This bug is now fixed. Please get latest version of pyside-setup scripts from github and try rebuild. -Roman > > > Thanks, > > Otto > > > > *From:* Roman Lacko [mailto:backup.rlacko at gmail.com] > *Sent:* Thursday, November 07, 2013 12:13 AM > *To:* Otto Chiu > *Cc:* PySide at qt-project.org > *Subject:* Re: [PySide] Installing on Ubuntu with python3 > > > > 2013/11/7 Otto Chiu > > Hi All, > > I want to see if anybody has anybody has any tips or hints on installing > pyside on Ubuntu with python3 in a virtualenv. > > > > I tried following the instructions here: > https://pypi.python.org/pypi/PySide#installing-pyside-on-a-unix-system, > but I keep getting syntax errors when I go install the egg. > > > > You can ignore the syntax errors when installing the egg, just don't > forget to run the post install script: > > $ python2.7 pyside_postinstall.py -install > > BTW, what version of Ubuntu you have ? > > Thanks > > Roman > > > > I also tried http://qt-project.org/wiki/PySide_Binaries_Linux with the > python3-pyside option but python can’t find the PySide package. > > > > Any help is much appreciated. > > > > Otto > > > _______________________________________________ > 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 heng at cantab.net Fri Nov 8 16:28:05 2013 From: heng at cantab.net (Henry Gomersall) Date: Fri, 08 Nov 2013 15:28:05 +0000 Subject: [PySide] inter-object communications Message-ID: <527D0305.5090909@cantab.net> This is a conceptual question, which I'm sure someone more well versed with Qt can answer. Is *all* inter-object communication within Qt handled through the signal-slot mechanism? Is this what allows PySide to extend classes from within Python and still have them function correctly within the broader framework (as the python methods simply need to handle signals properly)? (is this even generally true?). I've been playing around with cwrap (a not-yet-complete tool to generate cython definition files) and libclang in the context of seeing how much cython+libclang+some templating could generate the vast bulk of wrapping a library (in this case Qt, which seemed like a good end target!). Clearly, there are issues if one wants the python objects to be passed around as though they are first class citizens in the class heirarchy (though I'm sure hacks can be used). It was from this that I posited that Qt sidesteps this by objects never actually calling methods on one another, but instead delegating everything to the signal/slot framework. Is this a fair assessment? Cheers, Henry From jpe at wingware.com Fri Nov 8 16:43:48 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 08 Nov 2013 10:43:48 -0500 Subject: [PySide] inter-object communications In-Reply-To: <527D0305.5090909@cantab.net> References: <527D0305.5090909@cantab.net> Message-ID: <527D06B4.8090202@wingware.com> On 11/8/13 10:28 AM, Henry Gomersall wrote: > This is a conceptual question, which I'm sure someone more well versed > with Qt can answer. > > Is *all* inter-object communication within Qt handled through the > signal-slot mechanism? No, all inter-object communication is not handled by signal / slots. Regular C++ method calls are used. You may be thinking of gtk, which uses its signal mechanism in more places, but even in gtk, not everything uses signals / slots. PySide uses the ability to subclass C++ classes and to override existing virtual methods. This is done by generating a C++ subclass for each class and overriding each method. In each overridden method, a check is done to see if a Python subclass implements the method and to call it if it does. Cheers, John From heng at cantab.net Fri Nov 8 17:01:01 2013 From: heng at cantab.net (Henry Gomersall) Date: Fri, 08 Nov 2013 16:01:01 +0000 Subject: [PySide] inter-object communications In-Reply-To: <527D06B4.8090202@wingware.com> References: <527D0305.5090909@cantab.net> <527D06B4.8090202@wingware.com> Message-ID: <527D0ABD.2080905@cantab.net> On 08/11/13 15:43, John Ehresman wrote: > On 11/8/13 10:28 AM, Henry Gomersall wrote: >> This is a conceptual question, which I'm sure someone more well versed >> with Qt can answer. >> >> Is *all* inter-object communication within Qt handled through the >> signal-slot mechanism? > > No, all inter-object communication is not handled by signal / slots. > Regular C++ method calls are used. You may be thinking of gtk, which > uses its signal mechanism in more places, but even in gtk, not > everything uses signals / slots. No, I just wasn't sure. Clearly there are _some_ cases where objects are passed directly, which would suggest their methods being called directly, but the docs say "Signals and slots are used for communication between objects." without much info about how prevalent that is. > > PySide uses the ability to subclass C++ classes and to override existing > virtual methods. This is done by generating a C++ subclass for each > class and overriding each method. In each overridden method, a check is > done to see if a Python subclass implements the method and to call it if > it does. Ah, ok. So PySide creates a parallel class heirarchy, with methods that can call back into Python. Out of interest, how is this check on being a python implemented subclass performed? (a pointer to the relevant code would be awesome!). Cheers, Henry From ochiu at teslamotors.com Fri Nov 8 17:14:52 2013 From: ochiu at teslamotors.com (Otto Chiu) Date: Fri, 8 Nov 2013 16:14:52 +0000 Subject: [PySide] Installing on Ubuntu with python3 In-Reply-To: References: <459D4CF76F76B54697869793F5BEF3592D5095EC@SJC04-DAG01-N01.teslamotors.com> <459D4CF76F76B54697869793F5BEF3592D50A673@SJC04-DAG01-N01.teslamotors.com> Message-ID: <459D4CF76F76B54697869793F5BEF3592D50B4A4@SJC04-DAG01-N01.teslamotors.com> Awesome! I will give it a try as soon as I can and let you know. From: Roman Lacko [mailto:backup.rlacko at gmail.com] Sent: Friday, November 08, 2013 6:26 AM To: Otto Chiu Cc: PySide at qt-project.org Subject: Re: [PySide] Installing on Ubuntu with python3 2013/11/7 Otto Chiu > I have Ubuntu 12.04. Even after running the post install script I am getting ImportError: dynamic module does not define init function (PyInit_QtCore). I was able to import PySide just fine though. This bug is now fixed. Please get latest version of pyside-setup scripts from github and try rebuild. -Roman Thanks, Otto From: Roman Lacko [mailto:backup.rlacko at gmail.com] Sent: Thursday, November 07, 2013 12:13 AM To: Otto Chiu Cc: PySide at qt-project.org Subject: Re: [PySide] Installing on Ubuntu with python3 2013/11/7 Otto Chiu > Hi All, I want to see if anybody has anybody has any tips or hints on installing pyside on Ubuntu with python3 in a virtualenv. I tried following the instructions here: https://pypi.python.org/pypi/PySide#installing-pyside-on-a-unix-system, but I keep getting syntax errors when I go install the egg. You can ignore the syntax errors when installing the egg, just don't forget to run the post install script: $ python2.7 pyside_postinstall.py -install BTW, what version of Ubuntu you have ? Thanks Roman I also tried http://qt-project.org/wiki/PySide_Binaries_Linux with the python3-pyside option but python can't find the PySide package. Any help is much appreciated. Otto _______________________________________________ PySide mailing list PySide at qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpe at wingware.com Fri Nov 8 17:17:41 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 08 Nov 2013 11:17:41 -0500 Subject: [PySide] inter-object communications In-Reply-To: <527D0ABD.2080905@cantab.net> References: <527D0305.5090909@cantab.net> <527D06B4.8090202@wingware.com> <527D0ABD.2080905@cantab.net> Message-ID: <527D0EA5.2060609@wingware.com> On 11/8/13 11:01 AM, Henry Gomersall wrote: > Ah, ok. So PySide creates a parallel class heirarchy, with methods that > can call back into Python. Out of interest, how is this check on being a > python implemented subclass performed? (a pointer to the relevant code > would be awesome!). At a high level, the code for a method named "foo" is (untested code that omits error handling and ref counting): C++WrapperClass::foo(args...) { override = PyObject_GetAttrString(pySelf, "foo"); if (override != NULL) { result = PyObject_Call(override, args...); return result; } else { return C++BaseClass::foo(args...); } } Best way to get a more detailed look (for me, at least) is to look at the generated code. In a built PySide tree, look at PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp in the build directory. The QWidgetWrapper::setVisible method is the override for the QWidget::setVisible method. Cheers, John From heng at cantab.net Fri Nov 8 18:18:13 2013 From: heng at cantab.net (Henry Gomersall) Date: Fri, 08 Nov 2013 17:18:13 +0000 Subject: [PySide] inter-object communications In-Reply-To: <527D0EA5.2060609@wingware.com> References: <527D0305.5090909@cantab.net> <527D06B4.8090202@wingware.com> <527D0ABD.2080905@cantab.net> <527D0EA5.2060609@wingware.com> Message-ID: <527D1CD5.2020803@cantab.net> On 08/11/13 16:17, John Ehresman wrote: > On 11/8/13 11:01 AM, Henry Gomersall wrote: >> Ah, ok. So PySide creates a parallel class heirarchy, with methods that >> can call back into Python. Out of interest, how is this check on being a >> python implemented subclass performed? (a pointer to the relevant code >> would be awesome!). > > At a high level, the code for a method named "foo" is (untested code > that omits error handling and ref counting): > C++WrapperClass::foo(args...) > { > override = PyObject_GetAttrString(pySelf, "foo"); > if (override != NULL) { > result = PyObject_Call(override, args...); > return result; > } > else { > return C++BaseClass::foo(args...); > } > } > > Best way to get a more detailed look (for me, at least) is to look at > the generated code. In a built PySide tree, look at > PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp in the build directory. > The QWidgetWrapper::setVisible method is the override for the > QWidget::setVisible method. That is interesting. Thanks, Henry From ochiu at teslamotors.com Fri Nov 8 18:22:24 2013 From: ochiu at teslamotors.com (Otto Chiu) Date: Fri, 8 Nov 2013 17:22:24 +0000 Subject: [PySide] Installing on Ubuntu with python3 In-Reply-To: <459D4CF76F76B54697869793F5BEF3592D50B4A4@SJC04-DAG01-N01.teslamotors.com> References: <459D4CF76F76B54697869793F5BEF3592D5095EC@SJC04-DAG01-N01.teslamotors.com> <459D4CF76F76B54697869793F5BEF3592D50A673@SJC04-DAG01-N01.teslamotors.com> <459D4CF76F76B54697869793F5BEF3592D50B4A4@SJC04-DAG01-N01.teslamotors.com> Message-ID: <459D4CF76F76B54697869793F5BEF3592D50B6DD@SJC04-DAG01-N01.teslamotors.com> It is working now. Thank you for the quick response. From: pyside-bounces+ochiu=teslamotors.com at qt-project.org [mailto:pyside-bounces+ochiu=teslamotors.com at qt-project.org] On Behalf Of Otto Chiu Sent: Friday, November 08, 2013 8:15 AM To: Roman Lacko Cc: PySide at qt-project.org Subject: Re: [PySide] Installing on Ubuntu with python3 Awesome! I will give it a try as soon as I can and let you know. From: Roman Lacko [mailto:backup.rlacko at gmail.com] Sent: Friday, November 08, 2013 6:26 AM To: Otto Chiu Cc: PySide at qt-project.org Subject: Re: [PySide] Installing on Ubuntu with python3 2013/11/7 Otto Chiu > I have Ubuntu 12.04. Even after running the post install script I am getting ImportError: dynamic module does not define init function (PyInit_QtCore). I was able to import PySide just fine though. This bug is now fixed. Please get latest version of pyside-setup scripts from github and try rebuild. -Roman Thanks, Otto From: Roman Lacko [mailto:backup.rlacko at gmail.com] Sent: Thursday, November 07, 2013 12:13 AM To: Otto Chiu Cc: PySide at qt-project.org Subject: Re: [PySide] Installing on Ubuntu with python3 2013/11/7 Otto Chiu > Hi All, I want to see if anybody has anybody has any tips or hints on installing pyside on Ubuntu with python3 in a virtualenv. I tried following the instructions here: https://pypi.python.org/pypi/PySide#installing-pyside-on-a-unix-system, but I keep getting syntax errors when I go install the egg. You can ignore the syntax errors when installing the egg, just don't forget to run the post install script: $ python2.7 pyside_postinstall.py -install BTW, what version of Ubuntu you have ? Thanks Roman I also tried http://qt-project.org/wiki/PySide_Binaries_Linux with the python3-pyside option but python can't find the PySide package. Any help is much appreciated. Otto _______________________________________________ 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 heng at cantab.net Fri Nov 8 22:36:13 2013 From: heng at cantab.net (Henry Gomersall) Date: Fri, 08 Nov 2013 21:36:13 +0000 Subject: [PySide] inter-object communications In-Reply-To: <527D0EA5.2060609@wingware.com> References: <527D0305.5090909@cantab.net> <527D06B4.8090202@wingware.com> <527D0ABD.2080905@cantab.net> <527D0EA5.2060609@wingware.com> Message-ID: <527D594D.4000404@cantab.net> On 08/11/13 16:17, John Ehresman wrote: > On 11/8/13 11:01 AM, Henry Gomersall wrote: >> Ah, ok. So PySide creates a parallel class heirarchy, with methods that >> can call back into Python. Out of interest, how is this check on being a >> python implemented subclass performed? (a pointer to the relevant code >> would be awesome!). > > At a high level, the code for a method named "foo" is (untested code > that omits error handling and ref counting): > C++WrapperClass::foo(args...) > { > override = PyObject_GetAttrString(pySelf, "foo"); > if (override != NULL) { > result = PyObject_Call(override, args...); > return result; > } > else { > return C++BaseClass::foo(args...); > } > } > > Best way to get a more detailed look (for me, at least) is to look at > the generated code. In a built PySide tree, look at > PySide/QtGui/PySide/QtGui/qwidget_wrapper.cpp in the build directory. > The QWidgetWrapper::setVisible method is the override for the > QWidget::setVisible method. Ach, it's complicated! So it seems the actual binding between objects is handled by Shiboken. Does the python object itself have a reference to the wrapper object, or is that only provided on demand through shiboken? Is this detail documented anywhere? Cheers, Henry From jpe at wingware.com Sat Nov 9 00:41:33 2013 From: jpe at wingware.com (John Ehresman) Date: Fri, 08 Nov 2013 18:41:33 -0500 Subject: [PySide] inter-object communications In-Reply-To: <527D594D.4000404@cantab.net> References: <527D0305.5090909@cantab.net> <527D06B4.8090202@wingware.com> <527D0ABD.2080905@cantab.net> <527D0EA5.2060609@wingware.com> <527D594D.4000404@cantab.net> Message-ID: <527D76AD.2020408@wingware.com> On 11/8/13 4:36 PM, Henry Gomersall wrote: > So it seems the actual binding between objects is handled by Shiboken. > Does the python object itself have a reference to the wrapper object, or > is that only provided on demand through shiboken? The python object has the C++ pointer to the object. That pointer will be to the object of the wrapper subclass only if the object was created with the wrapper subclass constructor. It other cases, the pointer will be to an object of a class such as QObject or QWidget. (BTW, most of this is not Qt specific). > Is this detail documented anywhere? The documentation I know of is http://setanta.wordpress.com/binding-c/ which was written by some of the original shiboken developers. I don't know how complete it is. Cheers, John From thoromyr at mac.com Sat Nov 9 02:47:43 2013 From: thoromyr at mac.com (Tim Doty) Date: Fri, 08 Nov 2013 19:47:43 -0600 Subject: [PySide] PySide on OS X Message-ID: <9FF965E9-2EDA-493B-850F-DA68B3370DA0@mac.com> PySide 1.2.1 does not appear to be available for OS X. That is, prebuilt is only on Windows, linux uses whatever distros package management, and OS X users are expected to get the Qt developer source and compile everything from scratch. At least, the only 1.2.1 I can find presents it that way [https://pypi.python.org/pypi/PySide] PySide 1.1.1 appears to be the last packaged for OS X. [https://qt-project.org/wiki/PySide_Binaries_MacOSX] Unfortunately it doesn’t appear to be compatible with OS X 10.9 inasmuch as PySide was installed and working until I updated to 10.9. Is anyone using PySide on OS X? On OS X 10.9? Although theoretically I could compile Qt and PySide that isn’t a particularly good solution when the apps I write need to be able to run on other systems — for better or worse I lack the requisite knowledge to package up Qt and PySide for redistribution. Is PySide just not widely enough used that lack of OS X support doesn’t matter? From sean at seanfisk.com Sat Nov 9 07:18:57 2013 From: sean at seanfisk.com (Sean Fisk) Date: Sat, 9 Nov 2013 01:18:57 -0500 Subject: [PySide] PySide on OS X In-Reply-To: <9FF965E9-2EDA-493B-850F-DA68B3370DA0@mac.com> References: <9FF965E9-2EDA-493B-850F-DA68B3370DA0@mac.com> Message-ID: Hi Tim, I frequently use PySide on OS X. The best way to install and use it, in my opinion, is the following: - Install homebrew and run brew install pyside pyside-tools. This will automatically download and compile Qt from source as well. - Create a virtualenv for your project. - Write a PTH file to the site-packages directory of your virtualenv that points to your PySide installation. On my system the path is /usr/local/lib/python2.7/site-packages. With that, you should be able to run: python -c 'import PySide; print PySide.__version__' To distribute our PySide app we use py2app to create an app bundle, makeicns to create our application icon, and yoursway-create-dmgto create a fancy disk image. They are not without issues but for the most part work well. Our app distributes without any external dependencies. I can’t comment on PySide with OS 10.9 Mavericks as I am still on OS 10.6 Snow Leopard (I know, I know). Honestly, the reason I haven’t updated is because I figured everything would break. Here are my versions: - Qt 4.8.5 - PySide 1.2.0 - Python 2.7.5 - Mac OS 10.6 Snow Leopard - py2app 0.7.3 Please let me know if you need any help installing or distributing your application. Our project is closed-source but I would be happy to share our distribution code with you. Cheers, -- Sean Fisk On Fri, Nov 8, 2013 at 8:47 PM, Tim Doty wrote: > PySide 1.2.1 does not appear to be available for OS X. That is, prebuilt > is only on Windows, linux uses whatever distros package management, and OS > X users are expected to get the Qt developer source and compile everything > from scratch. At least, the only 1.2.1 I can find presents it that way [ > https://pypi.python.org/pypi/PySide] > > PySide 1.1.1 appears to be the last packaged for OS X. [ > https://qt-project.org/wiki/PySide_Binaries_MacOSX] Unfortunately it > doesn’t appear to be compatible with OS X 10.9 inasmuch as PySide was > installed and working until I updated to 10.9. > > Is anyone using PySide on OS X? On OS X 10.9? Although theoretically I > could compile Qt and PySide that isn’t a particularly good solution when > the apps I write need to be able to run on other systems — for better or > worse I lack the requisite knowledge to package up Qt and PySide for > redistribution. > > Is PySide just not widely enough used that lack of OS X support doesn’t > matter? > _______________________________________________ > 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 heng at cantab.net Sat Nov 9 08:59:47 2013 From: heng at cantab.net (Henry Gomersall) Date: Sat, 09 Nov 2013 07:59:47 +0000 Subject: [PySide] inter-object communications In-Reply-To: <527D76AD.2020408@wingware.com> References: <527D0305.5090909@cantab.net> <527D06B4.8090202@wingware.com> <527D0ABD.2080905@cantab.net> <527D0EA5.2060609@wingware.com> <527D594D.4000404@cantab.net> <527D76AD.2020408@wingware.com> Message-ID: <527DEB73.5040001@cantab.net> On 08/11/13 23:41, John Ehresman wrote: > On 11/8/13 4:36 PM, Henry Gomersall wrote: >> So it seems the actual binding between objects is handled by Shiboken. >> Does the python object itself have a reference to the wrapper object, or >> is that only provided on demand through shiboken? > > The python object has the C++ pointer to the object. That pointer will > be to the object of the wrapper subclass only if the object was created > with the wrapper subclass constructor. It other cases, the pointer will > be to an object of a class such as QObject or QWidget. (BTW, most of > this is not Qt specific). Ok, helpful. The not being Qt specific is partly why it's so helpful :) > >> Is this detail documented anywhere? > > The documentation I know of is http://setanta.wordpress.com/binding-c/ > which was written by some of the original shiboken developers. I don't > know how complete it is. Ah, really useful! That's a great link - thanks! Cheers, Henry From pyside at m.allo.ws Sun Nov 10 22:32:49 2013 From: pyside at m.allo.ws (Zak) Date: Sun, 10 Nov 2013 16:32:49 -0500 Subject: [PySide] PySide on OS X In-Reply-To: References: <9FF965E9-2EDA-493B-850F-DA68B3370DA0@mac.com> Message-ID: <527FFB81.1040303@m.allo.ws> Hello Tim, I am using PySide with Mac OS X 10.9 Mavericks and everything is working fine. Here is my setup: Mac OS X 10.9 Mavericks Python 2.7.5 from Python.org (not Homebrew) PySide 1.1.1 (I downloaded the prebuilt binaries) Qt 4.8.2 (I downloaded the prebuilt binaries) PyQt 4.9.4 (just FYI) All of those libraries are 64-bit. I originally installed PySide (and PyQt4) on OS X 10.8, and when I upgraded to 10.9 everything just continued working. I have several PySide and PyQt applications that I bundled into single-file executables with PyInstaller, and all of those still work fine on OS X 10.9. They use various versions of PySide, PyQt, and Qt. I have no idea why it works for me and not for you. For me, upgrading to OS X 10.9 broke precisely one thing: Little Snitch. And there was a new version available for download from the Little Snitch website that fixed it. It was really a seamless upgrade, and I love all the new features in 10.9. Good luck, Zak Fallows From thoromyr at mac.com Sun Nov 10 23:35:09 2013 From: thoromyr at mac.com (Tim Doty) Date: Sun, 10 Nov 2013 16:35:09 -0600 Subject: [PySide] PySide on OS X In-Reply-To: <527FFB81.1040303@m.allo.ws> References: <9FF965E9-2EDA-493B-850F-DA68B3370DA0@mac.com> <527FFB81.1040303@m.allo.ws> Message-ID: <43A919EB-E831-450E-B065-68AF1EDBD842@mac.com> Thanks both for your input, I really appreciate it. Several things broke for me after upgrading to 10.9 and so far only one has been resolved (its an app that is distributed as a binary, but uses Qt — and Python IIRC). Reinstalling the app fixed it. I’ve dug around some more and was able to get two apps to work by by changing PYTHONPATH and, while I understand why that works, I don’t understand why it was needed. Particularly after a reinstall. Its possible that all the upgrades over the years have caused a problem somewhere: the system is only a year old, but I keep moving forward from one system to the next and started pretty much when Apple went Intel. I know there’s some cruft accumulated in ~/Library, just not clear what to do about it. And at a future date I may take you (Sean) up on your offer about distribution code. Too many projects ATM and getting the one app to work has allowed other things to keep me busy :) Thanks again! Tim Doty On Nov 10, 2013, at 3:32 PM, Zak wrote: > Hello Tim, > > I am using PySide with Mac OS X 10.9 Mavericks and everything is working fine. Here is my setup: > > Mac OS X 10.9 Mavericks > Python 2.7.5 from Python.org (not Homebrew) > PySide 1.1.1 (I downloaded the prebuilt binaries) > Qt 4.8.2 (I downloaded the prebuilt binaries) > PyQt 4.9.4 (just FYI) > > All of those libraries are 64-bit. I originally installed PySide (and PyQt4) on OS X 10.8, and when I upgraded to 10.9 everything just continued working. > > I have several PySide and PyQt applications that I bundled into single-file executables with PyInstaller, and all of those still work fine on OS X 10.9. They use various versions of PySide, PyQt, and Qt. > > I have no idea why it works for me and not for you. For me, upgrading to OS X 10.9 broke precisely one thing: Little Snitch. And there was a new version available for download from the Little Snitch website that fixed it. It was really a seamless upgrade, and I love all the new features in 10.9. > > Good luck, > > Zak Fallows From sean at seanfisk.com Mon Nov 11 07:15:58 2013 From: sean at seanfisk.com (Sean Fisk) Date: Mon, 11 Nov 2013 01:15:58 -0500 Subject: [PySide] PySide on OS X In-Reply-To: <43A919EB-E831-450E-B065-68AF1EDBD842@mac.com> References: <9FF965E9-2EDA-493B-850F-DA68B3370DA0@mac.com> <527FFB81.1040303@m.allo.ws> <43A919EB-E831-450E-B065-68AF1EDBD842@mac.com> Message-ID: Hi Tim, I realize it’s probably a little late now, but if you still have a Mountain Lion machine, you can try running python -c 'from pprint import pprint; import sys; pprint(sys.path)' on both machines with your Python to see if the default paths have changed. Debugging PYTHONPATH issues are *usually*straightforward - either modules are on it or not. Let me know if you need some help, since I will be updating to Mavericks soon too. Good luck on your apps! -- Sean Fisk On Sun, Nov 10, 2013 at 5:35 PM, Tim Doty wrote: > Thanks both for your input, I really appreciate it. Several things broke > for me after upgrading to 10.9 and so far only one has been resolved (its > an app that is distributed as a binary, but uses Qt — and Python IIRC). > Reinstalling the app fixed it. > > I’ve dug around some more and was able to get two apps to work by by > changing PYTHONPATH and, while I understand why that works, I don’t > understand why it was needed. Particularly after a reinstall. Its possible > that all the upgrades over the years have caused a problem somewhere: the > system is only a year old, but I keep moving forward from one system to the > next and started pretty much when Apple went Intel. I know there’s some > cruft accumulated in ~/Library, just not clear what to do about it. > > And at a future date I may take you (Sean) up on your offer about > distribution code. Too many projects ATM and getting the one app to work > has allowed other things to keep me busy :) > > Thanks again! > > Tim Doty > > On Nov 10, 2013, at 3:32 PM, Zak wrote: > > > Hello Tim, > > > > I am using PySide with Mac OS X 10.9 Mavericks and everything is working > fine. Here is my setup: > > > > Mac OS X 10.9 Mavericks > > Python 2.7.5 from Python.org (not Homebrew) > > PySide 1.1.1 (I downloaded the prebuilt binaries) > > Qt 4.8.2 (I downloaded the prebuilt binaries) > > PyQt 4.9.4 (just FYI) > > > > All of those libraries are 64-bit. I originally installed PySide (and > PyQt4) on OS X 10.8, and when I upgraded to 10.9 everything just continued > working. > > > > I have several PySide and PyQt applications that I bundled into > single-file executables with PyInstaller, and all of those still work fine > on OS X 10.9. They use various versions of PySide, PyQt, and Qt. > > > > I have no idea why it works for me and not for you. For me, upgrading to > OS X 10.9 broke precisely one thing: Little Snitch. And there was a new > version available for download from the Little Snitch website that fixed > it. It was really a seamless upgrade, and I love all the new features in > 10.9. > > > > Good luck, > > > > Zak Fallows > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Mon Nov 11 08:24:55 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Mon, 11 Nov 2013 20:24:55 +1300 Subject: [PySide] conforming fonts between platforms Message-ID: <52808647.5040408@ohufx.com> Hi all, I am facing the challenge I'm sure many of you have had to deal with before: I need to make sure that the font used in my application looks as similar as posisble between windows, linux and osx. I am currently using 12 point Helvetica, which turns into a 16 pixel high Sans Nimbus L on my linux box messing up my custom widget's layouts. What is the best practise here? Supposedly it is possible to compile a font into a resource which would ensure almost identical results, right?! Has anybody ever done this before? Cheers, frank From sean at seanfisk.com Mon Nov 11 08:48:01 2013 From: sean at seanfisk.com (Sean Fisk) Date: Mon, 11 Nov 2013 02:48:01 -0500 Subject: [PySide] conforming fonts between platforms In-Reply-To: <52808647.5040408@ohufx.com> References: <52808647.5040408@ohufx.com> Message-ID: Hi Frank, I struggled with this a while agoand have it working on Windows and Mac OS X. Still having some problems on GNU/Linux (specifically targeting Ubuntu) but my team is working on it. We first compile some TTF files into our resources, then import them in our program, then call this: # fonts.py from PySide import QtCore, QtGui def init(): """Initialize embedded fonts.""" font_dir_resource = QtCore.QResource(':/fonts') font_resource_path = font_dir_resource.absoluteFilePath() for ttf_filename in font_dir_resource.children(): # DON'T use `os.path.join()' here because Qt always uses UNIX-style # paths. On Windows `os.sep' is '\\'. res_file = QtCore.QFile('/'.join([font_resource_path, ttf_filename])) # Must re-open the file in read-only mode to read the contents # correctly. res_file.open(QtCore.QIODevice.ReadOnly) byte_array = res_file.readAll() QtGui.QFontDatabase.addApplicationFontFromData(byte_array) And to use it (snippet): class LoginView(QtGui.QDialog): def __init__(self, parent=None): super(LoginView, self).__init__(parent) # ... self.title_font = QtGui.QFont('YourFontName', 46) self.title_font.setStyleStrategy(QtGui.QFont.PreferAntialias) self.title_label = QtGui.QLabel('Your text in your font') self.title_label.setFont(self.title_font) Hope this helps. And if you get it working on GNU/Linux, let me know what you did! Cheers, -- Sean Fisk On Mon, Nov 11, 2013 at 2:24 AM, Frank Rueter | OHUfx wrote: > Hi all, > > I am facing the challenge I'm sure many of you have had to deal with > before: > > I need to make sure that the font used in my application looks as > similar as posisble between windows, linux and osx. > > I am currently using 12 point Helvetica, which turns into a 16 pixel > high Sans Nimbus L on my linux box messing up my custom widget's layouts. > > What is the best practise here? > Supposedly it is possible to compile a font into a resource which would > ensure almost identical results, right?! Has anybody ever done this before? > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Mon Nov 11 21:20:01 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 12 Nov 2013 09:20:01 +1300 Subject: [PySide] conforming fonts between platforms In-Reply-To: References: <52808647.5040408@ohufx.com> Message-ID: <52813BF1.40109@ohufx.com> thanks Sean, I will give it a go (I'm on Ubunto as well at home) On 11/11/13 20:48, Sean Fisk wrote: > > Hi Frank, > > I struggled with this a while ago > > and have it working on Windows and Mac OS X. Still having some > problems on GNU/Linux (specifically targeting Ubuntu) but my team is > working on it. We first compile some TTF files into our resources, > then import them in our program, then call this: > > |# fonts.py > > from PySideimport QtCore, QtGui > > def init(): > """Initialize embedded fonts.""" > font_dir_resource = QtCore.QResource(':/fonts') > font_resource_path = font_dir_resource.absoluteFilePath() > for ttf_filenamein font_dir_resource.children(): > # DON'T use `os.path.join()' here because Qt always uses UNIX-style > # paths. On Windows `os.sep' is '\\'. > res_file = QtCore.QFile('/'.join([font_resource_path, ttf_filename])) > # Must re-open the file in read-only mode to read the contents > # correctly. > res_file.open(QtCore.QIODevice.ReadOnly) > byte_array = res_file.readAll() > QtGui.QFontDatabase.addApplicationFontFromData(byte_array)| > > And to use it (snippet): > > |class LoginView(QtGui.QDialog): > def __init__(self, parent=None): > super(LoginView, self).__init__(parent) > > # ... > self.title_font = QtGui.QFont('YourFontName',46) > self.title_font.setStyleStrategy(QtGui.QFont.PreferAntialias) > self.title_label = QtGui.QLabel('Your text in your font') > self.title_label.setFont(self.title_font)| > > Hope this helps. And if you get it working on GNU/Linux, let me know > what you did! > > Cheers, > > -- > Sean Fisk > > > On Mon, Nov 11, 2013 at 2:24 AM, Frank Rueter | OHUfx > wrote: > > Hi all, > > I am facing the challenge I'm sure many of you have had to deal > with before: > > I need to make sure that the font used in my application looks as > similar as posisble between windows, linux and osx. > > I am currently using 12 point Helvetica, which turns into a 16 pixel > high Sans Nimbus L on my linux box messing up my custom widget's > layouts. > > What is the best practise here? > Supposedly it is possible to compile a font into a resource which > would > ensure almost identical results, right?! Has anybody ever done > this before? > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Tue Nov 12 00:05:23 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 12 Nov 2013 12:05:23 +1300 Subject: [PySide] conforming fonts between platforms In-Reply-To: <52813BF1.40109@ohufx.com> References: <52808647.5040408@ohufx.com> <52813BF1.40109@ohufx.com> Message-ID: <528162B3.6040107@ohufx.com> Actually I realised that in my case I can simply inherit the system font, because my app is meant to run inside of another host app which is already doing the hard work with fonts. So in my case working with QApplication.font() magically solves all my troubles (inside the host app, not as a standalone). I will check in with the guys who wrote the host app to see if they can share the magic solution. Cheers, frank On 12/11/13 09:20, Frank Rueter | OHUfx wrote: > thanks Sean, > > I will give it a go (I'm on Ubunto as well at home) > > On 11/11/13 20:48, Sean Fisk wrote: >> >> Hi Frank, >> >> I struggled with this a while ago >> >> and have it working on Windows and Mac OS X. Still having some >> problems on GNU/Linux (specifically targeting Ubuntu) but my team is >> working on it. We first compile some TTF files into our resources, >> then import them in our program, then call this: >> >> |# fonts.py >> >> from PySideimport QtCore, QtGui >> >> def init(): >> """Initialize embedded fonts.""" >> font_dir_resource = QtCore.QResource(':/fonts') >> font_resource_path = font_dir_resource.absoluteFilePath() >> for ttf_filenamein font_dir_resource.children(): >> # DON'T use `os.path.join()' here because Qt always uses UNIX-style >> # paths. On Windows `os.sep' is '\\'. >> res_file = QtCore.QFile('/'.join([font_resource_path, ttf_filename])) >> # Must re-open the file in read-only mode to read the contents >> # correctly. >> res_file.open(QtCore.QIODevice.ReadOnly) >> byte_array = res_file.readAll() >> QtGui.QFontDatabase.addApplicationFontFromData(byte_array)| >> >> And to use it (snippet): >> >> |class LoginView(QtGui.QDialog): >> def __init__(self, parent=None): >> super(LoginView, self).__init__(parent) >> >> # ... >> self.title_font = QtGui.QFont('YourFontName',46) >> self.title_font.setStyleStrategy(QtGui.QFont.PreferAntialias) >> self.title_label = QtGui.QLabel('Your text in your font') >> self.title_label.setFont(self.title_font)| >> >> Hope this helps. And if you get it working on GNU/Linux, let me know >> what you did! >> >> Cheers, >> >> -- >> Sean Fisk >> >> >> On Mon, Nov 11, 2013 at 2:24 AM, Frank Rueter | OHUfx >> > wrote: >> >> Hi all, >> >> I am facing the challenge I'm sure many of you have had to deal >> with before: >> >> I need to make sure that the font used in my application looks as >> similar as posisble between windows, linux and osx. >> >> I am currently using 12 point Helvetica, which turns into a 16 pixel >> high Sans Nimbus L on my linux box messing up my custom widget's >> layouts. >> >> What is the best practise here? >> Supposedly it is possible to compile a font into a resource which >> would >> ensure almost identical results, right?! Has anybody ever done >> this before? >> >> Cheers, >> frank >> _______________________________________________ >> 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 frank at ohufx.com Tue Nov 12 00:28:32 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 12 Nov 2013 12:28:32 +1300 Subject: [PySide] conforming fonts between platforms In-Reply-To: <528162B3.6040107@ohufx.com> References: <52808647.5040408@ohufx.com> <52813BF1.40109@ohufx.com> <528162B3.6040107@ohufx.com> Message-ID: <52816820.3000606@ohufx.com> Actually, simply using setPixelSize and letting QT take care of the font family does the job in my case even as a standalone, i.e.: font = QApplication.font() self.fontTitle = font self.fontTitle.setPixelSize(12) self.fontTitle.setBold(True) self.fontSubTitle = QApplication.font() self.fontSubTitle.setPixelSize(10) self.fontSubTitle.setBold(False) On 12/11/13 12:05, Frank Rueter | OHUfx wrote: > Actually I realised that in my case I can simply inherit the system > font, because my app is meant to run inside of another host app which > is already doing the hard work with fonts. > So in my case working with QApplication.font() magically solves all my > troubles (inside the host app, not as a standalone). > > I will check in with the guys who wrote the host app to see if they > can share the magic solution. > > Cheers, > frank > > > On 12/11/13 09:20, Frank Rueter | OHUfx wrote: >> thanks Sean, >> >> I will give it a go (I'm on Ubunto as well at home) >> >> On 11/11/13 20:48, Sean Fisk wrote: >>> >>> Hi Frank, >>> >>> I struggled with this a while ago >>> and >>> have it working on Windows and Mac OS X. Still having some problems >>> on GNU/Linux (specifically targeting Ubuntu) but my team is working >>> on it. We first compile some TTF files into our resources, then >>> import them in our program, then call this: >>> >>> |# fonts.py >>> >>> from PySideimport QtCore, QtGui >>> >>> def init(): >>> """Initialize embedded fonts.""" >>> font_dir_resource = QtCore.QResource(':/fonts') >>> font_resource_path = font_dir_resource.absoluteFilePath() >>> for ttf_filenamein font_dir_resource.children(): >>> # DON'T use `os.path.join()' here because Qt always uses UNIX-style >>> # paths. On Windows `os.sep' is '\\'. >>> res_file = QtCore.QFile('/'.join([font_resource_path, ttf_filename])) >>> # Must re-open the file in read-only mode to read the contents >>> # correctly. >>> res_file.open(QtCore.QIODevice.ReadOnly) >>> byte_array = res_file.readAll() >>> QtGui.QFontDatabase.addApplicationFontFromData(byte_array)| >>> >>> And to use it (snippet): >>> >>> |class LoginView(QtGui.QDialog): >>> def __init__(self, parent=None): >>> super(LoginView, self).__init__(parent) >>> >>> # ... >>> self.title_font = QtGui.QFont('YourFontName',46) >>> self.title_font.setStyleStrategy(QtGui.QFont.PreferAntialias) >>> self.title_label = QtGui.QLabel('Your text in your font') >>> self.title_label.setFont(self.title_font)| >>> >>> Hope this helps. And if you get it working on GNU/Linux, let me know >>> what you did! >>> >>> Cheers, >>> >>> -- >>> Sean Fisk >>> >>> >>> On Mon, Nov 11, 2013 at 2:24 AM, Frank Rueter | OHUfx >>> > wrote: >>> >>> Hi all, >>> >>> I am facing the challenge I'm sure many of you have had to deal >>> with before: >>> >>> I need to make sure that the font used in my application looks as >>> similar as posisble between windows, linux and osx. >>> >>> I am currently using 12 point Helvetica, which turns into a 16 pixel >>> high Sans Nimbus L on my linux box messing up my custom widget's >>> layouts. >>> >>> What is the best practise here? >>> Supposedly it is possible to compile a font into a resource >>> which would >>> ensure almost identical results, right?! Has anybody ever done >>> this before? >>> >>> Cheers, >>> frank >>> _______________________________________________ >>> 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 frank at ohufx.com Tue Nov 12 05:26:59 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 12 Nov 2013 17:26:59 +1300 Subject: [PySide] QLabel vs QWebView for simple html display Message-ID: <5281AE13.9070102@ohufx.com> Hi all, I have a QLabel in my app that displays some very simple html code pulled from a website. So far I have been using it successfully as a sort of news feed, but now I need to display an image from a url as well, which QLabel can't do afaik. So I had a go with QWebView but that just won't be have the same as QLabel when it comes to background colour (tried to set it to be transparent), sizes, size policies etc. I'm also getting some redraw problems when the QWebView is set to a transparent background. Here is some test code: http://pastebin.com/cSizj9ET Is it the right approach to force QWebView to behave like QLabel for the sole reason of being able to display an image via html? Or is there a simpler way of doing this? Cheers, frank From techtonik at gmail.com Tue Nov 12 08:00:10 2013 From: techtonik at gmail.com (anatoly techtonik) Date: Tue, 12 Nov 2013 10:00:10 +0300 Subject: [PySide] conforming fonts between platforms In-Reply-To: <52816820.3000606@ohufx.com> References: <52808647.5040408@ohufx.com> <52813BF1.40109@ohufx.com> <528162B3.6040107@ohufx.com> <52816820.3000606@ohufx.com> Message-ID: >From my own experience with playing with TTF fonts on Windows (the experiment is made with pyglet and checked into its codebase, so it may be pyglet bug), there is no guarantee that all symbols in monospace font have the same pixel size. It may disrupt layout easily. So this setPixelSize looks like the stuff that allows to force proper dimensions, and it is the only logical way to do for me. -- anatoly t. On Tue, Nov 12, 2013 at 2:28 AM, Frank Rueter | OHUfx wrote: > Actually, simply using setPixelSize and letting QT take care of the font > family does the job in my case even as a standalone, i.e.: > > font = QApplication.font() > self.fontTitle = font > self.fontTitle.setPixelSize(12) > self.fontTitle.setBold(True) > > self.fontSubTitle = QApplication.font() > self.fontSubTitle.setPixelSize(10) > self.fontSubTitle.setBold(False) > > > > > > On 12/11/13 12:05, Frank Rueter | OHUfx wrote: > > Actually I realised that in my case I can simply inherit the system font, > because my app is meant to run inside of another host app which is already > doing the hard work with fonts. > So in my case working with QApplication.font() magically solves all my > troubles (inside the host app, not as a standalone). > > I will check in with the guys who wrote the host app to see if they can > share the magic solution. > > Cheers, > frank > > > On 12/11/13 09:20, Frank Rueter | OHUfx wrote: > > thanks Sean, > > I will give it a go (I'm on Ubunto as well at home) > > On 11/11/13 20:48, Sean Fisk wrote: > > Hi Frank, > > I struggled with this a while ago and have it working on Windows and Mac OS > X. Still having some problems on GNU/Linux (specifically targeting Ubuntu) > but my team is working on it. We first compile some TTF files into our > resources, then import them in our program, then call this: > > # fonts.py > > from PySide import QtCore, QtGui > > def init(): > """Initialize embedded fonts.""" > font_dir_resource = QtCore.QResource(':/fonts') > font_resource_path = font_dir_resource.absoluteFilePath() > for ttf_filename in font_dir_resource.children(): > # DON'T use `os.path.join()' here because Qt always uses UNIX-style > # paths. On Windows `os.sep' is '\\'. > res_file = QtCore.QFile('/'.join([font_resource_path, > ttf_filename])) > # Must re-open the file in read-only mode to read the contents > # correctly. > res_file.open(QtCore.QIODevice.ReadOnly) > byte_array = res_file.readAll() > QtGui.QFontDatabase.addApplicationFontFromData(byte_array) > > And to use it (snippet): > > class LoginView(QtGui.QDialog): > def __init__(self, parent=None): > super(LoginView, self).__init__(parent) > > # ... > self.title_font = QtGui.QFont('YourFontName', 46) > self.title_font.setStyleStrategy(QtGui.QFont.PreferAntialias) > self.title_label = QtGui.QLabel('Your text in your font') > self.title_label.setFont(self.title_font) > > Hope this helps. And if you get it working on GNU/Linux, let me know what > you did! > > Cheers, > > -- > Sean Fisk > > > On Mon, Nov 11, 2013 at 2:24 AM, Frank Rueter | OHUfx > wrote: >> >> Hi all, >> >> I am facing the challenge I'm sure many of you have had to deal with >> before: >> >> I need to make sure that the font used in my application looks as >> similar as posisble between windows, linux and osx. >> >> I am currently using 12 point Helvetica, which turns into a 16 pixel >> high Sans Nimbus L on my linux box messing up my custom widget's layouts. >> >> What is the best practise here? >> Supposedly it is possible to compile a font into a resource which would >> ensure almost identical results, right?! Has anybody ever done this >> before? >> >> Cheers, >> frank >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > From gargi.das at hotmail.com Tue Nov 12 08:25:05 2013 From: gargi.das at hotmail.com (Gargi Das) Date: Tue, 12 Nov 2013 12:55:05 +0530 Subject: [PySide] QLabel vs QWebView for simple html display Message-ID: Hi, If html is that much simple why dont you parse the html and extract the url, but than you have to download the image and make a proper model for your listview. Other solution is to apply some css to the webview and make it look like label i think that can be done !! Regards, Gargi ________________________________ From: Frank Rueter | OHUfx Sent: ‎12-‎11-‎2013 09:57 AM To: pyside at qt-project.org Subject: [PySide] QLabel vs QWebView for simple html display Hi all, I have a QLabel in my app that displays some very simple html code pulled from a website. So far I have been using it successfully as a sort of news feed, but now I need to display an image from a url as well, which QLabel can't do afaik. So I had a go with QWebView but that just won't be have the same as QLabel when it comes to background colour (tried to set it to be transparent), sizes, size policies etc. I'm also getting some redraw problems when the QWebView is set to a transparent background. Here is some test code: http://pastebin.com/cSizj9ET Is it the right approach to force QWebView to behave like QLabel for the sole reason of being able to display an image via html? Or is there a simpler way of doing this? Cheers, frank _______________________________________________ PySide mailing list PySide at qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at seanfisk.com Tue Nov 12 09:13:45 2013 From: sean at seanfisk.com (Sean Fisk) Date: Tue, 12 Nov 2013 03:13:45 -0500 Subject: [PySide] QLabel vs QWebView for simple html display In-Reply-To: <5281AE13.9070102@ohufx.com> References: <5281AE13.9070102@ohufx.com> Message-ID: Hi Frank, I think it depends whether the HTML dictates the layout or you would like to dictate the layout: - HTML dictates layout → Use the web view. - I want to dictate the layout → Parse the HTML to extract the URL, download the image manually, and put it into a QLabel. Also remember that if you would like to distribute this and bundle PySide/Qt, using WebKit will add a significant size to your executable. If you truly need it, include it. However, for this, I don’t think it’s necessary. >From what you have said, it sounds like you would like to dictate the layout. The process isn’t exactly simple, but it’s doable in not too many lines. Off the top of my head: #!/usr/bin/env python import sys from PySide import QtGuiimport requestsimport lxml.html def main(argv): app = QtGui.QApplication(argv) widget = QtGui.QWidget() layout = QtGui.QVBoxLayout(widget) html = '''

announcementssome text that is pulled from a website but which will be quite simple.

''' # NOPEP8 doc = lxml.html.fragment_fromstring(html) for img_src_attribute in doc.xpath('//img/@src'): response = requests.get(img_src_attribute) pixmap = QtGui.QPixmap() pixmap.loadFromData(response.content) label = QtGui.QLabel() label.setPixmap(pixmap) layout.addWidget(label) widget.show() widget.raise_() return app.exec_() if __name__ == '__main__': raise SystemExit(main(sys.argv)) ... which yields... [image: Inline image 2] I didn't address the issue of transparent backgrounds, etc., because I'm not sure exactly what's going on there. But all three of the widgets on-screen are QLabels, so they should be able to do anything a QLabel can do. Obviously, do some more error checking than I did if you are pulling this from a website with untrusted data. Let me know if you need help with that. Hope this helps! Sincerely, -- Sean Fisk On Mon, Nov 11, 2013 at 11:26 PM, Frank Rueter | OHUfx wrote: > Hi all, > > I have a QLabel in my app that displays some very simple html code > pulled from a website. > > So far I have been using it successfully as a sort of news feed, but now > I need to display an image from a url as well, which QLabel can't do afaik. > > So I had a go with QWebView but that just won't be have the same as > QLabel when it comes to background colour (tried to set it to be > transparent), sizes, size policies etc. > I'm also getting some redraw problems when the QWebView is set to a > transparent background. > > Here is some test code: > http://pastebin.com/cSizj9ET > > > Is it the right approach to force QWebView to behave like QLabel for the > sole reason of being able to display an image via html? Or is there a > simpler way of doing this? > > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: screenshot.png Type: image/png Size: 62474 bytes Desc: not available URL: From kay.hayen at gmail.com Tue Nov 12 11:54:29 2013 From: kay.hayen at gmail.com (Kay Hayen) Date: Tue, 12 Nov 2013 11:54:29 +0100 Subject: [PySide] PySide bindings don't work with Nuitka Message-ID: <528208E5.2080204@gmail.com> Hello, I am the author of a very compatible Python compiler called Nuitka, see http://nuitka.net/pages/overview.html for some information about it. In the past, I have made my compiler work with Qt and wxPython by creating patches myself, and I was capable of doing that. Unfortunately that does not yet work with PySide, but that is what many users have. I raised a bug for it, but it go no attention yet: https://bugreports.qt-project.org/browse/PYSIDE-198 The thing is, really, I just need some pointers, for where I need to make Python function/method checks in shiboken recognize compiled functions as well. Currently the bindings don't turn my callable object into slots, as can be seen in the "hello.py" attached to the bug. Would you please consider lending me a hand, and pointing me in the right direction, as to where to ask instead. PySide is a big enough community for me to have no clue where to report what against. :-) Yours, Kay From frank at ohufx.com Tue Nov 12 20:45:24 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 13 Nov 2013 08:45:24 +1300 Subject: [PySide] conforming fonts between platforms In-Reply-To: References: <52808647.5040408@ohufx.com> <52813BF1.40109@ohufx.com> <528162B3.6040107@ohufx.com> <52816820.3000606@ohufx.com> Message-ID: <1424dd8c468.27ac.2e27cae6899a6173ae9339f12e35714b@ohufx.com> Thanks for confirming Sent with AquaMail for Android http://www.aqua-mail.com On 12 November 2013 8:00:10 PM anatoly techtonik wrote: > From my own experience with playing with TTF fonts on Windows (the > experiment is made with pyglet and checked into its codebase, so it > may be pyglet bug), there is no guarantee that all symbols in > monospace font have the same pixel size. It may disrupt layout easily. > So this setPixelSize looks like the stuff that allows to force proper > dimensions, and it is the only logical way to do for me. > -- > anatoly t. > > > On Tue, Nov 12, 2013 at 2:28 AM, Frank Rueter | OHUfx wrote: > > Actually, simply using setPixelSize and letting QT take care of the font > > family does the job in my case even as a standalone, i.e.: > > > > font = QApplication.font() > > self.fontTitle = font > > self.fontTitle.setPixelSize(12) > > self.fontTitle.setBold(True) > > > > self.fontSubTitle = QApplication.font() > > self.fontSubTitle.setPixelSize(10) > > self.fontSubTitle.setBold(False) > > > > > > > > > > > > On 12/11/13 12:05, Frank Rueter | OHUfx wrote: > > > > Actually I realised that in my case I can simply inherit the system font, > > because my app is meant to run inside of another host app which is already > > doing the hard work with fonts. > > So in my case working with QApplication.font() magically solves all my > > troubles (inside the host app, not as a standalone). > > > > I will check in with the guys who wrote the host app to see if they can > > share the magic solution. > > > > Cheers, > > frank > > > > > > On 12/11/13 09:20, Frank Rueter | OHUfx wrote: > > > > thanks Sean, > > > > I will give it a go (I'm on Ubunto as well at home) > > > > On 11/11/13 20:48, Sean Fisk wrote: > > > > Hi Frank, > > > > I struggled with this a while ago and have it working on Windows and Mac OS > > X. Still having some problems on GNU/Linux (specifically targeting Ubuntu) > > but my team is working on it. We first compile some TTF files into our > > resources, then import them in our program, then call this: > > > > # fonts.py > > > > from PySide import QtCore, QtGui > > > > def init(): > > """Initialize embedded fonts.""" > > font_dir_resource = QtCore.QResource(':/fonts') > > font_resource_path = font_dir_resource.absoluteFilePath() > > for ttf_filename in font_dir_resource.children(): > > # DON'T use `os.path.join()' here because Qt always uses UNIX-style > > # paths. On Windows `os.sep' is '\\'. > > res_file = QtCore.QFile('/'.join([font_resource_path, > > ttf_filename])) > > # Must re-open the file in read-only mode to read the contents > > # correctly. > > res_file.open(QtCore.QIODevice.ReadOnly) > > byte_array = res_file.readAll() > > QtGui.QFontDatabase.addApplicationFontFromData(byte_array) > > > > And to use it (snippet): > > > > class LoginView(QtGui.QDialog): > > def __init__(self, parent=None): > > super(LoginView, self).__init__(parent) > > > > # ... > > self.title_font = QtGui.QFont('YourFontName', 46) > > self.title_font.setStyleStrategy(QtGui.QFont.PreferAntialias) > > self.title_label = QtGui.QLabel('Your text in your font') > > self.title_label.setFont(self.title_font) > > > > Hope this helps. And if you get it working on GNU/Linux, let me know what > > you did! > > > > Cheers, > > > > -- > > Sean Fisk > > > > > > On Mon, Nov 11, 2013 at 2:24 AM, Frank Rueter | OHUfx > > wrote: > >> > >> Hi all, > >> > >> I am facing the challenge I'm sure many of you have had to deal with > >> before: > >> > >> I need to make sure that the font used in my application looks as > >> similar as posisble between windows, linux and osx. > >> > >> I am currently using 12 point Helvetica, which turns into a 16 pixel > >> high Sans Nimbus L on my linux box messing up my custom widget's layouts. > >> > >> What is the best practise here? > >> Supposedly it is possible to compile a font into a resource which would > >> ensure almost identical results, right?! Has anybody ever done this > >> before? > >> > >> Cheers, > >> frank > >> _______________________________________________ > >> PySide mailing list > >> PySide at qt-project.org > >> http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > > > > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > > > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside > > From frank at ohufx.com Tue Nov 12 21:08:00 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 13 Nov 2013 09:08:00 +1300 Subject: [PySide] QLabel vs QWebView for simple html display In-Reply-To: References: <5281AE13.9070102@ohufx.com> Message-ID: <52828AA0.7060905@ohufx.com> Thanks Sean and Gargi, I will do the manual download and continue using the QLabel as per your advise. Cheers, frank On 12/11/13 21:13, Sean Fisk wrote: > > Hi Frank, > > I think it depends whether the HTML dictates the layout or you would > like to dictate the layout: > > * HTML dictates layout → Use the web view. > * I want to dictate the layout → Parse the HTML to extract the URL, > download the image manually, and put it into a QLabel. > > Also remember that if you would like to distribute this and bundle > PySide/Qt, using WebKit will add a significant size to your > executable. If you truly need it, include it. However, for this, I > don’t think it’s necessary. > > From what you have said, it sounds like you would like to dictate the > layout. The process isn’t exactly simple, but it’s doable in not too > many lines. Off the top of my head: > > |#!/usr/bin/env python > > import sys > > from PySideimport QtGui > import requests > import lxml.html > > def main(argv): > app = QtGui.QApplication(argv) > widget = QtGui.QWidget() > layout = QtGui.QVBoxLayout(widget) > html ='''

announcementssome text that is pulled from a website but which will be quite simple.

''' # NOPEP8 > doc = lxml.html.fragment_fromstring(html) > for img_src_attributein doc.xpath('//img/@src'): > response = requests.get(img_src_attribute) > pixmap = QtGui.QPixmap() > pixmap.loadFromData(response.content) > label = QtGui.QLabel() > label.setPixmap(pixmap) > layout.addWidget(label) > widget.show() > widget.raise_() > return app.exec_() > > if __name__ =='__main__': > raise SystemExit(main(sys.argv))| > ... which yields... > Inline image 2 > I didn't address the issue of transparent backgrounds, etc., because > I'm not sure exactly what's going on there. But all three of the > widgets on-screen are QLabels, so they should be able to do anything a > QLabel can do. > > Obviously, do some more error checking than I did if you are pulling > this from a website with untrusted data. Let me know if you need help > with that. Hope this helps! > > Sincerely, > > > > -- > Sean Fisk > > > On Mon, Nov 11, 2013 at 11:26 PM, Frank Rueter | OHUfx > > wrote: > > Hi all, > > I have a QLabel in my app that displays some very simple html code > pulled from a website. > > So far I have been using it successfully as a sort of news feed, > but now > I need to display an image from a url as well, which QLabel can't > do afaik. > > So I had a go with QWebView but that just won't be have the same as > QLabel when it comes to background colour (tried to set it to be > transparent), sizes, size policies etc. > I'm also getting some redraw problems when the QWebView is set to a > transparent background. > > Here is some test code: > http://pastebin.com/cSizj9ET > > > Is it the right approach to force QWebView to behave like QLabel > for the > sole reason of being able to display an image via html? Or is there a > simpler way of doing this? > > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 62474 bytes Desc: not available URL: From frank at ohufx.com Wed Nov 13 01:28:08 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 13 Nov 2013 13:28:08 +1300 Subject: [PySide] QLabel vs QWebView for simple html display In-Reply-To: References: <5281AE13.9070102@ohufx.com> Message-ID: <5282C798.4080902@ohufx.com> just to follow up, here is what I have done so far (tried to stay away from external libraries as I will have to distribute the app): http://pastebin.com/VSjYBrSF This seems to work for me but am happy to hear any comments on this approach. Cheers, frank On 12/11/13 21:13, Sean Fisk wrote: > > Hi Frank, > > I think it depends whether the HTML dictates the layout or you would > like to dictate the layout: > > * HTML dictates layout → Use the web view. > * I want to dictate the layout → Parse the HTML to extract the URL, > download the image manually, and put it into a QLabel. > > Also remember that if you would like to distribute this and bundle > PySide/Qt, using WebKit will add a significant size to your > executable. If you truly need it, include it. However, for this, I > don’t think it’s necessary. > > From what you have said, it sounds like you would like to dictate the > layout. The process isn’t exactly simple, but it’s doable in not too > many lines. Off the top of my head: > > |#!/usr/bin/env python > > import sys > > from PySideimport QtGui > import requests > import lxml.html > > def main(argv): > app = QtGui.QApplication(argv) > widget = QtGui.QWidget() > layout = QtGui.QVBoxLayout(widget) > html ='''

announcementssome text that is pulled from a website but which will be quite simple.

''' # NOPEP8 > doc = lxml.html.fragment_fromstring(html) > for img_src_attributein doc.xpath('//img/@src'): > response = requests.get(img_src_attribute) > pixmap = QtGui.QPixmap() > pixmap.loadFromData(response.content) > label = QtGui.QLabel() > label.setPixmap(pixmap) > layout.addWidget(label) > widget.show() > widget.raise_() > return app.exec_() > > if __name__ =='__main__': > raise SystemExit(main(sys.argv))| > ... which yields... > Inline image 2 > I didn't address the issue of transparent backgrounds, etc., because > I'm not sure exactly what's going on there. But all three of the > widgets on-screen are QLabels, so they should be able to do anything a > QLabel can do. > > Obviously, do some more error checking than I did if you are pulling > this from a website with untrusted data. Let me know if you need help > with that. Hope this helps! > > Sincerely, > > > > -- > Sean Fisk > > > On Mon, Nov 11, 2013 at 11:26 PM, Frank Rueter | OHUfx > > wrote: > > Hi all, > > I have a QLabel in my app that displays some very simple html code > pulled from a website. > > So far I have been using it successfully as a sort of news feed, > but now > I need to display an image from a url as well, which QLabel can't > do afaik. > > So I had a go with QWebView but that just won't be have the same as > QLabel when it comes to background colour (tried to set it to be > transparent), sizes, size policies etc. > I'm also getting some redraw problems when the QWebView is set to a > transparent background. > > Here is some test code: > http://pastebin.com/cSizj9ET > > > Is it the right approach to force QWebView to behave like QLabel > for the > sole reason of being able to display an image via html? Or is there a > simpler way of doing this? > > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 62474 bytes Desc: not available URL: From jpe at wingware.com Wed Nov 13 02:16:33 2013 From: jpe at wingware.com (John Ehresman) Date: Tue, 12 Nov 2013 20:16:33 -0500 Subject: [PySide] PySide bindings don't work with Nuitka In-Reply-To: <528208E5.2080204@gmail.com> References: <528208E5.2080204@gmail.com> Message-ID: <5282D2F1.5080508@wingware.com> On 11/12/13 5:54 AM, Kay Hayen wrote: > The thing is, really, I just need some pointers, for where I need to > make Python function/method checks in shiboken recognize compiled > functions as well. Currently the bindings don't turn my callable object > into slots, as can be seen in the "hello.py" attached to the bug. > > Would you please consider lending me a hand, and pointing me in the > right direction, as to where to ask instead. PySide is a big enough > community for me to have no clue where to report what against. :-) This list or the pyside-dev at googlegroups.com list are the best ways to reach people working on pyside or shiboken. I'll try to look into this soon. Thanks, John From sean at seanfisk.com Wed Nov 13 05:17:45 2013 From: sean at seanfisk.com (Sean Fisk) Date: Tue, 12 Nov 2013 23:17:45 -0500 Subject: [PySide] QLabel vs QWebView for simple html display In-Reply-To: <5282C798.4080902@ohufx.com> References: <5281AE13.9070102@ohufx.com> <5282C798.4080902@ohufx.com> Message-ID: Looks great! Thanks for sharing your approach. Keep in mind that if the HTML fragment is untrusted and doesn’t have an img tag with a srcattribute, your app will crash on an AttributeError. Tuple unpacking could make the for loop code a little more readable: def handle_starttag(self, tag, attrs): if tag == 'img': for attr_name, attr_value in attrs: if attr_name == 'src': self.imageUrl = attr_value I like the use of built-in libraries. I used requests and lxml because I am using them for a large project and already knew how to use them, but they are definitely overkill for this. -- Sean Fisk On Tue, Nov 12, 2013 at 7:28 PM, Frank Rueter | OHUfx wrote: > just to follow up, here is what I have done so far (tried to stay away > from external libraries as I will have to distribute the app): > > http://pastebin.com/VSjYBrSF > > This seems to work for me but am happy to hear any comments on this > approach. > > > Cheers, > frank > > > On 12/11/13 21:13, Sean Fisk wrote: > > Hi Frank, > > I think it depends whether the HTML dictates the layout or you would like > to dictate the layout: > > - HTML dictates layout → Use the web view. > - I want to dictate the layout → Parse the HTML to extract the URL, > download the image manually, and put it into a QLabel. > > Also remember that if you would like to distribute this and bundle > PySide/Qt, using WebKit will add a significant size to your executable. If > you truly need it, include it. However, for this, I don’t think it’s > necessary. > > From what you have said, it sounds like you would like to dictate the > layout. The process isn’t exactly simple, but it’s doable in not too many > lines. Off the top of my head: > > #!/usr/bin/env python > import sys > from PySide import QtGuiimport requestsimport lxml.html > def main(argv): > app = QtGui.QApplication(argv) > widget = QtGui.QWidget() > layout = QtGui.QVBoxLayout(widget) > html = '''

announcementssome text that is pulled from a website but which will be quite simple.

''' # NOPEP8 > doc = lxml.html.fragment_fromstring(html) > for img_src_attribute in doc.xpath('//img/@src'): > response = requests.get(img_src_attribute) > pixmap = QtGui.QPixmap() > pixmap.loadFromData(response.content) > label = QtGui.QLabel() > label.setPixmap(pixmap) > layout.addWidget(label) > widget.show() > widget.raise_() > return app.exec_() > if __name__ == '__main__': > raise SystemExit(main(sys.argv)) > > ... which yields... > [image: Inline image 2] > I didn't address the issue of transparent backgrounds, etc., because I'm > not sure exactly what's going on there. But all three of the widgets > on-screen are QLabels, so they should be able to do anything a QLabel can > do. > > Obviously, do some more error checking than I did if you are pulling > this from a website with untrusted data. Let me know if you need help with > that. Hope this helps! > > Sincerely, > > > > -- > Sean Fisk > > > On Mon, Nov 11, 2013 at 11:26 PM, Frank Rueter | OHUfx wrote: > >> Hi all, >> >> I have a QLabel in my app that displays some very simple html code >> pulled from a website. >> >> So far I have been using it successfully as a sort of news feed, but now >> I need to display an image from a url as well, which QLabel can't do >> afaik. >> >> So I had a go with QWebView but that just won't be have the same as >> QLabel when it comes to background colour (tried to set it to be >> transparent), sizes, size policies etc. >> I'm also getting some redraw problems when the QWebView is set to a >> transparent background. >> >> Here is some test code: >> http://pastebin.com/cSizj9ET >> >> >> Is it the right approach to force QWebView to behave like QLabel for the >> sole reason of being able to display an image via html? Or is there a >> simpler way of doing this? >> >> >> Cheers, >> frank >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 62474 bytes Desc: not available URL: From frank at ohufx.com Thu Nov 14 03:27:26 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Thu, 14 Nov 2013 15:27:26 +1300 Subject: [PySide] QLabel vs QWebView for simple html display In-Reply-To: References: <5281AE13.9070102@ohufx.com> <5282C798.4080902@ohufx.com> Message-ID: <5284350E.9050909@ohufx.com> Ha, yes, indeed, thanks for pointing that out! I'm initialising self.imageUrl in the constructor now as an empty string to avoid AttributeErrors, and have also incorporated your suggested tuple unpacking - much nicer that way. Cheers, frank On 13/11/13 17:17, Sean Fisk wrote: > > Looks great! Thanks for sharing your approach. Keep in mind that if > the HTML fragment is untrusted and doesn’t have an |img| tag with a > |src| attribute, your app will crash on an |AttributeError|. Tuple > unpacking could make the for loop code a little more readable: > > | def handle_starttag(self, tag, attrs): > if tag =='img': > for attr_name, attr_valuein attrs: > if attr_name =='src': > self.imageUrl = attr_value| > > I like the use of built-in libraries. I used requests and lxml because > I am using them for a large project and already knew how to use them, > but they are definitely overkill for this. > > > > -- > Sean Fisk > > > On Tue, Nov 12, 2013 at 7:28 PM, Frank Rueter | OHUfx > wrote: > > just to follow up, here is what I have done so far (tried to stay > away from external libraries as I will have to distribute the app): > > http://pastebin.com/VSjYBrSF > > This seems to work for me but am happy to hear any comments on > this approach. > > > Cheers, > frank > > > On 12/11/13 21:13, Sean Fisk wrote: >> >> Hi Frank, >> >> I think it depends whether the HTML dictates the layout or you >> would like to dictate the layout: >> >> * HTML dictates layout → Use the web view. >> * I want to dictate the layout → Parse the HTML to extract the >> URL, download the image manually, and put it into a QLabel. >> >> Also remember that if you would like to distribute this and >> bundle PySide/Qt, using WebKit will add a significant size to >> your executable. If you truly need it, include it. However, for >> this, I don’t think it’s necessary. >> >> From what you have said, it sounds like you would like to dictate >> the layout. The process isn’t exactly simple, but it’s doable in >> not too many lines. Off the top of my head: >> >> |#!/usr/bin/env python >> >> import sys >> >> from PySideimport QtGui >> import requests >> import lxml.html >> >> def main(argv): >> app = QtGui.QApplication(argv) >> widget = QtGui.QWidget() >> layout = QtGui.QVBoxLayout(widget) >> html ='''

announcementssome text that is pulled from a website but which will be quite simple.

''' # NOPEP8 >> doc = lxml.html.fragment_fromstring(html) >> for img_src_attributein doc.xpath('//img/@src'): >> response = requests.get(img_src_attribute) >> pixmap = QtGui.QPixmap() >> pixmap.loadFromData(response.content) >> label = QtGui.QLabel() >> label.setPixmap(pixmap) >> layout.addWidget(label) >> widget.show() >> widget.raise_() >> return app.exec_() >> >> if __name__ =='__main__': >> raise SystemExit(main(sys.argv))| >> ... which yields... >> Inline image 2 >> I didn't address the issue of transparent backgrounds, etc., >> because I'm not sure exactly what's going on there. But all three >> of the widgets on-screen are QLabels, so they should be able to >> do anything a QLabel can do. >> >> Obviously, do some more error checking than I did if you are >> pulling this from a website with untrusted data. Let me know if >> you need help with that. Hope this helps! >> >> Sincerely, >> >> >> >> -- >> Sean Fisk >> >> >> On Mon, Nov 11, 2013 at 11:26 PM, Frank Rueter | OHUfx >> > wrote: >> >> Hi all, >> >> I have a QLabel in my app that displays some very simple html >> code >> pulled from a website. >> >> So far I have been using it successfully as a sort of news >> feed, but now >> I need to display an image from a url as well, which QLabel >> can't do afaik. >> >> So I had a go with QWebView but that just won't be have the >> same as >> QLabel when it comes to background colour (tried to set it to be >> transparent), sizes, size policies etc. >> I'm also getting some redraw problems when the QWebView is >> set to a >> transparent background. >> >> Here is some test code: >> http://pastebin.com/cSizj9ET >> >> >> Is it the right approach to force QWebView to behave like >> QLabel for the >> sole reason of being able to display an image via html? Or is >> there a >> simpler way of doing this? >> >> >> Cheers, >> frank >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 62474 bytes Desc: not available URL: From frank at ohufx.com Thu Nov 14 04:54:37 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Thu, 14 Nov 2013 16:54:37 +1300 Subject: [PySide] sender().data() does not work for custom objects Message-ID: <5284497D.90100@ohufx.com> Hi all, I'm trying to make a QAction pass a custom object as it's data, so I can grab it via QWidget.sender().data() This works just fine for a default object like a dictionary, but not for a custom object that I need to use. This works fine in PySide 1.0.9 but PySide 1.2.1 always returns None when querying sender().data() from a QAction that has a custom object assigned to it's data. Here is some sample code that shows the problem: http://pastebin.com/pT7KJ4Uf Is this a bug in PySide 1.2.1 or did I do something wrong before which accidentally worked in PySide 1.09 when it shouldn't have? Cheers, frank From schampailler at skynet.be Thu Nov 14 10:39:37 2013 From: schampailler at skynet.be (S. Champailler) Date: Thu, 14 Nov 2013 10:39:37 +0100 (CET) Subject: [PySide] sender().data() does not work for custom objects In-Reply-To: <5284497D.90100@ohufx.com> References: <5284497D.90100@ohufx.com> Message-ID: <1857431885.1530771.1384421977241.JavaMail.open-xchange@webmail.nmp.skynet.be> I can reproduce that.. Note that in your code setting the data attribute in TestItem shadows the data method in the same class (I think). Stefan Le 14 novembre 2013 à 04:54, Frank Rueter | OHUfx a écrit : > Hi all, > > I'm trying to make a QAction pass a custom object as it's data, so I can > grab it via QWidget.sender().data() > This works just fine for a default object like a dictionary, but not for > a custom object that I need to use. > > This works fine in PySide 1.0.9 but PySide 1.2.1 always returns None > when querying sender().data() from a QAction that has a custom object > assigned to it's data. > > Here is some sample code that shows the problem: > http://pastebin.com/pT7KJ4Uf > > > Is this a bug in PySide 1.2.1 or did I do something wrong before which > accidentally worked in PySide 1.09 when it shouldn't have? > > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Thu Nov 14 21:04:33 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Fri, 15 Nov 2013 09:04:33 +1300 Subject: [PySide] sender().data() does not work for custom objects In-Reply-To: <1857431885.1530771.1384421977241.JavaMail.open-xchange@webmail.nmp.skynet.be> References: <5284497D.90100@ohufx.com> <1857431885.1530771.1384421977241.JavaMail.open-xchange@webmail.nmp.skynet.be> Message-ID: <52852CD1.4020608@ohufx.com> oops, yeah, that is not a good look. I already had the toolData attribute in place, just forgot to remove the data one, thanks for pointing that out. The problem persists though. Any takers? Might throw it up on stackoverflow as well... On 14/11/13 22:39, S. Champailler wrote: > I can reproduce that.. Note that in your code setting the data > attribute in TestItem shadows the data method in the same class (I > think). > Stefan > > Le 14 novembre 2013 à 04:54, Frank Rueter | OHUfx a > écrit : > > Hi all, > > > > I'm trying to make a QAction pass a custom object as it's data, so I > can > > grab it via QWidget.sender().data() > > This works just fine for a default object like a dictionary, but not > for > > a custom object that I need to use. > > > > This works fine in PySide 1.0.9 but PySide 1.2.1 always returns None > > when querying sender().data() from a QAction that has a custom object > > assigned to it's data. > > > > Here is some sample code that shows the problem: > > http://pastebin.com/pT7KJ4Uf > > > > > > Is this a bug in PySide 1.2.1 or did I do something wrong before which > > accidentally worked in PySide 1.09 when it shouldn't have? > > > > > > Cheers, > > frank > > _______________________________________________ > > PySide mailing list > > PySide at qt-project.org > > http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpe at wingware.com Thu Nov 14 21:11:01 2013 From: jpe at wingware.com (John Ehresman) Date: Thu, 14 Nov 2013 15:11:01 -0500 Subject: [PySide] sender().data() does not work for custom objects In-Reply-To: <52852CD1.4020608@ohufx.com> References: <5284497D.90100@ohufx.com> <1857431885.1530771.1384421977241.JavaMail.open-xchange@webmail.nmp.skynet.be> <52852CD1.4020608@ohufx.com> Message-ID: <52852E55.2010403@wingware.com> On 11/14/13 3:04 PM, Frank Rueter | OHUfx wrote: > oops, yeah, that is not a good look. I already had the toolData > attribute in place, just forgot to remove the data one, thanks for > pointing that out. > > The problem persists though. Any takers? Might throw it up on > stackoverflow as well... I suspect it's a bug. Could you add it to the bug database at https://bugreports.qt-project.org ? Thanks, John From frank at ohufx.com Thu Nov 14 21:12:21 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Fri, 15 Nov 2013 09:12:21 +1300 Subject: [PySide] sender().data() does not work for custom objects In-Reply-To: <52852E55.2010403@wingware.com> References: <5284497D.90100@ohufx.com> <1857431885.1530771.1384421977241.JavaMail.open-xchange@webmail.nmp.skynet.be> <52852CD1.4020608@ohufx.com> <52852E55.2010403@wingware.com> Message-ID: <52852EA5.3010004@ohufx.com> will do, thanks On 15/11/13 09:11, John Ehresman wrote: > On 11/14/13 3:04 PM, Frank Rueter | OHUfx wrote: >> oops, yeah, that is not a good look. I already had the toolData >> attribute in place, just forgot to remove the data one, thanks for >> pointing that out. >> >> The problem persists though. Any takers? Might throw it up on >> stackoverflow as well... > > I suspect it's a bug. Could you add it to the bug database at > https://bugreports.qt-project.org ? > > Thanks, > > John > > From nicolas.saubat at imag.fr Mon Nov 18 18:47:22 2013 From: nicolas.saubat at imag.fr (Nicolas SAUBAT) Date: Mon, 18 Nov 2013 18:47:22 +0100 Subject: [PySide] Shiboken generation error : Minimal constructor for type 'Array' Message-ID: <528A52AA.7090903@imag.fr> An HTML attachment was scrubbed... URL: From kay.hayen at gmail.com Mon Nov 18 20:40:44 2013 From: kay.hayen at gmail.com (Kay Hayen) Date: Mon, 18 Nov 2013 20:40:44 +0100 Subject: [PySide] PySide bindings don't work with Nuitka In-Reply-To: <5282D2F1.5080508@wingware.com> References: <528208E5.2080204@gmail.com> <5282D2F1.5080508@wingware.com> Message-ID: <528A6D3C.6040707@gmail.com> Hello John, Am 13.11.2013 02:16, schrieb John Ehresman: > On 11/12/13 5:54 AM, Kay Hayen wrote: >> The thing is, really, I just need some pointers, for where I need to >> make Python function/method checks in shiboken recognize compiled >> functions as well. Currently the bindings don't turn my callable object >> into slots, as can be seen in the "hello.py" attached to the bug. >> >> Would you please consider lending me a hand, and pointing me in the >> right direction, as to where to ask instead. PySide is a big enough >> community for me to have no clue where to report what against. :-) > > This list or the pyside-dev at googlegroups.com list are the best ways to > reach people working on pyside or shiboken. I'll try to look into this > soon. Did you have a chance to look at it already. Is there an additional information I can provide. Thanks, Kay Hayen From tismer at stackless.com Mon Nov 18 23:59:53 2013 From: tismer at stackless.com (Christian Tismer) Date: Mon, 18 Nov 2013 23:59:53 +0100 Subject: [PySide] Qt5 support In-Reply-To: <51DF0D4E.80307@wingware.com> References: <51DF0D4E.80307@wingware.com> Message-ID: <528A9BE9.5070702@stackless.com> On 11/07/13 21:53, John Ehresman wrote: > On 7/11/13 11:40 AM, Fabien Castan wrote: >> Has someone started some development or test for Qt5 support? >> ... >> I don’t know what is the difficulty to switch to Qt5. There is always a >> discussion about improving the binding tool with the binding of Qt5. Are >> these improvements really needed for Qt5 support? > We talked about this at the sprint and decided to look at alternative > binding tools in conjunction with supporting Qt5. The goal will be a > set of bindings that the developers who are currently supporting PySide > can more easily support and maintain. None of us were involved with the > development of shiboken and we would like to look at alternatives. > > That said, developer could begin looking at the changes required by Qt > 5. PySide is developed and maintained by the community and well thought > out patches and other changes to support Qt 5 would likely be accepted. > I got a possible offer to do the migration to Qt5. Because I never looked into this, I am not quite sure how to estimate the hours. As far as I read here, I have the rough idea of 100 to 300 hours. Am I over- or under-estimating very much? cheers - Chris -- Christian Tismer :^) Software Consulting : Have a break! Take a ride on Python's Karl-Liebknecht-Str. 121 : *Starship* http://starship.python.net/ 14482 Potsdam : PGP key -> http://pgp.uni-mainz.de phone +49 173 24 18 776 fax +49 (30) 700143-0023 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/ From frank at ohufx.com Tue Nov 19 06:16:57 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 19 Nov 2013 18:16:57 +1300 Subject: [PySide] pyside-rcc ignoring certain files Message-ID: <528AF449.4060007@ohufx.com> Hi all, I'm having some trouble with pyside-rcc trying to compile some svg and png files. All went well until the compiler decided to ignore one of the image files. When I changed that image file's name to be suffixed with an underscore it worked. I shrugged it off as a bizarre bug and kept going, but now I have a bunch of images that act up and whos name I have to change in order for pyside-rcc to actually recognise them. Here is a list (you can see the underscored ones): ??? 3d.svg ??? channel.svg ??? color.svg ??? deep.svg ??? draw.svg ??? filter.svg ??? flipbook.png ??? image.svg ??? import_export.png *??? keyer_.svg* ??? merge.svg ??? metadata.svg ??? nodegraph.png *??? other_.svg* *??? particles_.svg* ??? presets.png *??? python_.png* ??? render.png ??? stereo.svg ??? time.svg ??? transform.svg ??? ui.png What's even stranger, is this: The first file to be ignored was "particles.svg", so I changed it to "particles_.svg" and it worked. After doing the same to a few more files that kept being ignored, the particles_.svg all of a sudden is ignored again. And even stranger, when giving the "particles_.svg" another underscore in it's name like "particles__.svg" the "other_.svg" image is ignored as well. It feels like I'm a geeky hidden camera show or something :-D Has anybody ever seen this? Cheers, frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Tue Nov 19 08:50:48 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 19 Nov 2013 20:50:48 +1300 Subject: [PySide] tooltip background colour Message-ID: <528B1858.1050601@ohufx.com> Hi all, I have a few custom widget with tooltips, one of which has such a dark background when run in context of it's host application that it's unreadable. What is the best way to control a tooltip's window/background color? I'm getting a bit lost amongst color roles and groups :/ This is what I was trying as a test but to no avail: app = QtGui.QApplication([]) w = QtGui.QWidget() w.setToolTip('test') palette = w.palette() palette.setColor(QtGui.QPalette.ColorGroup.Inactive, QtGui.QPalette.ColorRole.ToolTipBase, QtGui.QColor(255,0,0)) w.setPalette(palette) w.show() sys.exit(app.exec_()) Cheers, frank From heng at cantab.net Tue Nov 19 10:18:09 2013 From: heng at cantab.net (Henry Gomersall) Date: Tue, 19 Nov 2013 09:18:09 +0000 Subject: [PySide] Qt5 support In-Reply-To: <51DF0D4E.80307@wingware.com> References: <51DF0D4E.80307@wingware.com> Message-ID: <528B2CD1.4090306@cantab.net> On 11/07/13 20:53, John Ehresman wrote: > On 7/11/13 11:40 AM, Fabien Castan wrote: >> >Has someone started some development or test for Qt5 support? >> >... >> >I don’t know what is the difficulty to switch to Qt5. There is always a >> >discussion about improving the binding tool with the binding of Qt5. Are >> >these improvements really needed for Qt5 support? > We talked about this at the sprint and decided to look at alternative > binding tools in conjunction with supporting Qt5. The goal will be a > set of bindings that the developers who are currently supporting PySide > can more easily support and maintain. None of us were involved with the > development of shiboken and we would like to look at alternatives. > > That said, developer could begin looking at the changes required by Qt > 5. PySide is developed and maintained by the community and well thought > out patches and other changes to support Qt 5 would likely be accepted. I've actually been thinking about this. I naively thought that most of the effort was in the API extraction, but having read the excellent blog post that John pointed me to previously ( http://setanta.wordpress.com/binding-c/ ), I'm very much conscious of the other aspects. It struck me that libshiboken could still be a very useful tool in any future binding efforts, providing tools to alleviate much of the C++ difficulties. I'm sure it could be used with no end of alternative options (I've been thinking about it in the context of Cython bindings). Cheers, Henry From matthew.woehlke at kitware.com Tue Nov 19 18:22:14 2013 From: matthew.woehlke at kitware.com (Matthew Woehlke) Date: Tue, 19 Nov 2013 12:22:14 -0500 Subject: [PySide] tooltip background colour In-Reply-To: <528B1858.1050601@ohufx.com> References: <528B1858.1050601@ohufx.com> Message-ID: On 2013-11-19 02:50, Frank Rueter | OHUfx wrote: > Hi all, > > I have a few custom widget with tooltips, one of which has such a dark > background when run in context of it's host application that it's > unreadable. > What is the best way to control a tooltip's window/background color? > I'm getting a bit lost amongst color roles and groups :/ Try setting the application palette (QApplication::setPalette) before creating any widgets. Also... > palette = w.palette() > palette.setColor(QtGui.QPalette.ColorGroup.Inactive, > QtGui.QPalette.ColorRole.ToolTipBase, > QtGui.QColor(255,0,0)) ...try setting the color in the Active group instead or in addition. (I think tool tips use active, at least if their parent is active. Maybe always... active vs. inactive handling isn't necessarily as well handled as it should be.) -- Matthew From sean at seanfisk.com Tue Nov 19 19:36:15 2013 From: sean at seanfisk.com (Sean Fisk) Date: Tue, 19 Nov 2013 13:36:15 -0500 Subject: [PySide] Building PySide API Docs Message-ID: Hello, I would like to obtain a copy of the latest PySide API docs for 1.2.1. I have an old copy of 1.1.0 and I know that 1.0.7 and 1.1.0 are available on the wiki. I tried to guess at how to build it and eventually ended up at make apidoc, but it’s blowing up on errors. Can anybody direct me on how to build the API docs, or a place where I can obtain the latest copy? Thanks, -- Sean Fisk -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Tue Nov 19 21:16:38 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 20 Nov 2013 09:16:38 +1300 Subject: [PySide] tooltip background colour In-Reply-To: References: <528B1858.1050601@ohufx.com> Message-ID: <528BC726.1070205@ohufx.com> Thanks Matthew, I realised I am setting a style sheet on that particular widget for other reasons, which is what interfered with the palette. Cheers, frank On 20/11/13 06:22, Matthew Woehlke wrote: > On 2013-11-19 02:50, Frank Rueter | OHUfx wrote: >> Hi all, >> >> I have a few custom widget with tooltips, one of which has such a dark >> background when run in context of it's host application that it's >> unreadable. >> What is the best way to control a tooltip's window/background color? >> I'm getting a bit lost amongst color roles and groups :/ > Try setting the application palette (QApplication::setPalette) before > creating any widgets. > > Also... > >> palette = w.palette() >> palette.setColor(QtGui.QPalette.ColorGroup.Inactive, >> QtGui.QPalette.ColorRole.ToolTipBase, >> QtGui.QColor(255,0,0)) > ...try setting the color in the Active group instead or in addition. (I > think tool tips use active, at least if their parent is active. Maybe > always... active vs. inactive handling isn't necessarily as well handled > as it should be.) > From frank at ohufx.com Wed Nov 20 01:28:36 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 20 Nov 2013 13:28:36 +1300 Subject: [PySide] paintEvent ni QScrollArea not triggered Message-ID: <528C0234.8010407@ohufx.com> Hi all, I seem to be stumbling from one bug into the next these days. Here is a code snippet that shows a QScrollArea's custom paintEvent not being triggered if the QScrollArea.setWidget() is used to add a child widget AND QScrollArea.setWidgetResizable(True) is called in the constructor: http://pastebin.com/Qr27ndKY If you comment out line 9 the paint method does it's job, with line 9 active, it is not called. Can somebody please confirm this is a bug before I log it? Cheers, frank From frank at ohufx.com Wed Nov 20 01:31:53 2013 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 20 Nov 2013 13:31:53 +1300 Subject: [PySide] paintEvent ni QScrollArea not triggered In-Reply-To: <528C0234.8010407@ohufx.com> References: <528C0234.8010407@ohufx.com> Message-ID: <528C02F9.7000803@ohufx.com> I forgot: this problem only occurs when the application's style is set. On 20/11/13 13:28, Frank Rueter | OHUfx wrote: > Hi all, > > I seem to be stumbling from one bug into the next these days. > Here is a code snippet that shows a QScrollArea's custom paintEvent not > being triggered if the QScrollArea.setWidget() is used to add a child > widget AND QScrollArea.setWidgetResizable(True) is called in the > constructor: > > http://pastebin.com/Qr27ndKY > > If you comment out line 9 the paint method does it's job, with line 9 > active, it is not called. > Can somebody please confirm this is a bug before I log it? > > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From sean at seanfisk.com Tue Nov 26 08:36:29 2013 From: sean at seanfisk.com (Sean Fisk) Date: Tue, 26 Nov 2013 02:36:29 -0500 Subject: [PySide] PySide 1.2.1 API Docs Message-ID: Hello PySiders! After a monumental struggle I was able to achieve the goal of building the PySide and Shiboken 1.2.1 API docs. Following in the footsteps of those before me, I’ve uploaded them to Github Pagesfor use by the community. I’ve also created tarballs of the documentation available for download. I’ve gathered the build process into a Bash script which is available in this Github repo . I’ve tested it on Mac OS X and CentOS, and it should work on most UNIX-like systems. If anyone wants to hack on it, let me know if you have questions. During the build process, I stumbled upon a couple things: - qdoc3 from Qt 4.6 is needed to build API docs for PySide. This is because WebXML support was buggy in Qt 4.7 and dropped in Qt 4.8, and Shiboken uses this to generate the docs (thanks Roman Lacko). This is very annoying because parts of Qt 4.6 must be configured and built for qdoc3to build correctly. - Shiboken has a documented --documentation-only flag but refuses to actually accept it. But Shiboken doesn’t tell you which option was invalid, only that it was “called with the wrong arguments.” This is annoying but seems like it has an easy fix. The documentation build process is little convoluted in general. Some of these issues seem like they are out of the hands of PySide, though. I hope these docs are able to help somebody out there! Thanks, -- Sean Fisk -------------- next part -------------- An HTML attachment was scrubbed... URL: From backup.rlacko at gmail.com Tue Nov 26 09:27:48 2013 From: backup.rlacko at gmail.com (Roman Lacko) Date: Tue, 26 Nov 2013 09:27:48 +0100 Subject: [PySide] PySide 1.2.1 API Docs In-Reply-To: References: Message-ID: Hi Sean, thanks for the hard work you spend on this. I will upload the docs to readthedocs server. Thanks Roman 2013/11/26 Sean Fisk > Hello PySiders! > > After a monumental struggle I was able to achieve the goal of building the > PySide and Shiboken 1.2.1 API docs. Following in the footsteps of those > before me, I’ve uploaded them to Github Pagesfor use by the community. I’ve also created tarballs of the documentation > available for download. > > I’ve gathered the build process into a Bash script which is available in this > Github repo . I’ve tested it on > Mac OS X and CentOS, and it should work on most UNIX-like systems. If > anyone wants to hack on it, let me know if you have questions. > > During the build process, I stumbled upon a couple things: > > - qdoc3 from Qt 4.6 is needed to build API docs for PySide. This is > because WebXML support was buggy in Qt 4.7 and dropped in Qt 4.8, and > Shiboken uses this to generate the docs (thanks Roman Lacko). This is very > annoying because parts of Qt 4.6 must be configured and built for qdoc3to build correctly. > - Shiboken has a documented --documentation-only flag but refuses to > actually accept it. But Shiboken doesn’t tell you which option was invalid, > only that it was “called with the wrong arguments.” This is annoying but > seems like it has an easy fix. > > The documentation build process is little convoluted in general. Some of > these issues seem like they are out of the hands of PySide, though. > > I hope these docs are able to help somebody out there! > > Thanks, > -- > Sean Fisk > > _______________________________________________ > 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 gadiyar at ti.com Tue Nov 26 11:34:46 2013 From: gadiyar at ti.com (Gadiyar, Anand) Date: Tue, 26 Nov 2013 10:34:46 +0000 Subject: [PySide] PySide 1.2.1 API Docs In-Reply-To: References: Message-ID: Sean, Thanks for this. I've just used your script on an Ubuntu box and it works well! - Anand From: pyside-bounces+gadiyar=ti.com at qt-project.org [mailto:pyside-bounces+gadiyar=ti.com at qt-project.org] On Behalf Of Roman Lacko Sent: Tuesday, November 26, 2013 1:58 PM To: Sean Fisk Cc: PySide Subject: Re: [PySide] PySide 1.2.1 API Docs Hi Sean, thanks for the hard work you spend on this. I will upload the docs to readthedocs server. Thanks Roman 2013/11/26 Sean Fisk > Hello PySiders! After a monumental struggle I was able to achieve the goal of building the PySide and Shiboken 1.2.1 API docs. Following in the footsteps of those before me, I've uploaded them to Github Pages for use by the community. I've also created tarballs of the documentation available for download. I've gathered the build process into a Bash script which is available in this Github repo. I've tested it on Mac OS X and CentOS, and it should work on most UNIX-like systems. If anyone wants to hack on it, let me know if you have questions. During the build process, I stumbled upon a couple things: * qdoc3 from Qt 4.6 is needed to build API docs for PySide. This is because WebXML support was buggy in Qt 4.7 and dropped in Qt 4.8, and Shiboken uses this to generate the docs (thanks Roman Lacko). This is very annoying because parts of Qt 4.6 must be configured and built for qdoc3 to build correctly. * Shiboken has a documented --documentation-only flag but refuses to actually accept it. But Shiboken doesn't tell you which option was invalid, only that it was "called with the wrong arguments." This is annoying but seems like it has an easy fix. The documentation build process is little convoluted in general. Some of these issues seem like they are out of the hands of PySide, though. I hope these docs are able to help somebody out there! Thanks, -- Sean Fisk _______________________________________________ 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 niceguysan at gmail.com Tue Nov 26 17:47:42 2013 From: niceguysan at gmail.com (=?UTF-8?B?xaHDo8Ox?=) Date: Tue, 26 Nov 2013 22:17:42 +0530 Subject: [PySide] PySide 1.2.1 API Docs In-Reply-To: References: Message-ID: Thanks Sean!!! much appreciated. On Tue, Nov 26, 2013 at 4:04 PM, Gadiyar, Anand wrote: > Sean, > > > > Thanks for this. I’ve just used your script on an Ubuntu box and it works > well! > > > > - Anand > > > > *From:* pyside-bounces+gadiyar=ti.com at qt-project.org [mailto: > pyside-bounces+gadiyar=ti.com at qt-project.org] *On Behalf Of *Roman Lacko > *Sent:* Tuesday, November 26, 2013 1:58 PM > *To:* Sean Fisk > *Cc:* PySide > *Subject:* Re: [PySide] PySide 1.2.1 API Docs > > > > Hi Sean, > > thanks for the hard work you spend on this. > > I will upload the docs to readthedocs server. > > Thanks > > Roman > > > > 2013/11/26 Sean Fisk > > Hello PySiders! > > After a monumental struggle I was able to achieve the goal of building the > PySide and Shiboken 1.2.1 API docs. Following in the footsteps of those > before me, I’ve uploaded them to Github Pagesfor use by the community. I’ve also created tarballs of the documentation > available for download. > > I’ve gathered the build process into a Bash script which is available in this > Github repo . I’ve tested it on > Mac OS X and CentOS, and it should work on most UNIX-like systems. If > anyone wants to hack on it, let me know if you have questions. > > During the build process, I stumbled upon a couple things: > > · qdoc3 from Qt 4.6 is needed to build API docs for PySide. This > is because WebXML support was buggy in Qt 4.7 and dropped in Qt 4.8, and > Shiboken uses this to generate the docs (thanks Roman Lacko). This is very > annoying because parts of Qt 4.6 must be configured and built for qdoc3to build correctly. > > · Shiboken has a documented --documentation-only flag but refuses > to actually accept it. But Shiboken doesn’t tell you which option was > invalid, only that it was “called with the wrong arguments.” This is > annoying but seems like it has an easy fix. > > The documentation build process is little convoluted in general. Some of > these issues seem like they are out of the hands of PySide, though. > > I hope these docs are able to help somebody out there! > > Thanks, > > -- > > Sean Fisk > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > -- [image: San's personal blog] -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at seanfisk.com Tue Nov 26 20:12:09 2013 From: sean at seanfisk.com (Sean Fisk) Date: Tue, 26 Nov 2013 14:12:09 -0500 Subject: [PySide] PySide 1.2.1 API Docs In-Reply-To: References: Message-ID: Thanks, Anand, for testing the script out. Glad to have some confirmation of it working. Thanks, Roman, for uploading to ReadTheDocs and for your advice on building the docs. -- Sean Fisk On Tue, Nov 26, 2013 at 5:34 AM, Gadiyar, Anand wrote: > Sean, > > > > Thanks for this. I’ve just used your script on an Ubuntu box and it works > well! > > > > - Anand > > > > *From:* pyside-bounces+gadiyar=ti.com at qt-project.org [mailto: > pyside-bounces+gadiyar=ti.com at qt-project.org] *On Behalf Of *Roman Lacko > *Sent:* Tuesday, November 26, 2013 1:58 PM > *To:* Sean Fisk > *Cc:* PySide > *Subject:* Re: [PySide] PySide 1.2.1 API Docs > > > > Hi Sean, > > thanks for the hard work you spend on this. > > I will upload the docs to readthedocs server. > > Thanks > > Roman > > > > 2013/11/26 Sean Fisk > > Hello PySiders! > > After a monumental struggle I was able to achieve the goal of building the > PySide and Shiboken 1.2.1 API docs. Following in the footsteps of those > before me, I’ve uploaded them to Github Pagesfor use by the community. I’ve also created tarballs of the documentation > available for download. > > I’ve gathered the build process into a Bash script which is available in this > Github repo . I’ve tested it on > Mac OS X and CentOS, and it should work on most UNIX-like systems. If > anyone wants to hack on it, let me know if you have questions. > > During the build process, I stumbled upon a couple things: > > · qdoc3 from Qt 4.6 is needed to build API docs for PySide. This > is because WebXML support was buggy in Qt 4.7 and dropped in Qt 4.8, and > Shiboken uses this to generate the docs (thanks Roman Lacko). This is very > annoying because parts of Qt 4.6 must be configured and built for qdoc3to build correctly. > > · Shiboken has a documented --documentation-only flag but refuses > to actually accept it. But Shiboken doesn’t tell you which option was > invalid, only that it was “called with the wrong arguments.” This is > annoying but seems like it has an easy fix. > > The documentation build process is little convoluted in general. Some of > these issues seem like they are out of the hands of PySide, though. > > I hope these docs are able to help somebody out there! > > Thanks, > > -- > > Sean Fisk > > > _______________________________________________ > 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 Wed Nov 27 22:51:43 2013 From: techtonik at gmail.com (anatoly techtonik) Date: Thu, 28 Nov 2013 00:51:43 +0300 Subject: [PySide] Building PySide API Docs In-Reply-To: References: Message-ID: As there are no replies, we can start with some entrypoints. 1. Where do you think this info should be located? 2. What exact errors do you get? -- anatoly t. On Tue, Nov 19, 2013 at 9:36 PM, Sean Fisk wrote: > Hello, > > I would like to obtain a copy of the latest PySide API docs for 1.2.1. I > have an old copy of 1.1.0 and I know that 1.0.7 and 1.1.0 are available on > the wiki. > > I tried to guess at how to build it and eventually ended up at make apidoc, > but it’s blowing up on errors. Can anybody direct me on how to build the API > docs, or a place where I can obtain the latest copy? > > Thanks, > > -- > Sean Fisk > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > From sean at seanfisk.com Thu Nov 28 00:15:35 2013 From: sean at seanfisk.com (Sean Fisk) Date: Wed, 27 Nov 2013 18:15:35 -0500 Subject: [PySide] Building PySide API Docs In-Reply-To: References: Message-ID: I got them built! Roman Lacko sent me some advice (though not to the list) and I started a new PySide threadabout it. -- Sean Fisk On Wed, Nov 27, 2013 at 4:51 PM, anatoly techtonik wrote: > As there are no replies, we can start with some entrypoints. > 1. Where do you think this info should be located? > 2. What exact errors do you get? > -- > anatoly t. > > > On Tue, Nov 19, 2013 at 9:36 PM, Sean Fisk wrote: > > Hello, > > > > I would like to obtain a copy of the latest PySide API docs for 1.2.1. I > > have an old copy of 1.1.0 and I know that 1.0.7 and 1.1.0 are available > on > > the wiki. > > > > I tried to guess at how to build it and eventually ended up at make > apidoc, > > but it’s blowing up on errors. Can anybody direct me on how to build the > API > > docs, or a place where I can obtain the latest copy? > > > > Thanks, > > > > -- > > Sean Fisk > > > > _______________________________________________ > > 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 Nov 28 01:43:27 2013 From: techtonik at gmail.com (anatoly techtonik) Date: Thu, 28 Nov 2013 03:43:27 +0300 Subject: [PySide] Building PySide API Docs In-Reply-To: References: Message-ID: Oh, that's great. -- anatoly t. On Thu, Nov 28, 2013 at 2:15 AM, Sean Fisk wrote: > I got them built! Roman Lacko sent me some advice (though not to the list) > and I started a new PySide thread about it. > > > > -- > Sean Fisk > > > On Wed, Nov 27, 2013 at 4:51 PM, anatoly techtonik > wrote: >> >> As there are no replies, we can start with some entrypoints. >> 1. Where do you think this info should be located? >> 2. What exact errors do you get? >> -- >> anatoly t. >> >> >> On Tue, Nov 19, 2013 at 9:36 PM, Sean Fisk wrote: >> > Hello, >> > >> > I would like to obtain a copy of the latest PySide API docs for 1.2.1. I >> > have an old copy of 1.1.0 and I know that 1.0.7 and 1.1.0 are available >> > on >> > the wiki. >> > >> > I tried to guess at how to build it and eventually ended up at make >> > apidoc, >> > but it’s blowing up on errors. Can anybody direct me on how to build the >> > API >> > docs, or a place where I can obtain the latest copy? >> > >> > Thanks, >> > >> > -- >> > Sean Fisk >> > >> > _______________________________________________ >> > PySide mailing list >> > PySide at qt-project.org >> > http://lists.qt-project.org/mailman/listinfo/pyside >> > > >