[PyQt] PyQt Digest, Vol 72, Issue 53

Sean Decal freshcure at live.com
Thu Jul 29 23:57:33 BST 2010


Hi,

 

Been doing a few excersises from the PyQt4 Rapid Gui Programming  with Python and Qt. The Chapter 13 Python Editor crashes after about 15 seconds on Linux and Windows using Python 2.6 and 2.7 does anyone else get this ? 

If I exit the program crashes I get a Segmentation Error in the Geany IDE.

 

Sean  
 
> From: pyqt-request at riverbankcomputing.com
> Subject: PyQt Digest, Vol 72, Issue 53
> To: pyqt at riverbankcomputing.com
> Date: Thu, 29 Jul 2010 22:29:28 +0100
> 
> Send PyQt mailing list submissions to
> pyqt at riverbankcomputing.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> or, via email, send a message with subject or body 'help' to
> pyqt-request at riverbankcomputing.com
> 
> You can reach the person managing the list at
> pyqt-owner at riverbankcomputing.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PyQt digest..."
> 
> 
> Today's Topics:
> 
> 1. Re: connect problem on windows xp (F.A.Pinkse)
> 2. Re: connect problem on windows xp (Fabio Mauri)
> 3. Links to the web from html help files in a resource.
> (Robert Norman)
> 4. Which version of Python does dip REALLY work with?
> (Peter Milliken)
> 5. Re: Which version of Python does dip REALLY work with?
> (Phil Thompson)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 29 Jul 2010 16:56:44 +0200
> From: "F.A.Pinkse" <fapinkse at gmail.com>
> To: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] connect problem on windows xp
> Message-ID: <i2s4rv$hd7$1 at dough.gmane.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hi Fabio
> 
> To see you print() statements you need to lauch your script with python
> If you use pythonw the script is lauched and the communication channels 
> are closed.
> 
> Or you use one of these:
> 
> 
> def noneSelected(self):
> print ("signal catched 2")
> self.dtype.setText("signal catched 2")
> msgBox=QtGui.QMessageBox()
> msgBox.setText("signal catched 2")
> msgBox.exec()
> 
> def refreshList(self):
> print ("signal catched 1")
> self.dtype.setText ("signal catched 1")
> msgBox=QtGui.QMessageBox()
> msgBox.setText("signal catched 1")
> msgBox.exec()
> 
> I 'borrowed one of the line/text edit widgets.
> Hope this helps.
> 
> 
> With best regards,
> 
> 
> Frans.
> 
> 
> Op 7/29/2010 12:46 PM, Fabio Mauri schreef:
> > Ok, this below is a minimal example.
> > Launching this (with the gui file attached in the previous mail) in
> > Ubuntu 10.04 I can see the prints on cmdline when clicking on
> > pushbuttons, under windows xp I cannot see them.
> >
> > #!/usr/bin/python
> > from twisted.internet import reactor
> > from coherence.base import Coherence
> > from coherence.upnp.core import utils
> >
> > import sys
> > import time
> > from threading import Thread, Timer
> > from Wdw import Ui_Wdw
> > from PyQt4 import QtGui
> > from PyQt4 import QtCore
> > from PyQt4.QtCore import *
> > from PyQt4.QtGui import *
> >
> > class UPnPgui(QtCore.QObject, Ui_Wdw):
> >
> > def __init__(self):
> > self.version = "0.5b"
> > return
> >
> > def doConnections(self):
> > QObject.connect(self.refresh, SIGNAL("clicked()"), self.refreshList)
> > QObject.connect(self.clearSel, SIGNAL("clicked()"), self.noneSelected)
> > return
> >
> > def noneSelected(self):
> > print "signal catched 2"
> >
> > def refreshList(self):
> > print "signal catched 1"
> >
> > if __name__ == "__main__":
> > app = QtGui.QApplication(sys.argv)
> > window = QtGui.QWidget()
> > ui = UPnPgui()
> > ui.setupUi(window)
> > ui.doConnections()
> > window.show()
> > window.geometry()
> > window.setWindowTitle(window.windowTitle() + " version " + ui.version)
> > sys.exit(app.exec_())
> >
> > On Thu, Jul 29, 2010 at 9:32 AM, Sybren A. St?vel<sybren at stuvel.eu> wrote:
> >> On Thu, Jul 29, 2010 at 08:59:16AM +0200, Fabio Mauri wrote:
> >>> Attached you can find the Ui_Wdw class.
> >>
> >> That wasn't my point. Please make a *minimal* bit of code that shows
> >> your problem.
> >>
> >>> In the last connect, I used a different style because for such a
> >>> reason the QObject.connect() i used in the lines above wouldn't work
> >>> while the signal.connect() does (on Ubuntu 10.04).
> >>
> >> That's strange, as signal.connect() works just fine here (Ubuntu
> >> 10.04).
> >>
> >> Please try to make a minimal example, just one bit of code that shows
> >> the problem.
> >>
> >> --
> >> Sybren St?vel
> >>
> >> http://stuvel.eu/
> >>
> >> -----BEGIN PGP SIGNATURE-----
> >> Version: GnuPG v1.4.6 (GNU/Linux)
> >>
> >> iD8DBQFMUS6h8ZTyn8Yy+5MRAqSpAJ9cdL4gUAHDLuTT2pF+4m9BpU3kbACfe9H+
> >> MMM3k69wFanU5O1GktogOlQ=
> >> =wAb4
> >> -----END PGP SIGNATURE-----
> >>
> >>
> >
> >
> >
> 
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Thu, 29 Jul 2010 17:28:56 +0200
> From: Fabio Mauri <fabio.mauri at gmail.com>
> To: "F.A.Pinkse" <fapinkse at gmail.com>
> Cc: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] connect problem on windows xp
> Message-ID:
> <AANLkTinviUSMfoFTV6Ej2WVcmdoEY4zWWqUyNB+wumuP at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> I solved the issue following linjunhalida's suggestion:
> 
> adding QObject.__init__(self) in the __init__ function of my GUI,
> everything turns fine also on windows.
> 
> Thank you linjunhalida, and thank you all!
> 
> On Thu, Jul 29, 2010 at 4:56 PM, F.A.Pinkse <fapinkse at gmail.com> wrote:
> > Hi Fabio
> >
> > To see you print() statements you need to lauch your script with python
> > If you use pythonw the script is lauched and the communication channels are
> > closed.
> >
> > Or you use one of these:
> >
> >
> > ? ?def noneSelected(self):
> > ? ? ? ?print ("signal catched 2")
> > ? ? ? ?self.dtype.setText("signal catched 2")
> > ? ? ? ?msgBox=QtGui.QMessageBox()
> > ? ? ? ?msgBox.setText("signal catched 2")
> > ? ? ? ?msgBox.exec()
> >
> > ? ?def refreshList(self):
> > ? ? ? ?print ("signal catched 1")
> > ? ? ? ?self.dtype.setText ("signal catched 1")
> > ? ? ? ?msgBox=QtGui.QMessageBox()
> > ? ? ? ?msgBox.setText("signal catched 1")
> > ? ? ? ?msgBox.exec()
> >
> > I 'borrowed one of the line/text edit widgets.
> > Hope this helps.
> >
> >
> > With best regards,
> >
> >
> > Frans.
> >
> >
> > Op 7/29/2010 12:46 PM, Fabio Mauri schreef:
> >>
> >> Ok, this below is a minimal example.
> >> Launching this (with the gui file attached in the previous mail) in
> >> Ubuntu 10.04 I can see the prints on cmdline when clicking on
> >> pushbuttons, under windows xp I cannot see them.
> >>
> >> #!/usr/bin/python
> >> from twisted.internet import reactor
> >> from coherence.base import Coherence
> >> from coherence.upnp.core import utils
> >>
> >> import sys
> >> import time
> >> from threading import Thread, Timer
> >> from Wdw import Ui_Wdw
> >> from PyQt4 import QtGui
> >> from PyQt4 import QtCore
> >> from PyQt4.QtCore import *
> >> from PyQt4.QtGui import *
> >>
> >> class UPnPgui(QtCore.QObject, Ui_Wdw):
> >>
> >> ? ? def __init__(self):
> >> ? ? ? ? self.version = "0.5b"
> >> ? ? ? ? return
> >>
> >> ? ? def doConnections(self):
> >> ? ? ? ? QObject.connect(self.refresh, SIGNAL("clicked()"),
> >> self.refreshList)
> >> ? ? ? ? QObject.connect(self.clearSel, SIGNAL("clicked()"),
> >> self.noneSelected)
> >> ? ? ? ? return
> >>
> >> ? ? def noneSelected(self):
> >> ? ? ? ? print "signal catched 2"
> >>
> >> ? ? def refreshList(self):
> >> ? ? ? ? print "signal catched 1"
> >>
> >> if __name__ == "__main__":
> >> ? ? app = QtGui.QApplication(sys.argv)
> >> ? ? window = QtGui.QWidget()
> >> ? ? ui = UPnPgui()
> >> ? ? ui.setupUi(window)
> >> ? ? ui.doConnections()
> >> ? ? window.show()
> >> ? ? window.geometry()
> >> ? ? window.setWindowTitle(window.windowTitle() + " version " + ui.version)
> >> ? ? sys.exit(app.exec_())
> >>
> >> On Thu, Jul 29, 2010 at 9:32 AM, Sybren A. St?vel<sybren at stuvel.eu>
> >> ?wrote:
> >>>
> >>> On Thu, Jul 29, 2010 at 08:59:16AM +0200, Fabio Mauri wrote:
> >>>>
> >>>> Attached you can find the Ui_Wdw class.
> >>>
> >>> That wasn't my point. Please make a *minimal* bit of code that shows
> >>> your problem.
> >>>
> >>>> In the last connect, I used a different style because for such a
> >>>> reason the QObject.connect() i used in the lines above wouldn't work
> >>>> while the signal.connect() does (on Ubuntu 10.04).
> >>>
> >>> That's strange, as signal.connect() works just fine here (Ubuntu
> >>> 10.04).
> >>>
> >>> Please try to make a minimal example, just one bit of code that shows
> >>> the problem.
> >>>
> >>> --
> >>> Sybren St?vel
> >>>
> >>> http://stuvel.eu/
> >>>
> >>> -----BEGIN PGP SIGNATURE-----
> >>> Version: GnuPG v1.4.6 (GNU/Linux)
> >>>
> >>> iD8DBQFMUS6h8ZTyn8Yy+5MRAqSpAJ9cdL4gUAHDLuTT2pF+4m9BpU3kbACfe9H+
> >>> MMM3k69wFanU5O1GktogOlQ=
> >>> =wAb4
> >>> -----END PGP SIGNATURE-----
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> > _______________________________________________
> > PyQt mailing list ? ?PyQt at riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> >
> 
> 
> 
> -- 
> Fabio Mauri
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Thu, 29 Jul 2010 09:52:14 -0700
> From: Robert Norman <tfcrobert at gmail.com>
> To: pyqt at riverbankcomputing.com
> Subject: [PyQt] Links to the web from html help files in a resource.
> Message-ID: <4C51B1BE.9070305 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> I'm using a QTextBrowser for my help system and would like to have some 
> of the hyperlinks bring up the users full browser so that they can, for 
> examle, download support files from third party web sites. All the 
> links, of course get the qrc path prepended to the links since all the 
> html files are in a resource path "qrc:/Help". 
> So my internal link to myPage.html is translated to 
> "qrc:/Help/myPage.html". 
> 
> I'm guessing I'd have to subclass QTextBrowser and check to see if the 
> links contain some appropriate pattern link www.* , filter out the qrc 
> stuff and pass the link on to the default browser. 
> 
> Anyone have a sample of doing this?
> Thanks,
> Rob
> 
> -- 
> Robert Norman
> Embedded Systems Software Engineer
> AC Propulsion
> www.acpropulsion.com
> 909-592-5399 x4030
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Fri, 30 Jul 2010 07:13:06 +1000
> From: Peter Milliken <peter.milliken at gmail.com>
> To: pyqt at riverbankcomputing.com
> Subject: [PyQt] Which version of Python does dip REALLY work with?
> Message-ID:
> <AANLkTikBRiU39xkay97YQyUMcfGa7uzqNBF77SsDWG3F at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi,
> 
> I have Mark Summerfield's book on Rapid gui development with Python and Qt
> and followed the link in Appendix A and found "dip".
> 
> I have Python 2.6.2. The web-site states it works with 2.6, 2.7 and 3.x, I
> realise it is 0.1 and is bound to have problems, but...
> 
> First problem after installation was that the "shebang" doesn't work with
> cygwin bash and Windows XP i.e. when you just run dip-builder it returns a
> complaint of "no such file" for /c/Python26/Scripts/dip-builder - Python
> doesn't understand bash paths.
> 
> Next problem (after explicitly running dip-builder in the Scripts directory)
> was the final line:
> 
> wres12386#1(/c/Python26/Scripts)$ python dip-builder
> File "dip-builder", line 93
> sys.exit(app.exec())
> ^
> SyntaxError: invalid syntax
> [exited with 1]
> 
> A quick look at the Qt documentation for QApplication shows it should be
> app.exec_()
> 
> So that script can't work with ANY version of Python :-)
> 
> Fixed that, then it complained with:
> 
> wres12386#1(/c/Python26/Scripts)$ python dip-builder
> Traceback (most recent call last):
> File "dip-builder", line 28, in <module>
> from dip.plugins import PluginManager
> File "c:\Python26\lib\site-packages\dip\plugins\__init__.py", line 21, in
> <module>
> from .i_extension_point import IExtensionPoint
> File "c:\Python26\lib\site-packages\dip\plugins\i_extension_point.py",
> line 16, in <module>
> from dip.model import Interface, List, Str
> File "c:\Python26\lib\site-packages\dip\model\__init__.py", line 45, in
> <module>
> from .adapt import adapt
> File "c:\Python26\lib\site-packages\dip\model\adapt.py", line 21
> def adapt(*adapted, to):
> ^
> SyntaxError: invalid syntax
> [exited with 1]
> 
> Not sure what this error is - haven't investigated it, thought it might be
> advisable to re-check the versions of Python it is supposed to work with. I
> realise I don't have the latest 2.6.x, but I thought before I go to a lot of
> trouble downloading other versions of Python (I do not want to go to 3.x - I
> need to stay with 2.x), I thought I would ask the question:
> 
> Exactly what version of Python has anybody ACTUALLY got the dip distribution
> working with? :-)
> 
> In the meantime, I think I'll just go back to reading the book...
> 
> Thanks
> Peter
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100730/655ea7c4/attachment-0001.html>
> 
> ------------------------------
> 
> Message: 5
> Date: Thu, 29 Jul 2010 22:29:24 +0100
> From: Phil Thompson <phil at riverbankcomputing.com>
> To: Peter Milliken <peter.milliken at gmail.com>
> Cc: pyqt at riverbankcomputing.com
> Subject: Re: [PyQt] Which version of Python does dip REALLY work with?
> Message-ID: <422bbea991bc77749b98650b9b873498 at localhost>
> Content-Type: text/plain; charset=UTF-8
> 
> On Fri, 30 Jul 2010 07:13:06 +1000, Peter Milliken
> <peter.milliken at gmail.com> wrote:
> > Hi,
> > 
> > I have Mark Summerfield's book on Rapid gui development with Python and
> Qt
> > and followed the link in Appendix A and found "dip".
> > 
> > I have Python 2.6.2. The web-site states it works with 2.6, 2.7 and 3.x,
> I
> > realise it is 0.1 and is bound to have problems, but...
> > 
> > First problem after installation was that the "shebang" doesn't work
> with
> > cygwin bash and Windows XP i.e. when you just run dip-builder it returns
> a
> > complaint of "no such file" for /c/Python26/Scripts/dip-builder - Python
> > doesn't understand bash paths.
> > 
> > Next problem (after explicitly running dip-builder in the Scripts
> > directory)
> > was the final line:
> > 
> > wres12386#1(/c/Python26/Scripts)$ python dip-builder
> > File "dip-builder", line 93
> > sys.exit(app.exec())
> > ^
> > SyntaxError: invalid syntax
> > [exited with 1]
> > 
> > A quick look at the Qt documentation for QApplication shows it should be
> > app.exec_()
> > 
> > So that script can't work with ANY version of Python :-)
> > 
> > Fixed that, then it complained with:
> > 
> > wres12386#1(/c/Python26/Scripts)$ python dip-builder
> > Traceback (most recent call last):
> > File "dip-builder", line 28, in <module>
> > from dip.plugins import PluginManager
> > File "c:\Python26\lib\site-packages\dip\plugins\__init__.py", line 21,
> in
> > <module>
> > from .i_extension_point import IExtensionPoint
> > File "c:\Python26\lib\site-packages\dip\plugins\i_extension_point.py",
> > line 16, in <module>
> > from dip.model import Interface, List, Str
> > File "c:\Python26\lib\site-packages\dip\model\__init__.py", line 45,
> in
> > <module>
> > from .adapt import adapt
> > File "c:\Python26\lib\site-packages\dip\model\adapt.py", line 21
> > def adapt(*adapted, to):
> > ^
> > SyntaxError: invalid syntax
> > [exited with 1]
> > 
> > Not sure what this error is - haven't investigated it, thought it might
> be
> > advisable to re-check the versions of Python it is supposed to work
> with. I
> > realise I don't have the latest 2.6.x, but I thought before I go to a
> lot
> > of
> > trouble downloading other versions of Python (I do not want to go to 3.x
> -
> > I
> > need to stay with 2.x), I thought I would ask the question:
> > 
> > Exactly what version of Python has anybody ACTUALLY got the dip
> > distribution
> > working with? :-)
> > 
> > In the meantime, I think I'll just go back to reading the book...
> 
> So what version of dip are you using?
> 
> dip v0.1 is Python v3 only. For earlier versions of Python you need a
> current snapshot. Hint: pick the one with "py2" in the package name.
> 
> Phil
> 
> 
> ------------------------------
> 
> _______________________________________________
> PyQt mailing list
> PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> End of PyQt Digest, Vol 72, Issue 53
> ************************************
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100729/92da1bea/attachment-0001.html>


More information about the PyQt mailing list