[PyKDE] kabc module bug

2006-01-26 Thread Jim Bublitz
Since KDE 3.2.0, resourcefile.h has been omitted from the kdelibs source 
tarball, but is still available in kde3/include/kabc. Similarly, 
resourcedir.h has never been included with kdelibs. Consequently, PyKDE omits 
both files for most KDE versions. 

Both seem to include useful classes for working with kabc - the KAddressBook 
application uses at least one of those, for example, as late as KDE 3.4.0 and 
probably later. They're also in at least some of the API docs.

I'll be adding those into PyKDE, but the versioning may not be completely 
correct, as I don't have a full set of versions for each of those files, and 
there have been changes to the constructors and some methods have been 
dropped over time.

I'll have either the final release or another snapshot ready early next week 
and will include the classes from those files.

Jim

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


[PyKDE] Installing eric3 on Ubuntu

2006-01-26 Thread leau2001

Package needed with synaptic

— python2.4-qt3
— python2.4-qtext
— python2.4-sip4.qt3
— pyqt-tools
— python2.4-qt3-gl (to use l’OpenGL)

— qt3-designer
— qt3-assistant
— qt3-dev-tools
— qt3-doc
— qt3-examples
— qt3-linguist

For those who want to develop on ubuntu gnome, you need to install

— qt3-qtconfig

On synaptic, use eric package and not eric3 package

On gnome use console to start, on kubuntu programs are on the K menu

lo


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


Re: [PyKDE] [PyQt4] QDate.toString(QtCore.Qt.TextDate) is not UTF-8

2006-01-26 Thread Phil Thompson
On Thursday 26 January 2006 12:53 am, Ismail Donmez wrote:
 Hi,

 I am using QDate.toString(QtCore.Qt.TextDate) in my application and Turkish
 characters are malformed unless I do
 unicode(QDate.toString(QtCore.Qt.TextDate) , I checked the Qt4 apidocs and
 it says :

 QString toString ( const QString  format ) const
 QString toString ( Qt::DateFormat format = Qt::TextDate ) const

 so it should already be supporting UTF-8, is there a problem with PyQt4 or
 am I missing something here?

There's nothing special about these methods as far as PyQt is concerned - no 
handwritten code or anything. Can you repeat the problem with an equivalent 
C++ program?

Phil

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


Re: [PyKDE] Installing eric3 on Ubuntu

2006-01-26 Thread Stephan Hermann
On Thursday 26 January 2006 09:42, leau2001 wrote:
 Package needed with synaptic

 — python2.4-qt3
 — python2.4-qtext
 — python2.4-sip4.qt3
 — pyqt-tools
 — python2.4-qt3-gl (to use l’OpenGL)

 — qt3-designer
 — qt3-assistant
 — qt3-dev-tools
 — qt3-doc
 — qt3-examples
 — qt3-linguist

 For those who want to develop on ubuntu gnome, you need to install

 — qt3-qtconfig

 On synaptic, use eric package and not eric3 package

 On gnome use console to start, on kubuntu programs are on the K menu

Please be sure, that python-kde3 and python-kde3-dev (for pyuic) is installed, 
too :)

And please file any bugs you find in those package at 
http://launchpad.net/malone/ (this is only for ubuntu)

Please do not file any bugs in the debian bts for ubuntu packages. Thx.

regards
\sh

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


Re: [PyKDE] [PyQt4] QDate.toString(QtCore.Qt.TextDate) is not UTF-8

2006-01-26 Thread Andreas Pakulat
On 26.01.06 03:15:54, Ismail Donmez wrote:
 I am doing something like this QStatusBar.showMessage(Foo - %s % 
 QDate.toString(QtCore.Qt.TextDate))

Does it work with:

QStatusBar.showMessage(QtCore.QString(Foo -
%1).arg(QDate.toString(QtCore.Qt.QTextDate)))

? I suspect that the %-replacement converts the QString to str and then
after replacement again into QString and in between you loose
Unicode'ness of your string. But this is only guessing, Phil should know
for sure.

Andreas

-- 
Don't go surfing in South Dakota for a while.

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


Re: [PyKDE] Installing eric3 on Ubuntu

2006-01-26 Thread Fabio Spelta
  On synaptic, use eric package and not eric3 package

I miss something. I installed everything you wrote, but I get:
Traceback (most recent call last):
  File /usr/lib/python2.4/site-packages/eric/eric3.py, line 15, in ?
from qt import QTextCodec, SIGNAL, SLOT, qApp
ImportError: cannot import name QTextCodec

Thanks!
--
Fabio

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


Re: [PyKDE] eric3 Configuration option for pyuic4 [was: Configuration for pyuic4]

2006-01-26 Thread Andreas Pakulat
On 26.01.06 10:15:44, Detlev Offenbach wrote:
 Am Mittwoch, 25. Januar 2006 19:42 schrieb Andreas Pakulat:
  On 25.01.06 19:22:17, Andreas Pakulat wrote:
   I'm currently looking for some options to tweak pyuic4's behaviour. In
   particular I'd like to
  
   a) change the generated filename
 
 That is not possible. Eric3 basically mimics the behavior of pyuic4 for the 
 generation of the filename. It just prepends Ui_ to the given filename.

I guess you mean it mimics the generation of filename of pyuic3, as
pyuic4 doesn't force you to a specific pattern... Anyway I can patch
that myself...

   b) turn off the automatic pyuic4 run for all or specific forms
 
 s. configuration dialog Projects-Various

Ah, overlooked that one. Thanks

Andreas

-- 
Exercise caution in your daily affairs.

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


Re: [PyKDE] eric3 Configuration option for pyuic4 [was: Configuration for pyuic4]

2006-01-26 Thread Detlev Offenbach
Am Donnerstag, 26. Januar 2006 10:49 schrieb Andreas Pakulat:
 On 26.01.06 10:15:44, Detlev Offenbach wrote:
  Am Mittwoch, 25. Januar 2006 19:42 schrieb Andreas Pakulat:
   On 25.01.06 19:22:17, Andreas Pakulat wrote:
I'm currently looking for some options to tweak pyuic4's behaviour.
In particular I'd like to
   
a) change the generated filename
 
  That is not possible. Eric3 basically mimics the behavior of pyuic4 for
  the generation of the filename. It just prepends Ui_ to the given
  filename.

 I guess you mean it mimics the generation of filename of pyuic3, as
 pyuic4 doesn't force you to a specific pattern... 

No, I meant pyuic4's class name generation. It generates a class Ui_FooDialog 
if the form name is FooDialog. I transferred this to the filename generation.

 Anyway I can patch 
 that myself...

b) turn off the automatic pyuic4 run for all or specific forms
 
  s. configuration dialog Projects-Various

 Ah, overlooked that one. Thanks

 Andreas

Detlev
-- 
Detlev Offenbach
[EMAIL PROTECTED]

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


Re: [PyKDE] Installing eric3 on Ubuntu

2006-01-26 Thread leau2001

Fabio Spelta a écrit :

On synaptic, use eric package and not eric3 package
  


I miss something. I installed everything you wrote, but I get:
Traceback (most recent call last):
  File /usr/lib/python2.4/site-packages/eric/eric3.py, line 15, in ?
from qt import QTextCodec, SIGNAL, SLOT, qApp
ImportError: cannot import name QTextCodec

Thanks!
--
Fabio

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



  

what ubuntu version ? under Gnome or Kde ?

lo

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


Re: [PyKDE] Installing eric3 on Ubuntu

2006-01-26 Thread leau2001

Stephan Hermann a écrit :

On Thursday 26 January 2006 09:42, leau2001 wrote:
  

Package needed with synaptic

— python2.4-qt3
— python2.4-qtext
— python2.4-sip4.qt3
— pyqt-tools
— python2.4-qt3-gl (to use l’OpenGL)

— qt3-designer
— qt3-assistant
— qt3-dev-tools
— qt3-doc
— qt3-examples
— qt3-linguist

For those who want to develop on ubuntu gnome, you need to install

— qt3-qtconfig

On synaptic, use eric package and not eric3 package

On gnome use console to start, on kubuntu programs are on the K menu



Please be sure, that python-kde3 and python-kde3-dev (for pyuic) is installed, 
too :)


And please file any bugs you find in those package at 
http://launchpad.net/malone/ (this is only for ubuntu)


Please do not file any bugs in the debian bts for ubuntu packages. Thx.

regards
\sh

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



  
For my self, i first install kde on my ubuntu , and then became and 
Kubuntu linux version ;), i think it's easier to develop for KDE to use 
KDE display...


lo



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


Re: [PyKDE] Installing eric3 on Ubuntu

2006-01-26 Thread Stephan Hermann
Hi,

On Thursday 26 January 2006 10:46, Fabio Spelta wrote:
   On synaptic, use eric package and not eric3 package

 I miss something. I installed everything you wrote, but I get:
 Traceback (most recent call last):
   File /usr/lib/python2.4/site-packages/eric/eric3.py, line 15, in ?
 from qt import QTextCodec, SIGNAL, SLOT, qApp
 ImportError: cannot import name QTextCodec

think you missed  python-qtext package?

regards,

\sh

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


Re: [PyKDE] [PyQt4] QDate.toString(QtCore.Qt.TextDate) is not UTF-8

2006-01-26 Thread Ismail Donmez
Per 26 Oca 2006 11:29 tarihinde, Andreas Pakulat şunları yazmıştı: 
 On 26.01.06 03:15:54, Ismail Donmez wrote:
  I am doing something like this QStatusBar.showMessage(Foo - %s %
  QDate.toString(QtCore.Qt.TextDate))

 Does it work with:

 QStatusBar.showMessage(QtCore.QString(Foo -
 %1).arg(QDate.toString(QtCore.Qt.QTextDate)))

This one works fine too, guess there is a problem with %s, Phil can you 
comment on this?

Regards,
ismail

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


Re: [PyKDE] [PyQt4] QDate.toString(QtCore.Qt.TextDate) is not UTF-8

2006-01-26 Thread Phil Thompson
On Thursday 26 January 2006 1:10 pm, Ismail Donmez wrote:
 Per 26 Oca 2006 11:29 tarihinde, Andreas Pakulat şunları yazmıştı:
  On 26.01.06 03:15:54, Ismail Donmez wrote:
   I am doing something like this QStatusBar.showMessage(Foo - %s %
   QDate.toString(QtCore.Qt.TextDate))
 
  Does it work with:
 
  QStatusBar.showMessage(QtCore.QString(Foo -
  %1).arg(QDate.toString(QtCore.Qt.QTextDate)))

 This one works fine too, guess there is a problem with %s, Phil can you
 comment on this?

You are converting Unicode to a string then back to Unicode. PyQt tries (not 
very hard) to find a Python codec matching the current Qt codec and falls 
back to the default Python codec. This is obviously going wrong at some 
point, but I'm not surprised.

Did you do something similar with PyQt3? Did you try with both 3.15.1 and the 
current PyQt3 snapshot?

Phil

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


Re: [PyKDE] [PyQt4] QDate.toString(QtCore.Qt.TextDate) is not UTF-8

2006-01-26 Thread Ismail Donmez
Per 26 Oca 2006 15:35 tarihinde, Phil Thompson şunları yazmıştı: 
 On Thursday 26 January 2006 1:10 pm, Ismail Donmez wrote:
  Per 26 Oca 2006 11:29 tarihinde, Andreas Pakulat şunları yazmıştı:
   On 26.01.06 03:15:54, Ismail Donmez wrote:
I am doing something like this QStatusBar.showMessage(Foo - %s %
QDate.toString(QtCore.Qt.TextDate))
  
   Does it work with:
  
   QStatusBar.showMessage(QtCore.QString(Foo -
   %1).arg(QDate.toString(QtCore.Qt.QTextDate)))
 
  This one works fine too, guess there is a problem with %s, Phil can you
  comment on this?

 You are converting Unicode to a string then back to Unicode. PyQt tries
 (not very hard) to find a Python codec matching the current Qt codec and
 falls back to the default Python codec. This is obviously going wrong at
 some point, but I'm not surprised.

 Did you do something similar with PyQt3? Did you try with both 3.15.1 and
 the current PyQt3 snapshot?

Its the same with current PyQt3 snapshot. So I guess it was all like this 
before too. Thanks you both.

Regards,
ismail

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


[PyKDE] PyQt4 QStringList (again)

2006-01-26 Thread Doug Bell
Hi,

I didn't get any replies to my earlier message about QStringList in
PyQt4, but maybe it wasn't clear.  So I'll try again.

In the example programs, QStringLists are created using stream
operators:

   s = QtCore.QStringList()
   s  'String 1'  'String 2'

This method works, but it isn't very Pythonic.  If you already have a
Python list of strings, it requires an extra iteration through the list.

My preference would be for this to work:

   s = QtCore.QStringList(['String 1', 'String 2'])  # doesn't work

Is this possible?  The use of QStringLists to initialize widgets is more
common in Qt4 than it was in Qt3, so it would be nice to have an easier
implementation.

Thanks,
Doug.

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


Re: [PyKDE] [PyQt4] QDate.toString(QtCore.Qt.TextDate) is not UTF-8

2006-01-26 Thread Phil Thompson
On Thursday 26 January 2006 1:44 pm, Ismail Donmez wrote:
 Per 26 Oca 2006 15:35 tarihinde, Phil Thompson şunları yazmıştı:
  On Thursday 26 January 2006 1:10 pm, Ismail Donmez wrote:
   Per 26 Oca 2006 11:29 tarihinde, Andreas Pakulat şunları yazmıştı:
On 26.01.06 03:15:54, Ismail Donmez wrote:
 I am doing something like this QStatusBar.showMessage(Foo - %s %
 QDate.toString(QtCore.Qt.TextDate))
   
Does it work with:
   
QStatusBar.showMessage(QtCore.QString(Foo -
%1).arg(QDate.toString(QtCore.Qt.QTextDate)))
  
   This one works fine too, guess there is a problem with %s, Phil can you
   comment on this?
 
  You are converting Unicode to a string then back to Unicode. PyQt tries
  (not very hard) to find a Python codec matching the current Qt codec and
  falls back to the default Python codec. This is obviously going wrong at
  some point, but I'm not surprised.
 
  Did you do something similar with PyQt3? Did you try with both 3.15.1 and
  the current PyQt3 snapshot?

 Its the same with current PyQt3 snapshot. So I guess it was all like this
 before too. Thanks you both.

I'd still like to know if it works with PyQt 3.15.1 - there have been changes 
that would affect this since then.

Phil

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


Re: [PyKDE] PyQt4 QStringList (again)

2006-01-26 Thread Phil Thompson
On Thursday 26 January 2006 2:01 pm, Doug Bell wrote:
 Hi,

 I didn't get any replies to my earlier message about QStringList in
 PyQt4, but maybe it wasn't clear.  So I'll try again.

 In the example programs, QStringLists are created using stream
 operators:

s = QtCore.QStringList()
s  'String 1'  'String 2'

 This method works, but it isn't very Pythonic.  If you already have a
 Python list of strings, it requires an extra iteration through the list.

 My preference would be for this to work:

s = QtCore.QStringList(['String 1', 'String 2'])  # doesn't work

 Is this possible?  The use of QStringLists to initialize widgets is more
 common in Qt4 than it was in Qt3, so it would be nice to have an easier
 implementation.

I haven't forgotten it - just hasn't reached the top of the pile yet.

Phil

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


Re: [PyKDE] [PyQt4] QDate.toString(QtCore.Qt.TextDate) is not UTF-8

2006-01-26 Thread Ismail Donmez
Per 26 Oca 2006 16:27 tarihinde, Phil Thompson şunları yazmıştı: 
 On Thursday 26 January 2006 1:44 pm, Ismail Donmez wrote:
  Per 26 Oca 2006 15:35 tarihinde, Phil Thompson şunları yazmıştı:
   On Thursday 26 January 2006 1:10 pm, Ismail Donmez wrote:
Per 26 Oca 2006 11:29 tarihinde, Andreas Pakulat şunları yazmıştı:
 On 26.01.06 03:15:54, Ismail Donmez wrote:
  I am doing something like this QStatusBar.showMessage(Foo - %s
  % QDate.toString(QtCore.Qt.TextDate))

 Does it work with:

 QStatusBar.showMessage(QtCore.QString(Foo -
 %1).arg(QDate.toString(QtCore.Qt.QTextDate)))
   
This one works fine too, guess there is a problem with %s, Phil can
you comment on this?
  
   You are converting Unicode to a string then back to Unicode. PyQt tries
   (not very hard) to find a Python codec matching the current Qt codec
   and falls back to the default Python codec. This is obviously going
   wrong at some point, but I'm not surprised.
  
   Did you do something similar with PyQt3? Did you try with both 3.15.1
   and the current PyQt3 snapshot?
 
  Its the same with current PyQt3 snapshot. So I guess it was all like this
  before too. Thanks you both.

 I'd still like to know if it works with PyQt 3.15.1 - there have been
 changes that would affect this since then.


Tried with PyQt snapshot from 20051013:

In [1]: from qt import *

In [2]: print %s % QString(€uro)
â¬uro



 Phil

 ___
 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


[PyKDE] Problems with auto-connect and QAbstractButton.clicked()

2006-01-26 Thread Andreas Pakulat
Hi,

I have 2 problems with QAbstractButton.clicked and auto-connection:

1. the auto-connected slot gets called twice, I have no idea why

2. according to Qt4 docs clicked has a boolean argument which I cannot
use with the autoconnected slot.

The attached files include a minimal example.

Andreas

-- 
Your lucky number is 3552664958674928.  Watch for it everywhere.
ui version=4.0 
 author/author
 comment/comment
 exportmacro/exportmacro
 classForm/class
 widget class=QWidget name=Form 
  property name=geometry 
   rect
x0/x
y0/y
width312/width
height246/height
   /rect
  /property
  property name=windowTitle 
   stringForm/string
  /property
  layout class=QHBoxLayout 
   property name=margin 
number9/number
   /property
   property name=spacing 
number6/number
   /property
   item
widget class=QPushButton name=pushButton 
 property name=text 
  stringPushButton/string
 /property
/widget
   /item
  /layout
 /widget
 pixmapfunction/pixmapfunction
 resources/
 connections/
/ui
import sys
import cStringIO
import os
from PyQt4 import QtCore, QtGui
# this time, we use the code generator
from PyQt4.uic import Compiler

def compileToType(filename):
code_string = cStringIO.StringIO()
widget_info = Compiler.compileUi(file(filename, r), code_string)
# the buffer code_string now contains the generated Python code
widget_module = compile(code_string.getvalue(), filename, exec)
exec widget_module
return locals()[widget_info[uiclass]]

class myWidget(QtGui.QWidget, compileToType(test.ui)):
def __init__(self):
QtGui.QWidget.__init__(self)
self.setupUi(self)

# according to Qt4 docs clicked takes a boolean argument
def on_pushButton_clicked(self):
print test

if __name__ == __main__:
app =  QtGui.QApplication(sys.argv)
w = myWidget()
w.show()
sys.exit(app.exec_())
___
PyKDE mailing listPyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde


[PyKDE] New Signal/Slot Implementation

2006-01-26 Thread Phil Thompson
Tonight's SIP and PyQt snapshots will have revised support for signals and 
slots. This is just a warning that it's a fairly fundamental change and there 
might be outstanding issues.

The reason for the change is to support queued and inter-thread connections in 
PyQt4 - which seem to work now.

This involves a change to the internal API so everything need rebuilding.

Phil

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


Re: [PyKDE] Problems with auto-connect and QAbstractButton.clicked()

2006-01-26 Thread Phil Thompson
On Thursday 26 January 2006 3:49 pm, Andreas Pakulat wrote:
 Hi,

 I have 2 problems with QAbstractButton.clicked and auto-connection:

 1. the auto-connected slot gets called twice, I have no idea why

Because the signal is emitted twice, once with no argument and once with a 
bool argument.

 2. according to Qt4 docs clicked has a boolean argument which I cannot
 use with the autoconnected slot.

It has an optional bool argument so define the slot as...

def on_pushButton_clicked(self, checked=None):

...and then decide which call you are going to respond to (until I look at 
Torsten's suggestion of using decorators).

Phil

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


Re: [PyKDE] Problems with auto-connect and QAbstractButton.clicked()

2006-01-26 Thread Andreas Pakulat
On 26.01.06 17:12:15, Phil Thompson wrote:
 On Thursday 26 January 2006 3:49 pm, Andreas Pakulat wrote:
  Hi,
 
  I have 2 problems with QAbstractButton.clicked and auto-connection:
 
  1. the auto-connected slot gets called twice, I have no idea why
 
 Because the signal is emitted twice, once with no argument and once with a 
 bool argument.

This is due to PyQt4's signal/slot implementation right? Because I can't
reproduce that under C++ and I can't see more than 1 emit in the Qt4
source.

  2. according to Qt4 docs clicked has a boolean argument which I cannot
  use with the autoconnected slot.
 
 It has an optional bool argument so define the slot as...
 
 def on_pushButton_clicked(self, checked=None):
 
 ...and then decide which call you are going to respond to

Ok, thanks for the suggestion.

Will any of these change with the new snapshots coming out this night?
Just curious.

Andreas

-- 
Try to have as good a life as you can under the circumstances.

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


Re: [PyKDE] Problems with auto-connect and QAbstractButton.clicked()

2006-01-26 Thread Phil Thompson
On Thursday 26 January 2006 5:38 pm, Andreas Pakulat wrote:
 On 26.01.06 17:12:15, Phil Thompson wrote:
  On Thursday 26 January 2006 3:49 pm, Andreas Pakulat wrote:
   Hi,
  
   I have 2 problems with QAbstractButton.clicked and auto-connection:
  
   1. the auto-connected slot gets called twice, I have no idea why
 
  Because the signal is emitted twice, once with no argument and once with
  a bool argument.

 This is due to PyQt4's signal/slot implementation right? Because I can't
 reproduce that under C++ and I can't see more than 1 emit in the Qt4
 source.

Sort of. It looks like moc implements signals with optional arguments by 
defining multiple signals in the meta-object. PyQt has no way of knowing how 
many signals there really are.

   2. according to Qt4 docs clicked has a boolean argument which I cannot
   use with the autoconnected slot.
 
  It has an optional bool argument so define the slot as...
 
  def on_pushButton_clicked(self, checked=None):
 
  ...and then decide which call you are going to respond to

 Ok, thanks for the suggestion.

 Will any of these change with the new snapshots coming out this night?
 Just curious.

No.

Phil

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


[PyKDE] [pyQT] qiconview segmentation fault

2006-01-26 Thread piotr maliński
I have a problem with qiconview - I use it to list files and folders.
The path to list is taken from 1) lineedit and 2) via clicks on
folders from the qiconview. The first one works, the second one ends
with segmentation fault. the slot function looks like this:

def listuj_iconview(self):
import glob
import os.path
itm = self.iconView1.currentItem()
path = str(self.lineEdit2.text()) + / + str(QIconViewItem(itm).text())

if os.path.exists(path) and os.path.isdir(path):
  self.lineEdit2.setText(path)
  path = path + /*
  dirlist = glob.glob(path)
  self.iconView1.clear()
  self.dir = QPixmap('images/folder.png')
  self.dirlink = QPixmap('images/folder_link.png')
  self.file = QPixmap('images/file.png')
  for folder in dirlist:
if os.path.isdir(folder):
  if os.path.islink(folder):
nazwa = folder.split('/')
QIconViewItem( self.iconView1, nazwa.pop(), self.dirlink )
  else:
nazwa = folder.split('/')
QIconViewItem( self.iconView1, nazwa.pop(), self.dir )
  for file in dirlist:
if os.path.isfile(file):
  nazwa = file.split('/')
  QIconViewItem( self.iconView1, nazwa.pop(), self.file )

and it dies on self.iconView1.clear(). I've googled out this message:
http://mats.imk.fraunhofer.de/pipermail/pykde/2001-July/001324.html
but it doesn't help me. I've tried various things like clearSelected()
and/or close() before and show() after the clear() function. I use:
qscintilla-1.5.1, PyQt-3.14.1 and sip-4.2.1 on gentoo. I've tested it
on current Arch with the same result :/

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


[PyKDE] automatic slots and subclassing

2006-01-26 Thread Andreas Pakulat
Hi,

another thing I found with automatic slots: It seems they do not work
when subclassing:

class parentWidget(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
def on_pushButton_clicked(self, checked = None):
print tst

class myWidget(parentWidget, compileToType(test.ui)):
def __init__(self):
parentWidget.__init__(self)
self.setupUi(self)

compileToType produces a type from the .ui-file... 

The slot on_pushButton_clicked is not called, though the same thing
works in C++.

Is this also due to some magic stuff moc does, or is this just something
that doesn't work (yet)?

Andreas

-- 
Your life would be very empty if you had nothing to regret.

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


[PyKDE] KABC::ResourceFile oversight

2006-01-26 Thread Jim Bublitz
I posted yesterday that resourcefile.h was missing from the kdelibs tarball - 
that isn't correct. It's been relocated to the kabc/plugins/file 
subdirectory, which I hadn't checked. 

There are other KABC::Resource subclasses (see the subdirs under 
kabc/plugins). I don't intend to add those to PyKDE unless someone has an 
application that requires them (I might have an application that requires 
KABC::ResourceFile, so I'm adding it - one of the few privileges of 
maintaining PyKDE).

When I get the versioning completed and sip has had a few days to stabilize, 
I'll put out an actual PyKDE release.

Jim

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