From heng at cantab.net Sat Jan 3 23:12:42 2015 From: heng at cantab.net (Henry Gomersall) Date: Sat, 03 Jan 2015 22:12:42 +0000 Subject: [PySide] Let's get serious for Pyside to support Qt5 In-Reply-To: <0FDFE781C3033D44AA32DE14D9BFBD06135AAF53@wcosexch01k.cos.is.keysight.com> References: <20141210163851.GO445@tonks> <54887B31.7060200@wingware.com> <5489C29C.6030507@wingware.com> <86C5F1E5-2913-46D0-969F-FD80E3C3331A@gmail.com> <548A1429.6070903@wingware.com> <548B3AA1.4090002@stackless.com>, <0FDFE781C3033D44AA32DE14D9BFBD06135AAF53@wcosexch01k.cos.is.keysight.com> Message-ID: <54A8695A.9090305@cantab.net> On 28/12/14 20:24, peter_karasev at keysight.com wrote: > Can the whole shiboken-instead-of-boost-python thing be revisited? It is a huge PITA to interface through shiboken when you have a C++ application using QT and you provide some boost-python wrappers or have legacy C-python wrappers for domain-specific code. The way shiboken+pyside are structured now, you are in for a world of pain when embedding python in a native QT application as opposed to driving the app from python scripts. For the benefit of the conversation, this link is a useful one: http://setanta.wordpress.com/binding-c/ I'd love to see such stuff being added to something like xdress: http://xdress.org/, building on the pile of existing work that exists in this area. Essentially the existing libshiboken is used in conjunction with a more sane binding generation tool. Cheers, Henry From thomson.eric at gmail.com Thu Jan 8 04:45:13 2015 From: thomson.eric at gmail.com (Eric Thomson) Date: Wed, 7 Jan 2015 22:45:13 -0500 Subject: [PySide] Annotated guide to simpletreemodel: looking for feedback. Message-ID: I wrote an annotated guide to the simpletreemodel example that comes with PySide, and I am looking for feedback. The doc is based on the c++ documentation, and is aimed at novice PySide programmers. Right now it's in PDF form: https://www.dropbox.com/s/b81b91pm2aea8vd/simpleTreeModelPyside_0.1.pdf?dl=0 Warning: it is 15 pages long, but it is broken up into three parts that can stand semi-independently. I am not sure what I am going to do with it yet. Put it on my web site, or maybe something more "official". It depends on what feedback I get, as I have never done anything like this. I am looking for any feedback, from nit-picky grammar but especially big-picture conceptual flaws. Feedback here, or personal email, is fine (thomson dot eric [] gmail). Please let me know if this is the wrong forum for me to be posting this: my intention is not to spam the group! From proski at gnu.org Mon Jan 12 23:02:56 2015 From: proski at gnu.org (Pavel Roskin) Date: Mon, 12 Jan 2015 17:02:56 -0500 Subject: [PySide] Unicode strings in QApplication constructor kill python interpreter Message-ID: Hello! I'm checking if PySide is better than PyQt at handling this issue with QApplication initialization: http://stackoverflow.com/questions/27869281/python3-qt4-discards-non-ascii-characters-from-unicode-strings-in-qapplication-c It turns out it has it's own set of bugs. In Python 2, unicode arguments kill the interpreter: $ python Python 2.7.8 (default, Oct 20 2014, 15:05:29) [GCC 4.9.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from PySide.QtGui import QApplication >>> QApplication([u"test"]) Segmentation fault (core dumped) The backtrace: #0 __strlen_ia32 () at ../sysdeps/i386/i686/multiarch/../../i586/strlen.S:94 #1 0xf7e630cd in __GI___strdup (s=0x0) at strdup.c:41 #2 0xf736ae78 in Shiboken::sequenceToArgcArgv(_object*, int*, char***, char const*) () from /usr/lib/i386-linux-gnu/libshiboken-python2.7.so.1.2 #3 0xf62eaba6 in ?? () from /usr/lib/python2.7/dist-packages/PySide/QtGui.so #4 0x080f9d91 in type_call.lto_priv () at ../Objects/typeobject.c:745 #5 0x081082cf in PyObject_Call (kw=, arg=, func=) at ../Objects/abstract.c:2529 #6 do_call (nk=, na=, pp_stack=, func=) at ../Python/ceval.c:4239 #7 call_function (oparg=, pp_stack=) at ../Python/ceval.c:4044 #8 PyEval_EvalFrameEx () at ../Python/ceval.c:2667 #9 0x08106535 in PyEval_EvalCodeEx () at ../Python/ceval.c:3253 #10 0x0813b96c in PyEval_EvalCode ( locals={'__builtins__': , '__name__': '__main__', 'QApplication': , '__doc__': None, '__package__': None}, globals={'__builtins__': , '__name__': '__main__', 'QApplication': , '__doc__': None, '__package__': None}, co=0xf7cdaec0) at ../Python/ceval.c:667 #11 run_mod.lto_priv () at ../Python/pythonrun.c:1371 #12 0x0808d601 in PyRun_InteractiveOneFlags (fp=0xf7f92c20 <_IO_2_1_stdin_>, filename=0x8237988 "", flags=0xffffcfd8) at ../Python/pythonrun.c:858 #13 0x0808d399 in PyRun_InteractiveLoopFlags (fp=0xf7f92c20 <_IO_2_1_stdin_>, filename=0x8237988 "", flags=0xffffcfd8) at ../Python/pythonrun.c:778 #14 0x0806f7f0 in PyRun_AnyFileExFlags (fp=0xf7f92c20 <_IO_2_1_stdin_>, filename=0x8237988 "", closeit=0, flags=0xffffcfd8) at ../Python/pythonrun.c:747 #15 0x080daed1 in Py_Main () at ../Modules/main.c:640 #16 0x080da93b in main (argc=1, argv=0xffffd124) at ../Modules/python.c:23 Conversely, non-Unicode arguments become empty strings in Python 3: #! /usr/bin/python3 from PySide.QtGui import QApplication app = QApplication(["string1", b"bytes", "string2"]) print(app.arguments()) The output is: ['string1', '', 'string2'] I'm using Ubuntu 14.10 i386 with python 2.7.8-1 python3 3.4.2-1 python-pyside 1.2.2-1 python3-pyside 1.2.2-1 -- Regards, Pavel Roskin From proski at gnu.org Wed Jan 14 03:20:38 2015 From: proski at gnu.org (Pavel Roskin) Date: Tue, 13 Jan 2015 21:20:38 -0500 Subject: [PySide] Supporting type argument in QtCore.QSettings.value Message-ID: Hello! I tried converting Frescobaldi to PySide, and the biggest annoyance by far was the lack of the type support in QtCore.QSettings.value(). I had to fix hundreds of calls to fix errors like this: version = QSettings().value("settings_version", 0, int) TypeError: PySide.QtCore.QSettings.value(): too many arguments Would it be possible to follow the approach taken by PyQt and accept the optional third "type" argument? http://pyqt.sourceforge.net/Docs/PyQt4/pyqt_qsettings.html -- Regards, Pavel Roskin From techtonik at gmail.com Sat Jan 17 20:02:43 2015 From: techtonik at gmail.com (anatoly techtonik) Date: Sat, 17 Jan 2015 22:02:43 +0300 Subject: [PySide] Let's get serious for Pyside to support Qt5 In-Reply-To: <54A8695A.9090305@cantab.net> References: <20141210163851.GO445@tonks> <54887B31.7060200@wingware.com> <5489C29C.6030507@wingware.com> <86C5F1E5-2913-46D0-969F-FD80E3C3331A@gmail.com> <548A1429.6070903@wingware.com> <548B3AA1.4090002@stackless.com> <0FDFE781C3033D44AA32DE14D9BFBD06135AAF53@wcosexch01k.cos.is.keysight.com> <54A8695A.9090305@cantab.net> Message-ID: On Sun, Jan 4, 2015 at 1:12 AM, Henry Gomersall wrote: > > I'd love to see such stuff being added to something like xdress: > http://xdress.org/, building on the pile of existing work that exists in > this area. Essentially the existing libshiboken is used in conjunction > with a more sane binding generation tool. Here is a talk about xdress: https://www.youtube.com/watch?v=a4kqO1IBZ4U I still need a barebone example how to make a simple Qt Hello World working with xdress to figure out what is its palce in the whole picture. It looks like it should be taught to understand PySide XML files, or there is a better description of API in Qt5? -- anatoly t. From techtonik at gmail.com Sat Jan 17 20:48:31 2015 From: techtonik at gmail.com (anatoly techtonik) Date: Sat, 17 Jan 2015 22:48:31 +0300 Subject: [PySide] Let's get serious for Pyside to support Qt5 In-Reply-To: References: <20141210163851.GO445@tonks> <54887B31.7060200@wingware.com> <5489C29C.6030507@wingware.com> <86C5F1E5-2913-46D0-969F-FD80E3C3331A@gmail.com> <548A1429.6070903@wingware.com> <548B3AA1.4090002@stackless.com> <0FDFE781C3033D44AA32DE14D9BFBD06135AAF53@wcosexch01k.cos.is.keysight.com> <54A8695A.9090305@cantab.net> Message-ID: On Sat, Jan 17, 2015 at 10:02 PM, anatoly techtonik wrote: > On Sun, Jan 4, 2015 at 1:12 AM, Henry Gomersall wrote: >> >> I'd love to see such stuff being added to something like xdress: >> http://xdress.org/, building on the pile of existing work that exists in >> this area. Essentially the existing libshiboken is used in conjunction >> with a more sane binding generation tool. > > Here is a talk about xdress: > https://www.youtube.com/watch?v=a4kqO1IBZ4U And here are another guidelines from the same conference based on experience of creating C++ wrappers: https://www.youtube.com/watch?v=EaRGRIqSMEc#t=781 From 2281570025 at qq.com Sun Jan 18 02:37:01 2015 From: 2281570025 at qq.com (=?utf-8?B?aU1hdGg=?=) Date: Sun, 18 Jan 2015 09:37:01 +0800 Subject: [PySide] Which used a rather good tool to wrap Qt for Python , PySide or PyQt ? Message-ID: the PySide code here prompts "TypeError: 'str' object is not callable" while it is working,but ‍When changed to PyQt code, it works well.‍ The reason why this happen is because you cannot ‍self.text = None in PySide,‍ It seems naming-clash error happened in PySide while not in PyQt , so Which used a rather good tool to wrap Qt for Python , PySide or PyQt ? ‍ from PySide import QtGui, QtCore class MyProgressBar(QtGui.QProgressBar): def __init__(self): super().__init__() self.setRange(0, 0) self.setAlignment(QtCore.Qt.AlignCenter) self.text = None # def setText(self, text): # self.text = text # def text(self): # return self.text app = QtGui.QApplication([]) p = MyProgressBar() # p.setText('finding resource...') p.show() app.exec_()‍ -------------- next part -------------- An HTML attachment was scrubbed... URL: From 2281570025 at qq.com Mon Jan 19 03:55:05 2015 From: 2281570025 at qq.com (=?utf-8?B?aU1hdGg=?=) Date: Mon, 19 Jan 2015 10:55:05 +0800 Subject: [PySide] =?utf-8?b?5Zue5aSN77yaICBXaGljaCB1c2VkIGEgcmF0aGVyIGdv?= =?utf-8?q?od_tool_to_wrap_Qt_for_Python=2C_PySide_or_PyQt_=3F?= In-Reply-To: <54BC23DF.8060305@granitesemi.com> References: <54BC23DF.8060305@granitesemi.com> Message-ID: The root cause of the problem here is you cannot self.text = None,not setText("").‍ ------------------ 原始邮件 ------------------ 发件人: "Kenneth Martin";; 发送时间: 2015年1月19日(星期一) 凌晨5:21 收件人: "iMath"<2281570025 at qq.com>; 主题: Re: [PySide] Which used a rather good tool to wrap Qt for Python, PySide or PyQt ? I think PySide does accept .setText("") instead of .setText(None) On 15-01-17 08:37 PM, iMath wrote: the PySide code here prompts "TypeError: 'str' object is not callable" while it is working,but ‍When changed to PyQt code, it works well.‍ The reason why this happen is because you cannot ‍self.text = None in PySide,‍ It seems naming-clash error happened in PySide while not in PyQt , so Which used a rather good tool to wrap Qt for Python , PySide or PyQt ? ‍ from PySide import QtGui, QtCore class MyProgressBar(QtGui.QProgressBar): def __init__(self): super().__init__() self.setRange(0, 0) self.setAlignment(QtCore.Qt.AlignCenter) self.text = None # def setText(self, text): # self.text = text # def text(self): # return self.text app = QtGui.QApplication([]) p = MyProgressBar() # p.setText('finding resource...') p.show() app.exec_()‍ _______________________________________________ PySide mailing list PySide at qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- An HTML attachment was scrubbed... URL: From seanheelan at gmail.com Wed Jan 21 19:58:31 2015 From: seanheelan at gmail.com (Sean Heelan) Date: Wed, 21 Jan 2015 18:58:31 +0000 Subject: [PySide] Regression in pysidesignal.cpp? Message-ID: Hi guys, Today in a PySide project I noticed a crash with a stack trace starting from line 469 of pysidesignal.cpp. This is within the signalInstanceDisconnect function and is on a call to Py_DECREF on a value that is returned by PyObject_CallObject. PyObject_CallObject can return NULL if it fails and so what should be used on its result is Py_XDECREF. I quickly googled "signalInstanceDisconnect" and came across this [1] which is a bug report from 2012 reporting the same error, but also claiming to have been fixed along with a commit to git. Looking at the code on HEAD on the master branch at [2] you can see that Py_DECREF is still used though. Git blame has no indication that this was ever fixed [3], and I can't find the git commit with the ID mentioned either. I was under the impression that PySide has moved repository at least once in the past, so perhaps the commit was lost then? Or am I looking at an out of date copy of the code? Any explanation of the discrepancy would be appreciated. Thanks, Sean [1] http://srinikom.github.io/pyside-bz-archive/1158.html [2] https://qt.gitorious.org/pyside/pyside/source/0c64d1b2c6e5e0951675ad9b22294db4a10741c7:libpyside/pysidesignal.cpp#L469 [3] git blame -L469 libpyside/pysidesignal.cpp | head -n 1 d0decf40 libpyside/pysidesignal.cpp (Renato Filho 2011-08-26 19:11:54 -0300 469) Py_DECREF(result); -------------- next part -------------- An HTML attachment was scrubbed... URL: