On Thursday 28 October 2010 19:42:33 Matti Airas wrote:
> On 28.10.2010 10:21, ext Algis Kabaila wrote:
> 
> >   I did read it and it looks nice, but the very first example of 
hello
> > World  (I show the listing of it, obtained via clipboard from the
> > wiki/Signals_and_Slots_in_PySide)  did not work, at least for me.
> >
> > Listing of Hello World, first example:
> > ***************************************
> > import sys
> > from PySide import QtCore, QtGui
> >
> > # define a function that will be used as a slot
> > def sayHello():
> >      print 'Hello world!'
> >
> > app = QtGui.QApplication(sys.argv)
> >
> > button = QtGui.QPushButton('Say hello!')
> >
> > # connect the clicked signal to the sayHello slot
> > button.clicked.connect(sayHello)
> > button.show()
> >
> > sys.exit(app.exec_())
> > ***************************************
> 
> Hi,
> 
> I'm a bit baffled - this works just fine for me, as for all the other 
> examples on the page. Could you elaborate on what you tried to do 
and 
> how it failed?
> 
> The only thing I could see potentially causing trouble is the lack 
of 
> the shebang lines in the examples. I added them in the examples.
> 
> Cheers,
> 
> ma.

Hi Atti,

First and foremost - I am wrong and your examples are fine!

What happened is the following: 

1)
Usually I use Eric 4.4.4a (r3717) for Python programs, OS kubuntu 
10.10.   Call the above example1.py.  It fails on my Eric with an 
error message "The debugger program raised an exception unhandled Type 
Error "bad argument type for built-in operation" File 
/dat/work/PySide/examples/example1.py
Line 10
[Line 10 is       app = QtGui.QApplication(sys.argv)  -- this is my 
comment in [..]   ]
Break here?  Yes | No
Ans. "No"  results in a message "The program being debugged terminated 
unexpectedly"  OK 

2) Eric is a fine program - highly recommended.  So I was already 
unhappy and could not see what was happening.

3) I tried to run the program in CLI.  Here is the dialog:

************
a...@supremo:/dat/work/PySide/examples$ ./example1.py                           
                                                                                
     
(4069) KSharedDataCache::Private::mapSharedMemory: Opening cache 
"/var/tmp/kdecache-ak/icon-cache.kcache" page size is 4096                      
                  
(4069) KSharedDataCache::Private::mapSharedMemory: Attached to cache, 
determining if it must be initialized                                           
             
(4069) KSharedDataCache::Private::mapSharedMemory: Cache fully 
initialized -- attached to memory mapping
(4069) KSharedDataCache::Private::mapSharedMemory: 4390912 bytes 
available out of 10485760
^C^C^C^C^C^C^C^C
***********

As the program would not respond to ctrl+C, it "confirmation"  that the 
program was *not working*.   I fell into the age old trap - I did not 
see the tiny widget  on a large screen (1680 x 1050)! It may have been  
covered by another program...

So all is well with your page,  and my rework of the example was 
wasted as I failed to make the *Widget bigger*!  Eric's debugger 
failed to work well with PySide, but that is to be expected, 
particularly since my eric is not the  latest, so it may well be that 
the newer version works perfectly with PySide.

I hope my lengthy communications have not caused undue annoyance.  

Sincere thank you for putting me straight on the issue!

As an excuse here is a tit  bit of personal information - in some 
three and half months I will be 86 years old.  I play chess on the net 
(FICS) and I program Python to satisfy myself that my short term 
memory loss has not rendered me useless.   Alas, clearly my attention 
to detail is not what it used to be...

Al.

-- 
Algis Kabaila
http://akabaila.pcug.org.au/
_______________________________________________
PySide mailing list
[email protected]
http://lists.openbossa.org/listinfo/pyside

Reply via email to