Re: [PyQt] Help about the use of OpenGL with PyQt

2009-04-05 Thread duncan duncan
On Sat, Apr 4, 2009 at 6:43 PM, Jamie Riotto  wrote:

> OpenGL Tutorial:
> http://cs.uccs.edu/~semwal/indexGLTutorial.html
>
> Also NeHe productions does a realy great job breaking down OpenGL into
> "lessons": My favorite!
> http://nehe.gamedev.net/
>
> Also, since your accessing OpenGL through PyOpenGL, you should look at:
> http://pyopengl.sourceforge.net/documentation/
>
> for other links and examples. Enjoy - jaime
>
>

There are also the QGLViewer/PyQGLViewer  couple.
Basically QGLViewer is build on top of the Qt4 OpenGL widget and PyQGLViewer
is its python bindings.

http://www.libqglviewer.com/
http://pyqglviewer.gforge.inria.fr/wiki/doku.php

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

[PyQt] Eric4 ver 4.3 crash on start

2009-03-26 Thread duncan duncan
Hello

I am not sure the problem is a pyqt4 problem or a eric4 problem

On start, I get this error:


galactica:~> eric4
Warning: translation file 'qt_it_IT'could not be loaded.
Using default.
Warning: translation file 'eric4_it_IT'could not be loaded.
Using default.
Warning: translation file 'qscintilla_it_IT'could not be loaded.
Using default.
QVariant::load(QDataStream &s): type  unknown to QVariant.
Abort
galactica:~>
-


I am using eric4 from the debian testing package (4.3.0-2) as well as the
pyqt4 package from the same distribution (4.4.2) and sip4 4.7.6.

The same problem will occur with the version in experimental (4.4.4)

Any hints ?

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

Re: [PyQt] No MySQL driver on Windows PyQt4?

2008-12-10 Thread duncan duncan
2008/12/10 duncan duncan <[EMAIL PROTECTED]>

>
>
> On Wed, Dec 10, 2008 at 10:29 AM, Phil Thompson <
> [EMAIL PROTECTED]> wrote:
>
>> On Wed, 10 Dec 2008 10:05:12 +0100, "piotr maliński" <[EMAIL PROTECTED]
>> >
>> wrote:
>> > I've installed latest PyQt4 release for Windows and the problem is it
>> > doesn't has MySQL driver (QSqlDatabase: QMYSQL driver not loaded). There
>> is
>> > only SQLITE and ODBC...
>>
>> Correct - you will have to compile Qt and PyQt yourself with the necessary
>> support.
>>
>
>
> I have some problems also using the SQLITE drivers under windows.
>
> I installed the binary package for Qt and PyQt4, but then I get this error:
>
>
> --
> G:\home>c:\Python25\python.exe
> Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
> (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from PyQt4.QtSql import *
> >>> QSqlDatabase.isDriverAvaible("QSQLITE")
> Traceback (most recent call last):
>   File "", line 1, in 
> AttributeError: isDriverAvaible
> >>> QSqlDatabase.isDriverAvailable("QSQLITE")
> False
> --
>
>
> In the directory C:\Python25\Lib\site-packages\PyQt4\plugins\sqldrivers I
> have these files:
>
> libqsqlite4.a
> libqsqlited4.a
> libqsqlodbc4.a
> libqsqlodbcd4.a
> qsqlite4.dll
> qsqlited4.dll
> qsqlodbc4.dll
> qsqlodbcd4.dll
>
>
> while in the directory  C:\Qt\4.4.3\plugins\sqldrivers I have these files:
>
> libqsqlite4.a
> libqsqlited4.a
> libqsqlodbc4.a
> libqsqlodbcd4.a
> qsqlite4.dll
> qsqlited4.dll
> qsqlodbc4.dll
> qsqlodbcd4.dll
>
>
> The demo from the Qt4 installation works fine
>
> Any hints ?
>
> bye
> Gianluca
>

Another information:

the snippet of code I use is this


app = QApplication(sys.argv)
db = QSqlDatabase.addDatabase("QSQLITE")
db.setDatabaseName("chiamami.db")
-

and the output of the program is

G:\home\chiamami>chiamami.py
QSqlDatabase: QSQLITE driver not loaded
QSqlDatabase: available drivers:
QString::arg: Argument missing: Database Error, Driver not loaded Driver not
loaded

So I suppose that for some reasons PyQt4 and/or Qt4 don't find the .dll
files.

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

Re: [PyQt] No MySQL driver on Windows PyQt4?

2008-12-10 Thread duncan duncan
On Wed, Dec 10, 2008 at 10:29 AM, Phil Thompson <[EMAIL PROTECTED]
> wrote:

> On Wed, 10 Dec 2008 10:05:12 +0100, "piotr maliński" <[EMAIL PROTECTED]>
> wrote:
> > I've installed latest PyQt4 release for Windows and the problem is it
> > doesn't has MySQL driver (QSqlDatabase: QMYSQL driver not loaded). There
> is
> > only SQLITE and ODBC...
>
> Correct - you will have to compile Qt and PyQt yourself with the necessary
> support.
>


I have some problems also using the SQLITE drivers under windows.

I installed the binary package for Qt and PyQt4, but then I get this error:


--
G:\home>c:\Python25\python.exe
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.QtSql import *
>>> QSqlDatabase.isDriverAvaible("QSQLITE")
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: isDriverAvaible
>>> QSqlDatabase.isDriverAvailable("QSQLITE")
False
--


In the directory C:\Python25\Lib\site-packages\PyQt4\plugins\sqldrivers I
have these files:

libqsqlite4.a
libqsqlited4.a
libqsqlodbc4.a
libqsqlodbcd4.a
qsqlite4.dll
qsqlited4.dll
qsqlodbc4.dll
qsqlodbcd4.dll


while in the directory  C:\Qt\4.4.3\plugins\sqldrivers I have these files:

libqsqlite4.a
libqsqlited4.a
libqsqlodbc4.a
libqsqlodbcd4.a
qsqlite4.dll
qsqlited4.dll
qsqlodbc4.dll
qsqlodbcd4.dll


The demo from the Qt4 installation works fine

Any hints ?

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

[PyQt] Segmentation fault running eric4-4.1.5

2008-07-01 Thread duncan duncan
Hello


After installing eric4 from source, I get this error:

---
akira:~> eric4
Warning: translation file 'qt_it_IT'could not be loaded.
Using default.
Warning: translation file 'eric4_it_IT'could not be loaded.
Using default.
Warning: translation file 'qscintilla_it_IT'could not be loaded.
Using default.
Object::connect: No such signal Shell::destroyed(QObject*)
Object::connect: No such signal Shell::destroyed(QObject*)
Object::connect: No such signal LexerPython::colorChanged(QColor,int)
Object::connect: No such signal LexerPython::eolFillChanged(bool,int)
Object::connect: No such signal LexerPython::fontChanged(QFont,int)
Object::connect: No such signal LexerPython::paperChanged(QColor,int)
Object::connect: No such signal LexerPython::propertyChanged(const
char*,const char*)
Segmentation fault
akira:~>
---

The system is:
python 2.5.2
sip 4.7.2
Qt 4.4.0
PyQt 4.4.2
QScintilla 2.2

All the package except QScintilla are installed from the debian repository
(lenny)
QScintilla and the Python binding where rebuild from source

As additional info, I can add that some eric4 module (like the mini-editor
or the preference dialog)
work if run stand alone

Any hint ?
The same error are generated from the lastest snapshot

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

[PyQt] Two problems with QSystemTrayIcon

2008-03-07 Thread duncan duncan
Hello.

I am trying to put an icon into the system tray area using QSystemTrayIcon.
All work well except when I close the program.

I put the icon in the area using this code:


icon=QtGui.QIcon("pixmaps/todo_list.png")
systray=QtGui.QSystemTrayIcon(icon)
#systray.setIcon(icon)
menu = QtGui.QMenu()
quitAction = menu.addAction('Quit')
systray.setContextMenu(menu)
quitAction.connect(quitAction, QtCore.SIGNAL("triggered()"),  ui.QuitApp
)
systray.show()

sys.exit(app.exec_())
-

I have two minor problems:

1) when I close the program, the icon stay in the tray area until I move the
mouse pointer over it, at this point it go away
2) after exiting from the program, I get this error:
QApplication::qAppName: Please instantiate the QApplication object first

I have the feeling that the two problems are connected, but I cannot find a
clue

I am working with Qt 4.3.3 and PyQt4.3.3.2 under Windows XP

Any suggestions ?

thanks in advance
Gianluca
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Re: Modelss dialog not usable

2007-12-17 Thread duncan duncan
On Dec 17, 2007 3:56 PM, Andreas Pakulat <[EMAIL PROTECTED]> wrote:

> On 17.12.07 15:08:23, duncan duncan wrote:
> > On Dec 17, 2007 3:00 PM, duncan duncan <[EMAIL PROTECTED]> wrote:
> >
> > > Hello.
> > >
> > > In my application (a QApplication), as central widget I have two
> > > QListWidget.
> > >
> > > When I double click on an item of a list widget, I want to show a
> dialog
> > > with some detail data for the item
> > >
> > >
> > > This is the relevant code, the dialog is designed using Qt-Designer
> and
> > > windowModality is Qt::NonModal
> > >
> > > ---
> > > ItemDlg = QtGui.QDialog()
> > > ItemDlgGui = Ui_D_item_detail()
> > > ItemDlgGui.setupUi(ItemDlg)
> > >
> > > ItemDlg.show()
> > >
> > > #ItemDlg.exec_()
> > > ---
> > >
> > > If I use the ItemDlg.exec_() line, all work correctly, but the dialog
> is
> > > modal, so I cannot work on the main window.
> > >
> > > Since I want a modeless dialog, I try to use ItemDlg.show() but now
> the
> > > dialog show itself and then close immediatly.
> > >
> > > Any hints ?
> > >
> >
> > It seems that by mistake I resolve the problem.
> >
> > It just need to call the .show() AND the .exec_() function.
>
> No you don't. You actually want to make sure the instance doesn't get
> deleted once the function that creates it ends. Thats why its closed
> immediately when you only use show(). When the function ends, there's no
> refernece to the dialog anymore, because ItemDlg is a local variable,
> thus the dialog is garbage collected.
>




>
> Do something like self.itemdialog = QtGui.QDialog() instead of the first
> line above.
>

Actually I modified all the structure, so these lines of codes are in the
__init__ function of a derived class (not important I suppose).

The whole point of the problem is that I want (and I need) to be able to
open the dialog (the display a set of editable data), look at it, modify
some field, then eventually open another dialog which display some diffente
data (basically the data are record of a db table)

If in the __init__ funciont I put the code you suggest, without the call to
.exec_(), the dialog close immediatly. I suppose that this happen because
self is not a pointer to the application, but a pointer to the dialog class.

For now it work as I expect, I will do further investigation as soon as the
code will stabilize a little (and all the feature are implemented)

Thanks anyway
bye
Gianluca
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Re: Modelss dialog not usable

2007-12-17 Thread duncan duncan
On Dec 17, 2007 3:00 PM, duncan duncan <[EMAIL PROTECTED]> wrote:

> Hello.
>
> In my application (a QApplication), as central widget I have two
> QListWidget.
>
> When I double click on an item of a list widget, I want to show a dialog
> with some detail data for the item
>
>
> This is the relevant code, the dialog is designed using Qt-Designer and
> windowModality is Qt::NonModal
>
> ---
> ItemDlg = QtGui.QDialog()
> ItemDlgGui = Ui_D_item_detail()
> ItemDlgGui.setupUi(ItemDlg)
>
> ItemDlg.show()
>
> #ItemDlg.exec_()
> ---
>
> If I use the ItemDlg.exec_() line, all work correctly, but the dialog is
> modal, so I cannot work on the main window.
>
> Since I want a modeless dialog, I try to use ItemDlg.show() but now the
> dialog show itself and then close immediatly.
>
> Any hints ?
>

It seems that by mistake I resolve the problem.

It just need to call the .show() AND the .exec_() function.

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

[PyQt] Modelss dialog not usable

2007-12-17 Thread duncan duncan
Hello.

In my application (a QApplication), as central widget I have two
QListWidget.

When I double click on an item of a list widget, I want to show a dialog
with some detail data for the item


This is the relevant code, the dialog is designed using Qt-Designer and
windowModality is Qt::NonModal

---
ItemDlg = QtGui.QDialog()
ItemDlgGui = Ui_D_item_detail()
ItemDlgGui.setupUi(ItemDlg)

ItemDlg.show()

#ItemDlg.exec_()
---

If I use the ItemDlg.exec_() line, all work correctly, but the dialog is
modal, so I cannot work on the main window.

Since I want a modeless dialog, I try to use ItemDlg.show() but now the
dialog show itself and then close immediatly.

Any hints ?


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

[PyQt] Newbe question on QGLWidget

2007-11-27 Thread duncan duncan
Hello.

I am playing with the QGLWidget and I have some problems.

I am able to draw an object and rotate/zoom/move it.
My problem now is that I'd like to draw the object in 4 viewport (no problem
here) but with different point of view.
Basically I am trying to draw the 3 basic orthogonal view (XY, XZ, YZ) and a
perspective view.
I am not interested in a 2D view for the orthogonal projections, since I
will need the full 3D object anyway.

Now I get this simply rotating the object around the axis as I need, but I
am not sure this is the correct thing to do.
Looking around it seems that the correct solution is to move the camera to
have the correct point of view.
So what are the correct way ? Rotate the object or move the camera ?

And if the correct way is to move the camera, where I can find a simple
example ?

My idea is to make something like this:

glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glViewport(0, 0, w, h)
gluLookAt(eyeX, eyeY, eyeZ,
  centerX, centerY, centerZ,
  upX, upY, upZ);
glMatrixMode(GL_MODELVIEW)

and then render my object

but I cannot understand if this is correct and where I must do it.
I suspect that I must do it in the paintGL function, setting the values of
the parameters for gluLookAt in some other places (I am thinking about
the properties
of the viewport)

Is this the correct approach ? If not, where is my error ?

thanks in advance
Gianluca
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Problems with QDialog, QLineEdit and returnPressed event

2007-10-10 Thread duncan duncan
Hello

I am trying to have a QDialog (the gui was designed with QtDesigner) with
some QLineEdit widget.
The QLineEdit widget is connected to the returnPressed event.

All work fine but when I press the Return key the dialog close.
At this point find that the buttons on the dialog need to have the
autoDefault property set to False.

The dialog has a QDialogButtonBox for the two buttons (Ok and Cancel), and
these buttons still have the
autoDefault property set to True but I am not able to set it to False.

I try with QtDesigner but all I see is the QDialogButtonBox widget, no
access to the buttons, so I try with this code:

---
for btn in self.uid.buttonBox.buttons():
btn.setAutoDefault(False)
---

and this fail too.

How can I solve the problem ? For now I have a workaround: I delete the
QDialogButtonBox and use just to buttons
connected with the accept() and reject() signal and this work.

As a side note: I understand it correctly that if I need some input
(QLineEdit specifically) connected wiht the returnPressed signal
it is better to create a void dialog and then put all the controls than to
create a dialog with the standard buttons ?

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

[PyQt] Problem with pyuic4 and QColumnView widget

2007-09-27 Thread duncan duncan
For a software I am developing I'd like to try to use a QColumnView widget.
All my gui is designed using the Designer and when I compile the .ui file
which had the widget I get this error:

"Unknown Qt widget: QColumnView"

both under Windows and under Linux.

I am working with Qt 4.3 and PyQt 4.3.

Any ideas ?

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

Re: [PyQt] Installation problem in linux

2007-09-27 Thread duncan duncan
On 9/27/07, Shyamsundar, Purkayastha (Purkayastha)** CTR ** <
[EMAIL PROTECTED]> wrote:
>
>  Hi
>
>
>
> I downloaded PyQt-x11-gpl-4.3.tar.gz and installed it in linux ( RHEL v
> 4.4 with 2.6 kernel )
>
>
>
> When I execute the configure script I get the following error
>
>
>
> [EMAIL PROTECTED] PyQt-x11-gpl-4.3]# python configure.py
>
> Determining the layout of your Qt installation...
>
> Error: Failed to create ./qtdirs using platform linux-g++. Make sure your
>
> compiler is installed correctly and you have a working make on your PATH.
>
> Please help
>
> I even downloaded the latest version of qt and installed it but I still
> get the same error message
>

Do you have installed the g++ compiler ?

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

[PyQt] setCurrentCell problem

2007-03-22 Thread duncan duncan

I am having some problems using setCurrentCell.

I have a QTableWidget with some rows and colums.

At some point I call QTableWidget.setCurrentCell(0,0)

The result is that the active cell is not the cell at row 0 col 0, but the
cell at row 0 col 1

This happen also calling setCurrentCell with row <> 0

Any hints ?

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

[PyQt] Getting mouse and key event with a qtablewidget

2007-03-15 Thread duncan duncan

Hello.

I'd like to be able to process the mouse and key pressed event with a
qtablewidget
The goal is to have a table in which the number of rows and columns are
dinamically
created when certain keys are pressed and that had a context menu to delete
the
row/column.

An example can be: if I press the tab key on the last column, a column is
added to the table or if I press the
arrow down on the last row, a new row is added.

Any hints ?

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

[PyKDE] Toolbars and widget

2007-02-13 Thread duncan duncan

I have am trying to port an application from Delphi to python/qt.
This application have some toolbars that have some action button and some
other widgets (combo boxes).
I am looking for  a way to duplicate the toolbars with Qt-designer but it
seems that it is no longer possible
to add different widget to the toolbars.

I am looking to qdockwidget, but this way I must manually rebuild all the
toolbars.
I have also a problem with this widget, since as I set the floating property
to true, I don't se it anymore
in the preview mode of qt-designer.

Are there some alternatives ?

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