[Kde-bindings] QtRuby doesn't support QTextBrowser.setFontPointSize

Jon Doud grumpymayor at gmail.com
Wed Sep 21 17:54:48 UTC 2011

I have a project that I have built in Qt (C++) that I am porting to QtRuby.
I am using the same mainwindow.ui form for both projects.

In the QtRuby project, I cannot change the font size in the QTextBrowser.

The following method makes no change in the QTextBrowser.  I know it is
being called correctly because of the puts statements.

 def setFontSize(size)
puts size.to_f  # outputs the correct value
puts @ui.textNote.currentFont.pointSizeF  # outputs 11.0 regardless of size

font = @ui.textNote.currentFont
puts font.pointSizeF # outputs 11.0 always
font.pointSizeF = 32.4
puts font.pointSizeF # outputs 32.4
@ui.textNote.currentFont = font
p @ui.textNote.currentFont.pointSizeF # outputs 11.0 always

The following method also doesn't work as expected.  It opens a Font Dialog
and sets the font family correctly as well as bold, underline and italic,
but the font size never changes.

  def showFonts
    ok = Qt::Boolean.new
    font = Qt::FontDialog.getFont(ok, @ui.textNote.currentFont, self);

Any ideas?

- GrumpyMayor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20110921/cba90d84/attachment.html>

More information about the Kde-bindings mailing list