GestureQueryModel Class Reference

The GestureQueryModel class provides a thumbnail icon view of a set of gestures. More...

#include <gesturequerymodel.h>

Inheritance diagram for GestureQueryModel:

AbstractDigestDbView AbstractView MvcBase List of all members.

Public Slots

virtual void setThumbnailSize (const QSize &size)
void setThumbnailSize (int w, int h)

Signals

void thumbnailSizeChanged (const QSize &size)

Public Member Functions

 GestureQueryModel (QObject *parent=0)
 GestureQueryModel (DigestDbController *controller, QObject *parent=0)
virtual Qt::ItemFlags flags (const QModelIndex &index) const
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
virtual QStringList mimeTypes () const
virtual QMimeData * mimeData (const QModelIndexList &indexes) const
QModelIndex findIndexOfGesture (int gestureId)
int rowGestureId (int row) const
const QSize & thumbnailSize () const

Protected Member Functions

virtual DEFINE_CUSTOM_VIEWEVENT_HANDLER
void 
resetEvent (VEvent *)
virtual void gesturesEvent (VGesturesEvent *)
virtual QPixmap fetchThumbnail (int gestureId) const
virtual QPixmap generateThumbnail (int gestureId) const
virtual QPixmap generateThumbnailTile (const QSize &size) const

Properties

QSize thumbnailSize

Detailed Description

The GestureQueryModel class provides a thumbnail icon view of a set of gestures.

This class extends QSqlQueryModel to provide gesture previews, in the form of thumbnail icons. The thumbnail pixmaps are fetched by views by them calling data() with the role set to Qt::DecorationRole.


Constructor & Destructor Documentation

GestureQueryModel::GestureQueryModel ( QObject *  parent = 0  ) 

Constructs a category item model with the given parent.

GestureQueryModel::GestureQueryModel ( DigestDbController controller,
QObject *  parent = 0 
)

Constructs a category item model with the given parent and attaches itself to the controller.


Member Function Documentation

Qt::ItemFlags GestureQueryModel::flags ( const QModelIndex &  index  )  const [virtual]

QVariant GestureQueryModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const [virtual]

QStringList GestureQueryModel::mimeTypes (  )  const [virtual]

QMimeData * GestureQueryModel::mimeData ( const QModelIndexList &  indexes  )  const [virtual]

QModelIndex GestureQueryModel::findIndexOfGesture ( int  gestureId  ) 

int GestureQueryModel::rowGestureId ( int  row  )  const

Returns the gesture ID for the given row.

Returns -1 on failure.

const QSize& GestureQueryModel::thumbnailSize (  )  const

void GestureQueryModel::thumbnailSizeChanged ( const QSize &  size  )  [signal]

void GestureQueryModel::setThumbnailSize ( const QSize &  size  )  [virtual, slot]

Sets the thumbnailSize(), updates the thumbnail tile cache and clears the entire thumbnail cache.

Emists thumbnailSizeChanged() before returning.

void GestureQueryModel::setThumbnailSize ( int  w,
int  h 
) [slot]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

void GestureQueryModel::resetEvent ( VEvent  )  [protected, virtual]

Resets the model's views.

Reimplemented from AbstractDigestDbView.

void GestureQueryModel::gesturesEvent ( VGesturesEvent event  )  [protected, virtual]

Emits dataChanged() on VGesturesEvent::GesturesUpdated.

Reimplemented from AbstractDigestDbView.

QPixmap GestureQueryModel::fetchThumbnail ( int  gestureId  )  const [protected, virtual]

Attempts to get the thumbnail from a cache. If that fails, this calls generateThumbnail(), updates the cache and then returns the result.

Caching is absolutely required, as data() is called a lot, asking for the thumbnail.

QPixmap GestureQueryModel::generateThumbnail ( int  gestureId  )  const [protected, virtual]

Generates a thumbnail pixmap for the given gestureId.

Returns a null pixmap on failure.

QPixmap GestureQueryModel::generateThumbnailTile ( const QSize &  size  )  const [protected, virtual]


Property Documentation

const QSize & GestureQueryModel::thumbnailSize [read, write]

Size of the thumbnail icon.

Defaults to 52x52.


The documentation for this class was generated from the following files:
Generated on Mon Jul 30 09:46:52 2007 for Digest by  doxygen 1.5.2