Re: [PyQt] Changes in PyKDE

2008-07-10 Thread Christoph Burgmer
Hi,

Am Freitag, 11. Juli 2008 schrieb Jim Bublitz:
> As some of you may have noticed, I haven't been keeping up with PyKDE very
> well lately (again), but Simon Edwards has.  Since I'm unlikely to be able
> to do much with it for the forseeable future, we've agreed to have Simon
> take it over.
>
> The major change will probably be that up-to-date releases will come via
> KDE releases (version releases and bugfix releases), and Simon will
> probably keep you up-to-date on the where and when of those. Any project
> decisions are now up to Simon.
>
> A number of people on this list have made significant contributions to
> PyKDE over the years, and I really appreciate all of the help, criticism,
> bug reports and fixes.
>
> I'll probably still follow the list and will be happy to answer any
> questions (although I can't imagine anything that Phil or Simon won't be
> able to handle better).
>
> Thanks again to everyone who has participated in PyKDE.

I just started two apps with PyKDE this year and am happy with it. Thanks for 
your work on this.

One small question: can we now use the KDE bug tracker for fileing bugs? Not 
that there are any big ones ;)

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


[PyQt] Changes in PyKDE

2008-07-10 Thread Jim Bublitz
As some of you may have noticed, I haven't been keeping up with PyKDE very 
well lately (again), but Simon Edwards has.  Since I'm unlikely to be able to 
do much with it for the forseeable future, we've agreed to have Simon take it 
over.

The major change will probably be that up-to-date releases will come via KDE 
releases (version releases and bugfix releases), and Simon will probably keep 
you up-to-date on the where and when of those. Any project decisions are now 
up to Simon.

A number of people on this list have made significant contributions to PyKDE 
over the years, and I really appreciate all of the help, criticism, bug 
reports and fixes.

I'll probably still follow the list and will be happy to answer any questions 
(although I can't imagine anything that Phil or Simon won't be able to handle 
better).

Thanks again to everyone who has participated in PyKDE.

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


Re: [PyQt] QDirModel instance

2008-07-10 Thread Scott Frankel


Fabulous!


On Jul 10, 2008, at 2:08 PM, Andreas Pakulat wrote:


On 10.07.08 11:46:36, Scott Frankel wrote:


Right.  Thanks for pointing out that I still need to explicitly pass
"self."

I'm still not getting checkboxes displayed in the tree widget,  
though.  I
believe the problem is in the nested return value in the model's  
data()

method.

The C++ example code I'm following uses a QMap data structure to hold
checkState values.  After reading Assistant notes, a python  
dir(QtCore),
and some googling, I've found that QMap is not implemented in  
PyQt.  So

I'm using a Dict instead.  Still, my app complains:

TypeError: invalid result type from DirModel.data()


Here's the C++ code I'm following:

   virtual QVariant data(const QModelIndex &index, int role =
Qt::DisplayRole) const
   {
   if (role == Qt::CheckStateRole && index.column() == 0) {
   return  
checkstates.value(fileInfo(index).absoluteFilePath(),

Qt::Unchecked);


You need to wrap that in a QVariant, i.e.

return QVariant()

data() needs to return a QVariant and Python doesn't support the
implicit constructors as C++ does.

Andreas

--
You will pass away very quickly.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



Scott Frankel
President/VFX Supervisor
Circle-S Studios
510-339-7477 (o)
510-332-2990 (c)




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


Re: [PyQt] QDirModel instance

2008-07-10 Thread Andreas Pakulat
On 10.07.08 11:46:36, Scott Frankel wrote:
>
> Right.  Thanks for pointing out that I still need to explicitly pass  
> "self."
>
> I'm still not getting checkboxes displayed in the tree widget, though.  I 
> believe the problem is in the nested return value in the model's data() 
> method.
>
> The C++ example code I'm following uses a QMap data structure to hold  
> checkState values.  After reading Assistant notes, a python dir(QtCore), 
> and some googling, I've found that QMap is not implemented in PyQt.  So 
> I'm using a Dict instead.  Still, my app complains:
>
>   TypeError: invalid result type from DirModel.data()
>
>
> Here's the C++ code I'm following:
>
> virtual QVariant data(const QModelIndex &index, int role =  
> Qt::DisplayRole) const
> {
> if (role == Qt::CheckStateRole && index.column() == 0) {
> return checkstates.value(fileInfo(index).absoluteFilePath(), 
> Qt::Unchecked);

You need to wrap that in a QVariant, i.e. 

return QVariant()

data() needs to return a QVariant and Python doesn't support the
implicit constructors as C++ does.

Andreas

-- 
You will pass away very quickly.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] QDirModel instance

2008-07-10 Thread Scott Frankel


Right.  Thanks for pointing out that I still need to explicitly pass  
"self."


I'm still not getting checkboxes displayed in the tree widget,  
though.  I believe the problem is in the nested return value in the  
model's data() method.


The C++ example code I'm following uses a QMap data structure to hold  
checkState values.  After reading Assistant notes, a python  
dir(QtCore), and some googling, I've found that QMap is not  
implemented in PyQt.  So I'm using a Dict instead.  Still, my app  
complains:


TypeError: invalid result type from DirModel.data()


Here's the C++ code I'm following:

virtual QVariant data(const QModelIndex &index, int role =  
Qt::DisplayRole) const

{
if (role == Qt::CheckStateRole && index.column() == 0) {
return  
checkstates.value(fileInfo(index).absoluteFilePath(), Qt::Unchecked);

}
return QDirModel::data(index, role);
}

private:
QMap checkstates;
};




Here's my code:

class DirModel(QtGui.QDirModel):
def __init__(self, parent=None):
QtGui.QDirModel.__init__(self, parent)

self.checkstates = {}

def data(self, index, role=QtCore.Qt.DisplayRole):
if (role == QtCore.Qt.CheckStateRole and index.column() == 0):
			self.checkstates[self.fileInfo(index).absoluteFilePath()] =  
QtCore.Qt.Checked
			return self.checkstates[self.fileInfo(index).absoluteFilePath()] 
# <-- problem???


return QtGui.QDirModel.data(self, index, role)



Thanks in advance for your suggestions!
Scott




On Jul 9, 2008, at 11:36 PM, Phil Thompson wrote:

On Wed, 9 Jul 2008 22:39:27 -0700, Scott Frankel <[EMAIL PROTECTED] 
>

wrote:


Hello,

I just joined this list and am new to PyQt (and Qt).  I've scanned  
the

archives, but I'm not sure even what I'm looking for to answer my
question.

I'm looking over some C++ code, trying to rewrite it in Python.  (My
Spanish is much better than my C++!)  I'm sub-classing and extending
QDirModel and getting the following error:

TypeError: first argument of unbound method QDirModel.data() must be
a QDirModel instance

The C++ methods are:

virtual QVariant data(const QModelIndex &index, int role =
Qt::DisplayRole) const
{
if (role == Qt::CheckStateRole && index.column() == 0) {
return
checkstates.value(fileInfo(index).absoluteFilePath(), Qt::Unchecked);
}
return QDirModel::data(index, role);
}


My translation so far looks like this:


[ ... ]
class DirModel(QtGui.QDirModel):
def data(self, index, role=QtCore.Qt.DisplayRole):
if (role == QtCore.Qt.CheckStateRole and index.column() == 0):
return 
checkstates.value(fileInfo(index).absoluteFilePath(),
QtCore.Qt.Unchecked)
return QtGui.QDirModel.data(index, role)
[ ... ]


Not sure how to make the first argument (index or self?) be a
QDirModel instance.  Ultimately I'm hoping for a directory tree with
check boxes.

Suggestions?


When using an unbound method (including __init__()) you must  
explicitly

pass self. So...

   return QtGui.QDirModel.data(self, index, role)

Phil




Scott Frankel
President/VFX Supervisor
Circle-S Studios
510-339-7477 (o)
510-332-2990 (c)




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

[PyQt] pyuic 4.4.2 missing support for QFormLayout?

2008-07-10 Thread Håvard Gulldahl
Hello, all,

I'm running:

$ pyuic4 --version: Python User Interface Compiler 4.4.2 for Qt version 4.4.0
$ dpkg -l pyqt4-dev-tools: 4.4.2-0ubuntu2


and it borks out on the attached .ui file with the following error message:

$ pyuic4 /tmp/test-formlayout.ui
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file '/tmp/test-formlayout.ui'
#
# Created: Thu Jul 10 16:29:00 2008
#  by: PyQt4 UI code generator 4.4.2
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(269,125)
self.gridLayout = QtGui.QGridLayout(Dialog)
self.gridLayout.setObjectName("gridLayout")
Unknown Qt widget: QFormLayout



Is QFormLayout missing from pyuic, or is something wrong on my end?


Thanks!
-- 
Håvard Gulldahl <[EMAIL PROTECTED]>


test-formlayout.ui
Description: application/designer
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Returning a subclass

2008-07-10 Thread David Klasinc

David Klasinc wrote:

Disregard. First few action that are added to the toolbar were in fact 
QActions, those added later were myActions.


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


[PyQt] Returning a subclass

2008-07-10 Thread David Klasinc

Greetings,

here is the code:

class myAction (QtGui.QAction):
def __init__ (self, parent, myProperty):
QtGui.QAction.__init__ (self, parent)
self.myProperty = myProperty

Later this myAction is instanced and added to a toolbar

someAction = myAction (self, "The Property")
self.toolbar.addAction(myAction)

Then in the end I want to iterate through all the actions in toolbar:

for a in self.toolbar.actions():
print type(a)
print a.myProperty

toolbar.actions() returns a list of QActions, is there a way to recast 
this QAction back to myAction? Is the information about subclass lost 
during this process? First print in the above code will print




And the second will raise the AttributeError obviously.

Any ideas on this one?

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


[PyQt] windows installer

2008-07-10 Thread Heinz A. Preisig
Title: business




Hi I got a new machine and installed

1. python 2.5
2. PyQt *Py2.5-gpl-4.4.2-1

running an application I get the error message  start point
for procedure could not be found in dynamic link library QtCore4.dll   
(translation from Norwegian...may not be precise)

What do I miss?

Regards,

Heinz Preisig
-- 





  

  Heinz A Preisig
Professor of Process Systems Engineering
  Private: 
Øvre Bakklandet 62 B, 7013 Trondheim, Norway
  


  Department
of Chemical Engineering
  Norwegian
University of Science and
Technology       
  
  N – 7491 Trondheim, Norway
  Tel direct:
   +47     735
92807
  Tel mob:  
   +47     9754
1334
  e-mail: 
  [EMAIL PROTECTED]
  web:
  www.chemeng.ntnu.no\~preisig

  

 





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