Hi everybody,
i was learning qlistview and writing simple application for testing. First of all the sample code:

Qt Code:
  1. #include <QApplication>
  2. #include <QVBoxLayout>
  3. #include <QListView>
  4. #include <QLabel>
  5. #include <QStringListModel>
  6. #include <QStringList>
  7.  
  8. class MyWidget: public QWidget
  9. {
  10. Q_OBJECT
  11.  
  12. public:
  13. MyWidget(QWidget *parent=0);
  14.  
  15. private slots:
  16. void currentSelected(const QModelIndex &);
  17.  
  18. private:
  19. QListView *listView;
  20. QLabel *selectedItemText;
  21. };
  22.  
  23. MyWidget::MyWidget(QWidget *parent)
  24. :QWidget(parent)
  25. {
  26. listView = new QListView;
  27. selectedItemText = new QLabel;
  28.  
  29. model = new QStringListModel();
  30. list << "lemons" << "melons" << "oranges" << "pears"
  31. << "grapes" << "apples" << "potatoes";
  32. model->setStringList(list);
  33.  
  34. listView->setModel(model);
  35.  
  36. QVBoxLayout *layout = new QVBoxLayout;
  37. layout->addWidget(listView);
  38. layout->addWidget(selectedItemText);
  39. setLayout(layout);
  40.  
  41. connect(listView, SIGNAL(clicked(const QModelIndex&)),
  42. this, SLOT(currentSelected(const QModelIndex &)));
  43. }
  44.  
  45. void MyWidget::currentSelected(const QModelIndex &current)
  46. {
  47. selectedItemText->setText(current.data().toString());
  48. }
  49.  
  50. int main(int argc, char *argv[])
  51. {
  52. QApplication app( argc, argv );
  53.  
  54. QWidget *window = new QWidget;
  55. window->setWindowTitle("Sample ListView");
  56.  
  57. MyWidget *myWidget = new MyWidget;
  58.  
  59. QVBoxLayout *mainLayout = new QVBoxLayout;
  60. mainLayout->addWidget(myWidget);
  61. window->setLayout(mainLayout);
  62. window->show();
  63.  
  64. return app.exec();
  65. }
  66.  
  67. #include "main.moc"
To copy to clipboard, switch view to plain text mode 

My questions are:

1) How start the application with some item already selected?
With the code above when an item is selected the QLabel is filled with the item data; but when the application starts no item is selected and the label is empty.

2) How bind the function currentSelected(const QModelIndex &) with up/down arrows keys?
In the application if I move the selection with the up/arrow keys the highlighted item changes but the label is not updated with the text of the highlighted item. I want the behavior of mouse single click with up/arrow keys.

3) How change the double-click event?
Now when an item is double-clicked the item goes in edit mode; i don't want this. Double-click like single-click is sufficient for me.

Hoping i was clear, thanks in advance for helping me.
Giuseppe