Qt Reference Documentation

QMaemo5ListPickSelector Class Reference

The QMaemo5ListPickSelector widget displays a list of items. More...

 #include <QMaemo5ListPickSelector>

Inherits QMaemo5AbstractPickSelector.

This class was introduced in Qt 4.6.


  • 1 property inherited from QObject

Public Functions

QMaemo5ListPickSelector ( QObject * parent = 0 )
~QMaemo5ListPickSelector ()
int currentIndex () const
QAbstractItemModel * model () const
int modelColumn () const
void setModel ( QAbstractItemModel * model )
void setModelColumn ( int column )
void setView ( QAbstractItemView * itemView )
QAbstractItemView * view () const

Reimplemented Public Functions

virtual QString currentValueText () const
virtual QWidget * widget ( QWidget * parent )

Public Slots

void setCurrentIndex ( int index )
  • 1 public slot inherited from QObject

Additional Inherited Members

Detailed Description

The QMaemo5ListPickSelector widget displays a list of items.

The QMaemo5ListPickSelector is a selector that displays the contents of a QAbstractItemModel and allows the user to select one item from it.

This object should be used together with the QMaemo5ValueButton.

See also QAbstractItemModel and QMaemo5ValueButton.

Property Documentation

currentIndex : int

This property holds the index of the current item in the list picker.

The current index can change when setting a new model with a lower row count than the previous one.

By default, for an empty list picker or a list picker in which no current item is set, this property has a value of -1.

Access functions:

int currentIndex () const
void setCurrentIndex ( int index )

model : QAbstractItemModel *

This property holds the model used in the list picker.

By default, Maemo lists have centered text so it makes sense to call setTextAlignment(Qt::AlignCenter) on all items in the model in order to comply with the Maemo 5 style guides.

Either list or table models can be used. Table models may require the modelColumn property to be set to a non-default value, depending on their contents.

The use of tree models with a pick selector is untested. In addition, changing the model while the list dialog is displayed may lead to undefined behavior.

Note: The list pick selector will not take ownership of the model.

Access functions:

QAbstractItemModel * model () const
void setModel ( QAbstractItemModel * model )

modelColumn : int

This property holds the column in the model that is used for the picker results.

This property determines the column in a table model used for determining the picker result.

By default, this property has a value of 0.

Access functions:

int modelColumn () const
void setModelColumn ( int column )

Member Function Documentation

QMaemo5ListPickSelector::QMaemo5ListPickSelector ( QObject * parent = 0 )

Constructs a new list pick selector with the given parent object.

QMaemo5ListPickSelector::~QMaemo5ListPickSelector ()

Destroys the pick selector and the view (if set). It will not destroy the model.

QString QMaemo5ListPickSelector::currentValueText () const [virtual]

Reimplemented from QMaemo5AbstractPickSelector::currentValueText().

void QMaemo5ListPickSelector::setView ( QAbstractItemView * itemView )

Sets the view to be used in the list pick selector pop-up to the given itemView. The list picker takes ownership of the view.

Note: If you want to use the convenience views (like QListWidget, QTableWidget or QTreeWidget), make sure you call setModel() on the list picker with the convenience widget's model before calling this function.

See also view().

QAbstractItemView * QMaemo5ListPickSelector::view () const

Returns the list view used for the list pick selector pop-up.

See also setView().

QWidget * QMaemo5ListPickSelector::widget ( QWidget * parent ) [virtual]

Reimplemented from QMaemo5AbstractPickSelector::widget().


Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();