Re: [PyQt] PyQtShell

2009-01-23 Thread Pierre Raybaut


Message: 7
Date: Sun, 18 Jan 2009 22:07:57 -0800 (PST)
From: eliben 
Subject: Re: [PyQt] PyQtShell
To: pyqt@riverbankcomputing.com
Message-ID: <21537432.p...@talk.nabble.com>
Content-Type: text/plain; charset=us-ascii




Pierre Raybaut wrote:
  
> 
> Hi all,
> 
> I would like to share with you this little open-source project of mine, 
> PyQtShell:

> http://pypi.python.org/pypi/PyQtShell/
> http://code.google.com/p/pyqtshell/
> 
> I've just started it a few days ago and I worked on it only a couple of 
> hours at home this week and saturday morning... so do not expect a 
> revolution here.
> But I thought that some of you might be interested in contributing or 
> simply testing it.
> 
> Here is an extract from the Google Code website:
> 
> PyQtShell is intended to be an extension to PyQt4 (module PyQt4.QtShell) 
> providing a console application (see screenshots below) based on 
> independent widgets which interact with each other:
> - QShell, a Python shell with useful options (like a '-os' switch 
> for importing os and os.path as osp, a '-pylab' switch for importing 
> matplotlib in interactive mode, ...) and advanced features like code 
> completion (requires QScintilla, i.e. module PyQt4.Qsci)

> - CurrentDirChanger: shows the current directory and allows to change
> it
> Not implemented :
> - GlobalsExplorer: shows globals() list with some properties for 
> each global (e.g. value for int or float, min and max values for arrays, 
> ...) and allows to open an appropriate GUI editor

> - and other widgets: FileExplorer, CodeEditor, ...
> 



Hi Pierre,

How can I contact you regarding contributing to the shell's code?

Eli

  
I'm very sorry, I completely missed all replies made to my post, I was 
too busy working on PyQtShell on my free time :)


Eli, I see that you've found out how to contact me.
The best way to contribute to the code is to use Mercurial, either by 
creating a clone of the read-only repository at 
http://source.pythonxy.com/PyQtShell/, or by downloading the source 
archive (on Google Code: http://code.google.com/p/pyqtshell/).
After that, you may update your local repository by doing a "Pull" from 
time to time. And if you want to contribute, send me your "diff" files 
by e-mail, I'll integrate them with great pleasure.


Frederic, I know about pyqonsole (and about Logilab too: we are working 
together on a project at my research center, CEA/DAM) and PyQtShell is - 
until now at least - intended to be only emulating the Python 
interpreter without emulating any kind of terminal (which is a 
limitation but it has the advantage to simplify greatly the code).


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


Re: [PyQt] QTextEdit: Is there a default text edit display?

2009-01-23 Thread David Boddie
On Fri Jan 23 20:06:04 GMT 2009, Marc Nations wrote:

> I need to use rich text in an application which appears to be utilized
> using QTextEdit. The edit options need to be available in the app. I
> assumed there was an option to pop them up in the widget or in the toolbar
> somewhere, like it does in QtDesigner. However I can't find anything to do
> that. I can build my own actions, of course, but would rather not if I
> don't need to. Is there a way to make the edit options available with
> default buttons?

QTextEdit doesn't expose any actions of its own, so you will have to create
your own. Take a look at the Application example supplied with PyQt (in the
examples/mainwindows/application directory) for code to do this.

Sadly, default icons for actions are apparently not a feature common to all
platforms, so you'll need to find a source of those. Perhaps someone reading
can suggest a good source of suitably-licensed icons.

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


Re: [PyQt] PyQt, QWebView, SVG Rendering Problem

2009-01-23 Thread David Boddie
On Fri Jan 23 12:47:29 GMT 2009, Atul Kulkarni wrote:

> I have a problem of rendering SVG Images in QWebView. The SVG Images are
> replaced with missing image icons ("?"). I am inserting a simple SVG image
> in an XHTML document.

This is a common problem with most Web browsers because SVG support is not
as widespread as it would ideally be. Does the page appear as it should do
in other browsers?

> Can any one help me resolve this problem. I would really appreciate any
> help or direction.
>
> My System and File details as follows:
> OS - Windows XP
> Python 2.5
> PyQt4.4.3 with Qt4
> Using Qt Designer 4.4.1 Open Source Edition
> My PyQt4 plugins has imageformats with qsvg4.dll, qsvgd4.dll

I don't think that Qt's support for SVG will make any difference here
because WebKit is doing the rendering. I don't know what features WebKit
has for embedding SVG 1.1 drawings into pages, but it seems to be able to
display them (Qt 4.4.3, PyQt 4.4.4, Linux) if you pass the URL to the
SVG itself to QWebView's load() method.

In fact, it seems that they can also be embedded into the page. The following
simplified XHTML markup worked for me:

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml";
  xmlns:svg="http://www.w3.org/2000/svg";
  xmlns:xlink="http://www.w3.org/1999/xlink"; lang="en">

  
  SVG Test


I am Object showing SVG

Your Browser does not support SVG




Initially, I was convinced it wasn't working because I couldn't see the
picture immediately below the "?" images, but scrolling down to the bottom
of the page revealed it.

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


[PyQt] QGraphicsScene/Item/View coordinates

2009-01-23 Thread Frédéric
Hi,

I would like to use QGraphicsXxx objects to create a widget which displays 
all pictures the motorized panohead will shoot, like this (done in PyGTK):

http://trac.gbiloba.org/papywizard/attachment/wiki/ScreenShots/shootDialog_mosaic_pc.png

I'm sure there is a simple way to avoid all computations I had to do with 
PyGTK, but I'm not yet familiar with this framework.

1) Is it possible to define my scene so its coordinates fit my shooting 
field of view? For example, if the user selects horizontal fov as [-90°, 
90°], and vertical fov as [-45°, 45°], should I instanciate the 
QGraphicsScene like this:

QGraphicsScene(-90, -45, 180, 90)

so if I add an item (say a rectangle) created by:

QGraphicsRectItem(-10, 10, 20, 20)

it will be centered in the scene?

2) I would like the previous scene always entirely visible in its view, 
whatever this view size is. How can I do that? Is it the purpose of the 
fitInView() method?

Thanks,

-- 
Frédéric

http://www.gbiloba.org

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


[PyQt] QTextEdit: Is there a default text edit display?

2009-01-23 Thread Marc Nations
Hi,

I need to use rich text in an application which appears to be utilized using
QTextEdit. The edit options need to be available in the app. I assumed there
was an option to pop them up in the widget or in the toolbar somewhere, like
it does in QtDesigner. However I can't find anything to do that. I can build
my own actions, of course, but would rather not if I don't need to. Is there
a way to make the edit options available with default buttons?

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

Re: [PyQt] Is it possible to use custom enums for custom widgets?

2009-01-23 Thread dboddie
On Fri Jan 23 12:53:13 GMT 2009, Umit Oztosun wrote:

> I am using custom widgets and plugins. I can define custom properties
> using pyqtProperty() using standart Qt types like int, bool, QColor
> etc. I wonder if it is possible to use custom types, i.e. when the
> widget is used in Qt Designer, I want a combobox to be displayed in
> the Property Editor for the custom property (just like, for example,
> focusPolicy QWidget property).
>
> Is there a way to do this?

It didn't seem to be possible the last time I tried to do this. I believe
that PyQt's meta-object support could be extended to allow custom enums
to be created in Python, but I don't know how much work it would be.

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


[PyQt] Re: QAbstractTableModel.data() implemented but get still

2009-01-23 Thread Michael Hammer
Michael Hammer  derhammer.net> writes:

> As I can't find any error, perhaps some of you can help.

Sry for making the noise. At this moment - after hours of searching I found that
a member variable was hiding the method ...

So long and thx for all the fish

Michael

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


[PyQt] Is it possible to use custom enums for custom widgets?

2009-01-23 Thread Umit Oztosun
Hello,

I am using custom widgets and plugins. I can define custom properties
using pyqtProperty() using standart Qt types like int, bool, QColor
etc. I wonder if it is possible to use custom types, i.e. when the
widget is used in Qt Designer, I want a combobox to be displayed in
the Property Editor for the custom property (just like, for example,
focusPolicy QWidget property).

Is there a way to do this?

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


[PyQt] PyQt, QWebView, SVG Rendering Problem

2009-01-23 Thread Atul Kulkarni

Hi,

I have a problem of rendering SVG Images in QWebView. The SVG Images are
replaced with missing image icons ("?"). I am inserting a simple SVG image
in an XHTML document.

Can any one help me resolve this problem. I would really appreciate any help
or direction.

My System and File details as follows:
OS - Windows XP
Python 2.5
PyQt4.4.3 with Qt4
Using Qt Designer 4.4.1 Open Source Edition
My PyQt4 plugins has imageformats with qsvg4.dll, qsvgd4.dll
http://www.nabble.com/file/p21623851/SVG_test.zip SVG_test.zip 

Thanks
Atul K.
-- 
View this message in context: 
http://www.nabble.com/PyQt%2C-QWebView%2C-SVG-Rendering-Problem-tp21623851p21623851.html
Sent from the PyQt mailing list archive at Nabble.com.

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


[PyQt] QAbstractTableModel.data() implemented but get still

2009-01-23 Thread Michael Hammer
Hi folks!

I've really tried a lot of different things - and I found one often proposed
solution to keep the instance of the model alive. As I can't find any error,
perhaps some of you can help.

The MainWindow where the model and view are referenced:

class MainWindow(QtGui.QMainWindow):
def __init__(self,parent=None):
QtGui.QWidget.__init__(self,parent)



self.model = table.TableModel([])
self.table_view = table.TableView()
self.table_view.setModel(self.model)
self.ui.gridlayout.addWidget(self.table_view, 0, 0, 1, 1)

And here is the model - I've indeed implemented the data() method:

class TableModel(QtCore.QAbstractTableModel):
def __init__(self,header,parent=None):
QtCore.QAbstractTableModel.__init__(self,parent)
self.header = ['a','b','c']
self.data = [['y','test1'],['n','test2'],['y','test3']]

def columnCount(self,parent):
return len(self.header)

def rowCount(self,parent):
return len(self.data)

def headerData(self, col, orientation, role):
 if ( orientation == QtCore.Qt.Horizontal and 
 role == QtCore.Qt.DisplayRole ):
   return QtCore.QVariant(self.header[col])
return QtCore.QVariant()

def data(self, index, role):
if not index.isValid():
return QVariant()
elif role != Qt.DisplayRole:
return QVariant()
return QVariant(self.data[index.row()][index.column()])

and there is some view to it:

class TableView(QtGui.QTableView):
def __init__(self,parent=None):
QtGui.QTableView.__init__(self,parent)

but I still get the error:

NotImplementedError: QAbstractTableModel.data() is abstract and must be 
overridden

Thx for any hint, greets

Michael


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