Re: [PyQt] Rich text in buttons

2009-11-21 Thread Richard A. Litherland

On Sat, 21 Nov 2009, Baz Walter wrote:


Richard A. Litherland wrote:
I'm very new to this, so I apologize if this question has been asked 1000 
times before. The text property of QAbstractButton doesn't recognize HTML 
markup, but the developers of KCalc, at least, have managed to work around 
this. I can't figure out how. Does anybody know?


well, i suppose the kde developers do :)

so why not have a look at the kcalc source code?

http://api.kde.org/4.3-api/kdeutils-apidocs/kcalc/html/kcalc__button_8cpp_source.html



I had, but was unable to find the relevant code. I've since discovered 
that it's in an override of QPushButton's paintEvent method. Now all I 
have to do is work out what's going on there... The author of the code 
doesn't seem entirely happy with the amount of work needed, since he or 
she includes the comment


  // rant: Qt4 needs QSimpleRichText, dammit!

Sorry for wasting your time; I should have looked harder before posting.

Rick L.
--
R.A. Litherland: lit...@math.lsu.edu
Web page: http://www.math.lsu.edu/~lither/
Other web page: http://www.orangeclawhammer.net/
Charity is a cold grey loveless thing. -- Clement Attlee
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Rich text in buttons

2009-11-21 Thread Baz Walter

Richard A. Litherland wrote:

On Sat, 21 Nov 2009, Baz Walter wrote:


Richard A. Litherland wrote:
I'm very new to this, so I apologize if this question has been asked 
1000 times before. The text property of QAbstractButton doesn't 
recognize HTML markup, but the developers of KCalc, at least, have 
managed to work around this. I can't figure out how. Does anybody know?


well, i suppose the kde developers do :)

so why not have a look at the kcalc source code?

http://api.kde.org/4.3-api/kdeutils-apidocs/kcalc/html/kcalc__button_8cpp_source.html 





I had, but was unable to find the relevant code. I've since discovered 
that it's in an override of QPushButton's paintEvent method. Now all I 
have to do is work out what's going on there... The author of the code 
doesn't seem entirely happy with the amount of work needed, since he or 
she includes the comment


  // rant: Qt4 needs QSimpleRichText, dammit!


there doesn't appear to be much kde-specific stuff in there, so 
hopefully you should be able to port it more-or-less as is. if you can't 
get it working, please post what you've got and i'm sure someone will 
try to help you further (or perhaps suggest some other way to achieve 
what you want).



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


[PyQt] Rich text in buttons

2009-11-20 Thread Richard A. Litherland
I'm very new to this, so I apologize if this question has been asked 1000 
times before. The text property of QAbstractButton doesn't recognize HTML 
markup, but the developers of KCalc, at least, have managed to work around 
this. I can't figure out how. Does anybody know?


Rick L.
--
R.A. Litherland: lit...@math.lsu.edu
Web page: http://www.math.lsu.edu/~lither/
Other web page: http://www.orangeclawhammer.net/
Charity is a cold grey loveless thing. -- Clement Attlee
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt