ShortcutModel Class Reference

A model for sQL editor shortcuts. See ShortcutEditorDialog for basic idea of shortcuts. Shortcuts are handled as a QList of QPairs in the model. It's due the need of changing "key" values what is impossible in QMap/QHash structures (well, it could be done but it is expensive). Shortcuts are saved by Preferences as a QMap(QString,QVariant). QVariant due the QSettings limitations. More...

#include <shortcutmodel.h>

List of all members.

Signals

void valueChanged ()
 Signal emmitted when the user finish the editation of one value.
void keysNotUnique (QString)
 Emitted when user enters duplicate key value. QString is the duplicate value. It's handled in the GUI with message box.

Public Member Functions

 ShortcutModel (QObject *parent=0)
 ~ShortcutModel ()
int rowCount (const QModelIndex &parent=QModelIndex()) const
int columnCount (const QModelIndex &parent=QModelIndex()) const
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Qt::ItemFlags flags (const QModelIndex &index) const
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex())
bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex())
void insertRow ()
void insertRow (QString key, QString value)
QList< QPair< QString, QString > > values ()
void saveValues ()
 Check emptiness of keys and save it by Preferences.


Detailed Description

A model for sQL editor shortcuts. See ShortcutEditorDialog for basic idea of shortcuts. Shortcuts are handled as a QList of QPairs in the model. It's due the need of changing "key" values what is impossible in QMap/QHash structures (well, it could be done but it is expensive). Shortcuts are saved by Preferences as a QMap(QString,QVariant). QVariant due the QSettings limitations.

Author:
Petr Vanek <petr@scribus.info>

Constructor & Destructor Documentation

ShortcutModel::ShortcutModel ( QObject *  parent = 0  ) 

ShortcutModel::~ShortcutModel (  ) 


Member Function Documentation

int ShortcutModel::rowCount ( const QModelIndex &  parent = QModelIndex()  )  const

Referenced by insertRow(), and removeRows().

int ShortcutModel::columnCount ( const QModelIndex &  parent = QModelIndex()  )  const

QVariant ShortcutModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

bool ShortcutModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

References keysNotUnique().

Qt::ItemFlags ShortcutModel::flags ( const QModelIndex &  index  )  const

QVariant ShortcutModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

bool ShortcutModel::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

References rowCount().

bool ShortcutModel::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

Referenced by insertRow().

void ShortcutModel::insertRow (  ) 

References insertRows(), and rowCount().

void ShortcutModel::insertRow ( QString  key,
QString  value 
)

References rowCount().

QList<QPair<QString,QString> > ShortcutModel::values (  )  [inline]

void ShortcutModel::saveValues (  ) 

Check emptiness of keys and save it by Preferences.

References Preferences::instance(), and Preferences::setShortcuts().

void ShortcutModel::valueChanged (  )  [signal]

Signal emmitted when the user finish the editation of one value.

void ShortcutModel::keysNotUnique ( QString   )  [signal]

Emitted when user enters duplicate key value. QString is the duplicate value. It's handled in the GUI with message box.

Referenced by setData().


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

Generated on Sat Jul 26 09:05:56 2008 for Sqliteman by  doxygen 1.5.5