[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/tests
From:       Roberto Raggi <roberto () kdevelop ! org>
Date:       2007-03-26 12:01:07
Message-ID: 1174910467.643671.24366.nullmailer () svn ! kde ! org
[Download RAW message or body]

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;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic