[PyQt] disconnect everything connected to an object's signals

2009-06-18 Thread TP
Hi everybody,

Qt Assistant says that:


Disconnect everything connected to an object's signals:
disconnect(myObject, 0, 0, 0)
0 may be used as a wildcard, meaning any signal, any receiving object,
or any slot in the receiving object, respectively.


But if I do:

disconnect( myObject, 0, 0, 0 )

I obtain:

disconnect( myObject, 0, 0, 0 )
TypeError: disconnect() takes exactly 1 argument (4 given)


What is the problem?
My machine: Linux, Qt 4.4.0, PyQt 4.4.4

Thanks in advance,

Julien

-- 
python -c print ''.join([chr(154 - ord(c)) for c in '*9(9(18%.\
91+,\'Z4(55l4('])

When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong. (first law of AC Clarke)

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] disconnect everything connected to an object's signals

2009-06-18 Thread Phil Thompson
On Thu, 18 Jun 2009 11:27:20 +0200, TP paratribulati...@free.fr wrote:
 Hi everybody,
 
 Qt Assistant says that:
 
 
 Disconnect everything connected to an object's signals:
 disconnect(myObject, 0, 0, 0)
 0 may be used as a wildcard, meaning any signal, any receiving
object,
 or any slot in the receiving object, respectively.
 
 
 But if I do:
 
 disconnect( myObject, 0, 0, 0 )
 
 I obtain:
 
 disconnect( myObject, 0, 0, 0 )
 TypeError: disconnect() takes exactly 1 argument (4 given)
 
 
 What is the problem?
 My machine: Linux, Qt 4.4.0, PyQt 4.4.4

PyQt's old connection API doesn't support all the options that Qt does. The
new API is more powerful.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Text orientation in a QTableView Header

2009-06-18 Thread Ben De Luca
Hi List,

 I was wondering if there was a simple way to change the
orientation of the text in a QTableViews QHeaderView? I would like to
be able to write the coloumn lables vertically rather than hoziontally
for a largenumber of coloumns that  contain large labels and single
diget numbers in the data fields.

 Is there a way to do this or am I looking at making a new
Header and changing the way it paints its text? If I have do this any
example code would be neat.


-bd
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] What about qtbrowserplugin?

2009-06-18 Thread piotr maliƄski
QtSoftware has in the add-ons catalog qtbrowserplugin package. I wonder if
this framework could get Python API and the possibility to write the plugins
in Python?

http://www.qtsoftware.com/products/appdev/add-on-products/catalog/4/Utilities/qtbrowserplugin
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Page setup for printer defaults

2009-06-18 Thread Robert Norman

Hello PyQt group,

My application uses a Brother label printer to spit out labels. I'd like 
to do a Page Setup, say in my preferences dialog and then save the 
printer information in a settings so that we don't have to go through a 
print dialog.
Currently I go through the print dialog once then use the resulting 
QPrinter for subsequent print operations and that works fine. I can 
assign the printer name to QPrinter so that it at least defaults to the 
correct printer, but I'm having trouble figuring out how to set the 
appropriate variables to match the printer to the specific label size. 

Specifically, in the print dialog, I use the properties dialog to select 
the label size. On return I can examine things like pageSize, pageRect, 
paperSize, paperRect but I can't seem to set pageSize and can't find 
methods for setting the  page or paper Rect.


For example, after the print dialog, pageSize returns 30 but 
setPageSize(30) causes an invalid  type error since it expects a 
QPrinter.PageSize enum value.  

1) How would you go about doing a PageSetup dialog, not Print Dialog, to 
both select a printer and it's default properties.

2) What needs to be saved and how can I restore the relevant properties.

I'm used to working through these issues myself, an often find that once 
the question is asked, the answer seems to come on it's own, but this 
time I'm stuck.


Thanks

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Function pointers and SIP

2009-06-18 Thread Giovanni Bajo

Hi Phil,

given a C++ object where you can register callbacks such as:

void registerCallback(void (*cb)(void*), void* user_data);

or

void registerCallback(std::tr1::functionvoid (void) cb);

how would you wrap them in SIP? Is there some code in PyQt that I can 
look at?

--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Function pointers and SIP

2009-06-18 Thread Giovanni Bajo
On gio, 2009-06-18 at 19:01 +0100, Phil Thompson wrote:
 On Thu, 18 Jun 2009 19:40:08 +0200, Giovanni Bajo ra...@develer.com
 wrote:
  Hi Phil,
  
  given a C++ object where you can register callbacks such as:
  
   void registerCallback(void (*cb)(void*), void* user_data);
  
  or
  
   void registerCallback(std::tr1::functionvoid (void) cb);
  
  how would you wrap them in SIP? Is there some code in PyQt that I can 
  look at?
 
 I think you answered this yourself a couple of weeks back.

I had a general idea of course, but I wanted to make sure there was not
automa[tg]ic support by SIP which I wasn't aware of.

 The nearest example in PyQt is probably qInstallMsgHandler().

Thanks. Why the internal qtcore_MsgHandler uses
SIP_BLOCK_THREAD/SIP_UNBLOCK_THREADS? Is that always needed or only if I
have previously explicitly released the GIL?
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt