ListElements/EasyStreet/mainwindow.cpp
author John Kern <johnk@symbian.org>
Thu, 16 Sep 2010 10:59:11 -0700
changeset 49 d9d4ea56179a
parent 42 b9716e8867f1
permissions -rwxr-xr-x
added a listview to support orange lab fw

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    birds << "Avocet" << "Sparrow" << "Crow" << "Sea gull" << "Kookaburra";
    birdList = new QListWidget;
    setCentralWidget(birdList);
    birdList->addItems(birds);
    connect(birdList, SIGNAL(itemClicked ( QListWidgetItem * )),
               this, SLOT(displayBird(QListWidgetItem *)));
}

void MainWindow::displayBird ( QListWidgetItem * item )
{
     QMessageBox::information(this,"picked", item->text());
}

//void MainWindow::on_birdList_itemClicked(QListWidgetItem *item)
//{
//    QMessageBox::information(this, "long", item->text());
//}

MainWindow::~MainWindow()
{
    delete ui;
}