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>

Public Member Functions | |
| FontPreview (QString fontName=QString::null, QWidget *parent=0, ScribusDoc *doc=0) | |
| Create Font Preview window,. | |
| ~FontPreview () | |
| QString | getCurrentFont () |
| Get the current selected font name. | |
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(). | |
| virtual void | searchButton_clicked () |
| The same as searchEdit_textChanged(). | |
| 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 () |
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. | |
Protected Attributes | |
| QPixmap | ttfFont |
| Pixmaps for each font type. | |
| QPixmap | otfFont |
| QPixmap | psFont |
| QPixmap | okIcon |
| QString | defaultStr |
| Default "blue quartz" text. | |
| PrefsContext * | prefs |
| Configuration structure. | |
| uint | xsize |
| window size | |
| uint | ysize |
| SampleItem * | sampleItem |
| Sample text frame to render the preview. | |
| FontListModel * | fontModel |
| Store fonts in the Qt4 MVC model part. | |
| QSortFilterProxyModel * | proxyModel |
| A model for searching in the font set. see searchButton_clicked() for more. | |
| ScribusDoc * | m_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.Definition at line 25 of file fontpreview.h.
Constructor & Destructor Documentation
| FontPreview::FontPreview | ( | QString | fontName = QString::null, |
|
| QWidget * | parent = 0, |
|||
| ScribusDoc * | doc = 0 | |||
| ) |
Create Font Preview window,.
- Parameters:
-
fontName Optional name of the font to init/select on start.
Definition at line 21 of file fontpreview.cpp.
References PrefsManager::appPrefs, cancelButton_clicked(), ParagraphStyle::charStyle(), Selection::count(), ScribusDoc::currentStyle, defaultStr, toolPrefs::defFont, displayButton_clicked(), CharStyle::font, fontList_currentChanged(), fontModel, PrefsContext::get(), PrefsFile::getPluginContext(), PrefsContext::getUInt(), PrefsManager::instance(), languageChange(), loadIcon(), m_Doc, ScribusDoc::m_Selection, prefs, PrefsManager::prefsFile, proxyModel, resetDisplayButton_clicked(), sampleItem, searchButton_clicked(), searchEdit_textChanged(), sizeSpin_valueChanged(), ApplicationPrefs::toolSettings, tr(), xsize, and ysize.
| FontPreview::~FontPreview | ( | ) |
Definition at line 92 of file fontpreview.cpp.
References SampleItem::cleanupTemporary(), prefs, sampleItem, and PrefsContext::set().
Member Function Documentation
| QString FontPreview::getCurrentFont | ( | ) |
Get the current selected font name.
- Return values:
-
QString the font name.
Definition at line 160 of file fontpreview.cpp.
References fontModel, FontListModel::nameForIndex(), and proxyModel.
Referenced by paintSample(), and FontPreviewPlugin::run().
| void FontPreview::paintSample | ( | ) | [protected] |
Create a pixmap sample with font preview. With GUI oprions.
Definition at line 118 of file fontpreview.cpp.
References allowSample(), getCurrentFont(), SampleItem::getSample(), sampleItem, SampleItem::setFont(), and SampleItem::setFontSize().
Referenced by displayButton_clicked(), fontList_currentChanged(), and sizeSpin_valueChanged().
| 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:
-
bool true if you can paint sample safely.
Definition at line 110 of file fontpreview.cpp.
References fontModel, and FontListModel::rowCount().
Referenced by paintSample().
| void FontPreview::languageChange | ( | ) | [protected, virtual, slot] |
Sets the strings of the subwidgets using the current language.
Definition at line 102 of file fontpreview.cpp.
References tr().
Referenced by FontPreview().
| void FontPreview::searchEdit_textChanged | ( | const QString & | s | ) | [protected, virtual, slot] |
Called after each text change. It calls paintSample().
- Parameters:
-
s non-used string
Definition at line 136 of file fontpreview.cpp.
References searchButton_clicked().
Referenced by FontPreview().
| void FontPreview::searchButton_clicked | ( | ) | [protected, virtual, slot] |
The same as searchEdit_textChanged().
Definition at line 141 of file fontpreview.cpp.
References proxyModel.
Referenced by FontPreview(), and searchEdit_textChanged().
| void FontPreview::fontList_currentChanged | ( | const QModelIndex & | , | |
| const QModelIndex & | ||||
| ) | [protected, slot] |
Slot to handle row changes in the table view.
Definition at line 190 of file fontpreview.cpp.
References paintSample().
Referenced by FontPreview().
| void FontPreview::displayButton_clicked | ( | ) | [protected, slot] |
Setup the preview phrase instead of "blue quartz...".
Definition at line 168 of file fontpreview.cpp.
References paintSample(), sampleItem, and SampleItem::setText().
Referenced by FontPreview(), and resetDisplayButton_clicked().
| void FontPreview::resetDisplayButton_clicked | ( | ) | [protected, slot] |
Reset the sample phrase to the standard "blue quartz".
Definition at line 179 of file fontpreview.cpp.
References defaultStr, and displayButton_clicked().
Referenced by FontPreview().
| void FontPreview::sizeSpin_valueChanged | ( | int | ) | [protected, slot] |
Font size change.
Definition at line 185 of file fontpreview.cpp.
References paintSample().
Referenced by FontPreview().
| void FontPreview::cancelButton_clicked | ( | ) | [protected, slot] |
Member Data Documentation
QPixmap FontPreview::ttfFont [protected] |
QPixmap FontPreview::otfFont [protected] |
Definition at line 43 of file fontpreview.h.
QPixmap FontPreview::psFont [protected] |
Definition at line 44 of file fontpreview.h.
QPixmap FontPreview::okIcon [protected] |
Definition at line 45 of file fontpreview.h.
QString FontPreview::defaultStr [protected] |
Default "blue quartz" text.
Definition at line 47 of file fontpreview.h.
Referenced by FontPreview(), and resetDisplayButton_clicked().
PrefsContext* FontPreview::prefs [protected] |
Configuration structure.
Definition at line 49 of file fontpreview.h.
Referenced by FontPreview(), and ~FontPreview().
uint FontPreview::xsize [protected] |
uint FontPreview::ysize [protected] |
SampleItem* FontPreview::sampleItem [protected] |
Sample text frame to render the preview.
Definition at line 55 of file fontpreview.h.
Referenced by displayButton_clicked(), FontPreview(), paintSample(), and ~FontPreview().
FontListModel* FontPreview::fontModel [protected] |
Store fonts in the Qt4 MVC model part.
Definition at line 58 of file fontpreview.h.
Referenced by allowSample(), FontPreview(), and getCurrentFont().
QSortFilterProxyModel* FontPreview::proxyModel [protected] |
A model for searching in the font set. see searchButton_clicked() for more.
Definition at line 62 of file fontpreview.h.
Referenced by FontPreview(), getCurrentFont(), and searchButton_clicked().
ScribusDoc* FontPreview::m_Doc [protected] |
The documentation for this class was generated from the following files:
