CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Slots | Signals | Public Member Functions | Protected Attributes | Properties | List of all members
ctkFontButton Class Reference

#include <Libs/Widgets/ctkFontButton.h>

Inheritance diagram for ctkFontButton:
Inheritance graph
[legend]
Collaboration diagram for ctkFontButton:
Collaboration graph
[legend]

Public Slots

void browseFont ()
 

Signals

void currentFontChanged (const QFont &)
 

Public Member Functions

 ctkFontButton (const QFont &currentFont, QWidget *parent=0)
 
 ctkFontButton (QWidget *parent=0)
 
QFont currentFont () const
 
QString fontTextFormat () const
 
void setCurrentFont (const QFont &newFont)
 Set/get the current font. More...
 
void setFontTextFormat (const QString &fontTextFormat)
 
virtual ~ctkFontButton ()
 Destructor. More...
 

Protected Attributes

QScopedPointer< ctkFontButtonPrivate > d_ptr
 

Properties

QFont currentFont
 Application QFont by default. More...
 
QString fontTextFormat
 

Detailed Description

Definition at line 33 of file ctkFontButton.h.

Constructor & Destructor Documentation

◆ ctkFontButton() [1/2]

ctkFontButton::ctkFontButton ( QWidget *  parent = 0)

Constructor Creates a default ctkFontButton initialized with QApplication font

◆ ctkFontButton() [2/2]

ctkFontButton::ctkFontButton ( const QFont &  currentFont,
QWidget *  parent = 0 
)

Constructor Creates a ctkFontButton with a given font

◆ ~ctkFontButton()

virtual ctkFontButton::~ctkFontButton ( )
virtual

Destructor.

Member Function Documentation

◆ browseFont

void ctkFontButton::browseFont ( )
slot

browse() opens a pop up where the user can select a new font. browse() is automatically called when the button is clicked.

◆ currentFont()

QFont ctkFontButton::currentFont ( ) const

◆ currentFontChanged

void ctkFontButton::currentFontChanged ( const QFont &  )
signal

Fired anytime the current font changed. Programatically or by the user via the file dialog that pop up when clicking on the button.

◆ fontTextFormat()

QString ctkFontButton::fontTextFormat ( ) const

Get the font text format

See also
fontTextFormat, setFontTextFormat()

◆ setCurrentFont()

void ctkFontButton::setCurrentFont ( const QFont &  newFont)

Set/get the current font.

◆ setFontTextFormat()

void ctkFontButton::setFontTextFormat ( const QString &  fontTextFormat)

Set the font text format

See also
fontTextFormat, fontTextFormat()

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkFontButtonPrivate> ctkFontButton::d_ptr
protected

Definition at line 96 of file ctkFontButton.h.

Property Documentation

◆ currentFont

QFont ctkFontButton::currentFont
readwrite

Application QFont by default.

Definition at line 1 of file ctkFontButton.h.

◆ fontTextFormat

QString ctkFontButton::fontTextFormat
readwrite

This property holds the format of the text of the pushbutton. These expressions may be used in place of the current font:

  • fff family
  • sss pointSize with suffix "pt". e.g. "9pt"
  • ss pointSize with no suffix. e.g. "9"
  • www full name weight e.g. Bold (if font is bold)
  • ww weight. e.g. 50 (if font is normal)
  • biu 3 character string where the first character is 'b' if bold or - otherwise, the second character is 'i' if the font italic or - otherwise and the third characis is 'u' if the font is underline or '-' otherwise. e.g. "bi-" if the font is bold and italic but not underline
  • bbb 'bold' if bold, nothing otherwise
  • bb 'b' if bold, nothing otherwise
  • iii 'italic' if italic, nothing otherwise
  • ii 'i' if italic, nothing otherwise
  • uuu 'underline' if underline, nothing otherwise
  • uu 'u' if underline, nothing otherwise Note that the listing order matches the replacement order. fff-sss by default.

Definition at line 1 of file ctkFontButton.h.


The documentation for this class was generated from the following file: