Trolltech Home | Qtopia-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qtopia-interest Archive, October 2007
Changing pushbutton font size


Message 1 in thread

Hi.

I've got a few pushbuttons that I want to make quite large and have pretty
large text on them.  The application is for a child so the interface is a
bit different from what most people are usually used to.

While I can change the size of the PushButton just fine I've run into
several problems trying to scale up the text on the pushbutton.  I've tried
setFont(pushbutton) as well as creating a pixmap of the text.

So:
- Should setFont work on a QPushButton?
- If so, do I need to do a repaint or something to get it to work?
- is there a better way to do this?

Thanks for any feedback or directions you can provide.

Michael

Message 2 in thread

On Monday 15 October 2007 10:24, Michael van Strien wrote:
[snip]
> - Should setFont work on a QPushButton?
> - If so, do I need to do a repaint or something to get it to work?

Hmm, it should 'just work'. The following works for me:

QPushButton *pb = new QPushButton("Test");
QFont font = pb->font();
font.setPointSize(36);
pb->setFont(font);

Regards,
Michael

--
 [ signature omitted ]