PDA

View Full Version : Groupbox and child widget fonts?



silenuz
3rd December 2009, 13:19
How do I get the child widgets in a group-box to have a different font then the group-box in qt-creator? I have two group-boxes in a horiz layout, one has a tableWidget and the other multiple layouts and controls. After much fiddling I finally have the group-box with the multiple controls working properly however no matter what I do I can't seem to get the tablewidget to render with any font other then the parent groupboxes.

This problem is further complicated by the fact that when I go Tools->Form Editor->preview in qtcreator I get something totally different then when I build my project and execute it. by totally different I mean different layouts, size hints, fonts, etc....Does anyone know why this might be? Happens with qtcreator 1.2 and 1.3. Also why is the .ui file shown differently when in qtdesigner then in qtcreator design mode?

Also should mention the generated header file for the ui looks okay, also if I add the following code to my class constructor the font for the tablewidget is still the same as the font for the groupbox. Is this a known bug in Qt?



QFont font1;
font1.setPointSize(10);
font1.setUnderline(false);
tableWidgetResults->setFont(font1);

wysota
3rd December 2009, 13:49
Please provide a minimal compilable example reproducing the problem.

silenuz
3rd December 2009, 14:35
is attached along with screen-shots.

fanat9
3rd December 2009, 14:46
Hmmm, works for me.

See screenshot.