Tony Peña | 1 Oct 08:31 2011
Picon

Print with PyQt4 at Windows

Hi i need to devel an app ...
and i guess i have all about develop with python + qt4 + use qtsql for the backend of database, a little designer but...
how can i use data stored to print at Windows Printer?...
exist some like QuickReport for Delphi?  but for PyQt4? or some widget or module ...

http://delphiallimite.blogspot.com/2009/01/creacin-de-informes-con-quickreport-i.html

please just take a look the image.. to can see my question...

i make son googles research and i only can get to make a PDF with QPrinter... but how can i designe the page . and setting the values into QPrint?.. because i want to some template to can draw some lines and set some values getting from database.. like link above

any suggest / ideas?


--
Antonio Peña
Secure email with PGP 0x8B021001 available at http://pgp.mit.edu
Fingerprint: 74E6 2974 B090 366D CE71  7BB2 6476 FA09 8B02 1001

<div><p>Hi i need to devel an app ... <br>and i guess i have all about develop with python + qt4 + use qtsql for the backend of database, a little designer but...<br>how can i use data stored to print at Windows Printer?...<br>exist some like QuickReport for Delphi?&nbsp; but for PyQt4? or some widget or module ...<br><br><a href="http://delphiallimite.blogspot.com/2009/01/creacin-de-informes-con-quickreport-i.html">http://delphiallimite.blogspot.com/2009/01/creacin-de-informes-con-quickreport-i.html</a><br><br>please just take a look the image.. to can see my question...<br><br>i make son googles research and i only can get to make a PDF with QPrinter... but how can i designe the page . and setting the values into QPrint?.. because i want to some template to can draw some lines and set some values getting from database.. like link above<br><br>any suggest / ideas?<br><br clear="all"><br>-- <br>Antonio Pe<span>&ntilde;</span>a<span></span><br>Secure email with PGP 0x8B021001 available at <a href="http://pgp.mit.edu" target="_blank">http://pgp.mit.edu</a><br>
Fingerprint: 74E6 2974 B090 366D CE71&nbsp; 7BB2 6476 FA09 8B02 1001<br></p></div>
Phil Thompson | 1 Oct 11:04 2011

Re: QMenu.setTitle on OS X

On Fri, 30 Sep 2011 16:52:18 -0500, John Wiggins <jwiggins <at> enthought.com>
wrote:
> Hello,
> I've run into some strange behavior with QMenu's setTitle function
> failing on OS X, but only when called on the Help menu. Here's what
> I'm running:
> OS X 10.5.8; Qt 4.5.3(Carbon); PyQt 4.6; sip 4.9.3
> If you run the attached program, select the "Change menu titles" item
> in the Options menu and note that Help menu title will not change.
> So I guess my questions are: Has anybody else run into this and found
> a workaround? Is it still happening in newer versions of Qt/OS X? Is
> this a Qt bug or a Carbon bug?
> 
> - John

Works fine for me with current versions of everything.

Phil
Henning Schröder | 1 Oct 13:03 2011
Picon

Small terminal/console with vt100 emulation

Hello,
because pyqonsole only works with Qt3 and porting to Qt4 looks
complicated, I used the vt100 implementation of AjaxTerm and created a
PyQt4 widget for it.
Now I can embed a shell in my Linux applications. If anyone else is
interested in such a thing you will find the current version at
http://www.henning-schroeder.de/pyqterm.tgz

Regards
Henning
Detlev Offenbach | 2 Oct 13:53 2011
Picon

ANN: eric 4.4.18 released

Hi,

I just uploaded eric 4.4.x. It is a maintenance release fixing some bugs. It 
is available via the eric web site.

http://eric-ide.python-projects.org/index.html

Regards,
Detlev
-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
--

-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
Detlev Offenbach | 2 Oct 13:54 2011
Picon

ANN: eric 5.1.6 released

Hi,

I just uploaded eric 5.1.6. It is a maintenance release fixing some bugs. It 
is available via the eric web site.

http://eric-ide.python-projects.org/index.html

Regards,
Detlev
--

-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
Detlev Offenbach | 2 Oct 13:56 2011
Picon

ANN: eric 4.4.18 released

Hi,

I just uploaded eric 4.4.18. It is a maintenance release fixing some bugs. It 
is available via the eric web site.

http://eric-ide.python-projects.org/index.html

Regards,
Detlev
--

-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
Mark Mordeca | 3 Oct 15:22 2011
Picon

Can't insert Nulls Using QSqlQuery.execBatch

Greetings,

Using PyQt, I am having a problem inserting Nulls into a MySql table using the execBatch() method of QSqlQuery. From the documentation, a null QVariant (i.e. QVariant(QVariant.Double)) represents a Null when inserting.  When doing a regular query.exec_ it does actually insert Nulls, however when I do a query.execBatch(), zeros get inserted, not Nulls.

query.prepare(INSERT INTO `table` VALUES (?, ?))

var1=[1.0, QVariant(QVariant.Double)]
var2=[QVariant(QVariant.Double), 32.6]

query.addBindValue(QVariant(var1))
query.addBindValue(QVariant(var2))
query.execBatch()

With the above code, I would expect this to be inserted (Nulls should appear where QVariant objects in the lists are):

1.0  Null
Null 32.6

Instead what actually gets inserted is:

1.0 0
0   32.6

If I were to insert this line by line using just regular exec_ it would work, but I would rather use execBatch as I have many rows to insert at once (above is just an example). I have tried making every item in the lists a QVariant, whether Null or not, but I still get zeros, and I cannot pass in anything other than a QVariant to addBindValue (which I why I wrap the list in one when I call the method).

Any help would be greatly appreciated. Thank you.

Mark

 

<div><div class="WordSection1">
<p class="MsoNormal"><span>Greetings,</span></p>
<p class="MsoNormal"><span>Using PyQt, I am having a problem inserting Nulls into a MySql table using the execBatch() method of QSqlQuery. From the documentation, a null QVariant (i.e. QVariant(QVariant.Double)) represents a Null when inserting.&nbsp; When doing a regular query.exec_ it does actually insert Nulls, however when I do a query.execBatch(), zeros get inserted, not Nulls.</span></p>
<p class="MsoNormal"><span>query.prepare(INSERT INTO `table` VALUES (?, ?))<br><br>var1=[1.0, QVariant(QVariant.Double)]<br>var2=[QVariant(QVariant.Double), 32.6]<br><br>query.addBindValue(QVariant(var1))<br>query.addBindValue(QVariant(var2))<br>query.execBatch()</span></p>
<p class="MsoNormal"><span>With the above code, I would expect this to be inserted (Nulls should appear where QVariant objects in the lists are): </span></p>
<p class="MsoNormal"><span>1.0 &nbsp;Null<br>Null 32.6</span></p>
<p class="MsoNormal"><span>Instead what actually gets inserted is:</span></p>
<p class="MsoNormal"><span>1.0 0<br>0 &nbsp; 32.6</span></p>
<p class="MsoNormal"><span>If I were to insert this line by line using just regular exec_ it would work, but I would rather use execBatch as I have many rows to insert at once (above is just an example). I have tried making every item in the lists a QVariant, whether Null or not, but I still get zeros, and I cannot pass in anything other than a QVariant to addBindValue (which I why I wrap the list in one when I call the method).</span></p>
<p class="MsoNormal"><span>Any help would be greatly appreciated. Thank you.</span></p>
<p class="MsoNormal"><span>Mark</span></p>
<p class="MsoNormal">&nbsp;</p>
</div></div>
Nathan Hüsken | 3 Oct 15:33 2011
Picon

Drag and Drop from one list into another with Model/View

Hi,

I have an application with 2 listviews (and corresponding models). The
first list view lists items. The second lists references to this items
(which can occure multiple times).

Now I want support drag and drop such that items from the first list
viewcan be dropped in the second.

So I try enable drag and drop by doing the following:
In the main window:

    self.ui.firstListView.setDragEnabled(True)
    self.ui.secondListView.setAcceptDrops(True)

now for the model of the first ListView:

    class FirstModel(QtCore.QAbstractListModel):
      ...
      def flags(self, index):
        return QtCore.QAbstractListModel.flags(self, index) |
QtCore.Qt.ItemIsDragEnabled
      def mimeTypes(self):
        return ["application/vnd.text.list"]

And for the second:

    class SecondModel(QtCore.QAbstractListModel):
      ...
      def mimeTypes(self):
        return ["application/vnd.text.list"]
      def dropMimeData(self, data, action, row, column, parent = None):
        print "dropMimeData"

Running the application I can drag items from the first listview, but I
can not drop it into the second (dropMimeData is never called).
What am I missing here?

Also:
As soon as I start dragging items, I get:
TypeError: invalid result type from FirstModel.rowCount()

rowCount returns an Int. Why do I get this message?

Thanks!
John Wiggins | 3 Oct 17:31 2011

Re: QMenu.setTitle on OS X

Thanks for checking. Is it safe to assume this was a bug in Qt that
was fixed sometime between 4.5.3 and 4.7.x?
- John

On Sat, Oct 1, 2011 at 4:04 AM, Phil Thompson
<phil <at> riverbankcomputing.com> wrote:
> On Fri, 30 Sep 2011 16:52:18 -0500, John Wiggins <jwiggins <at> enthought.com>
> wrote:
>> Hello,
>> I've run into some strange behavior with QMenu's setTitle function
>> failing on OS X, but only when called on the Help menu. Here's what
>> I'm running:
>> OS X 10.5.8; Qt 4.5.3(Carbon); PyQt 4.6; sip 4.9.3
>> If you run the attached program, select the "Change menu titles" item
>> in the Options menu and note that Help menu title will not change.
>> So I guess my questions are: Has anybody else run into this and found
>> a workaround? Is it still happening in newer versions of Qt/OS X? Is
>> this a Qt bug or a Carbon bug?
>>
>> - John
>
> Works fine for me with current versions of everything.
>
> Phil
>
Phil Thompson | 3 Oct 17:57 2011

Re: QMenu.setTitle on OS X

On Mon, 3 Oct 2011 10:31:59 -0500, John Wiggins <jwiggins <at> enthought.com>
wrote:
> Thanks for checking. Is it safe to assume this was a bug in Qt that
> was fixed sometime between 4.5.3 and 4.7.x?
> - John

Probably. It certainly wasn't a PyQt change.

Phil

> On Sat, Oct 1, 2011 at 4:04 AM, Phil Thompson
> <phil <at> riverbankcomputing.com> wrote:
>> On Fri, 30 Sep 2011 16:52:18 -0500, John Wiggins
<jwiggins <at> enthought.com>
>> wrote:
>>> Hello,
>>> I've run into some strange behavior with QMenu's setTitle function
>>> failing on OS X, but only when called on the Help menu. Here's what
>>> I'm running:
>>> OS X 10.5.8; Qt 4.5.3(Carbon); PyQt 4.6; sip 4.9.3
>>> If you run the attached program, select the "Change menu titles" item
>>> in the Options menu and note that Help menu title will not change.
>>> So I guess my questions are: Has anybody else run into this and found
>>> a workaround? Is it still happening in newer versions of Qt/OS X? Is
>>> this a Qt bug or a Carbon bug?
>>>
>>> - John
>>
>> Works fine for me with current versions of everything.
>>
>> Phil
>>
> _______________________________________________
> PyQt mailing list    PyQt <at> riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Gmane