Esempio n. 1
0
QFontInfo QWidgetProto::fontInfo() const
{
  QWidget *item = qscriptvalue_cast<QWidget*>(thisObject());
  if (item)
    return item->fontInfo();
  return QFontInfo(QApplication::font());
}
void FontHelper::SetFont(QWidget * w)
{
#ifndef Q_OS_MAC
	QObjectList widgetList = w->children();
	for (int k = 0, sz = widgetList.size(); k < sz; ++k)
	{
		QWidget * tw = dynamic_cast<QWidget*>(widgetList[k]);
		if (tw)
		{
			int pt = tw->fontInfo().pointSize();
			bool bold = tw->fontInfo().bold();
			tw->setFont(FontHelper::pt(pt, bold));
			SetFont(tw);
		}
	}
#endif		// Q_OS_MAC
}