RE: [PyQt] QSqlQueryModel works but QSqlTableModel doesn't work

2008-03-05 Thread Ivan Coronado
I don't think that are the permissions, anyway  I tried to log in as
root and I still have the same problem. I'm using mysql and connecting
to it trought QODBC. All the other tables works well! I'm
desperate!

Thanks again for the help

 

-Mensaje original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] En nombre de Simone
Enviado el: martes, 04 de marzo de 2008 18:46
Para: pyqt@riverbankcomputing.com
Asunto: Re: [PyQt] QSqlQueryModel works but QSqlTableModel doesn't work

Ivan Coronado ha scritto:
 Ja ja ja, yes, now the table has 15 records. Using QSqlQueryModel I
can see the records. Another rare thing, If I use QSqlTableModel I only
see the column names, but If I click in any header of the table, all the
column names disappear.

It seems something related to the status of table. Do you have the
permission to read the table? Which database are you using?

Simone

Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 

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

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


Re: [PyQt] Qt 3: wrapping QSettings subclass fails

2008-03-05 Thread Phil Thompson
On Tuesday 04 March 2008, Arve Knudsen wrote:
 On Mon, Mar 3, 2008 at 5:39 PM, Phil Thompson

 [EMAIL PROTECTED] wrote:
  On Monday 03 March 2008, Arve Knudsen wrote:
Hello all
I've run into a problem wrapping a subclass of Qt 3's QSettings. The
problem is that QSettings' copy constructor is private and SIP wants
to copy construct an instance of my class. How can I solve this?
 
   What are the circumstances in which SIP wants to create the instance?

 This is the generated code at least: http://pastebin.com/m64228e27.

I can't reproduce this. The simple attached test does the right thing.

Phil
%Module foo

%Import QtCore/QtCoremod.sip

class Foo : QSettings
//class Foo
{
%TypeHeaderCode
#include foo.h
%End

public:
Foo();
};
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] mysql in pyqt4 for windows

2008-03-05 Thread Mario Daniel Carugno
I've downloaded the pyqt4 binary package for windows, and comes with
sql drivers for odbc and sqlite3.
I need the mysql driver. Can it be installed easy or do i have to
compile qt libs ?
How can i get it ?

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


Re: [PyQt] mysql in pyqt4 for windows

2008-03-05 Thread Phil Thompson
On Wednesday 05 March 2008, Mario Daniel Carugno wrote:
 I've downloaded the pyqt4 binary package for windows, and comes with
 sql drivers for odbc and sqlite3.
 I need the mysql driver. Can it be installed easy or do i have to
 compile qt libs ?
 How can i get it ?

You have to compile everything yourself.

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


Re: [PyQt] Wrapping style classes with SIP for styling pythonapplication.

2008-03-05 Thread Phil Thompson
On Wednesday 05 March 2008, Igor Prischepoff wrote:
 Hello,Phil.
 Attached is my test case with crashing styles
 qtguimod.sip - added 2 lines which include qcommonstyle.sip,qmotifstyle.sip
 qcommonstyle.sip - hand-made wrapper
 qmotifstyle.sip  - hand-made wrapper

 test_norwegian.py - testing wrapping style which crashes(commenting out
 method polish will fix crash)

 test_style.py - testing QStyle abstract style which crashes on _standard_
 pyqt 4.3.3. version

 Can you look at what i'm doing wrong here?

 p.s.
 Wild guess:
 does qstyle.sip need a
 %ConvertToTypeCode section?

You should extend the %ConvertToSubClassCode in qapplication.sip to include 
the new classes as they are QObject sub-classes.

 Seems like there is:
 ...
 virtual void polish ( QWidget * widget )
 virtual void polish ( QApplication * application )
 virtual void polish ( QPalette  palette )
 ...

 virtual void unpolish ( QWidget * widget )
 virtual void unpolish ( QApplication * application )
 ...

 so SIP-level conversion code between QWidget,QApplication and QPalette
 should be there?
 (or maybe i'm totally wrong)

Wrong. If you reimplement polish() in Python then you need to check the type 
of the argument to work out overload has been called.  Something like...

def polish(self, arg):
if isinstance(arg, QtGui.QPalette):
# polish(const QPalette ) reimplementation
elif isinstance(arg, QtGui.QWidget):
# polish(QWidget *) reimplementation
else:
# We haven't reimplemented this so call the base class.
QMotifStyle.polish(self, arg)

 my environment: windows xp, qt 4.3.3. pyqt 4.3.3-2 opensource,python 2.5

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


[PyQt] PyKDE-3.16.1 release

2008-03-05 Thread Jim Bublitz
A new PyKDE3 release is up at Riverbank Computing:

http://www.riverbankcomputing.co.uk/pykde/index.php

This release removes the need to patch the PyKDE3 source code, and should also 
remove any of the konsole_part issues some people were having (konsole_part 
is no longer supported). 

The release also requires a sip version of 4.7.0 or later (preferably the most 
recent release - 4.7.4 - which is also available at Riverbank).

I've decided to upgrade PyKDE3 to the latest KDE releases, through 3.5.9.  The 
current release should build against any PyKDE3 released version, and there 
probably isn't a lot of new stuff in the more recent KDE releases.

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


[PyQt] PyKDE4-4.0.0 release available

2008-03-05 Thread Jim Bublitz
The first PyKDE4 tarball release is available at Riverbank Computing

http://www.riverbankcomputing.co.uk/pykde/index.php

This release will build against KDE 4.0.0 or 4.0.1 (the difference between the 
two is a total of 3 new methods). With the exception of a couple of small bug 
fixes, this release should be the same as the kdebindings releases that come 
with KDE4, maintained by Simon Edwards.

This release includes a full set of documentation based on the C++ 
documentation included in the KDE4 h files. It also includes a tutorial and a 
few small example programs. It also includes a framework for viewing live 
examples and documentation simultaneously (pykdedocs), based on the 
pykdesampler Troy Melhase began for PyKDE3. 

The documentation, examples and viewer can be installed separately if you 
already have PyKDE4 installed. The viewer requires PyKDE4.

Contributions of additional example programs or tutorials would be greatly 
appreciated.

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


[PyQt] PyQt

2008-03-05 Thread Jon Chambers
Hi,
I'm trying to write a program that creates an onscreen keyboard that uses an
2-analogue stick joypad for input. I'm having issues becuase the joystick
needs to be polled regularly. I'm using a QTimer  to call a paintEvent
update()  that polls the joystick in the main class (Keyboard). However
there's some other drawing i want to do when the joystick is polled. However
the drawing is supposed to be done by a different class with its own
graphics etc (called Ring), and i found the only way that seemed to work was
to put the drawing i want to do in the paintEvent of that class and both
seem to get called. But this seems kinda weird, and for some reason if i
simply called the drawing to be done by Ring as a method of the Ring object
in the paintEvent of Keyboard it doesn't work.
I'm sorry if there's a bit confusing, i'm very new to programming and QT and
also asking questions on mailing lists.

Basically doing

Class keyboard()
...
self.timer.start(50)
self.connect(self.timer, QtCore.SIGNAL('timeout()'), self, QtCore.SLOT
('update()'))
...
def paintEvent()
...poll the joystick

Class Ring()
...
def paintEvent()
... do the ring drawing

works, but doing

Class keyboard()
...
self.timer.start(50)
self.connect(self.timer, QtCore.SIGNAL('timeout()'), self, QtCore.SLOT
('update()'))
...
def paintEvent()
...poll the joystick
...ring.drawstuff()

Class Ring()
...
def drawstuff()
... do the ring drawing

Just lands me with a blank window.
Hope someone can help explain this.
thanks
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] PyQt

2008-03-05 Thread Matt Newell
On Wednesday 05 March 2008 15:58:26 Jon Chambers wrote:
 Hi,
 I'm trying to write a program that creates an onscreen keyboard that uses
 an 2-analogue stick joypad for input. I'm having issues becuase the
 joystick needs to be polled regularly. I'm using a QTimer  to call a
 paintEvent update()  that polls the joystick in the main class (Keyboard).
 However there's some other drawing i want to do when the joystick is
 polled. However the drawing is supposed to be done by a different class
 with its own graphics etc (called Ring), and i found the only way that
 seemed to work was to put the drawing i want to do in the paintEvent of
 that class and both seem to get called. But this seems kinda weird, and for
 some reason if i simply called the drawing to be done by Ring as a method
 of the Ring object in the paintEvent of Keyboard it doesn't work.
 I'm sorry if there's a bit confusing, i'm very new to programming and QT
 and also asking questions on mailing lists.



I think the correct thing to do would have a slot connected to the timer that 
polls the joystick then calls ring.update().  You should generally avoid 
having any code in the paintEvent except for actual painting code.  And you 
should call paintEvent on the widget that actually needs repainting.

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


RE: [PyQt] PyQt

2008-03-05 Thread Peter Shinners
 I'm using a QTimer  to call a paintEvent update()  that polls the
 joystick in the main class (Keyboard). However there's some other
 drawing i want to do when the joystick is polled. However the
 drawing is supposed to be done by a different class with its own
 graphics etc (called Ring)


I know this isn't the main point of your questions. But the paintEvent
Function you are overriding should only deal with painting. It doesn't
Clean to be polling hardwhere during this call.

It sounds like the best plan is to create your own method to handle
polling the hardware. You can then tell the widget to update if anything
has changed.

Using the QTimer is the right approach, just have it call your own 
function that does something like this.

def myTimerCallback(self):
PollJoysticks()
self.ringWidget.repaint()



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


[PyQt] Re: PyQt

2008-03-05 Thread Jon Chambers
Thanks for the speedy responses!
I'm now trying to create a non-paintEvent function that calls an update if
necessary. But now when i do

self.connect(self.timer, QtCore.SIGNAL('timeout()'), self.pollJoysticks())

i get an error: Argument 3 (i.e. the pyFunction call) is of invalid type.
but here (
http://www.riverbankcomputing.com/Docs/PyQt4/pyqt4ref.html#signal-and-slot-support)
It says i should be able to use the form

QtCore.QObject.connect(a, QtCore.SIGNAL(QtSig()), pyFunction)

I know that the timeout signal and my polling function work because they
worked fine before, all i did was rename paintEvent to pollJoysticks and add
a call to the proper paintEvent, and replace
self.connect(self.timer, QtCore.SIGNAL('timeout()'), self, QtCore.SLOT
('update()')
with what i put above.
if i use
self.connect(self.timer, QtCore.SIGNAL('timeout()'), self, QtCore.SLOT
('pollJoysticks()'))
polljoysticks doesn't get called at all. Is there something special i should
put in the pollJoysticks method to make it a Slot?
thanks
jon

On Wed, Mar 5, 2008 at 11:58 PM, Jon Chambers [EMAIL PROTECTED]
wrote:

 Hi,
 I'm trying to write a program that creates an onscreen keyboard that uses
 an 2-analogue stick joypad for input. I'm having issues becuase the joystick
 needs to be polled regularly. I'm using a QTimer  to call a paintEvent
 update()  that polls the joystick in the main class (Keyboard). However
 there's some other drawing i want to do when the joystick is polled. However
 the drawing is supposed to be done by a different class with its own
 graphics etc (called Ring), and i found the only way that seemed to work was
 to put the drawing i want to do in the paintEvent of that class and both
 seem to get called. But this seems kinda weird, and for some reason if i
 simply called the drawing to be done by Ring as a method of the Ring object
 in the paintEvent of Keyboard it doesn't work.
 I'm sorry if there's a bit confusing, i'm very new to programming and QT
 and also asking questions on mailing lists.

 Basically doing

 Class keyboard()
 ...
 self.timer.start(50)
 self.connect(self.timer, QtCore.SIGNAL('timeout()'), self, QtCore.SLOT
 ('update()'))
 ...
 def paintEvent()
 ...poll the joystick

 Class Ring()
 ...
 def paintEvent()
 ... do the ring drawing

 works, but doing

 Class keyboard()
 ...
 self.timer.start(50)
 self.connect(self.timer, QtCore.SIGNAL('timeout()'), self, QtCore.SLOT
 ('update()'))
 ...
 def paintEvent()
 ...poll the joystick
 ...ring.drawstuff()

 Class Ring()
 ...
 def drawstuff()
 ... do the ring drawing

 Just lands me with a blank window.
 Hope someone can help explain this.
 thanks

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

Re: [PyQt] Re: PyQt

2008-03-05 Thread Jim Bublitz
On Wednesday 05 March 2008 16:29, Jon Chambers wrote:
 Thanks for the speedy responses!
 I'm now trying to create a non-paintEvent function that calls an update if
 necessary. But now when i do

 self.connect(self.timer, QtCore.SIGNAL('timeout()'), self.pollJoysticks())

Remove the parens from self.pollJoysticks () - you want the address of the 
method, not to call the method. Should be:

self.connect (  ... self.pollJoysticks)

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


[PyQt] pyqt + opencv

2008-03-05 Thread tony dennis
Hi everyone. is there some know how to integrate pyqt and opencv. Now I am
working an image processing project. i want to use pyqt to provide GUI and
opencv to process image. But opencv returns the image object as cvMat,
anybody know how to display the cvMat image on a QLabel?
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt