synaptiks::MouseDevicesModel Class Reference

A Qt model class to manager mouse devices through HAL. More...

#include <mousedevicesmodel.h>

List of all members.

Signals

void checkedDevicesChanged (const QStringList &devices)

Public Member Functions

 MouseDevicesModel (QObject *parent=0)
virtual ~MouseDevicesModel ()
int rowCount (const QModelIndex &parent=QModelIndex()) const
Qt::ItemFlags flags (const QModelIndex &index) const
QVariant data (const QModelIndex &index, int role) const
bool setData (const QModelIndex &index, const QVariant &value, int role)
bool touchpadsIgnored () const
void setTouchpadsIgnored (bool ignore)
QStringList checkedDevices () const
void setCheckedDevices (const QStringList &devices)

Properties

bool touchpadsIgnored
 Whether touchpads are ignored or not.
QStringList checkedDevices
 A list of devices checked by the user.

Detailed Description

A Qt model class to manager mouse devices through HAL.


Constructor & Destructor Documentation

MouseDevicesModel::MouseDevicesModel ( QObject *  parent = 0  ) 

Create a new object.

Parameters:
parent same as for QObject(QObject*)
MouseDevicesModel::~MouseDevicesModel (  )  [virtual]

Destroy this object.


Member Function Documentation

QStringList synaptiks::MouseDevicesModel::checkedDevices (  )  const

Query the checked devices.

Returns:
a list of all checked devices
void synaptiks::MouseDevicesModel::checkedDevicesChanged ( const QStringList &  devices  )  [signal]

Emitted, if the the list of checked devices changes.

Parameters:
devices the new list of checked devices
QVariant MouseDevicesModel::data ( const QModelIndex &  index,
int  role 
) const

Return the data for the given index and the given role.

Parameters:
index points to the data to fetch
role the role that data is needed for
Returns:
the data
Qt::ItemFlags MouseDevicesModel::flags ( const QModelIndex &  index  )  const

Returns the item flags for the given index.

Items of this model are enabled and checkable, but not selectable.

Parameters:
index the item to return flags for
int MouseDevicesModel::rowCount ( const QModelIndex &  parent = QModelIndex()  )  const

Return the number of rows in this model.

Parameters:
parent ignored, required by base class
Returns:
the number of rows
void MouseDevicesModel::setCheckedDevices ( const QStringList &  devices  ) 

Mark all given devices as checked.

Emits dataChanged(const QModelIndex&, const QModelIndex&) and checkedDevicesChanged(const QStringList&).

Parameters:
devices the devices to mark as checked
bool MouseDevicesModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)

Sets the data for the given index and the given role to the given value. If data was changed, true is returned and the itemChanged(const QModelIndex&, const QModelIndex&) signal is emitted.

The only data, that can be changed for this model, is the check state.

Parameters:
index the index to set data for
value the value
role the role to set data for
Returns:
true, if data was changed, false otherwise
void MouseDevicesModel::setTouchpadsIgnored ( bool  ignore  ) 

Ignore touchpads. Generally touchpads are mouses too and displayed by this model. However, there are cases, in which touchpads should not be considered as mouse devices. For such cases, you can have the model ignore touchpads with this function.

Setting this will reset the model.

By default, mouse devices are not ignored.

Parameters:
ignore if true, ignore touchpads
bool synaptiks::MouseDevicesModel::touchpadsIgnored (  )  const

Are touchpads ignored by this model?

Returns:
true, if this model ignores touchpads, false otherwise

Property Documentation

QStringList MouseDevicesModel::checkedDevices [read, write]

A list of devices checked by the user.

See also:
setCheckedDevices(const QStringList&)
checkedDevices()
bool MouseDevicesModel::touchpadsIgnored [read, write]

Whether touchpads are ignored or not.

See also:
setTouchpadsIgnored(bool)
touchpadsIgnored()

The documentation for this class was generated from the following files:
 All Classes Files Functions Typedefs Enumerations Enumerator Properties
Generated on Tue Apr 20 13:25:22 2010 for synaptiks by  doxygen 1.6.3