Group box setFont() oddness
Unsolved
General and Desktop
-
ui file:
QGroupBox *registerAndStack; QVBoxLayout *verticalLayout_8; QFrame *frame_1; QVBoxLayout *verticalLayout_9; QLabel *openLights; QLabel *openDarks; QLabel *openFlats; QLabel *openDarkFlats; QLabel *openBias;
my code:
QFont font(ui->registerAndStack->font()); QFont bold{ font }; bold.setWeight(QFont::Bold); ui->registerAndStack->setFont(bold); ui->frame_1->setFont(font); /* ui->openLights->setFont(font); ui->openDarks->setFont(font); ui->openFlats->setFont(font); ui->openDarkFlats->setFont(font); ui->openBias->setFont(font);
result:
I also tried setting the font on each QLabel with the same result. The non-indented QLabels all ended up bold even though I explicitly set the font non-bold. The only distinction about the non-bold lines is they have an explicit stylesheet set "margin-left: 30", while the bolded lines have no stylesheet.
Hmmmm... The plot thickens: I moved that code from the ctor to an mf (onInitDialog) that I call from showEvent, now that groupbox is displayed as I expected, but this one:
ui->processing->setFont(bold); ui->openPicture->setFont(font); ui->copyPicture->setFont(font); ui->doStarMask->setFont(font); ui->savePicture->setFont(font);
still displays in bold, but this one:
ui->options->setFont(bold); ui->settings->setFont(font); ui->ddpSettings->setFont(font); ui->loadSettings->setFont(font); ui->saveSettings->setFont(font); ui->recommendedSettings->setFont(font); ui->about->setFont(font); ui->help->setFont(font);
doesn't!!!
Additional data: the Options groupbox has a stylesheet: background-color: lightcyan, but the processing groupbox does not.
Baffled
David