[PyQt] QTextBrowser.append(mytext) ??

2007-12-23 Thread Jochen Georges
Hello,

I found an example with the following line:

self.browser = QTextBrowser()
#some code
self.browser.append(blabla)

why does that work?
nor i did find a QTextBrowser - method append in the qt-assistant,
neither in the pyqt-class reference. 
(http://www.riverbankcomputing.com/Docs/PyQt4/html/qtextbrowser.html)

thanks a lot for any hint.

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


Re: [PyQt] QTextBrowser.append(mytext) ??

2007-12-23 Thread Phil Thompson
On Sunday 23 December 2007, Jochen Georges wrote:
 Hello,

 I found an example with the following line:

 self.browser = QTextBrowser()
 #some code
 self.browser.append(blabla)

 why does that work?
 nor i did find a QTextBrowser - method append in the qt-assistant,
 neither in the pyqt-class reference.
 (http://www.riverbankcomputing.com/Docs/PyQt4/html/qtextbrowser.html)

 thanks a lot for any hint.

Check QTextBrowser's super classes.

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


Re: [PyQt] qtable data source

2007-12-23 Thread Sibylle Koczian
Am Sonntag, 23. Dezember 2007 06:50:44 schrieb nishith datta:
 hi all,
   I wish to show the output of my sql query in  a table.
   I am unable to do that.
   Can someone point out some resource / example or documentation to help me
 out. thanks in advance

http://doc.trolltech.com/4.0/sql.html

Is this no good? If no, why not? Or, of course, the book: Mark Summerfield, 
Rapid GUI programming with Python and Qt, Prentice Hall 2007, ISBN 
0-13-235418-7.

Sibylle

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


Re: [PyQt] Memory leak when using QAbstractTableModel

2007-12-23 Thread Noam Raphael
2007/12/23, Phil Thompson [EMAIL PROTECTED]:
  Is there anything that can be done?

 Not if I can't reproduce the problem. I'm using current SIP and PyQt snapshots
 and Qt 4.3.3.

It also works for me on windows, using the latest binary. But have you
tried it on linux? I'm using ubuntu 7.10, which uses gcc 4.1.3.

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


Re: [PyQt] Memory leak when using QAbstractTableModel

2007-12-23 Thread Andreas Pakulat
On 23.12.07 13:59:30, Noam Raphael wrote:
 2007/12/23, Phil Thompson [EMAIL PROTECTED]:
   Is there anything that can be done?
 
  Not if I can't reproduce the problem. I'm using current SIP and PyQt 
  snapshots
  and Qt 4.3.3.
 
 It also works for me on windows, using the latest binary. But have you
 tried it on linux? I'm using ubuntu 7.10, which uses gcc 4.1.3.

Works fine here on Debian unstable, with a bit older PyQt4(I think from
November) and Qt4.3.2. Yes the memory usage increases when starting to
scroll, but not that much. After scrolling from one end to the other on
both bars the python process is still under 30MB of res-memory according
to top.

Andreas

-- 
Time to be aggressive.  Go after a tattooed Virgo.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Memory leak when using QAbstractTableModel

2007-12-23 Thread Phil Thompson
On Sunday 23 December 2007, Noam Raphael wrote:
 2007/12/23, Phil Thompson [EMAIL PROTECTED]:
   Is there anything that can be done?
 
  Not if I can't reproduce the problem. I'm using current SIP and PyQt
  snapshots and Qt 4.3.3.

 It also works for me on windows, using the latest binary. But have you
 tried it on linux?

Yes.

 I'm using ubuntu 7.10, which uses gcc 4.1.3. 

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


Re: [PyQt] Memory leak when using QAbstractTableModel

2007-12-23 Thread Noam Raphael
2007/12/23, Andreas Pakulat [EMAIL PROTECTED]:
 Works fine here on Debian unstable, with a bit older PyQt4(I think from
 November) and Qt4.3.2. Yes the memory usage increases when starting to
 scroll, but not that much. After scrolling from one end to the other on
 both bars the python process is still under 30MB of res-memory according
 to top.

 Andreas

If you enlarge the window and scroll slowly, does it increase any
more? I think that every displayed cell leaks something, so if you
display more cells, you leak more memory.

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


Re: [PyQt] Memory leak when using QAbstractTableModel

2007-12-23 Thread Phil Thompson
On Sunday 23 December 2007, Noam Raphael wrote:
 2007/12/23, Andreas Pakulat [EMAIL PROTECTED]:
  Works fine here on Debian unstable, with a bit older PyQt4(I think from
  November) and Qt4.3.2. Yes the memory usage increases when starting to
  scroll, but not that much. After scrolling from one end to the other on
  both bars the python process is still under 30MB of res-memory according
  to top.
 
  Andreas

 If you enlarge the window and scroll slowly, does it increase any
 more? I think that every displayed cell leaks something, so if you
 display more cells, you leak more memory.

I see that behaviour, but a C++ version behaves in the same way so it's not a 
PyQt problem.

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


[PyQt] Re: drawComplexControl

2007-12-23 Thread Attila Olah
Still couldn't get it working... Any tutorials on this? Unfortunately
I'm unable tu buy the book for now, maybe next year...
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Fwd: drawComplexControl

2007-12-23 Thread Oleg Klimov
On Sun, 2007-12-23 at 06:18 +0100, Attila Olah wrote:

 How do I draw e.g. a tool box in a QTreeView? I tried override the
 model's delegate's paint() function, but it didn't work. I'd like to
 do something like this:
 http://doc.trolltech.com/4.3/qstyle.html#drawComplexControl
 in PyQt4. Is it the right approach?

Approach... Well, I'd suggest you re-think your approach a bit. Anything
non-standard is

 - Yes, non standard to user which have to learn how it works

 - You're somethat likely to fail to meet quality plank of the rest of
Qt (mouse events, prelight, styles, resizing etc). Think of how do you
apply a different style to your application, if you have lots of custom
drawing.

 - As you can see, many widgets use QStyle to draw themselves, it's
larger design than you probably want.

 - You may encounter conflicts with Tree widget drawing.

 - You may end up with larger and harder-to-debug, harder-to-support
code (rather then doing the standard way).

Me thinks you have to have good reasons to do custom drawing,

  Oleg


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


Re: [PyQt] qtable data source

2007-12-23 Thread nishith datta
Ok ,
  I went throught he documentation before and yet again.
  I can't figure out what the hell is wrong with this code ;-
  import sys
from PyQt4 import QtGui, QtSql
   
  db = QtSql.QSqlDatabase.addDatabase(QPSQL)
db.setHostName(localhost)
db.setPort(5432)
db.setDatabaseName(test)
db.setUserName(root)
db.setPassword(mypass)
print db.open()
   
  Always returns a false , however with psycopg2 , I am able to execute query 
too. 
  Can someone help me out with understanding whatz wrong with the code fragment 
above ?
  thanks
  nishith

   
-
Never miss a thing.   Make Yahoo your homepage.___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] qtable data source

2007-12-23 Thread Andreas Pakulat
On 23.12.07 11:05:18, nishith datta wrote:
 Ok ,
   I went throught he documentation before and yet again.
   I can't figure out what the hell is wrong with this code ;-
   import sys
 from PyQt4 import QtGui, QtSql

   db = QtSql.QSqlDatabase.addDatabase(QPSQL)
 db.setHostName(localhost)
 db.setPort(5432)
 db.setDatabaseName(test)
 db.setUserName(root)
 db.setPassword(mypass)
 print db.open()

   Always returns a false , however with psycopg2 , I am able to execute query 
 too. 

You don't create a QApplication or QCoreApplication, thats needed before
doing any sql-stuff with Qt. It works fine over here.

Andreas

-- 
Don't go surfing in South Dakota for a while.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt