diff -r 627c4a0fd0e7 -r c3690ec91ef8 src/hbinput/inputwidgets/hbinputsmileypicker.cpp --- a/src/hbinput/inputwidgets/hbinputsmileypicker.cpp Fri Jun 11 13:58:22 2010 +0300 +++ b/src/hbinput/inputwidgets/hbinputsmileypicker.cpp Wed Jun 23 18:33:25 2010 +0300 @@ -22,6 +22,7 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputsmileypicker.h" #include #include @@ -37,8 +38,6 @@ #include #include -#include "hbinputsmileypicker.h" - /// @cond class HbInputSmileyPickerPrivate: public HbDialogPrivate @@ -49,8 +48,8 @@ HbInputSmileyPickerPrivate(int rows, int columns); ~HbInputSmileyPickerPrivate(); - void getSmilies(const QStringList& smileys); - void _q_activated(const QModelIndex& index); + void getSmilies(const QStringList &smileys); + void _q_activated(const QModelIndex &index); // member variables. HbGridView *mView; @@ -58,7 +57,7 @@ }; HbInputSmileyPickerPrivate::HbInputSmileyPickerPrivate(int rows, int columns) -:mView(0), mModel(0) + : mView(0), mModel(0) { Q_Q(HbInputSmileyPicker); // we should make sure that it comes above vkb @@ -78,18 +77,18 @@ { } -void HbInputSmileyPickerPrivate::getSmilies(const QStringList& smileys) +void HbInputSmileyPickerPrivate::getSmilies(const QStringList &smileys) { mModel->clear(); - QStandardItem* item = 0; - foreach (QString smiley, smileys) { + QStandardItem *item = 0; + foreach(const QString &smiley, smileys) { item = new QStandardItem(); item->setData(HbIcon(smiley), Qt::DecorationRole); mModel->appendRow(item); } } -void HbInputSmileyPickerPrivate::_q_activated(const QModelIndex& index) +void HbInputSmileyPickerPrivate::_q_activated(const QModelIndex &index) { Q_Q(HbInputSmileyPicker); if (!hidingInProgress) { @@ -118,11 +117,10 @@ { Q_D(HbInputSmileyPicker); HbInputRegionCollector::instance()->attach(this); -#if QT_VERSION >= 0x040600 + // Make sure the smiley picker never steals focus. setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); -#endif // set dialog properties setFocusPolicy(Qt::ClickFocus); @@ -136,7 +134,7 @@ d->getSmilies(smileys); // connect signals - connect(d->mView, SIGNAL(activated(QModelIndex )), this, SLOT(_q_activated(QModelIndex ))); + connect(d->mView, SIGNAL(activated(QModelIndex)), this, SLOT(_q_activated(QModelIndex))); } /*! @@ -147,11 +145,11 @@ } /*! -This a virtual functions in QGraphicsWidget. It is called whenever the smiley picker widgets is shown. -Here in this function we are are scrolling to a position where we can see +This a virtual functions in QGraphicsWidget. It is called whenever the smiley picker widgets is shown. +Here in this function we are are scrolling to a position where we can see first row and column */ -void HbInputSmileyPicker::showEvent( QShowEvent * event ) +void HbInputSmileyPicker::showEvent(QShowEvent *event) { Q_D(HbInputSmileyPicker); QStandardItem *item = d->mModel->item(0);