StanfordCPPLib
Static Public Member Functions | List of all members
GFontChooser Class Reference

The GFontChooser class contains static methods for popping up font-choosing dialog boxes that allow the user to select a font family, size, and style. More...

#include "gfontchooser.h"

Static Public Member Functions

static string showDialog(string title="", string initialFont="")
 Pops up a font chooser dialog with the given top title text and the given initially selected font. More...
 
static string showDialog(GWindow *parent, string title="", string initialFont="")
 Pops up a font chooser dialog with the given top title text and the given initially selected font. More...
 
static string showDialog(QWidget* parent, string title="", string initialFont="")
 Pops up a font chooser dialog with the given top title text and the given initially selected font. More...
 

Detailed Description

The GFontChooser class contains static methods for popping up font-choosing dialog boxes that allow the user to select a font family, size, and style.

Each method blocks until the font is chosen and the dialog is closed, returning the font the user chose (or an empty string if the user canceled).

Fonts are represented as font strings such as "Helvetica-12-Bold" or "Times New Roman-14".

See the GFont class for more information about fonts and font strings.

Member Function Documentation

◆ showDialog() [1/3]

string showDialog ( string   title = "",
string   initialFont = "" 
)
static

Pops up a font chooser dialog with the given top title text and the given initially selected font.

All arguments are optional.

Parameters
initialFonta font string such as "Helvetica-12-Bold".

◆ showDialog() [2/3]

string showDialog ( GWindow parent,
string   title = "",
string   initialFont = "" 
)
static

Pops up a font chooser dialog with the given top title text and the given initially selected font.

All arguments are optional.

Parameters
initialFonta font string such as "Helvetica-12-Bold".

◆ showDialog() [3/3]

string showDialog ( QWidget*   parent,
string   title = "",
string   initialFont = "" 
)
static

Pops up a font chooser dialog with the given top title text and the given initially selected font.

All arguments are optional.

Parameters
initialFonta font string such as "Helvetica-12-Bold".