From js.augustyn at gmail.com Thu Aug 2 22:02:14 2012 From: js.augustyn at gmail.com (Jason Augustyn) Date: Thu, 2 Aug 2012 16:02:14 -0400 Subject: [PySide] Can't import PySide.phonon on Mac Message-ID: Hi all, I cannot import PySide.phonon on my mac. Attempts to do so yield: ImportError: No module named phonon I am running OSX Lion, with Python 2.7. I tried reinstalling Qt 4.8 and PySide 1.1.1 to no avail. Google turned up nothing of use - any ideas? Thanks, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From rth at crans.org Mon Aug 6 11:05:41 2012 From: rth at crans.org (Roman Yurchak) Date: Mon, 06 Aug 2012 11:05:41 +0200 Subject: [PySide] init function not found in dynamic modules Message-ID: <501F88E5.3040306@crans.org> Hello, recently while trying to complete the the following tutorial http://lynxline.com/superhybrids-part-2-now-qt-pyside/ I run into an error saying: ImportError: dynamic module does not define init function (initPyHybrid) Basically the code compiles fine, though with a lot of warnings. You can find the source code in this repo https://github.com/rth/pyside-hybrid and the compilation log here http://pastebin.com/thMbneHi However when I try to import the created module I get the previously cited error. In the generated cpp code there is something that looks like an init function (see http://pastebin.com/JByDAF5Z) so was wondering if you would know what could be wrong? I'm using gcc 4.6.3, pyside 1.1.1 and qt 4.8.2 on Gentoo Linux. However an other person run into exactly the same error with an older version of qt (4.7) and pyside (0.*) on Mac OS X. If I understand correctly with pyside 1.1.1 the line generatorrunner --generatorSet=shiboken ... has to be replaced by shiboken ... right? I noticed that there are a couple of warning like " warning: missing initializer for member ‘PyMethodDef:: .." that may be related. And I was also surprised by the fact that when I give shiboken a wrong path to typesystem.xml it still generates the same number of warnings and doesn't fail. I would be really grateful for any advice. Thank you in advance, -- Roman Yurchak From rth at crans.org Mon Aug 6 11:21:29 2012 From: rth at crans.org (Roman Yurchak) Date: Mon, 06 Aug 2012 11:21:29 +0200 Subject: [PySide] init function not found in dynamic modules Message-ID: <501F8C99.2090707@crans.org> Hello, I send this message to pyside at lists.pyside.org fist, but as it seems to be an outdated mailing list, I'm forwarding it to pyside at qt-project.org. Recently while trying to complete the the following tutorial http://lynxline.com/superhybrids-part-2-now-qt-pyside/ I run into an error saying: ImportError: dynamic module does not define init function (initPyHybrid) Basically the code compiles fine, though with a lot of warnings. You can find the source code in this repo https://github.com/rth/pyside-hybrid and the compilation log here http://pastebin.com/thMbneHi However when I try to import the created module I get the previously cited error. In the generated cpp code there is something that looks like an init function (see http://pastebin.com/JByDAF5Z) so was wondering if you would know what could be wrong? I'm using gcc 4.6.3, pyside 1.1.1 and qt 4.8.2 on Gentoo Linux. However an other person run into exactly the same error with an older version of qt (4.7) and pyside (0.*) on Mac OS X. If I understand correctly with pyside 1.1.1 the line generatorrunner --generatorSet=shiboken ... has to be replaced by shiboken ... right? I noticed that there are a couple of warning like " warning: missing initializer for member ‘PyMethodDef:: .." that may be related. And I was also surprised by the fact that when I give shiboken a wrong path to typesystem.xml it still generates the same number of warnings and doesn't fail. I would be really grateful for any advice. Thank you in advance, -- Roman Yurchak -- Roman From jlujan at fishtechnology.com Fri Aug 10 18:11:26 2012 From: jlujan at fishtechnology.com (Jeremy Lujan) Date: Fri, 10 Aug 2012 11:11:26 -0500 Subject: [PySide] Mac and Windows Support Message-ID: <57CE8180-89F7-461E-A962-F73607988DD7@fishtechnology.com> We currently use PyQt very heavily on Windows, Mac and Linux. There is some desire to switch to PySide but Mac and Windows support really has to get nailed down. I think I can convince everyone here to contribute build/test VMs if this would insure that these platforms do not become second class citizens. I am looking for more information on what it would take to set up build servers for us to provide core developers access to at least one of each platforms. Thanks, Jeremy Lujan jlujan at fishtechnology.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From felix.morency at gmail.com Fri Aug 10 19:48:04 2012 From: felix.morency at gmail.com (=?UTF-8?Q?F=C3=A9lix_C=2E_Morency?=) Date: Fri, 10 Aug 2012 13:48:04 -0400 Subject: [PySide] Mac and Windows Support In-Reply-To: <57CE8180-89F7-461E-A962-F73607988DD7@fishtechnology.com> References: <57CE8180-89F7-461E-A962-F73607988DD7@fishtechnology.com> Message-ID: I would also be interested in this. We are using PySide heavily on Windows, OSX and Linux. -F On Fri, Aug 10, 2012 at 12:11 PM, Jeremy Lujan wrote: > We currently use PyQt very heavily on Windows, Mac and Linux. There is some > desire to switch to PySide but Mac and Windows support really has to get > nailed down. I think I can convince everyone here to contribute build/test > VMs if this would insure that these platforms do not become second class > citizens. I am looking for more information on what it would take to set up > build servers for us to provide core developers access to at least one of > each platforms. > > Thanks, > > Jeremy Lujan > jlujan at fishtechnology.com > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -- -- Félix C. Morency, M.Sc. Plateforme d’analyse et de visualisation d’images Centre Hospitalier Universitaire de Sherbrooke Centre de recherche clinique Étienne-Le Bel Local Z5-3031 | 819.346.1110 ext 16634 From zfoxatis at gmail.com Sat Aug 11 00:17:35 2012 From: zfoxatis at gmail.com (Zfox Atis) Date: Sat, 11 Aug 2012 00:17:35 +0200 Subject: [PySide] PySide bug or my bad code? Message-ID: I saving rekord : (savebutton) def saveRecord(self): row = self.mapper.currentIndex() self.mapper.submit() #QDataWidgetMapper self.model.submitAll() #QSqlTableModel self.mapper.setCurrentIndex(row) and my QTableView vertical headers graphics damaged, if I using other tab and next return to before tab: this pics: http://dl.dropbox.com/u/32655213/tableviewerr01.jpg http://dl.dropbox.com/u/32655213/tableviewerr02.jpg http://dl.dropbox.com/u/32655213/tableviewerr03.jpg what problem or bug? I use: Ubuntu 12.04, Python 3.2.3. , Pyside 1.1.1 (I sorry if my question very beginner) -------------- next part -------------- An HTML attachment was scrubbed... URL: From antwebid at gmail.com Sun Aug 12 09:30:25 2012 From: antwebid at gmail.com (Laurence Anthony) Date: Sun, 12 Aug 2012 16:30:25 +0900 Subject: [PySide] QApplication.processEvents() is not working Message-ID: Can someone explain why the button in the following code does not become disabled and greyed out on being pressed, whereas it works perfectly in PyQt? (You can confirm this by commenting out the from PySide import and adding the PyQt4 import). It seems that QtGui.QApplication.processEvents() is not working properly, but being a novice to PySide, I may just have the syntax wrong. from __future__ import print_function #from PyQt4 import QtGui, QtCore from PySide import QtGui, QtCore import sys class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): self.qbtn = QtGui.QPushButton('Press', self) self.qbtn.clicked.connect(self.button_disable) self.qbtn.resize(self.qbtn.sizeHint()) self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Button Disable') self.show() def button_disable(self): self.qbtn.setEnabled(False) QtGui.QApplication.processEvents() for i in range(1, 100000000): pass print("finished") self.qbtn.setEnabled(True) if __name__ == '__main__': app = QtGui.QApplication(sys.argv) ex = Example() sys.exit(app.exec_()) Thank you! From a.richi at bluewin.ch Sun Aug 12 11:48:59 2012 From: a.richi at bluewin.ch (Aaron Richiger) Date: Sun, 12 Aug 2012 11:48:59 +0200 Subject: [PySide] QApplication.processEvents() is not working In-Reply-To: References: Message-ID: <50277C0B.6050602@bluewin.ch> Hello Laurence! Quite a bomb you that you sent us here... I had to power off my machine after 10 frozen minutes:-)! So for others who want to test your code, it might be a good idea to start with a smaller upper bound for the loop unless you are on a high performance machine:-) I get exactly the same behaviour with PyQt4 on my Ubuntu 12.04. So it seems to be a Qt and not a PySide thing. There is a solution (don't ask me for the reason, I just know it works for me...): Call processEvents() multiple times. Here 2 times is enough for me, but I observed in other projects, that sometimes it needs even more calls until all events are processed as expected. With this workaround, it also works with PyQt4. I hope this helps! Cheers! Aaron Am 12.08.2012 09:30, schrieb Laurence Anthony: > Can someone explain why the button in the following code does not > become disabled and greyed out on being pressed, whereas it works > perfectly in PyQt? (You can confirm this by commenting out the from > PySide import and adding the PyQt4 import). > > It seems that QtGui.QApplication.processEvents() is not working > properly, but being a novice to PySide, I may just have the syntax > wrong. > > from __future__ import print_function > #from PyQt4 import QtGui, QtCore > from PySide import QtGui, QtCore > import sys > > class Example(QtGui.QWidget): > > def __init__(self): > super(Example, self).__init__() > self.initUI() > > def initUI(self): > > self.qbtn = QtGui.QPushButton('Press', self) > self.qbtn.clicked.connect(self.button_disable) > self.qbtn.resize(self.qbtn.sizeHint()) > self.setGeometry(300, 300, 250, 150) > self.setWindowTitle('Button Disable') > self.show() > > def button_disable(self): > self.qbtn.setEnabled(False) > QtGui.QApplication.processEvents() > > for i in range(1, 100000000): > pass > print("finished") > self.qbtn.setEnabled(True) > > > if __name__ == '__main__': > app = QtGui.QApplication(sys.argv) > ex = Example() > sys.exit(app.exec_()) > > > Thank you! > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside From antwebid at gmail.com Sun Aug 12 13:02:44 2012 From: antwebid at gmail.com (Laurence Anthony) Date: Sun, 12 Aug 2012 20:02:44 +0900 Subject: [PySide] QApplication.processEvents() is not working In-Reply-To: <50277C0B.6050602@bluewin.ch> References: <50277C0B.6050602@bluewin.ch> Message-ID: Hi Aaron, Sorry for the large upper limit. On my computer it completes in literally 4 seconds (Windows Intel i5, 2.65 GHz) . I didn't think it would be a problem. On my computer with PyQT4, the single processEvents call seems to clear all events, but not with PySide. Maybe others have a alternative workaround. Laurence. From zfoxatis at gmail.com Sun Aug 12 18:26:40 2012 From: zfoxatis at gmail.com (Zfox Atis) Date: Sun, 12 Aug 2012 18:26:40 +0200 Subject: [PySide] PySide bug or my bad code II.? sample Message-ID: I doing sample code (sorry if too much - 500 lines) http://pastebin.com/VG68u35d I trying many platform my code: ubuntu+pyside bad ( I trying unity+gnome3+xfce+lxde) win+pyside good win+qt4 good ubuntu +qt4 good -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Wed Aug 15 09:36:06 2012 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 15 Aug 2012 19:36:06 +1200 Subject: [PySide] controlling link colour in QLabel Message-ID: <502B5166.7070005@ohufx.com> Hi all, I'm wondering if it's posisble to control the link colour in a little html snippet inside a QLabel. I've got something like this: QLabel.setText('LATEST NEWS:' + newsText) Where "newsText" may or may not include a link (it's a html snippet that I get from an online database which may change frequently). The QLabel shows the embedded links in the default blue and I've read that you can change this using the palette, but I really only want to change the link colour in this one widget. Is there a different way? Cheers, frank From vihorev at gmail.com Wed Aug 15 21:56:45 2012 From: vihorev at gmail.com (Alexey Vihorev) Date: Wed, 15 Aug 2012 22:56:45 +0300 Subject: [PySide] PySide build with qt 4.8 for Windows 64 Message-ID: <001e01cd7b20$19f18140$4dd483c0$@gmail.com> Hi all! Is there any news regarding the subj? An ETA, perhaps? Anything? -------------- next part -------------- An HTML attachment was scrubbed... URL: From clong at setcorp.com Wed Aug 15 22:02:08 2012 From: clong at setcorp.com (Chris Long) Date: Wed, 15 Aug 2012 20:02:08 +0000 (UTC) Subject: [PySide] Documentation for libshiboken API? Message-ID: Hi, I am interesting in introspecting on the PySide runtime data structures that glue the C++ and Python together, from C++. I am guessing that I want to use libshiboken with the classes and functions declared in /usr/include/shiboken. Is that right? Is there any documentation for it? If you're curious, I want to do this because I'd like to let PySide interoperate with a large C++ library that's wrapped with swig. Thanks. - Chris -- A. Chris Long, Jr. Senior Research Scientist SET Corporation - An SAIC Company Phone 703.738.6214 Fax: 703.738.6201 http://www.setcorp.com From chaica at ohmytux.com Tue Aug 21 15:01:14 2012 From: chaica at ohmytux.com (chaica at ohmytux.com) Date: Tue, 21 Aug 2012 15:01:14 +0200 Subject: [PySide] Nicely resizing a QTableWidget inside a QMainWindow Message-ID: <0c1875f5bc918c680df1ac1c2ee68a2c@localhost> Hi, I've got some issues with QTableWidget inside a QMainWindow. My problem is that when resizing the main window, the QTableWidget does not follow and does not resize accordingly to its main window. I tried several ways to correct it but could not succeed. Help will be greatly appreciated. The code follows: class DrawTrackerth(QMainWindow): def __init__(self): QMainWindow.__init__(self) # create a QT table widget with len(players) numbers of rows and 4 columns ...some stuff columnnames = ['foo', 'bar'] tableWidget = QTableWidget(len(lines), len(columnnames)) tableWidget.setHorizontalHeaderLabels(columnnames) for line in lines: newItem1 = QTableWidgetItem(line) tableWidget.setItem(..., 0, newItem1) newItem2 = QTableWidgetItem(line) tableWidget.setItem(..., 1, newItem2) tableWidget.resizeColumnsToContents() tableWidget.resizeRowsToContents() exitaction = QAction(QIcon('exit.png'), '&Exit', self) exitaction.setShortcut('Ctrl+Q') exitaction.setStatusTip('Exit application') exitaction.triggered.connect(self.close) self.statusBar() # define the menu bar menubar = self.menuBar() filemenu = menubar.addMenu('&Commands') filemenu.addAction(exitaction) # define the table as central in the window self.setCentralWidget(tableWidget) self.setWindowTitle('MyApp') self.resize(800,600) self.show() Regards, Carl Chenet From thopiekar at gmail.com Tue Aug 21 15:21:53 2012 From: thopiekar at gmail.com (Thomas-Karl Pietrowski) Date: Tue, 21 Aug 2012 15:21:53 +0200 Subject: [PySide] Nicely resizing a QTableWidget inside a QMainWindow In-Reply-To: <0c1875f5bc918c680df1ac1c2ee68a2c@localhost> References: <0c1875f5bc918c680df1ac1c2ee68a2c@localhost> Message-ID: <1345555313.22277.6.camel@Nokia-N900> Hey ;) I haven't tested your code exactly, but it seems that you missed to add a layout between your mainwindow and your table widget. Try to add one and I hope it helps. On Di., 21. Aug. 2012 15:01:14 CEST, chaica at ohmytux.com wrote: > Hi, > > I've got some issues with  QTableWidget inside a QMainWindow. > > My problem is that when resizing the main window, the QTableWidget > does not follow and does not resize accordingly to its main window. I > tried several ways to correct it but could not succeed. Help will be > greatly appreciated. > > The code follows: > > class DrawTrackerth(QMainWindow): >        def __init__(self): >                QMainWindow.__init__(self) > >                # create a QT table widget with len(players) numbers of rows > and 4 columns >                ...some stuff >                columnnames = ['foo', 'bar'] >                tableWidget = QTableWidget(len(lines), len(columnnames)) >                tableWidget.setHorizontalHeaderLabels(columnnames) >                for line in lines: >                        newItem1 = QTableWidgetItem(line) >                        tableWidget.setItem(..., 0, newItem1) >                        newItem2 = QTableWidgetItem(line) >                        tableWidget.setItem(..., 1, newItem2) >                tableWidget.resizeColumnsToContents() >                tableWidget.resizeRowsToContents() >                exitaction = QAction(QIcon('exit.png'), '&Exit', self) >                exitaction.setShortcut('Ctrl+Q') >                exitaction.setStatusTip('Exit application') >                exitaction.triggered.connect(self.close) >                self.statusBar() >                # define the menu bar >                menubar = self.menuBar() >                filemenu = menubar.addMenu('&Commands') >                filemenu.addAction(exitaction) >                # define the table as central in the window >                self.setCentralWidget(tableWidget) >                self.setWindowTitle('MyApp') >                self.resize(800,600) >                self.show() > > Regards, > Carl Chenet > > _______________________________________________ > 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 chaica at ohmytux.com Tue Aug 21 23:25:40 2012 From: chaica at ohmytux.com (Carl Chenet) Date: Tue, 21 Aug 2012 23:25:40 +0200 Subject: [PySide] Nicely resizing a QTableWidget inside a QMainWindow In-Reply-To: <1345555313.22277.6.camel@Nokia-N900> References: <0c1875f5bc918c680df1ac1c2ee68a2c@localhost> <1345555313.22277.6.camel@Nokia-N900> Message-ID: <5033FCD4.8060500@ohmytux.com> On 21/08/2012 15:21, Thomas-Karl Pietrowski wrote: > Hey ;) > > I haven't tested your code exactly, but it seems that you missed to add > a layout between your mainwindow and your table widget. > Try to add one and I hope it helps. Thanks for your help. I tried the following adding a qvboxlayout but it didn't improve. I'm not sure I'm using it in a correcdt way though. class Draw(QMainWindow): def __init__(self): QMainWindow.__init__(self) columnnames = ['...'] tableWidget = QTableWidget(len(lines), len(columnnames)) tableWidget.setHorizontalHeaderLabels(columnnames) for line in lines: newItem1 = QTableWidgetItem(player) tableWidget.setItem(nbplayers, 0, newItem1) ... tableWidget.resizeColumnsToContents() tableWidget.resizeRowsToContents() # define the action of the menu bar exitaction = QAction(QIcon('exit.png'), '&Exit', self) exitaction.setShortcut('Ctrl+Q') exitaction.setStatusTip('Exit application') exitaction.triggered.connect(self.close) self.statusBar() # define the menu bar menubar = self.menuBar() filemenu = menubar.addMenu('&Commands') filemenu.addAction(exitaction) # define the table as central in the window layout = QVBoxLayout() layout.addWidget(tableWidget) self.setCentralWidget(tableWidget) self.setWindowTitle('myapp') self.setLayout(layout) self.show() Regards, Carl Chenet From chaica at ohmytux.com Tue Aug 21 23:27:29 2012 From: chaica at ohmytux.com (Carl Chenet) Date: Tue, 21 Aug 2012 23:27:29 +0200 Subject: [PySide] Nicely resizing a QTableWidget inside a QMainWindow In-Reply-To: <852DB974-6ACA-4C1F-AE35-3E0CE7C6B298@gmail.com> References: <0c1875f5bc918c680df1ac1c2ee68a2c@localhost> <852DB974-6ACA-4C1F-AE35-3E0CE7C6B298@gmail.com> Message-ID: <5033FD41.6060301@ohmytux.com> On 21/08/2012 15:16, Andrés Torres wrote: > For better results when resizing, use a QLayout, in my experience a > QGridLayout works well in these cases. > Thanks for your help, I'll test it, but it seems a big change in my idea to use qtablewidget, which is exactly what I need. Regards, Carl Chenet From tommaso.vinci at polytechnique.fr Fri Aug 24 13:38:12 2012 From: tommaso.vinci at polytechnique.fr (Tommaso Vinci) Date: Fri, 24 Aug 2012 13:38:12 +0200 Subject: [PySide] pyside hybrid app Message-ID: Dear all, I'm trying to reproduce the hybrid app tutorial with pyside and can't get it work. I'm probably really close to the solution! first: I'm on a mac with qt and pyside installed. I'm able to compile the first qt library then run the generator without (major) issues, and finally compile the hybrid stuff I end up with both libraries but when I try to import them in python I get this error: Traceback (most recent call last): File "Main.py", line 4, in import PyHybrid ImportError: dynamic module does not define init function (initPyHybrid) I'm attaching a zip file of the source tree I've seen someone struggling with the same error but there he had problems with the LD_LIBRARY_PATH, in my case both libraries can resolve all the dynamic loading PyHybrid.so: libPyHybrid.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) /System/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.1) libpyside-python2.6.1.1.dylib (compatibility version 1.1.0, current version 1.1.0) libshiboken-python2.6.1.1.dylib (compatibility version 1.1.0, current version 1.1.0) libMainWindow.1.dylib (compatibility version 1.0.0, current version 1.0.0) QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, current version 4.7.4) QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.4) QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.4) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 830.0.0) libMainWindow.1.dylib: libMainWindow.1.dylib (compatibility version 1.0.0, current version 1.0.0) QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.4) QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.4) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 830.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11) Hope someone can help me -- Tommaso Vinci LULI - Ecole Polytechnique +33 (0)1 69335427 tommaso.vinci at polytechnique.edu http://www.luli.polytechnique.fr -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: HybridApp.tgz Type: application/x-gzip Size: 3151 bytes Desc: not available URL: From yann.lanthony at gmail.com Fri Aug 24 14:48:23 2012 From: yann.lanthony at gmail.com (Yann Lanthony) Date: Fri, 24 Aug 2012 14:48:23 +0200 Subject: [PySide] pyside hybrid app In-Reply-To: References: Message-ID: Hi, I think the only problem is the way you name your package. The generated dynamic library is named libPyHybrid.dylib according to the TARGET defined in hybridpy/hybridpy.pro. But in your typesystem, you name your python module "hybridpy". The name you give in the typesystem has to be the one of the final python module because it is the one used to create, among other things, the init method of the module. So in your case, this method is called inithybridpy and that's why it fails to find a initPyHybrid method. Try one of these options : - set TARGET = hybridpy in your .pro - or put in your typesystem I think this should resolve your problem (I haven't tried on your project but I already faced such issues and this was the solution I found). Regards, Yann 2012/8/24 Tommaso Vinci > Dear all, > > I'm trying to reproduce the hybrid app tutorial with pyside and can't get > it work. > I'm probably really close to the solution! > > first: I'm on a mac with qt and pyside installed. > > I'm able to compile the first qt library then run the generator without > (major) issues, and finally compile the hybrid stuff > > I end up with both libraries but when I try to import them in python I get > this error: > Traceback (most recent call last): > File "Main.py", line 4, in > import PyHybrid > ImportError: dynamic module does not define init function (initPyHybrid) > > > I'm attaching a zip file of the source tree > I've seen someone struggling with the same error but there he had problems > with the LD_LIBRARY_PATH, in my case both libraries can resolve all the > dynamic loading > > > PyHybrid.so: > libPyHybrid.1.dylib (compatibility version 1.0.0, current version > 1.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 125.2.11) > /System/Library/Frameworks/Python.framework/Versions/2.6/Python > (compatibility version 2.6.0, current version 2.6.1) > libpyside-python2.6.1.1.dylib (compatibility version 1.1.0, current > version 1.1.0) > libshiboken-python2.6.1.1.dylib (compatibility version 1.1.0, current > version 1.1.0) > libMainWindow.1.dylib (compatibility version 1.0.0, current version > 1.0.0) > QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, current > version 4.7.4) > QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, > current version 4.7.4) > QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current > version 4.7.4) > /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current > version 7.9.0) > /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current > version 830.0.0) > > libMainWindow.1.dylib: > libMainWindow.1.dylib (compatibility version 1.0.0, current version > 1.0.0) > QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current > version 4.7.4) > QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, > current version 4.7.4) > /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current > version 7.9.0) > /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current > version 830.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current > version 125.2.11) > > > Hope someone can help me > > -- > Tommaso Vinci > LULI - Ecole Polytechnique > +33 (0)1 69335427 > tommaso.vinci at polytechnique.edu > http://www.luli.polytechnique.fr > > > _______________________________________________ > 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 tommaso.vinci at polytechnique.fr Fri Aug 24 15:05:11 2012 From: tommaso.vinci at polytechnique.fr (Tommaso Vinci) Date: Fri, 24 Aug 2012 15:05:11 +0200 Subject: [PySide] pyside hybrid app In-Reply-To: References: Message-ID: Thanks a MILLION! that solved the problem! now I can move on and translate my qt app... (I'll be around soon asking for dumb questions!) On Fri, Aug 24, 2012 at 2:48 PM, Yann Lanthony wrote: > Hi, > > I think the only problem is the way you name your package. > The generated dynamic library is named libPyHybrid.dylib according to the > TARGET defined in hybridpy/hybridpy.pro. But in your typesystem, you name > your python module "hybridpy". The name you give in the typesystem has to > be the one of the final python module because it is the one used to create, > among other things, the init method of the module. > So in your case, this method is called inithybridpy and that's why it > fails to find a initPyHybrid method. > > Try one of these options : > - set TARGET = hybridpy in your .pro > - or put in your typesystem > > I think this should resolve your problem (I haven't tried on your project > but I already faced such issues and this was the solution I found). > > Regards, > Yann > > 2012/8/24 Tommaso Vinci > >> Dear all, >> >> I'm trying to reproduce the hybrid app tutorial with pyside and can't get >> it work. >> I'm probably really close to the solution! >> >> first: I'm on a mac with qt and pyside installed. >> >> I'm able to compile the first qt library then run the generator without >> (major) issues, and finally compile the hybrid stuff >> >> I end up with both libraries but when I try to import them in python I >> get this error: >> Traceback (most recent call last): >> File "Main.py", line 4, in >> import PyHybrid >> ImportError: dynamic module does not define init function (initPyHybrid) >> >> >> I'm attaching a zip file of the source tree >> I've seen someone struggling with the same error but there he had >> problems with the LD_LIBRARY_PATH, in my case both libraries can resolve >> all the dynamic loading >> >> >> PyHybrid.so: >> libPyHybrid.1.dylib (compatibility version 1.0.0, current version >> 1.0.0) >> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current >> version 125.2.11) >> /System/Library/Frameworks/Python.framework/Versions/2.6/Python >> (compatibility version 2.6.0, current version 2.6.1) >> libpyside-python2.6.1.1.dylib (compatibility version 1.1.0, current >> version 1.1.0) >> libshiboken-python2.6.1.1.dylib (compatibility version 1.1.0, current >> version 1.1.0) >> libMainWindow.1.dylib (compatibility version 1.0.0, current version >> 1.0.0) >> QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, >> current version 4.7.4) >> QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, >> current version 4.7.4) >> QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, >> current version 4.7.4) >> /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current >> version 7.9.0) >> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current >> version 830.0.0) >> >> libMainWindow.1.dylib: >> libMainWindow.1.dylib (compatibility version 1.0.0, current version >> 1.0.0) >> QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, >> current version 4.7.4) >> QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, >> current version 4.7.4) >> /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current >> version 7.9.0) >> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current >> version 830.0.0) >> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current >> version 125.2.11) >> >> >> Hope someone can help me >> >> -- >> Tommaso Vinci >> LULI - Ecole Polytechnique >> +33 (0)1 69335427 >> tommaso.vinci at polytechnique.edu >> http://www.luli.polytechnique.fr >> >> >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside >> >> > -- Tommaso Vinci LULI - Ecole Polytechnique +33 (0)1 69335427 tommaso.vinci at polytechnique.edu http://www.luli.polytechnique.fr -------------- next part -------------- An HTML attachment was scrubbed... URL: From hugo.lima at openbossa.org Mon Aug 27 16:31:23 2012 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Mon, 27 Aug 2012 11:31:23 -0300 Subject: [PySide] Documentation for libshiboken API? In-Reply-To: References: Message-ID: <1537505.BrEkDbic1P@hugodesktop> On Wednesday, August 15, 2012 08:02:08 PM Chris Long wrote: > Hi, > > I am interesting in introspecting on the PySide runtime data structures that > glue the C++ and Python together, from C++. I am guessing that I want to > use libshiboken with the classes and functions declared in > /usr/include/shiboken. > > Is that right? Is there any documentation for it? Almost all public functions have some comments on the header file, however I must admit that the comments may not be much clear or depend on knowledgment not explained in the comments itself. > If you're curious, I want to do this because I'd like to let PySide > interoperate with a large C++ library that's wrapped with swig. > > Thanks. > > - Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From hugo.lima at openbossa.org Mon Aug 27 16:31:23 2012 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Mon, 27 Aug 2012 11:31:23 -0300 Subject: [PySide] Documentation for libshiboken API? In-Reply-To: References: Message-ID: <1537505.BrEkDbic1P@hugodesktop> On Wednesday, August 15, 2012 08:02:08 PM Chris Long wrote: > Hi, > > I am interesting in introspecting on the PySide runtime data structures that > glue the C++ and Python together, from C++. I am guessing that I want to > use libshiboken with the classes and functions declared in > /usr/include/shiboken. > > Is that right? Is there any documentation for it? Almost all public functions have some comments on the header file, however I must admit that the comments may not be much clear or depend on knowledgment not explained in the comments itself. > If you're curious, I want to do this because I'd like to let PySide > interoperate with a large C++ library that's wrapped with swig. > > Thanks. > > - Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From hugo.lima at openbossa.org Mon Aug 27 16:42:22 2012 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Mon, 27 Aug 2012 11:42:22 -0300 Subject: [PySide] PySide build with qt 4.8 for Windows 64 In-Reply-To: <001e01cd7b20$19f18140$4dd483c0$@gmail.com> References: <001e01cd7b20$19f18140$4dd483c0$@gmail.com> Message-ID: <2426253.Rvj9Tz3NzB@hugodesktop> On Wednesday, August 15, 2012 10:56:45 PM Alexey Vihorev wrote: > Hi all! > > Is there any news regarding the subj? An ETA, perhaps? Anything? I was supposed to make a new PySide release last month, but due to my vacations it was postponed. I don't have a ETA yet, but Roman needs a release before creating win64 packages, so you can expect win64 packages only after a new release. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From david.garcia at upf.edu Mon Aug 27 20:55:33 2012 From: david.garcia at upf.edu (David =?ISO-8859-1?Q?Garc=EDa_Garz=F3n?=) Date: Mon, 27 Aug 2012 20:55:33 +0200 Subject: [PySide] Obtaining QObject from PySide based PyObject Message-ID: <1593741.CxrI22LTrc@wl082936> I have a function implemented in CPython (in fact, boost-python but I guess is the same) that receives as parameter a QWidget from python code and i would like to recover the pointer to the QObject. Formerly we were using PyQt and used some complex sip api >From some boost python code (CPython for the sake of simplicity) From david.garcia at upf.edu Mon Aug 27 21:12:27 2012 From: david.garcia at upf.edu (David =?ISO-8859-1?Q?Garc=EDa_Garz=F3n?=) Date: Mon, 27 Aug 2012 21:12:27 +0200 Subject: [PySide] Obtaining QObject from PySide based PyObject (complete) Message-ID: <96152238.d566e79Gsm@wl082936> Sorry for the previous unfinished message. Here goes the final one. I am porting a CPython library (boost based indeed) from PyQt to PySide. I had a function in the library that received a Sip wrapped widget as a PyObject and I used the very ugly SIP api to recover a pointer to the actual C++ QObject. Does anyone know how recover the C++ QObject from the PyObject in PySide? Thanks. David. PS: If someone is curious the current sip unwrapper, based on some snippets i found, is in here: http://clam-project.org/clam/trunk/ipyclam/sipunwrap.cxx And the function which uses it is bindUi in http://clam-project.org/clam/trunk/ipyclam/Clam_NetworkProxy.cxx From hugo.lima at openbossa.org Mon Aug 27 21:23:03 2012 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Mon, 27 Aug 2012 16:23:03 -0300 Subject: [PySide] Obtaining QObject from PySide based PyObject (complete) In-Reply-To: <96152238.d566e79Gsm@wl082936> References: <96152238.d566e79Gsm@wl082936> Message-ID: <10046387.5KaC9rtBQY@hugodesktop> On Monday, August 27, 2012 09:12:27 PM David García Garzón wrote: > Sorry for the previous unfinished message. Here goes the final one. > > I am porting a CPython library (boost based indeed) from PyQt to PySide. > I had a function in the library that received a Sip wrapped widget > as a PyObject and I used the very ugly SIP api to recover a pointer to the > actual C++ QObject. > > Does anyone know how recover the C++ QObject from the PyObject in PySide? You can use: Shiboken::Object::cppPointer(...), it's on libshiboken basewrapper.h It receives two parameters, a SbkObject* and a PyTypeObject*, the SbkObject* will be your PyObject*, just cast it and make sure it always will be a Python object representing a C++ object bound using Shiboken, the PyTypeObject* must be the PyTypeObject* for QObject, you can get it using: Shiboken::TypeResolver::get("QObject*")->pythonType(); TypeResolver class is located on libshiboken typeresolver.h header. Hope this would help you. > Thanks. > David. > > PS: If someone is curious the current sip unwrapper, based on some snippets > i found, is in here: > http://clam-project.org/clam/trunk/ipyclam/sipunwrap.cxx > And the function which uses it is bindUi in > http://clam-project.org/clam/trunk/ipyclam/Clam_NetworkProxy.cxx > > > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From frank at ohufx.com Tue Aug 28 09:20:38 2012 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 28 Aug 2012 19:20:38 +1200 Subject: [PySide] right clicking on QTableView to get selected rows Message-ID: <503C7146.3010409@ohufx.com> Hi everybody, I'm trying to implement a simple right click menu for a QTableView to work with the selected rows. The basics seem to work nicely but it seems like the selectionModel() gets updated AFTER the mousePressEvent registered, meaning if the right selection that happens on right lcick is not yet included in the selecetdRows() return value. How do I best ensure that whatever row is right clicked is included in the selectionModel().selectedRows(0)? Here is my code: class ToolsView(QTableView): def __init__(self, parent=None): super(ToolsView, self).__init__(parent) self.setSortingEnabled(True) self.setEditTriggers(QAbstractItemView.NoEditTriggers) self.horizontalHeader().setStretchLastSection(True) self.setSelectionBehavior(QAbstractItemView.SelectRows) def mousePressEvent(self, event): mouseBtn = event.button() if mouseBtn == Qt.MouseButton.RightButton: print self.selectionModel().selectedRows(0) super(InstalledToolsView, self).mousePressEvent(event) Cheers, frank From kandraitibold at gmail.com Tue Aug 28 11:37:56 2012 From: kandraitibold at gmail.com (Tibold Kandrai) Date: Tue, 28 Aug 2012 11:37:56 +0200 Subject: [PySide] right clicking on QTableView to get selected rows In-Reply-To: <503C7146.3010409@ohufx.com> References: <503C7146.3010409@ohufx.com> Message-ID: Hi, There are multiple ways to deal with the context menus. You don't necessarily need to use the mousePressEvent. I would use or the customContextMenuRequested signal or adding actions to the view. Note you also need to set the contextMenuPolicy to ActionsContextMenu or CustomContextMenu depending on which you use. References: - http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#customContextMenuRequested - http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#contextMenuPolicy-prop - http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#addAction I am not sure though how the selection works exactly with the context menu. But in the customContextMenuRequested you can get the right clicked row's index easily like this: model_index = self.indexAt(point) Hope this helps, Tibold 2012/8/28 Frank Rueter | OHUfx > Hi everybody, > > I'm trying to implement a simple right click menu for a QTableView to > work with the selected rows. The basics seem to work nicely but it seems > like the selectionModel() gets updated AFTER the mousePressEvent > registered, meaning if the right selection that happens on right lcick > is not yet included in the selecetdRows() return value. > How do I best ensure that whatever row is right clicked is included in > the selectionModel().selectedRows(0)? > Here is my code: > > > class ToolsView(QTableView): > def __init__(self, parent=None): > super(ToolsView, self).__init__(parent) > self.setSortingEnabled(True) > self.setEditTriggers(QAbstractItemView.NoEditTriggers) > self.horizontalHeader().setStretchLastSection(True) > self.setSelectionBehavior(QAbstractItemView.SelectRows) > > def mousePressEvent(self, event): > mouseBtn = event.button() > if mouseBtn == Qt.MouseButton.RightButton: > print self.selectionModel().selectedRows(0) > super(InstalledToolsView, self).mousePressEvent(event) > > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > -- Kandrai Tibold -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Tue Aug 28 11:41:47 2012 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Tue, 28 Aug 2012 21:41:47 +1200 Subject: [PySide] right clicking on QTableView to get selected rows In-Reply-To: References: <503C7146.3010409@ohufx.com> Message-ID: <503C925B.1080102@ohufx.com> cool, thanks Tibold. That sounds like the right lead. I will investigate... On 28/08/12 9:37 PM, Tibold Kandrai wrote: > Hi, > > There are multiple ways to deal with the context menus. You don't > necessarily need to use the mousePressEvent. > I would use or the customContextMenuRequested signal or adding actions > to the view. Note you also need to set the contextMenuPolicy to > ActionsContextMenu or CustomContextMenu depending on which you use. > > References: > > * http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#customContextMenuRequested > * http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#contextMenuPolicy-prop > * http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#addAction > > I am not sure though how the selection works exactly with the context > menu. But in the customContextMenuRequested you can get the right > clicked row's index easily like this: > model_index = self.indexAt(point) > > Hope this helps, > Tibold > > > 2012/8/28 Frank Rueter | OHUfx > > > Hi everybody, > > I'm trying to implement a simple right click menu for a QTableView to > work with the selected rows. The basics seem to work nicely but it > seems > like the selectionModel() gets updated AFTER the mousePressEvent > registered, meaning if the right selection that happens on right lcick > is not yet included in the selecetdRows() return value. > How do I best ensure that whatever row is right clicked is included in > the selectionModel().selectedRows(0)? > Here is my code: > > > class ToolsView(QTableView): > def __init__(self, parent=None): > super(ToolsView, self).__init__(parent) > self.setSortingEnabled(True) > self.setEditTriggers(QAbstractItemView.NoEditTriggers) > self.horizontalHeader().setStretchLastSection(True) > self.setSelectionBehavior(QAbstractItemView.SelectRows) > > def mousePressEvent(self, event): > mouseBtn = event.button() > if mouseBtn == Qt.MouseButton.RightButton: > print self.selectionModel().selectedRows(0) > super(InstalledToolsView, self).mousePressEvent(event) > > > Cheers, > frank > _______________________________________________ > PySide mailing list > PySide at qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside > > > > > -- > Kandrai Tibold -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.garcia at upf.edu Tue Aug 28 14:48:32 2012 From: david.garcia at upf.edu (David =?ISO-8859-1?Q?Garc=EDa_Garz=F3n?=) Date: Tue, 28 Aug 2012 14:48:32 +0200 Subject: [PySide] Obtaining QObject from PySide based PyObject (complete) In-Reply-To: <10046387.5KaC9rtBQY@hugodesktop> References: <96152238.d566e79Gsm@wl082936> <10046387.5KaC9rtBQY@hugodesktop> Message-ID: <1564282.WylHtcGgKK@wl082936> On Monday 27 August 2012 16:23:03 Hugo Parente Lima wrote: > On Monday, August 27, 2012 09:12:27 PM David García Garzón wrote: > > Sorry for the previous unfinished message. Here goes the final one. > > > > I am porting a CPython library (boost based indeed) from PyQt to PySide. > > I had a function in the library that received a Sip wrapped widget > > as a PyObject and I used the very ugly SIP api to recover a pointer to the > > actual C++ QObject. > > > > Does anyone know how recover the C++ QObject from the PyObject in PySide? > > You can use: > Shiboken::Object::cppPointer(...), it's on libshiboken basewrapper.h > > It receives two parameters, a SbkObject* and a PyTypeObject*, the SbkObject* > will be your PyObject*, just cast it and make sure it always will be a > Python object representing a C++ object bound using Shiboken, the > PyTypeObject* must be the PyTypeObject* for QObject, you can get it using: > > Shiboken::TypeResolver::get("QObject*")->pythonType(); > > TypeResolver class is located on libshiboken typeresolver.h header. > > Hope this would help you. > Yes, thanks, this seems to be just what i needed. You even provided answer to what i wanted to ask next, how to identify pyside objects. No time to try it just now but i am eager to try it to see if it works. Thanks a lot. David From hugo.lima at openbossa.org Tue Aug 28 16:25:18 2012 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Tue, 28 Aug 2012 11:25:18 -0300 Subject: [PySide] Obtaining QObject from PySide based PyObject (complete) In-Reply-To: <1564282.WylHtcGgKK@wl082936> References: <96152238.d566e79Gsm@wl082936> <10046387.5KaC9rtBQY@hugodesktop> <1564282.WylHtcGgKK@wl082936> Message-ID: <10684831.0hduZLiNck@hugodesktop> On Tuesday, August 28, 2012 02:48:32 PM David García Garzón wrote: > On Monday 27 August 2012 16:23:03 Hugo Parente Lima wrote: > > On Monday, August 27, 2012 09:12:27 PM David García Garzón wrote: > > > Sorry for the previous unfinished message. Here goes the final one. > > > > > > I am porting a CPython library (boost based indeed) from PyQt to PySide. > > > I had a function in the library that received a Sip wrapped widget > > > as a PyObject and I used the very ugly SIP api to recover a pointer to > > > the > > > actual C++ QObject. > > > > > > Does anyone know how recover the C++ QObject from the PyObject in > > > PySide? > > > > You can use: > > Shiboken::Object::cppPointer(...), it's on libshiboken basewrapper.h > > > > It receives two parameters, a SbkObject* and a PyTypeObject*, the > > SbkObject* will be your PyObject*, just cast it and make sure it always > > will be a Python object representing a C++ object bound using Shiboken, > > the > > PyTypeObject* must be the PyTypeObject* for QObject, you can get it using: > > > > Shiboken::TypeResolver::get("QObject*")->pythonType(); > > > > TypeResolver class is located on libshiboken typeresolver.h header. > > > > Hope this would help you. > > Yes, thanks, this seems to be just what i needed. You even provided answer > to what i wanted to ask next, how to identify pyside objects. No time to > try it just now but i am eager to try it to see if it works. Thanks a lot. There's a function on basewrapper.h that do just that, test if the PyObject is a SbkObject, i.e. a PySide object. Shiboken::Object::checkType(PyObject*) Returns true if the object is an instance of a type created by the Shiboken generator. > David -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From Ramakanthreddy_Kesireddy at mahindrasatyam.com Tue Aug 28 17:12:49 2012 From: Ramakanthreddy_Kesireddy at mahindrasatyam.com (Ramakanthreddy_Kesireddy) Date: Tue, 28 Aug 2012 15:12:49 +0000 Subject: [PySide] PyQt Opensource for test automation Message-ID: Hi, I would like to know if PyQt tool for test automation is available as open source. If so, please share the link for downloading the same. Br, Ramakanth ________________________________ DISCLAIMER: This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anderson.lizardo at openbossa.org Tue Aug 28 17:35:16 2012 From: anderson.lizardo at openbossa.org (Anderson Lizardo) Date: Tue, 28 Aug 2012 11:35:16 -0400 Subject: [PySide] PyQt Opensource for test automation In-Reply-To: References: Message-ID: Hi, On Tue, Aug 28, 2012 at 11:12 AM, Ramakanthreddy_Kesireddy wrote: > I would like to know if PyQt tool for test automation is available as open > source. > > If so, please share the link for downloading the same. This list is for PySide, not PyQt. For PyQt see: http://www.riverbankcomputing.com/mailman/listinfo/pyqt Regards, -- Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil From pyside at m.allo.ws Tue Aug 28 21:29:51 2012 From: pyside at m.allo.ws (Zak) Date: Tue, 28 Aug 2012 15:29:51 -0400 Subject: [PySide] PySide plus Django: How can I make the PySide application auto-start the server? Message-ID: <503D1C2F.2000002@m.allo.ws> Dear PySide People, I am making a PySide application for Windows 7. One important portion of my application is a Django web app. Currently, to start my application, you do the following: # First, we need to start the Django web server. 1. Open a terminal ("Command Prompt" on Windows). 2. At the terminal: cd /path/to/server/ python manage.py runserver # Now the server is running. # Next, we need to start the PySide GUI. 3. Double-click the file pts_qt.py # The contents of the file pts_qt.py are attached to this email. # pts_qt.py is very simple (for the purposes of asking this question), it just opens a Qt GUI window, fills it with a QWebKit browser, and points the browser at http://127.0.0.1:8000/, which is the URL of the website being served by Django. As you can see, starting my application requires 3 steps. I want it to be just one step. That step should be "Double-click the file pts_qt.py", and that should start the Django webserver automatically. It would also be nice if closing the Qt GUI by clicking the "X" in the corner of the window would stop the Django server too. How can I make pts_qt.py start the Django server automatically? Note that the Django server should start its own terminal window (Command Prompt window) which prints status messages and stuff. Thank you, Zak P.S. You might be asking, "Why is this a PySide app and not just a web app?" Well, the actual application is more complicated. It comes in three flavors: A. Pure Web App, to be used remotely and with nothing but a browser. B. Remote Thick Client. This is a PySide app that interacts with the remote web server, but also does special non-web stuff, like interfacing with hardware. C. Pure Local Client. This is a PySide app that is like the Remote Thick Client, except that it doesn't connect to the mothership server. It starts its own Django server. This is the thing we are trying to fix. -------------- next part -------------- A non-text attachment was scrubbed... Name: pts_qt.py Type: text/x-python-script Size: 332 bytes Desc: not available URL: From hugo.lima at openbossa.org Tue Aug 28 23:13:15 2012 From: hugo.lima at openbossa.org (Hugo Parente Lima) Date: Tue, 28 Aug 2012 18:13:15 -0300 Subject: [PySide] PySide 1.1.2 - "Alaursa": Python for Qt released! Message-ID: <1550114.b2ArTxsZpe@hugodesktop> The PySide team is proud to announce the new release version 1.1.2 of PySide project. About PySide ============ PySide is the Python Qt bindings project, providing access the complete Qt 4.8 framework as well as to generator tools for rapidly generating bindings for any C++ libraries. The PySide project is developed in the open, with all facilities you'd expect from any modern OSS project such as all code in a git repository [1], an open bug tracking [2] for reporting bugs, and an open design process [3]. List of bugs fixed ================== - During signal emission don't get return type after callback - Invalidate QStandardModel::invisibleRootItem in clear() method - QAbstractItemModel has wrong ownership policy for selectionModel() - Improved QVector to python conversion - Disable docstring generation if tools aren't found. - Fixed some issues compiling PySide using VC++ - Install the shiboken module to site-packages - Fix compilation when there is no libxslt installed on the system. - Set a default hash function for all ObjectTypes. - Fix segfault calling shiboken.dump Special thanks to Nathan Smith, John Ehresman, John Cummings, Paulo Alcantra and Roman Lacko who contributed with most of the patches used to fix the issues addressed by this release. Download ======== The files can be downloaded from PySide download page[4] References ========== [1] http://qt.gitorious.org/pyside [2] https://bugreports.qt-project.org/browse/PYSIDE [3] http://www.pyside.org/docs/pseps/psep-0001.html [4] http://developer.qt.nokia.com/wiki/PySideDownloads -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From pyside at m.allo.ws Wed Aug 29 00:18:11 2012 From: pyside at m.allo.ws (Zak) Date: Tue, 28 Aug 2012 18:18:11 -0400 Subject: [PySide] PySide plus Django: How can I make the PySide application auto-start the server? In-Reply-To: <503D1C2F.2000002@m.allo.ws> References: <503D1C2F.2000002@m.allo.ws> Message-ID: <503D43A3.2080707@m.allo.ws> Dear PySide People, I figured out how to make the start-up process one step. I put the following in pts_qt.py, right before app.exec_(): # Goes at top, of course: import subprocess # Stuff server = subprocess.Popen(["python", "C:\\Users\\me\\pts\\manage.py", "runserver"]) app.exec_() # If execution reaches this point, it means the Qt GUI window was closed server.kill() Now I can start the Qt GUI and the Django server by just double-clicking pts_qt.py. Unfortunately, closing the Qt GUI window does NOT stop the Django server, even though I called server.kill(). At the moment, it is necessary to close the Qt GUI window and then close the Python terminal window, so shutting down the application is now two steps. Any idea how I can make it into just one step? Doesn't work: server.kill() server.terminate() server.send_signal(signal.SIGINT) # Other signals that don't work: SIGTERM 1 2 CTRL_C_EVENT CTRL_BREAK_EVENT Also doesn't work: Calling a Django viewfunction that calls sys.exit(). Unfortunately, the entire Django server is running inside a "try" clause that looks for and disables sys.exit(). I don't want to modify the Django internals, although I could and that would work. It would just make installation harder, I don't want to do it. Thanks, Zak On 8/28/12 3:29 PM, Zak wrote: > Dear PySide People, > > I am making a PySide application for Windows 7. One important portion > of my application is a Django web app. Currently, to start my > application, you do the following: > > # First, we need to start the Django web server. > > 1. Open a terminal ("Command Prompt" on Windows). > > 2. At the terminal: > > cd /path/to/server/ > > python manage.py runserver > > # Now the server is running. > > # Next, we need to start the PySide GUI. > > 3. Double-click the file pts_qt.py > > # The contents of the file pts_qt.py are attached to this email. > > # pts_qt.py is very simple (for the purposes of asking this question), > it just opens a Qt GUI window, fills it with a QWebKit browser, and > points the browser at http://127.0.0.1:8000/, which is the URL of the > website being served by Django. > > As you can see, starting my application requires 3 steps. I want it to > be just one step. That step should be "Double-click the file > pts_qt.py", and that should start the Django webserver automatically. > > It would also be nice if closing the Qt GUI by clicking the "X" in the > corner of the window would stop the Django server too. > > How can I make pts_qt.py start the Django server automatically? Note > that the Django server should start its own terminal window (Command > Prompt window) which prints status messages and stuff. > > Thank you, > > Zak > > P.S. You might be asking, "Why is this a PySide app and not just a web > app?" Well, the actual application is more complicated. It comes in > three flavors: > > A. Pure Web App, to be used remotely and with nothing but a browser. > > B. Remote Thick Client. This is a PySide app that interacts with the > remote web server, but also does special non-web stuff, like > interfacing with hardware. > > C. Pure Local Client. This is a PySide app that is like the Remote > Thick Client, except that it doesn't connect to the mothership server. > It starts its own Django server. This is the thing we are trying to fix. From frank at ohufx.com Wed Aug 29 02:45:58 2012 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Wed, 29 Aug 2012 12:45:58 +1200 Subject: [PySide] right clicking on QTableView to get selected rows In-Reply-To: <503C925B.1080102@ohufx.com> References: <503C7146.3010409@ohufx.com> <503C925B.1080102@ohufx.com> Message-ID: <503D6646.6060702@ohufx.com> brilliant, just adding actions to the widget itself and using self.setContextMenuPolicy(Qt.ActionsContextMenu) works nicely. I was way over complicating this task. Thank you!! On 28/08/12 9:41 PM, Frank Rueter | OHUfx wrote: > cool, thanks Tibold. That sounds like the right lead. > I will investigate... > > On 28/08/12 9:37 PM, Tibold Kandrai wrote: >> Hi, >> >> There are multiple ways to deal with the context menus. You don't >> necessarily need to use the mousePressEvent. >> I would use or the customContextMenuRequested signal or adding >> actions to the view. Note you also need to set the contextMenuPolicy >> to ActionsContextMenu or CustomContextMenu depending on which you use. >> >> References: >> >> * http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#customContextMenuRequested >> * http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#contextMenuPolicy-prop >> * http://doc.qt.nokia.com/4.7-snapshot/qwidget.html#addAction >> >> I am not sure though how the selection works exactly with the context >> menu. But in the customContextMenuRequested you can get the right >> clicked row's index easily like this: >> model_index = self.indexAt(point) >> >> Hope this helps, >> Tibold >> >> >> 2012/8/28 Frank Rueter | OHUfx > >> >> Hi everybody, >> >> I'm trying to implement a simple right click menu for a QTableView to >> work with the selected rows. The basics seem to work nicely but >> it seems >> like the selectionModel() gets updated AFTER the mousePressEvent >> registered, meaning if the right selection that happens on right >> lcick >> is not yet included in the selecetdRows() return value. >> How do I best ensure that whatever row is right clicked is >> included in >> the selectionModel().selectedRows(0)? >> Here is my code: >> >> >> class ToolsView(QTableView): >> def __init__(self, parent=None): >> super(ToolsView, self).__init__(parent) >> self.setSortingEnabled(True) >> self.setEditTriggers(QAbstractItemView.NoEditTriggers) >> self.horizontalHeader().setStretchLastSection(True) >> self.setSelectionBehavior(QAbstractItemView.SelectRows) >> >> def mousePressEvent(self, event): >> mouseBtn = event.button() >> if mouseBtn == Qt.MouseButton.RightButton: >> print self.selectionModel().selectedRows(0) >> super(InstalledToolsView, self).mousePressEvent(event) >> >> >> Cheers, >> frank >> _______________________________________________ >> PySide mailing list >> PySide at qt-project.org >> http://lists.qt-project.org/mailman/listinfo/pyside >> >> >> >> >> -- >> Kandrai Tibold > > > > _______________________________________________ > 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 a.richi at bluewin.ch Wed Aug 29 05:53:40 2012 From: a.richi at bluewin.ch (Aaron Richiger) Date: Wed, 29 Aug 2012 05:53:40 +0200 Subject: [PySide] PySide plus Django: How can I make the PySide application auto-start the server? In-Reply-To: <503D43A3.2080707@m.allo.ws> References: <503D1C2F.2000002@m.allo.ws> <503D43A3.2080707@m.allo.ws> Message-ID: <503D9244.7000606@bluewin.ch> Hello Zak! Nice description and example code! Only a small part of your problem is correlated to PySide, most of it is about python in general and django. I wrote an example app to show you the possibilities (you only have to adapt the path to your django project): http://pastebin.com/i0MbgMXH - You figured out already how to start the server using subprocess. - You wanted the output of the server being printed in a separate window(console): This was quite difficult. I am not a Windows user, so don't know how to start a console programmatically there, but I suggest just using another PySide Widget to show the servers output (see example code). Accessing the output was the main problem, due to a bug in django (missing sys.stdout.flush() in runserver.py). That's why reading stdout seems to be impossible. But only the welcome message is shown in stdout and all the rest (info about requests) is printed to stderr with flushing, so we can access this. Reading it from subprocess.stderr in a loop would be a typical threading task, but there seem to be some performance blockers when using PySide (Qt?) with data streams, the GUI freezes sometimes when streaming this data directly. One possible solution is writing the output of the server into a file and read the content of this file in a loop. Does not sound too good, I know, but the performance is much better, no freezing anymore... - Getting the closeEvent of both views is no problem, but shutting down the django server is not that easy unfortunately. Most of your signals would work, if you would send them to the right pid, but knowing this pid is difficult, since you only get the one of subprocess.Popen and don't know anything about the pids after the process forks to start the server. You can hope, that it is pid+1, but this might not always be the case. Using some ps-grep-awk etc. magic, you can find the correct pid. I did not implement this since it's not PySide related, but it's no problem. And then, you can kill this pid. I hope, this makes sense. Like this, everything is done in one step. Cheers! Aaron From pyside at m.allo.ws Wed Aug 29 16:00:52 2012 From: pyside at m.allo.ws (Zak) Date: Wed, 29 Aug 2012 10:00:52 -0400 Subject: [PySide] PySide plus Django: How can I make the PySide application auto-start the server? In-Reply-To: <503D9244.7000606@bluewin.ch> References: <503D1C2F.2000002@m.allo.ws> <503D43A3.2080707@m.allo.ws> <503D9244.7000606@bluewin.ch> Message-ID: <503E2094.2040609@m.allo.ws> Hello Aaron, Thank you so much for all the help. I have learned at least two important things from your email: - You give a great example for how to echo the Django server's status messages into a Qt GUI widget. - You gave me the idea to use the os module to search for the pid of the Django server, and then send a signal to that pid using the os module, rather than using subprocess.Popen.send_signal(). I had not considered the fact that, due to process forking, subprocess.Popen.send_signal() may not be sending the signal to the right process / pid. Once I figure out how to terminate the Django server process, I plan to email the list again. Even though it is not really PySide related, it should help any future users who want to wrap PySide and Django together in this way. Thanks, Zak From schampailler at skynet.be Wed Aug 29 21:29:23 2012 From: schampailler at skynet.be (Stefan Champailler) Date: Wed, 29 Aug 2012 21:29:23 +0200 Subject: [PySide] PySide 1.1.2 - "Alaursa": Python for Qt released! In-Reply-To: <1550114.b2ArTxsZpe@hugodesktop> References: <1550114.b2ArTxsZpe@hugodesktop> Message-ID: <503E6D93.3050508@skynet.be> Wohah ! This has been open for a long time ! I'll hopefully test it soon :-) And thank you for PySide, it's been super stable (I use it +/- 10 hours a week since 18 months and beside that bug it has proven really solid) Stefan On 08/28/2012 11:13 PM, Hugo Parente Lima wrote: > QAbstractItemModel has wrong ownership policy for selectionModel() -- Timeo Danaos et dona ferentes From david.garcia at upf.edu Wed Aug 29 23:48:45 2012 From: david.garcia at upf.edu (=?ISO-8859-1?Q?David_Garc=EDa_Garz=F3n?=) Date: Wed, 29 Aug 2012 23:48:45 +0200 Subject: [PySide] Obtaining QObject from PySide based PyObject (complete) In-Reply-To: <10684831.0hduZLiNck@hugodesktop> References: <96152238.d566e79Gsm@wl082936> <10046387.5KaC9rtBQY@hugodesktop> <1564282.WylHtcGgKK@wl082936> <10684831.0hduZLiNck@hugodesktop> Message-ID: <503E8E3D.8020307@upf.edu> On 28/08/12 16:25, Hugo Parente Lima wrote: > On Tuesday, August 28, 2012 02:48:32 PM David García Garzón wrote: >> On Monday 27 August 2012 16:23:03 Hugo Parente Lima wrote: >>> On Monday, August 27, 2012 09:12:27 PM David García Garzón wrote: >>>> Sorry for the previous unfinished message. Here goes the final one. >>>> >>>> I am porting a CPython library (boost based indeed) from PyQt to PySide. >>>> I had a function in the library that received a Sip wrapped widget >>>> as a PyObject and I used the very ugly SIP api to recover a pointer to >>>> the >>>> actual C++ QObject. >>>> >>>> Does anyone know how recover the C++ QObject from the PyObject in >>>> PySide? >>> You can use: >>> Shiboken::Object::cppPointer(...), it's on libshiboken basewrapper.h >>> >>> It receives two parameters, a SbkObject* and a PyTypeObject*, the >>> SbkObject* will be your PyObject*, just cast it and make sure it always >>> will be a Python object representing a C++ object bound using Shiboken, >>> the >>> PyTypeObject* must be the PyTypeObject* for QObject, you can get it using: >>> >>> Shiboken::TypeResolver::get("QObject*")->pythonType(); >>> >>> TypeResolver class is located on libshiboken typeresolver.h header. >>> >>> Hope this would help you. >> Yes, thanks, this seems to be just what i needed. You even provided answer >> to what i wanted to ask next, how to identify pyside objects. No time to >> try it just now but i am eager to try it to see if it works. Thanks a lot. > There's a function on basewrapper.h that do just that, test if the PyObject is > a SbkObject, i.e. a PySide object. > > Shiboken::Object::checkType(PyObject*) > > Returns true if the object is an instance of a type created by the Shiboken > generator. > >> David Thats the final code: void * shibokenUnwrap(PyObject * pyobject) { :...if (not Shiboken::Object::checkType(pyobject)) :...:...return 0; // Not a shiboken object :...SbkObject * sbkobject = (SbkObject *) pyobject; :...PyTypeObject * type = Shiboken::TypeResolver::get("QObject*")->pythonType(); :...void * cppobject = Shiboken::Object::cppPointer(sbkobject, type); :...if (not cppobject) :...:...return 0; // Not a QObject :...return cppobject; } I got it compiling, but to get it working i still need do the opposite way. Converting a new c++ qobject created in c++ into a pyside pyobject. I found in the headers the promising function Shiboken::Object::newObject but i don't know what i should send as first parameters. Any ideas?. David.