Scribus
Open source desktop publishing at your fingertips
FontPreview Class Reference

Main window for "Font Preview" plugin. It's only gui. Constructs a FontPreview as a child of 'parent', with the name 'name' and widget flags set to 'f'. The dialog will by default be modeless, unless you set 'modal' to true to construct a modal dialog. More...

#include <fontpreview.h>

Inheritance diagram for FontPreview:
Collaboration diagram for FontPreview:

Public Member Functions

 FontPreview (QString fontName=QString::null, QWidget *parent=0, ScribusDoc *doc=0)
 Create Font Preview window,. More...
 
QString getCurrentFont ()
 Get the current selected font name. More...
 

Protected Slots

virtual void languageChange ()
 Sets the strings of the subwidgets using the current language.
 
virtual void searchEdit_textChanged (const QString &s)
 Called after each text change. It calls paintSample(). More...
 
void fontList_currentChanged (const QModelIndex &, const QModelIndex &)
 Slot to handle row changes in the table view.
 
void displayButton_clicked ()
 Setup the preview phrase instead of "blue quartz...".
 
void resetDisplayButton_clicked ()
 Reset the sample phrase to the standard "blue quartz".
 
void sizeSpin_valueChanged (int)
 Font size change.
 
void cancelButton_clicked ()
 
void setExtendedView (bool state)
 Show/hide "advanced" columns in the view.
 

Protected Member Functions

void paintSample ()
 Create a pixmap sample with font preview. With GUI oprions.
 
bool allowSample ()
 Check if is there any item in list to prevent crashes. It allows not to paint the sample if there could be memory leak. More...
 
void showEvent (QShowEvent *event)
 Paint sample on the dialog opening.
 
void resizeEvent (QResizeEvent *event)
 

Protected Attributes

QPixmap ttfFont
 Pixmaps for each font type.
 
QPixmap otfFont
 
QPixmap psFont
 
QPixmap okIcon
 
QString defaultStr
 Default "blue quartz" text.
 
PrefsContextprefs
 Configuration structure.
 
uint xsize
 window size
 
uint ysize
 
SampleItemsampleItem
 Sample text frame to render the preview.
 
FontListModelfontModel
 Store fonts in the Qt4 MVC model part.
 
QSortFilterProxyModel * proxyModel
 A model for searching in the font set. see searchEdit_textChanged() for more.
 
ScribusDocm_Doc
 

Detailed Description

Main window for "Font Preview" plugin. It's only gui. Constructs a FontPreview as a child of 'parent', with the name 'name' and widget flags set to 'f'. The dialog will by default be modeless, unless you set 'modal' to true to construct a modal dialog.

Constructor & Destructor Documentation

FontPreview::FontPreview ( QString  fontName = QString::null,
QWidget *  parent = 0,
ScribusDoc doc = 0 
)

Create Font Preview window,.

Parameters
fontNameOptional name of the font to init/select on start.

Member Function Documentation

bool FontPreview::allowSample ( )
protected

Check if is there any item in list to prevent crashes. It allows not to paint the sample if there could be memory leak.

Return values
booltrue if you can paint sample safely.
QString FontPreview::getCurrentFont ( )

Get the current selected font name.

Return values
QStringthe font name.
void FontPreview::searchEdit_textChanged ( const QString &  s)
protectedvirtualslot

Called after each text change. It calls paintSample().

Parameters
snon-used string

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