Listing 3

  QHBox h;
  QLabel* l = new QLabel( &h );
  QListBox* lb = new QListBox( &h );
  lb->insertItem( "foo" );
  lb->insertItem( "bar" );
  lb->insertItem( "baz" );
  QObject::connect( lb, SIGNAL( highlighted(const QString&) ),
                    l, SLOT( setText(const QString&) ) );