From kde-commits Mon Mar 26 12:01:07 2007 From: Roberto Raggi Date: Mon, 26 Mar 2007 12:01:07 +0000 To: kde-commits Subject: KDE/kdelibs/kdeui/tests Message-Id: <1174910467.643671.24366.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=117491701420169 SVN commit 646653 by raggi: There is no signal QListWidget::highlighted(QString). Use QListWidget::currentRowChanged(int) M +11 -3 kcompletionuitest.cpp M +1 -1 kcompletionuitest.h --- trunk/KDE/kdelibs/kdeui/tests/kcompletionuitest.cpp #646652:646653 @@ -105,8 +105,8 @@ ListBox1 = new QListWidget( GroupBox1 ); Layout8->addWidget( ListBox1 ); - connect( ListBox1, SIGNAL( highlighted( const QString& )), - SLOT( slotHighlighted( const QString& ))); + connect( ListBox1, SIGNAL( currentRowChanged( int )), + SLOT( slotHighlighted( int ))); ListBox1->setToolTip("Contains the contents of the completion object.\n:x is the weighting, i.e. how often an item has been inserted"); Layout7 = new QVBoxLayout; @@ -164,8 +164,16 @@ ListBox1->addItems( items ); } -void Form1::slotHighlighted( const QString& text ) +void Form1::slotHighlighted( int row ) { + if (row == -1) + return; + + QListWidgetItem *i = ListBox1->item( row ); + Q_ASSERT(i != 0); + + QString text = i->text(); + // remove any "weighting" int index = text.lastIndexOf( ':' ); if ( index > 0 ) --- trunk/KDE/kdelibs/kdeui/tests/kcompletionuitest.h #646652:646653 @@ -41,7 +41,7 @@ void slotList(); void slotAdd(); void slotRemove(); - void slotHighlighted( const QString& ); + void slotHighlighted( int ); protected: QStringList defaultItems() const;