void WidgetSizeHelper::setDefaultFontSize(QWidget* pWidget) { // we get all of pWidget's children QObjectList children = pWidget->children(); // for each child for ( int i = 0; i < children.length(); i++ ) { /* * we change its font size if it is of one of those types * * - QLabel * - QLineEdit * - QRadioButton * - QGroupBox * - QCheckBox * - QStatusBar */ QWidget* pChild = static_cast<QWidget*> ( children.at(i) ); if ( qobject_cast<QLabel*>(pChild) != NULL || qobject_cast<QLineEdit*>(pChild) != NULL || qobject_cast<QRadioButton*>(pChild) != NULL || qobject_cast<QGroupBox*>(pChild) != NULL || qobject_cast<QCheckBox*>(pChild) != NULL || qobject_cast<QStatusBar*>(pChild) != NULL ) { QFont lFont = pChild->font(); lFont.setPointSize(Constants::MAC_FONT_SIZE); pChild->setFont(lFont); } // and scan it, if it has children if ( ! pChild->children().isEmpty() ) { setDefaultFontSize( pChild ); } } }
void VCSlider::setupLookAndFeel(qreal pixelDensity, int page) { setPage(page); setDefaultFontSize(pixelDensity * 3.5); setBackgroundColor(QColor("#444")); }
void VCCueList::setupLookAndFeel(qreal pixelDensity, int page) { setPage(page); setDefaultFontSize(pixelDensity * 3.5); }