[PyKDE] Cannot derive QValidator

2005-12-06 Thread Giovanni Bajo
Hey,

there seems to be a problem inheriting QValidator:

===
from qt import *
app = QApplication([])

class V(QValidator):
def validate(self, index, pos):
return QValidator.Valid
v = V(None)

cb = QComboBox(None)

cb.setEditable(True)
cb.setValidator(v)

cb.show()
app.setMainWidget(cb)
qApp.exec_loop()
===

any time I press a key, I see:


TypeError: invalid result type from V.validate()


This is with PyQt 3.15, SIP 4.3.1.
-- 
Giovanni Bajo

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Cannot derive QValidator

2005-12-06 Thread Phil Thompson
On Tuesday 06 December 2005 11:12 am, Giovanni Bajo wrote:
 Hey,

 there seems to be a problem inheriting QValidator:

 ===
 from qt import *
 app = QApplication([])

 class V(QValidator):
 def validate(self, index, pos):
 return QValidator.Valid
 v = V(None)

 cb = QComboBox(None)

 cb.setEditable(True)
 cb.setValidator(v)

 cb.show()
 app.setMainWidget(cb)
 qApp.exec_loop()
 ===

 any time I press a key, I see:

 
 TypeError: invalid result type from V.validate()
 

 This is with PyQt 3.15, SIP 4.3.1.

The Python signature is different to the C++ signature - check the 
documentation.

Phil

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Cannot derive QValidator

2005-12-06 Thread Giovanni Bajo
Phil Thompson [EMAIL PROTECTED] wrote:

 The Python signature is different to the C++ signature - check the
 documentation.

Argh, sorry! ;)
-- 
Giovanni Bajo

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] PyQt4 Update

2005-12-06 Thread David Boddie
On Mon, 5 Dec 2005 16:21:56, Phil Thompson wrote:  
On Saturday 03 December 2005 6:56 pm, David Boddie wrote: 
 
 Just to clarify: subclasses of QAbstractListModel that don't 
 reimplement columnCount() should automatically inherit the base 
 class's behaviour and return 1. It seems that the inheritance 
 mechanism wasn't working correctly for these classes, possibly 
 because QAbstractListModel implements columnCount() as a private 
 function. I don't know how SIP deals with this. 
 
Are you sure? Doesn't the private implementation effectively block 
the method from being propagated to more specific classes? 
 
I think you're correct here. You can't access that method from 
subclasses like QStringListModel. 
 
Try and compile: 
 
 QModelIndex i; 
 QStringListModel m; 
 
 m.columnCount(i); 
 
Yes, I was thinking of something like 
 
  QStringListModel model; 
  qDebug()  ((QAbstractItemModel )model).columnCount(); 
 
which returns 1. 
 
In Python, you can achieve the same thing with 
 
  model = QStringListModel() 
  QAbstractItemModel.columnCount(model) 
 
Since views use the abstract interface to interact with models, 
this syntax isn't too surprising. I just got a little confused 
when thinking about the correct way to get at the column 
information using Python. :-/ 
 
David 


___
$0 Web Hosting with up to 200MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Deployment on Windows? license compatible

2005-12-06 Thread Michael Zimmermann

Ulrich Berning wrote:

Hi Ulrich,

after being busy with other issues on my dsks for some weeks it is time 
to come back to our deployment issue on Windows...  Sorry, for bothering 
you again :-)



Compiling the pyqt modules statically into a python interpreter results 
in a generic interpreter, that can run any python script. This 
interpreter still violates Trolltech's commercial license agreement.
The idea of the VendorID package is to create a specialized interpreter 
binary (with the help of sib.py) that contains at least your application 
main script. With this specialized interpreter, you can only run your 
application, nothing else. The vendorid static library 
(vendorid.lib/libvendorid.a), that is linked with this special 
interpreter allows the import of pyqt modules for this interpreter.
The generic python interpeter (python[.exe]) can only import pyqt 
modules, if the vendorid extension module is available 
(vendorid.pyd/vendorid.so). This module will never be distributed, it is 
only available for qt licensees to help developing their applications 
without the need to build specialized interpreters at development time 
again and again, because their main script/modules have changed.
Distributing the vendorid extension module violates the commercial 
license agreement again.


Well, after a bit of trial and error I understand the bit about building 
a signed interpreter (Actually, this is working as I want it to work).


Currently I use my default installation that has QT and PyQT installed. 
With this setup anyone would be able to use the existing libraries with 
a generic python interpreter and bypass our signed interpreter. Not good.


What I think about doing is:
- Compile the pyQT modules statically into python
- Generate a singed interpreter for our applicaton
- Distribute the signed interpreter + any additional scripts + the 
python libs (including pyQT)



But here are the questions:

How about QT?
Imho I do need a QT library before I can build pyQT. Then, is it 
necessary to patch the code of QT to make it VendorId-aware? If so, 
where? Or how should I deploy the QT libs?


How about PyQT?
Is it enough if I configure  PyQT with the -i command line switch to 
make it vendorId aware?


Once again our objective is not to make a self-contained .exe but rather 
a solution, that leaves some of our code exposed to modifcations 


Thanks for the help so far...


--
cu,
   Michael

---
|  [EMAIL PROTECTED] |
--


___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] PyKDE-snapshot20051013 fails against kde-3.5.0

2005-12-06 Thread Stephan Hermann
Hi Jim,

when do you expect a new release of pykde or actually a new sip,pyqt,pykde 
toolchain.

I need to fix the packages (at least for pykde) for kde3.5 in kubuntu/ubuntu 
dapper (development branch).

Regards,

\sh
On Monday 05 December 2005 20:45, Jim Bublitz wrote:
 On Monday 05 December 2005 10:09, Rex Dieter wrote:
  Jim Bublitz wrote:
   On Monday 05 December 2005 06:41, Rex Dieter wrote:
  FYI,
  
  Using sip-4.3.2, PyQt-3.15.1, kde.3.5.0, gcc-3.4.4 (RedHat Enterprise
  4)... I'm having trouble getting PyKDE-snapshot20051013 to build
  (failure below).
  
  
  In file included from sip/kdecore/ktempdir.sip:32,
from sipkdecorepart0.cpp:50:
  /usr/include/kde/fixx11h.h:185: error: `CursorShape' was not declared
   in this scope
  
   In sip/kdecore/fixx11.sip. add the include for X11/X.h:
  
   %ModuleHeaderCode
   #include X11/X.h
   #include fixx11h.h
   %End
  
   You might need to make the same change in sip/kdecore/ktempdir.sip.
 
  Only the former modification was requierd, thanks.
 
  Just for me, what will be the next PyKDE version?  it appears to be
  4.0.0 from the snapshot's configure.py:
  pykde_version  = 0x04
  pykde_version_str  = 4.0.0

 I'm struggling with that - PyKDE now requires sip 4.0, so the 4.0 makes
 sense that way, but it won't support KDE 4.0 for a while, so it's
 misleading that way, and there will almost certainly be separate versions
 for KDE 3.x and 4.0. I'm thinking now that I should stick with 3.x until
 KDE 4.0 is supported and then bump up the first digit.

 Jim

 ___
 PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
 http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] PyKDE-snapshot20051013 fails against kde-3.5.0

2005-12-06 Thread Jim Bublitz
On Tuesday 06 December 2005 07:35, Stephan Hermann wrote:
 when do you expect a new release of pykde or actually a new
 sip,pyqt,pykde toolchain.

 I need to fix the packages (at least for pykde) for kde3.5 in
 kubuntu/ubuntu dapper (development branch).

I intended to have it out by now, but that obviously has worked out. The best 
I can offer is about a week or two, and that's not certain.

The only change that's required (that I know of) is the one in this thread. 
The current snapshot lacks any new methods/classes since KDE 3.4.2, but 
that's probably very minimal. There are some bugs that need to be addressed, 
but for most people they aren't serious (although for some they are).

Jim

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] Building PyQt4

2005-12-06 Thread Douglas Soares de Andrade
Hi all !

Im trying to build PyQt4 20051205 with 20051205 and im not having success.
Here is the errors:

sip/QtCore/qglobal.sip: In function 'int 
convertTo_QUrl_FormattingOptions(PyObject*, void**, int*)':
sip/QtCore/qglobal.sip:196: error: 'sipEnum_QUrl_FormattingOption' was not 
declared in this scope
sip/QtCore/qglobal.sip:205: error: 'sipEnum_QUrl_FormattingOption' was not 
declared in this scope
make[1]: ** [sipQtCoreQUrlFormattingOptions.o] Erro 1
make[1]: Leaving directory 
`/home/douglas/pacotes/pkg/gcc4/pyqt4/src/PyQt4-gpl-snapshot-20051205/QtCore'
make: ** [all] Erro 2
== ERROR: Build Failed.  Aborting...

Anyone managed to build PyQt4 with the current snapshots ?

Thanks in advance

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


Re: [PyKDE] Building PyQt4

2005-12-06 Thread Douglas Soares de Andrade
Hi Phil !

Thanks for the quick answer. I have another question... Is it possible to 
build pykde with the current sip snapshot ?

I tried and i had this errors:

Generating the C++ source for the kdecore module...
sip: Ptr is undefined
Error: Unable to create the C++ code.

Thanks !


Em Terça 06 Dezembro 2005 17:36, Phil Thompson escreveu:
 On Tuesday 06 December 2005 3:26 pm, Douglas Soares de Andrade wrote:
  Hi all !
 
  Im trying to build PyQt4 20051205 with 20051205 and im not having
  success. Here is the errors:
 
  sip/QtCore/qglobal.sip: In function 'int
  convertTo_QUrl_FormattingOptions(PyObject*, void**, int*)':
  sip/QtCore/qglobal.sip:196: error: 'sipEnum_QUrl_FormattingOption' was
  not declared in this scope
  sip/QtCore/qglobal.sip:205: error: 'sipEnum_QUrl_FormattingOption' was
  not declared in this scope
  make[1]: ** [sipQtCoreQUrlFormattingOptions.o] Erro 1
  make[1]: Leaving directory
  `/home/douglas/pacotes/pkg/gcc4/pyqt4/src/PyQt4-gpl-snapshot-20051205/QtC
 or e' make: ** [all] Erro 2
  == ERROR: Build Failed.  Aborting...
 
  Anyone managed to build PyQt4 with the current snapshots ?

 You need to build with the -c flag to configure.py. The current SIP
 snapshot doesn't get all the #include dependencies right - which doesn't
 matter when -c is used.

 Should be fixed in the next SIP snapshot.

 Phil

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] Re: Building PyQt4

2005-12-06 Thread m . gehling
Douglas Soares de Andrade schrieb: 

Hi all ! 


Im trying to build PyQt4 20051205 with 20051205 and im not having success.
Here is the errors: 

sip/QtCore/qglobal.sip: In function 'int 
convertTo_QUrl_FormattingOptions(PyObject*, void**, int*)':
sip/QtCore/qglobal.sip:196: error: 'sipEnum_QUrl_FormattingOption' was not 
declared in this scope
sip/QtCore/qglobal.sip:205: error: 'sipEnum_QUrl_FormattingOption' was not 
declared in this scope

make[1]: ** [sipQtCoreQUrlFormattingOptions.o] Erro 1
make[1]: Leaving directory 
`/home/douglas/pacotes/pkg/gcc4/pyqt4/src/PyQt4-gpl-snapshot-20051205/QtCore'

make: ** [all] Erro 2
== ERROR: Build Failed.  Aborting... 

Anyone managed to build PyQt4 with the current snapshots ? 



if you can't wait: 

- Install sip snap 20051205 

- Install pyqt snap 20051205 


1) in sip/QtCore/qbitarray.sip: comment out
QBitArray operator(const QBitArray , const QBitArray );
QBitArray operator|(const QBitArray , const QBitArray );
QBitArray operator^(const QBitArray , const QBitArray ); 

2) python configure.py -q /usr/share/qt4 -c -j 4 LIBDIR_QT=/usr/lib 


3) adding an include in
 sipQtCorepart2.cpp:  #include sipQtCoreQEventLoop.h
 sipQtGuipart1.cpp:  #include sipQtGuiQStyle.h
 sipQtGuipart2.cpp:  #include sipQtGuiQFileDialog.h
 sipQtGuipart3.cpp:  #include sipQtGuiQDockWidget.h
 sipQtGuipart3.cpp:  #include sipQtGuiQAbstractPrintDialog.h 


4) make
5) make install 

that works for me. 


gema

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] Re: Building PyQt4

2005-12-06 Thread Douglas Soares de Andrade
Hi gema !

Thank you sooo much with your tips, the only problem is that pyqt took some 
hours to build here and i only saw the symbol problem after the first 
import :)

So, i did your modifications and im building it again now.

Thank you again !

Em Terça 06 Dezembro 2005 20:11, [EMAIL PROTECTED] escreveu:
 Douglas Soares de Andrade schrieb:
  Hi all !
 
  Im trying to build PyQt4 20051205 with 20051205 and im not having
  success. Here is the errors:
 
  sip/QtCore/qglobal.sip: In function 'int
  convertTo_QUrl_FormattingOptions(PyObject*, void**, int*)':
  sip/QtCore/qglobal.sip:196: error: 'sipEnum_QUrl_FormattingOption' was
  not declared in this scope
  sip/QtCore/qglobal.sip:205: error: 'sipEnum_QUrl_FormattingOption' was
  not declared in this scope
  make[1]: ** [sipQtCoreQUrlFormattingOptions.o] Erro 1
  make[1]: Leaving directory
  `/home/douglas/pacotes/pkg/gcc4/pyqt4/src/PyQt4-gpl-snapshot-20051205/QtC
 ore' make: ** [all] Erro 2
  == ERROR: Build Failed.  Aborting...
 
  Anyone managed to build PyQt4 with the current snapshots ?

 if you can't wait:

  - Install sip snap 20051205

  - Install pyqt snap 20051205

 1) in sip/QtCore/qbitarray.sip: comment out
 QBitArray operator(const QBitArray , const QBitArray );
 QBitArray operator|(const QBitArray , const QBitArray );
 QBitArray operator^(const QBitArray , const QBitArray );

 2) python configure.py -q /usr/share/qt4 -c -j 4 LIBDIR_QT=/usr/lib

 3) adding an include in
   sipQtCorepart2.cpp:  #include sipQtCoreQEventLoop.h
   sipQtGuipart1.cpp:  #include sipQtGuiQStyle.h
   sipQtGuipart2.cpp:  #include sipQtGuiQFileDialog.h
   sipQtGuipart3.cpp:  #include sipQtGuiQDockWidget.h
   sipQtGuipart3.cpp:  #include sipQtGuiQAbstractPrintDialog.h

 4) make
 5) make install

 that works for me.

 gema

___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde