Unsolved QFontCombox not returning the font family
-
How do I make QFontComboBox to return a list of font family only but not the complete dialog pop-up with font style, point size and other style techniques(kerning, strikeout,underline). I'm doing something like this:
QFont Vizkit3DWidget::getFont()const { QFontComboBox *dialog = new QFontComboBox(); QFont font=dialog->currentFont(); return font.family(), } void Vizkit3DWidget::setFont(QFont font) { QFontComboBox *dialog = new QFontComboBox(); dialog->setCurrentFont(font); }
-
Hi and welcome to devnet,
If you want a list of the font families then why not just use QFontDatabase::families ?
-
@SGaist How do I set Kerning(),Strikeout,Underline() to disable in the above code since they are always called after the QFontComboBox constructor and even if set to disable, dialogbox still shows them.
-
@SGaist Actually I'm trying to set the selected QFont onto an osg::text3D node, setFont(), SetStyle(),SetCharactersize() ->extracting each of these seperatle from QFont applying them on text3D.
-
The code you show above does not much.
You should explain exactly what you are trying to achieve because you are talking about a dialog yet create a combo box that you don't even show.