Scribus
Open source desktop publishing at your fingertips
CharTableModel Class Reference

A model (MVC) to handle unicode characters map. It's a backend for CharTableView - its GUI representation. More...

#include <chartablemodel.h>

Inheritance diagram for CharTableModel:
Collaboration diagram for CharTableModel:

Public Slots

void appendUnicode (const QString &s, uint base=16)
 appends an unicode char into m_characters list. More...
 

Signals

void selectionChanged (QItemSelectionModel *model)
 Inform its view about internal selection changes. It's emitted everytime user adds an existing glyph to the CharClassDef list.
 
void rowAppended ()
 Emitted when there is a new row.
 

Public Member Functions

 CharTableModel (QObject *parent=0, int cols=4, ScribusDoc *doc=0, const QString &font=0)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 Get a graphics representation/pixmap of the glyph.
 
void setFontInUse (QString font)
 
ScFace fontFace ()
 Font in use. It's used in model's view.
 
void setCharacters (CharClassDef ch)
 
void setCharactersAndFonts (CharClassDef ch, QStringList fonts)
 
void addCharacter (QString ch)
 
CharClassDef characters ()
 
QStringList fonts ()
 
bool removeCharacter (int index)
 called to erase glyph at index from table.
 
void setDoc (ScribusDoc *doc)
 
void setViewWidth (int w)
 

Detailed Description

A model (MVC) to handle unicode characters map. It's a backend for CharTableView - its GUI representation.

Warning
: CharTableModel and CharTableView are designed for 1:1 relations!
Author
Petr Vanek petr@.nosp@m.scri.nosp@m.bus.i.nosp@m.nfo

Member Function Documentation

void CharTableModel::appendUnicode ( const QString &  s,
uint  base = 16 
)
slot

appends an unicode char into m_characters list.

Parameters
sa QString with numerical representation of the character.
basean optional parameter containing base of the numerical converion. See QString::toInt() documentation. The base parameter is used mainly in normal code - not in slot calls. If user adds an already existing glyph it's rejected and the original one is selected (see selectionChanged()).

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