Search code examples
qtlistviewqt4symbiannokia

Please let me know its an functionality behaviour or not


I have a listview filled with items. By default, the 0th item will be selected.

If I try to navigate the list using the mobile keypad, it's not gaining focus - instead I need to use my mobile select key for focus. In this process my mobile left soft key gets changed to “Done”. Why is the "Done" menu appearing?

How do I provide default focus to the listview? And how do I avoid the display of “Done” at left soft key?

Here is my code:

#include "Test_Doco.h"

#include <QtGui>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QListView *listui = new QListView();
    listui->setSelectionMode(QAbstractItemView::SingleSelection);

    listui->viewport()->setFocusPolicy(Qt::WheelFocus);
    listui->viewport()->setFocus();

    QStandardItemModel* listModel = new QStandardItemModel(); 

    for(int i =0; i<10;i++)
            {
                QStandardItem *item1 = new QStandardItem("AOL");
                listModel->appendRow(item1);
            }
         QModelIndex index = listModel->index(0,0);
        listui->setCurrentIndex(index);


    listui->setModel(listModel);
    listui->showMaximized();

        return a.exec();
}

Edit: I have updated the code. Please check it.


Solution

  • The issue is w.r.t Qt 4.6.2 and the issue is fixed in Qt 4.6.3